@@ -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' ;
1011import { DeploymentSettingModal_deployment$key } from '../__generated__/DeploymentSettingModal_deployment.graphql' ;
1112import { useSuspendedBackendaiClient } from '../hooks' ;
1213import BAIRadioGroup from './BAIRadioGroup' ;
1314import DeploymentOwnerInfo from './DeploymentOwnerInfo' ;
15+ import DeploymentRevisionDetailDrawer from './DeploymentRevisionDetailDrawer' ;
1416import DeploymentStatusTag , { DeploymentStatus } from './DeploymentStatusTag' ;
1517import DeploymentTagChips from './DeploymentTagChips' ;
1618import 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} ;
0 commit comments