Skip to content

Commit

Permalink
feat(pci.private-registry): fix routing
Browse files Browse the repository at this point in the history
ref: TAPC-584
Signed-off-by: Pierre-Philippe <[email protected]>
  • Loading branch information
Pierre-Philippe committed Dec 12, 2024
1 parent fbd47a9 commit 8bda40a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
29 changes: 11 additions & 18 deletions packages/manager/apps/pci-private-registry/src/routes.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const lazyRouteConfig = (importFn: CallableFunction) => ({
const lazyRouteConfig = (importFn: CallableFunction) => ({
lazy: async () => {
const { default: moduleDefault, ...moduleExports } = await importFn();

Expand All @@ -8,22 +8,19 @@ export const lazyRouteConfig = (importFn: CallableFunction) => ({
};
},
});

export interface RouteHandle {
tracking?: string;
}

const ROUTE_PATHS = {
root: '/pci/projects/:projectId/private-registry',
};

export default [
{
path: '/',
...lazyRouteConfig(() => import('@/pages/Layout')),
},
{
id: 'root',
path: ROUTE_PATHS.root,
path: '/pci/projects/:projectId/private-registry',
...lazyRouteConfig(() => import('@/pages/Layout')),
children: [
{
Expand All @@ -32,33 +29,25 @@ 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',
},
...lazyRouteConfig(() =>
import('@/pages/credentials/Credentials.page'),
),
},

{
id: 'delete',
path: 'delete',
Expand All @@ -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',
Expand Down

0 comments on commit 8bda40a

Please sign in to comment.