X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/77c5d854b58b46395c5db5531268494d40f27786..addb01b6d7636a8963ddb1eff4799ebc96f44739:/src/routes/routes.ts diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 528a0376..b0eb7918 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -40,6 +40,7 @@ export const Routes = { LINK_ACCOUNT: '/link_account', KEEP_SERVICES: `/keep-services`, USERS: '/users', + USER_PROFILE: `/user/:id(${RESOURCE_UUID_PATTERN})`, API_CLIENT_AUTHORIZATIONS: `/api_client_authorizations`, GROUPS: '/groups', GROUP_DETAILS: `/group/:id(${RESOURCE_UUID_PATTERN})`, @@ -68,7 +69,7 @@ export const getResourceUrl = (uuid: string) => { export const getNavUrl = (uuid: string, config: FederationConfig) => { const path = getResourceUrl(uuid) || ""; - const cls = uuid.substr(0, 5); + const cls = uuid.substring(0, 5); if (cls === config.localCluster || extractUuidKind(uuid) === ResourceKind.USER || COLLECTION_PDH_REGEX.exec(uuid)) { return path; } else if (config.remoteHostsConfig[cls]) { @@ -175,6 +176,9 @@ export const matchFedTokenRoute = (route: string) => export const matchUsersRoute = (route: string) => matchPath(route, { path: Routes.USERS }); +export const matchUserProfileRoute = (route: string) => + matchPath(route, { path: Routes.USER_PROFILE }); + export const matchApiClientAuthorizationsRoute = (route: string) => matchPath(route, { path: Routes.API_CLIENT_AUTHORIZATIONS });