diff --git a/packages/manager/apps/pci-private-registry/src/components/CIDR/Breadcrumb.tsx b/packages/manager/apps/pci-private-registry/src/components/CIDR/Breadcrumb.tsx index 0fa2d197a928..0f98fe13c691 100644 --- a/packages/manager/apps/pci-private-registry/src/components/CIDR/Breadcrumb.tsx +++ b/packages/manager/apps/pci-private-registry/src/components/CIDR/Breadcrumb.tsx @@ -6,7 +6,7 @@ import { useProjectUrl } from '@ovh-ux/manager-react-components'; const BreadcrumbCIDR = () => { const { data: project } = useProject(); - const hrefBack = useHref('../..'); + const hrefBack = useHref('..'); const hrefProject = useProjectUrl('public-cloud'); const { t } = useTranslation(['ip-restrictions', 'common']); return ( diff --git a/packages/manager/apps/pci-private-registry/src/routes.tsx b/packages/manager/apps/pci-private-registry/src/routes.tsx index a37f4575057e..00da67b3e228 100644 --- a/packages/manager/apps/pci-private-registry/src/routes.tsx +++ b/packages/manager/apps/pci-private-registry/src/routes.tsx @@ -1,4 +1,4 @@ -export const lazyRouteConfig = (importFn: CallableFunction) => ({ +const lazyRouteConfig = (importFn: CallableFunction) => ({ lazy: async () => { const { default: moduleDefault, ...moduleExports } = await importFn(); @@ -8,14 +8,11 @@ export const lazyRouteConfig = (importFn: CallableFunction) => ({ }; }, }); + export interface RouteHandle { tracking?: string; } -const ROUTE_PATHS = { - root: '/pci/projects/:projectId/private-registry', -}; - export default [ { path: '/', @@ -23,7 +20,7 @@ export default [ }, { id: 'root', - path: ROUTE_PATHS.root, + path: '/pci/projects/:projectId/private-registry', ...lazyRouteConfig(() => import('@/pages/Layout')), children: [ { @@ -32,26 +29,17 @@ export default [ tracking: 'registries', }, ...lazyRouteConfig(() => import('@/pages/list/List.page')), - }, - { - path: ':registryId', children: [ { - path: 'api-url', + path: ':registryId/api-url', handle: { tracking: 'api-url', }, ...lazyRouteConfig(() => import('@/pages/api-url/APIUrl.page')), }, + { - path: 'manage-cidr', - handle: { - tracking: 'CIDR', - }, - ...lazyRouteConfig(() => import('@/pages/CIDR/ManageCIDR.page')), - }, - { - path: 'credentials', + path: ':registryId/credentials', handle: { tracking: 'credentials', }, @@ -59,6 +47,7 @@ export default [ import('@/pages/credentials/Credentials.page'), ), }, + { id: 'delete', path: 'delete', @@ -78,6 +67,10 @@ export default [ }, ...lazyRouteConfig(() => import('@/pages/create/Create.page')), }, + { + path: ':registryId/manage-cidr', + ...lazyRouteConfig(() => import('@/pages/CIDR/ManageCIDR.page')), + }, { id: 'onboarding', path: 'onboarding',