@@ -36,38 +36,37 @@ export interface CINodeProps {
3636}
3737
3838export class CINode extends Component < CINodeProps > {
39- renderNodeIcon = ( ) => {
39+ renderNodeIcon = ( isJobCard : boolean ) => {
4040 if ( this . props . showPluginWarning ) {
4141 return < Warning className = "icon-dim-18 warning-icon-y7" />
4242 }
4343 return (
4444 < div
4545 className = { `workflow-node__icon-common ${
46- ( this . props . isJobView || this . props . isJobCI ) ? 'workflow-node__job-icon' : 'workflow-node__CI-icon'
46+ ( isJobCard ) ? 'workflow-node__job-icon' : 'workflow-node__CI-icon'
4747 } `}
4848 />
4949 )
5050 }
5151
52- renderReadOnlyCard = ( ) => {
52+ renderReadOnlyCard = ( isJobCard : boolean ) => {
5353 const _buildText = this . props . isExternalCI ? 'Build: External' : 'Build'
54- const nodeText = ( this . props . isJobView || this . props . isJobCI ) ? 'Job' : _buildText
54+ const nodeText = ( isJobCard ) ? 'Job' : _buildText
5555 return (
5656 < div className = "workflow-node" >
5757 < div className = "workflow-node__title flex" >
5858 < div className = "workflow-node__full-width-minus-Icon" >
5959 < span className = "workflow-node__text-light" > { nodeText } </ span >
6060 < div className = "dc__ellipsis-left" > { this . props . title } </ div >
6161 </ div >
62- { this . renderNodeIcon ( ) }
62+ { this . renderNodeIcon ( isJobCard ) }
6363 </ div >
6464 </ div >
6565 )
6666 }
6767
68- renderCardContent = ( ) => {
68+ renderCardContent = ( isJobCard : boolean ) => {
6969 const currPipeline = this . props . filteredCIPipelines . find ( ( pipeline ) => + pipeline . id === + this . props . id )
70- const isJobCard = this . props . isJobView || currPipeline ?. pipelineType === CIPipelineBuildType . CI_JOB
7170 const env = currPipeline ?. environmentId ? this . props . envList . find ( ( env ) => + env . id === + currPipeline . environmentId ) : undefined
7271 const _buildText = this . props . isExternalCI ? 'Build: External' : 'Build'
7372 const _linkedBuildText = this . props . isLinkedCI ? 'Build: Linked' : _buildText
@@ -110,7 +109,7 @@ export class CINode extends Component<CINodeProps> {
110109 < span className = "fw-4 fs-11" > Env: { env ? env . environment_name : DEFAULT_ENV } </ span >
111110 < span className = "fw-4 fs-11 ml-4 dc__italic-font-style" > { ! env && "(Default)" } </ span > </ > }
112111 </ div >
113- { this . renderNodeIcon ( ) }
112+ { this . renderNodeIcon ( isJobCard ) }
114113 </ div >
115114 </ div >
116115 </ Link >
@@ -144,6 +143,7 @@ export class CINode extends Component<CINodeProps> {
144143 }
145144
146145 render ( ) {
146+ const isJobCard : boolean = this . props . isJobView || this . props . isJobCI
147147 return (
148148 < foreignObject
149149 className = "data-hj-whitelist"
@@ -153,7 +153,7 @@ export class CINode extends Component<CINodeProps> {
153153 height = { this . props . height }
154154 style = { { overflow : 'visible' } }
155155 >
156- { this . props . configDiffView ? this . renderReadOnlyCard ( ) : this . renderCardContent ( ) }
156+ { this . props . configDiffView ? this . renderReadOnlyCard ( isJobCard ) : this . renderCardContent ( isJobCard ) }
157157 </ foreignObject >
158158 )
159159 }
0 commit comments