-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Standalone App Mode #1015
Standalone App Mode #1015
Conversation
home and app_library now redirected to the configured app admin capabilities still working need to figure out a way to get the admin dropdown menu in the stand alone app and clean up header buttons
adder user menu button to app base header when in standalone app mode
…dd the controller name since that can be controlled by the application itself add some logic to the site commands, if a standalone app is given, then update site settings accordingly fixed some old url patterns for non standalone_app_mode that had been messed up updated header.html to not show App Library button if standalone app is enabled
update the apps library title instead
black formatted and linted
…instead MULTIPLE_APP_MODE defaults to False so this new standalone app behavior would be the default moved away from updating site settings to use context processor instead
black format and lint
… the standalone if they want
fixed tests with the new MULTIPLE_APP_MODE default Added an ObjectDoesNotExist exception for when no apps are installed
updated get_active_app to just grab the standalone app if MULTIPLE_APP_MODE is turned off
tests/unit_tests/test_tethys_apps/test_cli/test_install_commands.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few changes. Let's get rid of the obsolete test file. And then report if the user menu can be reasonably be moved into its own template.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thanks @ckrew!
@swainn I think this is good to be merged if you approve now. |
This PR allows a tethys portal to be configured to act as a single app instead of a host for multiple apps.
In order to enable this mode, users will need to update their portal_config.yml under
TETHYS_PORTAL_CONFIG
thenMULTIPLE_APP_MODE
. The value is a boolean. The default value for this is True and by changing it to False, the standalone app mode will be enabled. An optional setting isSTANDALONE_APP
. This can be used to determine which app will be the standalone app. If this is not provided, then the code will just use the first application in the DB.The configured standalone application will become the home page for the tethys portal. The app library page is redirected to the standalone app as well. You can see the example below where I am accessing the application from the root instead of apps.
You can additionally see in the screenshot above, that the user menu is now available within the application itself. I have updated the headers in the app base html to show the user menu button if the Standalone App mode is turned on. A user can use that button to check portal/user settings just like before.
When a user now checks the other available tethys endpoints like the user profiles and admin settings, the headers are updated to reflect the Standalone App mode. As shown in the screenshot below, the "Tethys Portal" button on the left can still be updated to reflect a brand or company. The "Apps" button on the right will now display the app package name and redirect to the application.