diff options
Diffstat (limited to 'app/assets/javascripts/jobs/components/table/cells/actions_cell.vue')
-rw-r--r-- | app/assets/javascripts/jobs/components/table/cells/actions_cell.vue | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/assets/javascripts/jobs/components/table/cells/actions_cell.vue b/app/assets/javascripts/jobs/components/table/cells/actions_cell.vue index 9a8ec30bb2d..7dfa963a857 100644 --- a/app/assets/javascripts/jobs/components/table/cells/actions_cell.vue +++ b/app/assets/javascripts/jobs/components/table/cells/actions_cell.vue @@ -12,6 +12,7 @@ import { JOB_SCHEDULED, PLAY_JOB_CONFIRMATION_MESSAGE, RUN_JOB_NOW_HEADER_TITLE, + FILE_TYPE_ARCHIVE, } from '../constants'; import eventHub from '../event_hub'; import cancelJobMutation from '../graphql/mutations/job_cancel.mutation.graphql'; @@ -58,8 +59,11 @@ export default { }, }, computed: { + hasArtifacts() { + return this.job.artifacts.nodes.find((artifact) => artifact.fileType === FILE_TYPE_ARCHIVE); + }, artifactDownloadPath() { - return this.job.artifacts?.nodes[0]?.downloadPath; + return this.hasArtifacts.downloadPath; }, canReadJob() { return this.job.userPermissions?.readBuild; @@ -67,6 +71,9 @@ export default { canUpdateJob() { return this.job.userPermissions?.updateBuild; }, + canReadArtifacts() { + return this.job.userPermissions?.readJobArtifacts; + }, isActive() { return this.job.active; }, @@ -89,7 +96,7 @@ export default { return this.job.detailedStatus?.action?.method; }, shouldDisplayArtifacts() { - return this.job.userPermissions?.readJobArtifacts && this.job.artifacts?.nodes.length > 0; + return this.canReadArtifacts && this.hasArtifacts; }, }, methods: { |