summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-03-22 17:52:28 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2018-03-28 13:59:56 +0200
commit973e4030b13adbcc4eb7fad347b928a5164a04ff (patch)
tree2583fbd29dce1b6dde4b7a6b26525e7d27cf7d32 /app/assets
parent7d7b0688b846e346a0799340875d459d26c1718d (diff)
downloadgitlab-ce-973e4030b13adbcc4eb7fad347b928a5164a04ff.tar.gz
Refactor build_metadata
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/jobs/components/sidebar_details_block.vue12
1 files changed, 9 insertions, 3 deletions
diff --git a/app/assets/javascripts/jobs/components/sidebar_details_block.vue b/app/assets/javascripts/jobs/components/sidebar_details_block.vue
index 6ff3fa6e099..172de6b3679 100644
--- a/app/assets/javascripts/jobs/components/sidebar_details_block.vue
+++ b/app/assets/javascripts/jobs/components/sidebar_details_block.vue
@@ -44,10 +44,16 @@
runnerId() {
return `#${this.job.runner.id}`;
},
+ hasTimeout() {
+ return this.job.metadata != null && this.job.metadata.timeout_human_readable !== '';
+ },
timeout() {
- let t = `${this.job.metadata.timeout_human_readable}`;
+ if (this.job.metadata == null) {
+ return '';
+ }
- if (this.job.metadata.timeout_source != null) {
+ let t = this.job.metadata.timeout_human_readable;
+ if (this.job.metadata.timeout_source !== '') {
t += ` (from ${this.job.metadata.timeout_source})`;
}
@@ -130,7 +136,7 @@
/>
<detail-row
class="js-job-timeout"
- v-if="job.metadata.timeout_human_readable"
+ v-if="hasTimeout"
title="Timeout"
:help-url="runnerHelpUrl"
:value="timeout"