Skip to content

Commit

Permalink
use id instead of name for int key route
Browse files Browse the repository at this point in the history
  • Loading branch information
Forfold committed May 6, 2024
1 parent f429e4a commit 1cc4165
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/src/app/main/AppRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const alertQuery = gql`
}
}
`
const EXP_ROUTE_UNIV_KEY = '/services/:serviceID/integration-keys/:keyName'
const EXP_ROUTE_UNIV_KEY = '/services/:serviceID/integration-keys/:keyID'
// Allow any component to be used as a route.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const routes: Record<string, JSXElementConstructor<any>> = {
Expand Down
3 changes: 2 additions & 1 deletion web/src/app/main/components/ToolbarPageTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const typeMap: { [key: string]: string } = {
rotations: 'Rotation',
users: 'User',
services: 'Service',
'integration-keys': 'IntegrationKey',
}
const toTitleCase = (str: string): string =>
startCase(str)
Expand Down Expand Up @@ -122,7 +123,7 @@ function useBreadcrumbs(): [string, JSX.Element[] | JSX.Element] {
let title = ''
const crumbs: Array<JSX.Element> = []
const parts = path.split('/')
const name = useName(parts[1], parts[2])
const name = useName(parts[parts.length - 2], parts[parts.length - 1])
parts.slice(1).forEach((p, i) => {
const part = decodeURIComponent(p)
title = i === 1 ? name : toTitleCase(part)
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/services/IntegrationKeyCreateDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function IntegrationKeyCreateDialog(props: {
).then(() => {
if (value?.type === 'universal') {
return setLocation(
`/services/${serviceID}/integration-keys/${value.name}`,
`/services/${serviceID}/integration-keys/${createKeyStatus.data.createIntegrationKey.id}`,
)
}

Expand Down
2 changes: 1 addition & 1 deletion web/src/app/services/IntegrationKeyList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export default function IntegrationKeyList(props: {
.map(
(key: IntegrationKey): FlatListListItem => ({
title: key.name,
url: key.type === 'universal' ? key.name : undefined,
url: key.type === 'universal' ? key.id : undefined,
subText: (
<IntegrationKeyDetails
key={key.id}
Expand Down

0 comments on commit 1cc4165

Please sign in to comment.