Set document title on navigation to url path, refs #19369
authorPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Jun 2023 14:20:59 +0000 (10:20 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Fri, 2 Jun 2023 14:59:05 +0000 (10:59 -0400)
This is very simplistic, but we can make it better later.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/routes/route-change-handlers.ts
src/store/auth/auth-middleware.ts

index eef52058529b69acd74f17416552561382487e03..bdc1ddc06325bb473dc7493595df0f42fd56c5a7 100644 (file)
@@ -60,6 +60,8 @@ const handleLocationChange = (store: RootStore) => ({ pathname }: Location) => {
         }
     }
 
+    document.title = `Arvados (${store.getState().auth.config.uuidPrefix}) - ${pathname.slice(1)}`;
+
     if (projectMatch) {
         store.dispatch(openProjectPanel(projectMatch.params.id));
     } else if (collectionMatch) {
index eb1e42b5de74c475452647489482dc1892754740..0d08405ae11e87f329553e236e4550c0720a6fd6 100644 (file)
@@ -56,7 +56,7 @@ export const authMiddleware = (services: ServiceRepository): Middleware => store
             }
         },
         SET_CONFIG: ({ config }) => {
-            document.title = `Arvados Workbench (${config.uuidPrefix})`;
+            document.title = `Arvados (${config.uuidPrefix})`;
             next(action);
         },
         LOGOUT: ({ deleteLinkData, preservePath }) => {