@@ -22,129 +22,22 @@ import ReactSelect, { components } from 'react-select'
22
22
import moment from 'moment'
23
23
import { ReactComponent as ICArrowBackward } from '@Icons/ic-arrow-backward.svg'
24
24
import { ReactComponent as ICDocker } from '@Icons/ic-docker.svg'
25
- import { ReactComponent as ICCalendar } from '@Icons/ic-calendar.svg'
26
- import { ReactComponent as ICUserCircle } from '@Icons/ic-user-circle.svg'
27
- import { ReactComponent as ICBranch } from '@Icons/ic-branch.svg'
28
25
import { DeploymentStageType } from '@Shared/constants'
29
- import { getHandleOpenURL , renderMaterialIcon } from '@Shared/Helpers'
30
26
import {
31
27
SidebarType ,
32
28
CICDSidebarFilterOptionType ,
33
29
HistoryComponentType ,
34
30
HistorySummaryCardType ,
35
31
DeploymentSummaryTooltipCardType ,
36
32
FetchIdDataStatus ,
37
- BuildAndTaskSummaryTooltipCardProps ,
38
33
} from './types'
34
+ import BuildAndTaskSummaryTooltipCard from './BuildAndTaskSummaryTooltipCard'
39
35
import { getCustomOptionSelectionStyle } from '../ReactSelect'
40
36
import { DetectBottom } from '../DetectBottom'
41
- import {
42
- ConditionalWrap ,
43
- DATE_TIME_FORMATS ,
44
- SourceTypeMap ,
45
- createGitCommitUrl ,
46
- DropdownIndicator ,
47
- Tooltip ,
48
- } from '../../../Common'
49
- import { GitTriggers } from '../../types'
50
- import { CiPipelineSourceConfig } from './CiPipelineSourceConfig'
51
- import { HISTORY_LABEL , FILTER_STYLE , statusColor as colorMap , DEFAULT_CLUSTER_ID } from './constants'
52
- import {
53
- getFormattedTriggerTime ,
54
- getHistoryItemStatusIconFromWorkflowStages ,
55
- getTriggerStatusIcon ,
56
- getWorkflowNodeStatusTitle ,
57
- sanitizeWorkflowExecutionStages ,
58
- } from './utils'
59
- import { WorkerStatus } from './TriggerOutput'
60
- import { CommitChipCell } from '../CommitChipCell'
61
-
62
- const GitTriggerList = memo (
63
- ( {
64
- ciMaterials,
65
- gitTriggers,
66
- addMarginTop,
67
- } : Pick < DeploymentSummaryTooltipCardType , 'ciMaterials' | 'gitTriggers' > & {
68
- addMarginTop ?: boolean
69
- } ) : JSX . Element => (
70
- // eslint-disable-next-line react/jsx-no-useless-fragment
71
- < >
72
- { Object . keys ( gitTriggers ?? { } ) . length > 0 &&
73
- ciMaterials ?. map ( ( ciMaterial ) => {
74
- const gitDetail : GitTriggers = gitTriggers [ ciMaterial . id ]
75
- const sourceType = gitDetail ?. CiConfigureSourceType
76
- ? gitDetail . CiConfigureSourceType
77
- : ciMaterial ?. type
78
- const sourceValue = gitDetail ?. CiConfigureSourceValue
79
- ? gitDetail . CiConfigureSourceValue
80
- : ciMaterial ?. value
81
- const gitMaterialUrl = gitDetail ?. GitRepoUrl ? gitDetail . GitRepoUrl : ciMaterial ?. url
82
- if ( sourceType !== SourceTypeMap . WEBHOOK && ! gitDetail ) {
83
- return null
84
- }
85
-
86
- return (
87
- < div className = { `${ addMarginTop ? 'mt-22' : '' } ci-material-detail"` } key = { ciMaterial . id } >
88
- { sourceType === SourceTypeMap . WEBHOOK ? (
89
- < div className = "flex left column" >
90
- < CiPipelineSourceConfig
91
- sourceType = { sourceType }
92
- sourceValue = { sourceValue }
93
- showTooltip = { false }
94
- />
95
- </ div >
96
- ) : (
97
- < div className = "flexbox-col dc__gap-8" >
98
- < div className = "flexbox dc__gap-4 dc__align-start" >
99
- { renderMaterialIcon ( gitMaterialUrl ) }
100
-
101
- { gitDetail ?. GitRepoName && (
102
- < >
103
- < Tooltip content = { gitDetail . GitRepoName } >
104
- < span className = "cn-9 fs-13 fw-6 lh-20" >
105
- { gitDetail . GitRepoName }
106
- </ span >
107
- </ Tooltip >
108
-
109
- < span className = "cn-5 fs-13 fw-4 lh-20 dc__no-shrink" > /</ span >
110
- </ >
111
- ) }
112
-
113
- < a
114
- href = { createGitCommitUrl ( gitMaterialUrl , gitDetail ?. Commit ) }
115
- target = "_blank"
116
- rel = "noopener noreferrer"
117
- className = "anchor flexbox dc__gap-2 dc__align-items-center"
118
- >
119
- < ICBranch className = "icon-dim-12 dc__no-shrink fcn-7" />
120
- { sourceValue }
121
- </ a >
122
- </ div >
123
-
124
- { gitDetail ?. Commit && (
125
- < CommitChipCell
126
- commits = { [ gitDetail . Commit ] }
127
- handleClick = { getHandleOpenURL (
128
- createGitCommitUrl ( ciMaterial . url , gitDetail . Commit ) ,
129
- ) }
130
- />
131
- ) }
132
-
133
- { gitDetail ?. Message && (
134
- < Tooltip content = { gitDetail . Message } >
135
- < p className = "m-0 cn-9 fs-13 fw-4 lh-20 dc__truncate--clamp-3" >
136
- { gitDetail . Message }
137
- </ p >
138
- </ Tooltip >
139
- ) }
140
- </ div >
141
- ) }
142
- </ div >
143
- )
144
- } ) }
145
- </ >
146
- ) ,
147
- )
37
+ import { ConditionalWrap , DATE_TIME_FORMATS , DropdownIndicator } from '../../../Common'
38
+ import { HISTORY_LABEL , FILTER_STYLE , statusColor as colorMap } from './constants'
39
+ import { getHistoryItemStatusIconFromWorkflowStages , getTriggerStatusIcon , getWorkflowNodeStatusTitle } from './utils'
40
+ import GitTriggerList from './GitTriggerList'
148
41
149
42
const DeploymentSummaryTooltipCard = memo (
150
43
( {
@@ -172,56 +65,6 @@ const DeploymentSummaryTooltipCard = memo(
172
65
) ,
173
66
)
174
67
175
- const BuildAndTaskSummaryTooltipCard = memo (
176
- ( {
177
- workflowExecutionStages,
178
- triggeredByEmail,
179
- namespace,
180
- podName,
181
- stage,
182
- gitTriggers,
183
- ciMaterials,
184
- } : BuildAndTaskSummaryTooltipCardProps ) : JSX . Element => {
185
- const executionInfo = sanitizeWorkflowExecutionStages ( workflowExecutionStages )
186
-
187
- return (
188
- < div className = "shadow__overlay p-16 br-4 w-350 bg__primary mxh-300 dc__overflow-auto flexbox-col dc__gap-16" >
189
- { /* Info section */ }
190
- < div className = "dc__icon-text-layout" >
191
- < ICCalendar className = "fcn-7 icon-dim-20 dc__no-shrink" />
192
- < time className = "cn-9 fs-12 cn-9 fw-4 lh-20" >
193
- { executionInfo ?. triggeredOn ? getFormattedTriggerTime ( executionInfo . triggeredOn ) : '--' }
194
- </ time >
195
-
196
- < ICUserCircle className = "fcn-7 icon-dim-20 dc__no-shrink" />
197
- < Tooltip content = { triggeredByEmail } >
198
- < span className = "cn-9 fs-12 fw-4 lh-20 dc__truncate" > { triggeredByEmail } </ span >
199
- </ Tooltip >
200
-
201
- < WorkerStatus
202
- message = { executionInfo ?. workerDetails ?. message }
203
- podStatus = { executionInfo ?. workerDetails ?. status }
204
- stage = { stage }
205
- finishedOn = { executionInfo ?. workerDetails ?. endTime }
206
- clusterId = { executionInfo ?. workerDetails ?. clusterId || DEFAULT_CLUSTER_ID }
207
- workerPodName = { podName }
208
- namespace = { namespace }
209
- workerMessageContainerClassName = "cn-7 fs-12 fw-4 lh-18"
210
- titleClassName = "cn-9 fs-12 fw-4 lh-20"
211
- viewWorkerPodClassName = "fs-12"
212
- />
213
- </ div >
214
-
215
- { Object . keys ( gitTriggers ?? { } ) . length > 0 && ciMaterials ?. length > 0 && (
216
- < div className = "dc__border-bottom-n1" />
217
- ) }
218
-
219
- < GitTriggerList gitTriggers = { gitTriggers } ciMaterials = { ciMaterials } />
220
- </ div >
221
- )
222
- } ,
223
- )
224
-
225
68
const ViewAllCardsTile = memo (
226
69
( { handleViewAllHistory } : { handleViewAllHistory : ( ) => void } ) : JSX . Element => (
227
70
< div className = "flex pt-12 pb-12 pl-16 pr-16 dc__gap-16 dc__align-self-stretch" >
0 commit comments