Skip to content

Commit 90c3cf4

Browse files
committed
feat(FR-2905): deployment list polish — projectV2 display, revision drawer link, drop createdUserId, strictSelection on enum filters
1 parent bb91225 commit 90c3cf4

23 files changed

Lines changed: 48 additions & 50 deletions

react/src/components/DeploymentList.tsx

Lines changed: 47 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,31 @@ 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+
return (
526+
<BAIFlex gap="xs" align="center" wrap="nowrap">
527+
{projectName ? (
528+
<Typography.Text
529+
ellipsis={{ tooltip: projectName }}
530+
style={{ maxWidth: 160 }}
531+
>
532+
{projectName}
533+
</Typography.Text>
534+
) : null}
535+
<BAIFlex gap={0} align="center">
536+
{'('}
537+
<BAIId globalId={projectId} copyable />
538+
{')'}
539+
</BAIFlex>
540+
</BAIFlex>
530541
);
531542
},
532543
},
@@ -628,6 +639,13 @@ const DeploymentList: React.FC<DeploymentListProps> = ({
628639
}}
629640
onCancel={() => setDeletingDeployment(null)}
630641
/>
642+
<BAIUnmountAfterClose>
643+
<DeploymentRevisionDetailDrawer
644+
open={!!drawerRevisionFrgmt}
645+
revisionFrgmt={drawerRevisionFrgmt}
646+
onClose={() => setDrawerRevisionFrgmt(null)}
647+
/>
648+
</BAIUnmountAfterClose>
631649
</>
632650
);
633651
};

react/src/components/DeploymentReplicasTab.tsx

Lines changed: 1 addition & 0 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

resources/i18n/de.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Erstellt am",
1052-
"CreatedUserId": "Ersteller-ID",
10531052
"DestroyedAt": "Gelöscht am",
10541053
"DomainName": "Domäne",
10551054
"EndpointUrl": "Endpunkt-URL",

resources/i18n/el.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Δημιουργήθηκε",
1052-
"CreatedUserId": "ID δημιουργού",
10531052
"DestroyedAt": "Καταστράφηκε στις",
10541053
"DomainName": "Τομέας",
10551054
"EndpointUrl": "URL τελικού σημείου",

resources/i18n/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,6 @@
10681068
},
10691069
"filter": {
10701070
"CreatedAt": "Created At",
1071-
"CreatedUserId": "Creator ID",
10721071
"DestroyedAt": "Destroyed At",
10731072
"DomainName": "Domain",
10741073
"EndpointUrl": "Endpoint URL",

resources/i18n/es.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Creado el",
1052-
"CreatedUserId": "ID del creador",
10531052
"DestroyedAt": "Eliminado el",
10541053
"DomainName": "Dominio",
10551054
"EndpointUrl": "URL del endpoint",

resources/i18n/fi.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Luotu",
1052-
"CreatedUserId": "Luojan tunnus",
10531052
"DestroyedAt": "Tuhottu",
10541053
"DomainName": "Verkkotunnus",
10551054
"EndpointUrl": "Päätepisteen URL",

resources/i18n/fr.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Créé le",
1052-
"CreatedUserId": "ID du créateur",
10531052
"DestroyedAt": "Supprimé le",
10541053
"DomainName": "Domaine",
10551054
"EndpointUrl": "URL du point de terminaison",

resources/i18n/id.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Dibuat Pada",
1052-
"CreatedUserId": "ID Pembuat",
10531052
"DestroyedAt": "Dihancurkan Pada",
10541053
"DomainName": "Domain",
10551054
"EndpointUrl": "URL Titik Akhir",

resources/i18n/it.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@
10491049
},
10501050
"filter": {
10511051
"CreatedAt": "Creato il",
1052-
"CreatedUserId": "ID creatore",
10531052
"DestroyedAt": "Eliminato il",
10541053
"DomainName": "Dominio",
10551054
"EndpointUrl": "URL endpoint",

0 commit comments

Comments
 (0)