Skip to content

Commit d4b195a

Browse files
authored
Merge pull request #207 from devtron-labs/fix/jobs-artifacts
fix: show download report on jobs run history
2 parents b52ad10 + 5b56bd3 commit d4b195a

File tree

3 files changed

+27
-34
lines changed

3 files changed

+27
-34
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "0.1.8",
3+
"version": "0.1.9",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/CICDHistory/Artifacts.tsx

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ const Artifacts = ({
167167
if (status.toLowerCase() === TERMINAL_STATUS_MAP.RUNNING || status.toLowerCase() === TERMINAL_STATUS_MAP.STARTING) {
168168
return <CIProgressView />
169169
}
170-
if (isJobView && !blobStorageEnabled) {
170+
if (!blobStorageEnabled) {
171171
return (
172172
<div className="flex column p-24 w-100 h-100">
173173
<GenericEmptyState
@@ -193,15 +193,6 @@ const Artifacts = ({
193193
</div>
194194
)
195195
}
196-
if (isJobView && !isArtifactUploaded) {
197-
return (
198-
<GenericEmptyState
199-
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoFilesFound}
200-
subTitle={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoFilesGenerated}
201-
image={noartifact}
202-
/>
203-
)
204-
}
205196
if (status.toLowerCase() === TERMINAL_STATUS_MAP.FAILED || status.toLowerCase() === TERMINAL_STATUS_MAP.CANCELLED) {
206197
if (isJobCI) {
207198
return (
@@ -219,7 +210,7 @@ const Artifacts = ({
219210
/>
220211
)
221212
}
222-
if (!artifactId && status.toLowerCase() === TERMINAL_STATUS_MAP.SUCCEEDED) {
213+
if (!artifactId && status.toLowerCase() === TERMINAL_STATUS_MAP.SUCCEEDED && !isJobView) {
223214
return (
224215
<GenericEmptyState
225216
title={EMPTY_STATE_STATUS.ARTIFACTS_EMPTY_STATE_TEXTS.NoArtifactsFound}
@@ -259,26 +250,28 @@ const Artifacts = ({
259250
</div>
260251
</CIListItem>
261252
)}
262-
{blobStorageEnabled && getArtifactPromise && (type === HistoryComponentType.CD || isArtifactUploaded) && (
263-
<CIListItem
264-
type="report"
265-
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
266-
isSuperAdmin={isSuperAdmin}
267-
renderCIListHeader={renderCIListHeader}
268-
>
269-
<div className="flex column left">
270-
<div className="cn-9 fs-14">Reports.zip</div>
271-
<button
272-
type="button"
273-
onClick={handleArtifact}
274-
className="anchor p-0 cb-5 fs-12 flex left pointer"
275-
>
276-
Download
277-
<Download className="ml-5 icon-dim-16" />
278-
</button>
279-
</div>
280-
</CIListItem>
281-
)}
253+
{blobStorageEnabled &&
254+
getArtifactPromise &&
255+
(type === HistoryComponentType.CD || isArtifactUploaded || isJobView) && (
256+
<CIListItem
257+
type="report"
258+
hideImageTaggingHardDelete={hideImageTaggingHardDelete}
259+
isSuperAdmin={isSuperAdmin}
260+
renderCIListHeader={renderCIListHeader}
261+
>
262+
<div className="flex column left">
263+
<div className="cn-9 fs-14">Reports.zip</div>
264+
<button
265+
type="button"
266+
onClick={handleArtifact}
267+
className="anchor p-0 cb-5 fs-12 flex left pointer"
268+
>
269+
Download
270+
<Download className="ml-5 icon-dim-16" />
271+
</button>
272+
</div>
273+
</CIListItem>
274+
)}
282275
</div>
283276
)
284277
}

0 commit comments

Comments
 (0)