gitlab-org--gitlab-foss/app/assets/javascripts/vue_pipelines_index/status.js.es6

35 lines
857 B
JavaScript
Raw Normal View History

/* global Vue, gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueStatusScope = Vue.extend({
props: [
2016-12-13 12:27:34 -05:00
'pipeline', 'svgs', 'match',
],
computed: {
cssClasses() {
2017-01-06 17:32:06 -05:00
const cssObject = { 'ci-status': true };
2016-12-21 19:30:27 -05:00
cssObject[`ci-${this.pipeline.details.status.group}`] = true;
return cssObject;
},
svg() {
2016-12-13 12:27:34 -05:00
return this.svgs[this.match(this.pipeline.details.status.icon)];
},
2016-12-29 13:00:38 -05:00
detailsPath() {
const { status } = this.pipeline.details;
return status.has_details ? status.details_path : false;
2016-12-29 13:00:38 -05:00
},
},
template: `
<td class="commit-link">
<a
:class='cssClasses'
2016-12-29 13:00:38 -05:00
:href='detailsPath'
v-html='svg + pipeline.details.status.text'
>
</a>
</td>
`,
});
})(window.gl || (window.gl = {}));