@@ -7,11 +7,25 @@ import { workspaceSelectors } from '../../../../redux/selectors';
77import { Link } from 'react-router-dom' ;
88import { routePaths } from '../../../../routes/routePaths' ;
99import { Run } from '../../../../api/types' ;
10+ import { Box } from '../../boxes' ;
11+ import { icons } from '../../icons' ;
12+ import { iconColors , iconSizes } from '../../../../constants' ;
1013
1114interface CodeCardProps {
1215 run : Run ;
1316}
1417
18+ const innerBoxStyleDisable = {
19+ // height: '30px',
20+ border : '2px solid #f0ebfc' ,
21+ borderRadius : '5px' ,
22+ display : 'inline-flex' ,
23+ paddingLeft : '8px' ,
24+ paddingRight : '8px' ,
25+ justifyContent : 'center' ,
26+ alignItems : 'center' ,
27+ } ;
28+
1529const CodeCard = ( { run } : CodeCardProps ) => {
1630 const selectedWorkspace = useSelector ( workspaceSelectors . selectedWorkspace ) ;
1731 return (
@@ -20,17 +34,43 @@ const CodeCard = ({ run }: CodeCardProps) => {
2034 < Paragraph className = { styles . card__key } > Code Repository</ Paragraph >
2135 < Paragraph className = { styles . card__value } >
2236 { /* @ts -ignore */ }
23- { run . deployment ?. code_reference ?. code_repository ?. id ? (
24- < Link
25- to = { routePaths . repositories . overview (
26- selectedWorkspace ,
27- // @ts -ignore
28- run . deployment ?. code_reference ?. code_repository ?. id ,
37+ { run . body ?. code_reference ?. body ?. code_repository ?. id ? (
38+ < >
39+ { run . body ?. code_reference ?. permission_denied ||
40+ run . body ?. code_reference ?. body ?. code_repository
41+ . permission_denied ? (
42+ < div >
43+ < Box style = { innerBoxStyleDisable } >
44+ < icons . lock2
45+ style = { { paddingRight : '5px' } }
46+ color = { iconColors . grey }
47+ size = { iconSizes . sml }
48+ />
49+ < Paragraph
50+ size = "small"
51+ style = { {
52+ color : '#666c78' ,
53+ } }
54+ >
55+ { run . body ?. code_reference ?. body ?. code_repository ?. name &&
56+ `${ run . body ?. code_reference ?. body . code_repository ?. name } ` }
57+ { /* `${run?.body?.pipeline?.name} ( v${run?.pipeline?.version} )`} */ }
58+ </ Paragraph >
59+ </ Box >
60+ </ div >
61+ ) : (
62+ < Link
63+ to = { routePaths . repositories . overview (
64+ selectedWorkspace ,
65+ // @ts -ignore
66+ run . body ?. code_reference ?. body ?. code_repository ?. id ,
67+ ) }
68+ >
69+ { /* @ts -ignore */ }
70+ { run . body ?. code_reference ?. body ?. code_repository ?. name }
71+ </ Link >
2972 ) }
30- >
31- { /* @ts -ignore */ }
32- { run . deployment ?. code_reference ?. code_repository ?. id }
33- </ Link >
73+ </ >
3474 ) : (
3575 'n/a'
3676 ) }
0 commit comments