Skip to content

Commit 488cf4b

Browse files
committed
refactor(FR-2847): split admin deployment detail route under /admin-deployments/:id
1 parent d5f78df commit 488cf4b

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

react/src/components/EndpointList.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ const EndpointList: React.FC<EndpointListProps> = ({
134134
<BAINameActionCell
135135
title={name}
136136
showActions="always"
137-
to={(isAdminMode ? '/deployments/' : '/serving/') + row.endpoint_id}
137+
to={
138+
(isAdminMode ? '/admin-deployments/' : '/serving/') +
139+
row.endpoint_id
140+
}
138141
actions={[
139142
{
140143
key: 'settings',

react/src/pages/AdminDeploymentListPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const AdminDeploymentListPageContent: React.FC = () => {
166166
}}
167167
loading={isLoading}
168168
onRowClick={(deploymentId) => {
169-
webUINavigate(`/deployments/${toLocalId(deploymentId)}`);
169+
webUINavigate(`/admin-deployments/${toLocalId(deploymentId)}`);
170170
}}
171171
onEditClick={(frgmt) => setEditingDeploymentFrgmt(frgmt)}
172172
onDeleteComplete={updateFetchKey}

react/src/routes.tsx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,21 @@ export const mainLayoutChildRoutes: RouteObject[] = [
483483
</BAIErrorBoundary>
484484
),
485485
},
486+
{
487+
// FR-2847 — Admin deployment detail route. Reuses the shared
488+
// `DeploymentDetailPage` component but keeps admins under the
489+
// `/admin-deployments/*` URL space so that breadcrumbs and back
490+
// navigation preserve the admin context.
491+
path: ':deploymentId',
492+
handle: { labelKey: 'webui.menu.DeploymentDetail' },
493+
element: (
494+
<BAIErrorBoundary>
495+
<Suspense fallback={<Skeleton active />}>
496+
<DeploymentDetailPage />
497+
</Suspense>
498+
</BAIErrorBoundary>
499+
),
500+
},
486501
],
487502
},
488503
{
@@ -504,16 +519,17 @@ export const mainLayoutChildRoutes: RouteObject[] = [
504519
},
505520
},
506521
{
507-
// /admin-deployments has no nested detail route — the deployment
508-
// detail page is shared at /deployments/:deploymentId regardless
509-
// of the viewer's role.
522+
// FR-2847 — Legacy `/admin-serving/:serviceId` redirects to the
523+
// admin-scoped detail route so admins stay under
524+
// `/admin-deployments/*` instead of the user-facing
525+
// `/deployments/:deploymentId`.
510526
path: ':serviceId',
511527
Component: () => {
512528
const { serviceId } = useParams<{ serviceId: string }>();
513529
const location = useLocation();
514530
return (
515531
<WebUINavigate
516-
to={`/deployments/${serviceId}${location.search}`}
532+
to={`/admin-deployments/${serviceId}${location.search}`}
517533
replace
518534
/>
519535
);

0 commit comments

Comments
 (0)