diff options
author | Phil Hughes <me@iamphill.com> | 2017-12-12 09:22:37 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-12-12 09:22:37 +0000 |
commit | 8a29e0b07367e1d0cc071f0de189aafcae207bf8 (patch) | |
tree | 98d370dd7749c4d85207edd072cee32bf575a5d1 /app/assets | |
parent | f2d44bcd4361572a8d32f6846a6fbf28a43c892d (diff) | |
parent | 5e4681372ad6384c56d82dc8582d80f6568a0dcf (diff) | |
download | gitlab-ce-8a29e0b07367e1d0cc071f0de189aafcae207bf8.tar.gz |
Merge branch '40997-pipeline-null' into 'master'
Checks for null in job tooltip title
Closes #40997
See merge request gitlab-org/gitlab-ce!15869
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/pipelines/components/graph/job_component.vue | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/app/assets/javascripts/pipelines/components/graph/job_component.vue b/app/assets/javascripts/pipelines/components/graph/job_component.vue index 08199b4234a..b01c799643c 100644 --- a/app/assets/javascripts/pipelines/components/graph/job_component.vue +++ b/app/assets/javascripts/pipelines/components/graph/job_component.vue @@ -59,8 +59,26 @@ }, computed: { + status() { + return this.job && this.job.status ? this.job.status : {}; + }, + tooltipText() { - return `${this.job.name} - ${this.job.status.label}`; + const textBuilder = []; + + if (this.job.name) { + textBuilder.push(this.job.name); + } + + if (this.job.name && this.status.label) { + textBuilder.push('-'); + } + + if (this.status.label) { + textBuilder.push(`${this.job.status.label}`); + } + + return textBuilder.join(' '); }, /** @@ -78,8 +96,8 @@ <div class="ci-job-component"> <a v-tooltip - v-if="job.status.has_details" - :href="job.status.details_path" + v-if="status.has_details" + :href="status.details_path" :title="tooltipText" :class="cssClassJobName" data-container="body" @@ -95,6 +113,7 @@ <div v-else v-tooltip + class="js-job-component-tooltip" :title="tooltipText" :class="cssClassJobName" data-container="body" @@ -108,18 +127,18 @@ <action-component v-if="hasAction && !isDropdown" - :tooltip-text="job.status.action.title" - :link="job.status.action.path" - :action-icon="job.status.action.icon" - :action-method="job.status.action.method" + :tooltip-text="status.action.title" + :link="status.action.path" + :action-icon="status.action.icon" + :action-method="status.action.method" /> <dropdown-action-component v-if="hasAction && isDropdown" - :tooltip-text="job.status.action.title" - :link="job.status.action.path" - :action-icon="job.status.action.icon" - :action-method="job.status.action.method" + :tooltip-text="status.action.title" + :link="status.action.path" + :action-icon="status.action.icon" + :action-method="status.action.method" /> </div> </template> |