summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/pipelines_table_row.js
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-04-27 14:37:40 +0000
committerPhil Hughes <me@iamphill.com>2017-04-27 14:37:40 +0000
commitde489f972c1cbff487900be904c3c83700088b50 (patch)
treefce58f708a01974080aabb115fb0ad79a11de2ea /app/assets/javascripts/vue_shared/components/pipelines_table_row.js
parent6ae76738dde8fecb117f7706ae2ef74c1d83cdb7 (diff)
downloadgitlab-ce-de489f972c1cbff487900be904c3c83700088b50.tar.gz
Remove unused code
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/pipelines_table_row.js')
-rw-r--r--app/assets/javascripts/vue_shared/components/pipelines_table_row.js31
1 files changed, 29 insertions, 2 deletions
diff --git a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js
index 62b7131de51..79806bc7204 100644
--- a/app/assets/javascripts/vue_shared/components/pipelines_table_row.js
+++ b/app/assets/javascripts/vue_shared/components/pipelines_table_row.js
@@ -1,5 +1,4 @@
/* eslint-disable no-param-reassign */
-
import AsyncButtonComponent from '../../pipelines/components/async_button.vue';
import PipelinesActionsComponent from '../../pipelines/components/pipelines_actions';
import PipelinesArtifactsComponent from '../../pipelines/components/pipelines_artifacts';
@@ -166,6 +165,32 @@ export default {
}
return undefined;
},
+
+ /**
+ * Timeago components expects a number
+ *
+ * @return {type} description
+ */
+ pipelineDuration() {
+ if (this.pipeline.details && this.pipeline.details.duration) {
+ return this.pipeline.details.duration;
+ }
+
+ return 0;
+ },
+
+ /**
+ * Timeago component expects a String.
+ *
+ * @return {String}
+ */
+ pipelineFinishedAt() {
+ if (this.pipeline.details && this.pipeline.details.finished_at) {
+ return this.pipeline.details.finished_at;
+ }
+
+ return '';
+ },
},
template: `
@@ -192,7 +217,9 @@ export default {
</div>
</td>
- <time-ago :pipeline="pipeline"/>
+ <time-ago
+ :duration="pipelineDuration"
+ :finished-time="pipelineFinishedAt" />
<td class="pipeline-actions">
<div class="pull-right btn-group">