From d1e81ca54f91a87971558d453bc928053e60f07e Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 29 Sep 2022 21:47:12 -0500 Subject: [PATCH 1/2] /system/* routes to /sys/* --- app/routes.tsx | 2 +- app/util/path-builder.spec.ts | 22 +++++++++++----------- app/util/path-builder.ts | 24 ++++++++++++------------ 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/app/routes.tsx b/app/routes.tsx index 53b6b46c15..2b9f2e7517 100644 --- a/app/routes.tsx +++ b/app/routes.tsx @@ -73,7 +73,7 @@ export const routes = createRoutesFromElements( } handle={{ crumb: 'Hotkeys' }} /> - }> + }> } loader={SilosPage.loader} /> { "projects": "/orgs/a/projects", "serialConsole": "/orgs/a/projects/b/instances/c/serial-console", "settings": "/settings", - "silo": "/system/silos/s", - "siloNew": "/system/silos-new", - "silos": "/system/silos", + "silo": "/sys/silos/s", + "siloNew": "/sys/silos-new", + "silos": "/sys/silos", "snapshots": "/orgs/a/projects/b/snapshots", "sshKeys": "/settings/ssh-keys", - "system": "/system", - "systemHealth": "/system/health", - "systemInventory": "/system/inventory", - "systemIssues": "/system/issues", - "systemNetworking": "/system/networking", - "systemSettings": "/system/settings", - "systemUpdate": "/system/update", - "systemUtilization": "/system/utilization", + "system": "/sys", + "systemHealth": "/sys/health", + "systemInventory": "/sys/inventory", + "systemIssues": "/sys/issues", + "systemNetworking": "/sys/networking", + "systemSettings": "/sys/settings", + "systemUpdate": "/sys/update", + "systemUtilization": "/sys/utilization", "vpc": "/orgs/a/projects/b/vpcs/d", "vpcEdit": "/orgs/a/projects/b/vpcs/d/edit", "vpcNew": "/orgs/a/projects/b/vpcs-new", diff --git a/app/util/path-builder.ts b/app/util/path-builder.ts index 74d7f8afe2..5c84afe655 100644 --- a/app/util/path-builder.ts +++ b/app/util/path-builder.ts @@ -30,18 +30,18 @@ export const pb = { vpc: (params: PP.Vpc) => `${pb.vpcs(params)}/${params.vpcName}`, vpcEdit: (params: PP.Vpc) => `${pb.vpc(params)}/edit`, - system: () => '/system', - systemIssues: () => '/system/issues', - systemUtilization: () => '/system/utilization', - systemInventory: () => '/system/inventory', - systemHealth: () => '/system/health', - systemUpdate: () => '/system/update', - systemNetworking: () => '/system/networking', - systemSettings: () => '/system/settings', - - silos: () => '/system/silos', - siloNew: () => '/system/silos-new', - silo: ({ siloName }: PP.Silo) => `/system/silos/${siloName}`, + system: () => '/sys', + systemIssues: () => '/sys/issues', + systemUtilization: () => '/sys/utilization', + systemInventory: () => '/sys/inventory', + systemHealth: () => '/sys/health', + systemUpdate: () => '/sys/update', + systemNetworking: () => '/sys/networking', + systemSettings: () => '/sys/settings', + + silos: () => '/sys/silos', + siloNew: () => '/sys/silos-new', + silo: ({ siloName }: PP.Silo) => `/sys/silos/${siloName}`, settings: () => '/settings', profile: () => '/settings/profile', From 000dc97baaebf9cd3cf0c80d6a45ce74d2d1f0bd Mon Sep 17 00:00:00 2001 From: David Crespo Date: Thu, 29 Sep 2022 22:18:32 -0500 Subject: [PATCH 2/2] missed a spot where I should have used the path builder! --- app/components/TopBar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/TopBar.tsx b/app/components/TopBar.tsx index 6e93e923a6..b753fb6e0d 100644 --- a/app/components/TopBar.tsx +++ b/app/components/TopBar.tsx @@ -39,7 +39,7 @@ export function TopBar() { const loggedIn = user && !error - const isSystem = useLocation().pathname.startsWith('/system') // lol + const isSystem = useLocation().pathname.startsWith(pb.system()) // lol const { projectName } = useParams() const [cornerPicker, ...otherPickers] = [