tethysplatform / tethys

The Tethys Platform main Django website project repository.
http://tethysplatform.org/
BSD 2-Clause "Simplified" License
92 stars 50 forks source link

Standalone App Mode #1015

Closed ckrew closed 6 months ago

ckrew commented 7 months ago

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 then MULTIPLE_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 is STANDALONE_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.

standalone_app_config

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.

image

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.

image

coveralls commented 6 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling 1825cc4629bb6d369e4caaa8c2f055f9053b8367 on ckrew:standalone_apps into 3a895bc8d90ff39f5f28fb94a748695f996a27d1 on tethysplatform:main.

ckrew commented 6 months ago

@sdc50 and @swainn The two suggested changes have been implemented

sdc50 commented 6 months ago

@swainn I think this is good to be merged if you approve now.