From dcc13bac8192a1a1075f5596d0b014441ae5b33a Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Fri, 2 Jun 2023 10:20:59 -0400 Subject: [PATCH] Set document title on navigation to url path, refs #19369 This is very simplistic, but we can make it better later. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- src/routes/route-change-handlers.ts | 2 ++ src/store/auth/auth-middleware.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/routes/route-change-handlers.ts b/src/routes/route-change-handlers.ts index eef52058..bdc1ddc0 100644 --- a/src/routes/route-change-handlers.ts +++ b/src/routes/route-change-handlers.ts @@ -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) { diff --git a/src/store/auth/auth-middleware.ts b/src/store/auth/auth-middleware.ts index eb1e42b5..0d08405a 100644 --- a/src/store/auth/auth-middleware.ts +++ b/src/store/auth/auth-middleware.ts @@ -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 }) => { -- 2.30.2