2016-12-06 11:03:45 -05:00
|
|
|
/* 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',
|
2016-12-06 11:03:45 -05:00
|
|
|
],
|
|
|
|
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;
|
2016-12-06 11:03:45 -05:00
|
|
|
return cssObject;
|
|
|
|
},
|
|
|
|
svg() {
|
2016-12-13 12:27:34 -05:00
|
|
|
return this.svgs[this.match(this.pipeline.details.status.icon)];
|
2016-12-06 11:03:45 -05:00
|
|
|
},
|
2016-12-29 13:00:38 -05:00
|
|
|
detailsPath() {
|
|
|
|
const { status } = this.pipeline.details;
|
2017-01-04 14:36:42 -05:00
|
|
|
return status.has_details ? status.details_path : false;
|
2016-12-29 13:00:38 -05:00
|
|
|
},
|
2016-12-06 11:03:45 -05:00
|
|
|
},
|
|
|
|
template: `
|
2016-12-28 16:26:06 -05:00
|
|
|
<td class="commit-link">
|
2016-12-24 16:04:17 -05:00
|
|
|
<a
|
|
|
|
:class='cssClasses'
|
2016-12-29 13:00:38 -05:00
|
|
|
:href='detailsPath'
|
2016-12-24 16:04:17 -05:00
|
|
|
v-html='svg + pipeline.details.status.text'
|
|
|
|
>
|
2016-12-06 11:03:45 -05:00
|
|
|
</a>
|
|
|
|
</td>
|
|
|
|
`,
|
|
|
|
});
|
|
|
|
})(window.gl || (window.gl = {}));
|