Skip to content

Commit 33d5807

Browse files
committed
feat(FR-2905): deployment list polish — projectV2 display, revision drawer link, drop createdUserId, strictSelection on enum filters (#7439)
Resolves #7438([FR-2905](https://lablup.atlassian.net/browse/FR-2905)) Stacked on top of #7437. ## Summary Follow-up polish on the deployment list & replicas tab (FR-2904 series). Bundled as one PR per the project's "avoid excessive PR splitting" convention. - **Admin deployment list — Project column.** Replaced the raw project-ID cell with a `project name (BAIId)` cell. Name comes from `metadata.projectV2.basicInfo.name @SInCE(version: "26.4.3")` (DataLoader-resolved). ID stays copyable + ellipsis via `BAIId`. - **Deployment list — Revision number drawer link.** The Applied-Revision column now opens `DeploymentRevisionDetailDrawer` on click, matching the pattern used in `DeploymentReplicasTab`. The `currentRevision` fragment ref is spread into `...DeploymentRevisionDetail_revision` for the drawer. - **Drop `createdUserId` from the deployment list.** Both the admin column and the matching filter property were removed — the existing Owner / Creator column already surfaces the same information via `DeploymentOwnerInfo`. Orphan i18n key `deployment.filter.CreatedUserId` was removed from all 21 locale files. - **Property filter — `strictSelection: true` on enum types.** Applied to the `trafficStatus` enum filter in `DeploymentReplicasTab` so the value must come from the provided options. ## Test plan - [ ] Admin deployment list: open column settings, toggle the `Project` column on → confirm `project name (ID)` renders for deployments that have a project, and only the ID shows when name is unavailable (≤ 26.4.2 manager). - [ ] Deployment list: enable the Revision Number column → click the link → confirm `DeploymentRevisionDetailDrawer` opens with the right revision. - [ ] Admin deployment list: confirm the `Creator ID` column and the `Creator ID` admin filter are no longer present. - [ ] Replicas tab: open the property filter, choose `TrafficStatus` → confirm input requires selection from `Active` / `Inactive` (typing arbitrary text is rejected). - [ ] `bash scripts/verify.sh` — Relay / Lint / Format pass; TypeScript only reports pre-existing errors in unrelated pages. [FR-2905]: https://lablup.atlassian.net/browse/FR-2905?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent b82b552 commit 33d5807

25 files changed

Lines changed: 145 additions & 150 deletions

react/src/components/DeploymentConfigurationSection.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
MoreOutlined,
2323
PlusOutlined,
2424
} from '@ant-design/icons';
25-
import { useToggle } from 'ahooks';
2625
import {
2726
Alert,
2827
App,
@@ -250,10 +249,7 @@ const DeploymentConfigurationSection: React.FC<
250249
scroll: false,
251250
},
252251
);
253-
const [
254-
settingModalOpen,
255-
{ setLeft: closeSettingModal, setRight: openSettingModal },
256-
] = useToggle(false);
252+
const [settingModalOpen, setSettingModalOpen] = useState(false);
257253
const [isDeleteModalOpen, setIsDeleteModalOpen] = useState(false);
258254

259255
const [commitDeleteMutation, isInFlightDeleteMutation] =
@@ -327,13 +323,15 @@ const DeploymentConfigurationSection: React.FC<
327323
onChange={onRefetch}
328324
/>
329325
<Space.Compact>
330-
<Button
326+
<BAIButton
331327
icon={<EditOutlined />}
332328
disabled={isDeploymentDestroying}
333-
onClick={openSettingModal}
329+
action={async () => {
330+
setSettingModalOpen(true);
331+
}}
334332
>
335333
{t('button.Edit')}
336-
</Button>
334+
</BAIButton>
337335
<Dropdown
338336
trigger={['click']}
339337
menu={{
@@ -455,7 +453,7 @@ const DeploymentConfigurationSection: React.FC<
455453
open={settingModalOpen}
456454
deploymentFrgmt={deployment}
457455
onRequestClose={(success) => {
458-
closeSettingModal();
456+
setSettingModalOpen(false);
459457
if (success) onRefetch();
460458
}}
461459
/>

react/src/components/DeploymentList.tsx

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import {
77
DeploymentList_modelDeploymentConnection$data,
88
DeploymentList_modelDeploymentConnection$key,
99
} from '../__generated__/DeploymentList_modelDeploymentConnection.graphql';
10+
import type { DeploymentRevisionDetail_revision$key } from '../__generated__/DeploymentRevisionDetail_revision.graphql';
1011
import { DeploymentSettingModal_deployment$key } from '../__generated__/DeploymentSettingModal_deployment.graphql';
1112
import { useSuspendedBackendaiClient } from '../hooks';
1213
import BAIRadioGroup from './BAIRadioGroup';
1314
import DeploymentOwnerInfo from './DeploymentOwnerInfo';
15+
import DeploymentRevisionDetailDrawer from './DeploymentRevisionDetailDrawer';
1416
import DeploymentStatusTag, { DeploymentStatus } from './DeploymentStatusTag';
1517
import DeploymentTagChips from './DeploymentTagChips';
1618
import QuestionIconWithTooltip from './QuestionIconWithTooltip';
@@ -23,6 +25,7 @@ import {
2325
BAIId,
2426
BAINameActionCell,
2527
BAITable,
28+
BAIUnmountAfterClose,
2629
filterOutEmpty,
2730
filterOutNullAndUndefined,
2831
isValidUUID,
@@ -151,6 +154,8 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
151154
id: string;
152155
name: string;
153156
} | null>(null);
157+
const [drawerRevisionFrgmt, setDrawerRevisionFrgmt] =
158+
useState<DeploymentRevisionDetail_revision$key | null>(null);
154159

155160
const [commitDeleteMutation, isInFlightDeleteMutation] =
156161
useMutation<DeploymentListDeleteMutation>(graphql`
@@ -168,14 +173,19 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
168173
edges {
169174
node {
170175
id
171-
createdUserId
172176
metadata {
173177
name
174178
status
175179
createdAt
176180
updatedAt
177181
domainName
178182
projectId
183+
projectV2 @since(version: "26.4.3") {
184+
basicInfo {
185+
name
186+
}
187+
id
188+
}
179189
resourceGroupName
180190
...DeploymentTagChips_metadata
181191
}
@@ -202,6 +212,7 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
202212
name
203213
}
204214
}
215+
...DeploymentRevisionDetail_revision
205216
}
206217
...DeploymentOwnerInfo_deployment
207218
}
@@ -268,13 +279,6 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
268279
fixedOperator: 'equals' as const,
269280
rule: uuidRule,
270281
},
271-
{
272-
key: 'createdUserId',
273-
propertyLabel: t('deployment.filter.CreatedUserId'),
274-
type: 'uuid' as const,
275-
fixedOperator: 'equals' as const,
276-
rule: uuidRule,
277-
},
278282
{
279283
key: 'createdAt',
280284
propertyLabel: t('deployment.filter.CreatedAt'),
@@ -349,10 +353,14 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
349353
</BAIFlex>
350354
),
351355
render: (_text, row) => {
352-
const revisionNumber = row.currentRevision?.revisionNumber;
353-
if (revisionNumber == null)
356+
const revision = row.currentRevision;
357+
if (revision?.revisionNumber == null)
354358
return <Typography.Text type="secondary">-</Typography.Text>;
355-
return <Typography.Text>{`#${revisionNumber}`}</Typography.Text>;
359+
return (
360+
<Typography.Link
361+
onClick={() => setDrawerRevisionFrgmt(revision)}
362+
>{`#${revision.revisionNumber}`}</Typography.Link>
363+
);
356364
},
357365
},
358366
{
@@ -505,28 +513,30 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
505513
},
506514
isAdminMode && {
507515
key: 'projectId',
508-
title: t('deployment.ProjectId'),
516+
title: t('deployment.Project'),
509517
defaultHidden: true,
510518
sorter: true,
511519
render: (_text, row) => {
512520
const projectId = row.metadata?.projectId;
513-
return projectId ? (
514-
<BAIId globalId={projectId} copyable />
515-
) : (
516-
<Typography.Text type="secondary">-</Typography.Text>
517-
);
518-
},
519-
},
520-
isAdminMode && {
521-
key: 'createdUserId',
522-
title: t('deployment.CreatedBy'),
523-
defaultHidden: true,
524-
render: (_text, row) => {
525-
const userId = row.createdUserId;
526-
return userId ? (
527-
<BAIId globalId={userId} copyable />
528-
) : (
529-
<Typography.Text type="secondary">-</Typography.Text>
521+
if (!projectId) {
522+
return <Typography.Text type="secondary">-</Typography.Text>;
523+
}
524+
const projectName = row.metadata?.projectV2?.basicInfo?.name;
525+
if (!projectName) {
526+
return <BAIId globalId={projectId} copyable />;
527+
}
528+
return (
529+
<BAIFlex gap="xs" align="center" wrap="nowrap">
530+
<Typography.Text
531+
ellipsis={{ tooltip: projectName }}
532+
style={{ maxWidth: 160 }}
533+
>
534+
{projectName}
535+
</Typography.Text>
536+
<Typography.Text type="secondary">
537+
(<BAIId globalId={projectId} copyable type="secondary" />)
538+
</Typography.Text>
539+
</BAIFlex>
530540
);
531541
},
532542
},
@@ -628,6 +638,13 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
628638
}}
629639
onCancel={() => setDeletingDeployment(null)}
630640
/>
641+
<BAIUnmountAfterClose>
642+
<DeploymentRevisionDetailDrawer
643+
open={!!drawerRevisionFrgmt}
644+
revisionFrgmt={drawerRevisionFrgmt}
645+
onClose={() => setDrawerRevisionFrgmt(null)}
646+
/>
647+
</BAIUnmountAfterClose>
631648
</>
632649
);
633650
};

react/src/components/DeploymentReplicasTab.tsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
239239
propertyLabel: t('deployment.TrafficStatus'),
240240
type: 'enum' as const,
241241
options: trafficStatusOptions,
242+
strictSelection: true,
242243
},
243244
];
244245

@@ -337,11 +338,9 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
337338
{name}
338339
</Typography.Link>
339340
) : null}
340-
<BAIFlex gap={0} align="center">
341-
{'('}
342-
<BAIId globalId={session.id} />
343-
{')'}
344-
</BAIFlex>
341+
<Typography.Text type="secondary">
342+
(<BAIId globalId={session.id} type="secondary" />)
343+
</Typography.Text>
345344
</BAIFlex>
346345
);
347346
},
@@ -374,11 +373,9 @@ const DeploymentReplicasTab: React.FC<DeploymentReplicasTabProps> = ({
374373
? `#${revision.revisionNumber}`
375374
: '-'}
376375
</Typography.Link>
377-
<BAIFlex gap={0} align="center">
378-
{'('}
379-
<BAIId globalId={revision.id} />
380-
{')'}
381-
</BAIFlex>
376+
<Typography.Text type="secondary">
377+
(<BAIId globalId={revision.id} type="secondary" />)
378+
</Typography.Text>
382379
</BAIFlex>
383380
);
384381
},

0 commit comments

Comments
 (0)