tethysplatform / tethys

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

Standalone App Non-Home Index Fixes #1044

Closed ckrew closed 2 months ago

ckrew commented 2 months ago

This PR looks to resolve https://github.com/tethysplatform/tethys/issues/1042. The issue is that there are many redirects and reverses that point to a hardcoded "home" url. While this works fine when the single app index is home, these redirects fail when an app index is not "home".

The PR resolves the issue by putting conditional logic in front of the hardcoded "home" redirects. If the tethys portal is in single app mode, then the "home" redirects will point towards the app index url instead.

Along with the hardcoded "home" fix, I have also updated additional redirects that point to the app_library url which is no longer available in standalone app mode. If the tethys portal is in single app mode, these old app_library redirects will point to more appropriate endpoints instead.

This PR also adds a warning to users on all pages when single app mode is enabled but there are no applications installed.

image

coveralls commented 2 months ago

Coverage Status

coverage: 100.0%. remained the same when pulling cd08bdae87e2288c3dc1ca057c50834e56b6ced0 on ckrew:singleapp_nonhome_index into 3876fc53a07fb2356a33bca6c08d7954e3adbad1 on tethysplatform:main.

ckrew commented 2 months ago

This PR also adds a warning to users on all pages when single app mode is enabled but there are no applications installed.

image