@@ -32,7 +32,7 @@ import { ReactComponent as Down } from '../../../Assets/Icon/ic-arrow-forward.sv
3232import docker from '../../../Assets/Icon/ic-docker.svg'
3333import folder from '../../../Assets/Icon/ic-folder.svg'
3434import noartifact from '../../../Assets/Img/no-artifact@2x.png'
35- import { ArtifactType , CIListItemType , HistoryComponentType } from './types'
35+ import { ArtifactType , CIListItemType } from './types'
3636import { TERMINAL_STATUS_MAP } from './constants'
3737import { EMPTY_STATE_STATUS } from '../../constants'
3838
@@ -124,11 +124,9 @@ const Artifacts = ({
124124 downloadArtifactUrl,
125125 ciPipelineId,
126126 artifactId,
127- isJobView,
128127 isJobCI,
129128 imageComment,
130129 imageReleaseTags,
131- type,
132130 appReleaseTagNames,
133131 tagsEditable,
134132 hideImageTaggingHardDelete,
@@ -156,21 +154,26 @@ const Artifacts = ({
156154 // If artifactId is not 0 image info is shown, if isArtifactUploaded is true reports are shown
157155 // In case both are not present empty state is shown
158156 // isArtifactUploaded can be true even if status is failed
157+
158+ // NOTE: This means there are no reports and no image artifacts i.e. empty state
159159 if ( ! isArtifactUploaded && ! artifactId ) {
160160 if (
161161 status . toLowerCase ( ) === TERMINAL_STATUS_MAP . FAILED ||
162162 status . toLowerCase ( ) === TERMINAL_STATUS_MAP . CANCELLED ||
163163 status . toLowerCase ( ) === TERMINAL_STATUS_MAP . ERROR
164164 ) {
165- return isJobCI ? (
166- < GenericEmptyState
167- title = { EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . FailedToFetchArtifacts }
168- subTitle = { EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . FailedToFetchArtifactsError }
169- />
170- ) : (
165+ return (
171166 < GenericEmptyState
172- title = { EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . NoArtifactsGenerated }
173- subTitle = { EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . NoArtifactsError }
167+ title = {
168+ isJobCI
169+ ? EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . FailedToFetchArtifacts
170+ : EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . NoArtifactsGenerated
171+ }
172+ subTitle = {
173+ isJobCI
174+ ? EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . FailedToFetchArtifactsError
175+ : EMPTY_STATE_STATUS . ARTIFACTS_EMPTY_STATE_TEXTS . NoArtifactsError
176+ }
174177 />
175178 )
176179 }
@@ -218,28 +221,26 @@ const Artifacts = ({
218221 </ div >
219222 </ CIListItem >
220223 ) }
221- { blobStorageEnabled &&
222- downloadArtifactUrl &&
223- ( type === HistoryComponentType . CD || isArtifactUploaded || isJobView ) && (
224- < CIListItem
225- type = "report"
226- hideImageTaggingHardDelete = { hideImageTaggingHardDelete }
227- isSuperAdmin = { isSuperAdmin }
228- renderCIListHeader = { renderCIListHeader }
229- >
230- < div className = "flex column left" >
231- < div className = "cn-9 fs-14" > Reports.zip</ div >
232- < button
233- type = "button"
234- onClick = { handleArtifact }
235- className = "anchor p-0 cb-5 fs-12 flex left pointer"
236- >
237- Download
238- < Download className = "ml-5 icon-dim-16" />
239- </ button >
240- </ div >
241- </ CIListItem >
242- ) }
224+ { blobStorageEnabled && downloadArtifactUrl && isArtifactUploaded && (
225+ < CIListItem
226+ type = "report"
227+ hideImageTaggingHardDelete = { hideImageTaggingHardDelete }
228+ isSuperAdmin = { isSuperAdmin }
229+ renderCIListHeader = { renderCIListHeader }
230+ >
231+ < div className = "flex column left" >
232+ < div className = "cn-9 fs-14" > Reports.zip</ div >
233+ < button
234+ type = "button"
235+ onClick = { handleArtifact }
236+ className = "anchor p-0 cb-5 fs-12 flex left pointer"
237+ >
238+ Download
239+ < Download className = "ml-5 icon-dim-16" />
240+ </ button >
241+ </ div >
242+ </ CIListItem >
243+ ) }
243244 </ div >
244245 { ! blobStorageEnabled && (
245246 < div className = "flexbox dc__position-abs-b-20 dc__content-center w-100" >
0 commit comments