2017-05-06 17:02:06 +00:00
|
|
|
<script>
|
2018-06-28 14:25:49 +00:00
|
|
|
import _ from 'underscore';
|
2019-03-13 16:51:56 +00:00
|
|
|
import stageColumnMixin from 'ee_else_ce/pipelines/mixins/stage_column_mixin';
|
2018-10-17 11:11:52 +00:00
|
|
|
import JobItem from './job_item.vue';
|
|
|
|
import JobGroupDropdown from './job_group_dropdown.vue';
|
2019-05-02 18:27:35 +00:00
|
|
|
import ActionComponent from './action_component.vue';
|
2017-05-06 17:02:06 +00:00
|
|
|
|
2018-04-06 15:42:19 +00:00
|
|
|
export default {
|
|
|
|
components: {
|
2018-10-17 11:11:52 +00:00
|
|
|
JobItem,
|
|
|
|
JobGroupDropdown,
|
2019-05-02 18:27:35 +00:00
|
|
|
ActionComponent,
|
2018-04-06 15:42:19 +00:00
|
|
|
},
|
2019-03-13 16:51:56 +00:00
|
|
|
mixins: [stageColumnMixin],
|
2018-04-06 15:42:19 +00:00
|
|
|
props: {
|
|
|
|
title: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
2017-05-06 17:02:06 +00:00
|
|
|
},
|
2018-10-17 11:11:52 +00:00
|
|
|
groups: {
|
2018-04-06 15:42:19 +00:00
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
isFirstColumn: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
stageConnectorClass: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
2019-05-02 18:27:35 +00:00
|
|
|
action: {
|
|
|
|
type: Object,
|
|
|
|
required: false,
|
|
|
|
default: () => ({}),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
hasAction() {
|
|
|
|
return !_.isEmpty(this.action);
|
|
|
|
},
|
2018-04-06 15:42:19 +00:00
|
|
|
},
|
|
|
|
methods: {
|
2018-10-17 11:11:52 +00:00
|
|
|
groupId(group) {
|
|
|
|
return `ci-badge-${_.escape(group.name)}`;
|
2018-04-06 15:42:19 +00:00
|
|
|
},
|
2018-05-15 15:55:07 +00:00
|
|
|
pipelineActionRequestComplete() {
|
|
|
|
this.$emit('refreshPipelineGraph');
|
|
|
|
},
|
2018-04-06 15:42:19 +00:00
|
|
|
},
|
|
|
|
};
|
2017-05-06 17:02:06 +00:00
|
|
|
</script>
|
|
|
|
<template>
|
2018-11-16 20:07:38 +00:00
|
|
|
<li :class="stageConnectorClass" class="stage-column">
|
2019-05-02 18:27:35 +00:00
|
|
|
<div class="stage-name position-relative">
|
|
|
|
{{ title }}
|
|
|
|
<action-component
|
|
|
|
v-if="hasAction"
|
|
|
|
:action-icon="action.icon"
|
|
|
|
:tooltip-text="action.title"
|
|
|
|
:link="action.path"
|
2019-05-06 12:23:13 +00:00
|
|
|
class="js-stage-action stage-action position-absolute position-top-0 rounded"
|
2019-05-02 18:27:35 +00:00
|
|
|
@pipelineActionRequestComplete="pipelineActionRequestComplete"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
2017-05-06 17:02:06 +00:00
|
|
|
<div class="builds-container">
|
|
|
|
<ul>
|
|
|
|
<li
|
2018-10-17 11:11:52 +00:00
|
|
|
v-for="(group, index) in groups"
|
|
|
|
:id="groupId(group)"
|
|
|
|
:key="group.id"
|
2017-05-08 14:53:54 +00:00
|
|
|
:class="buildConnnectorClass(index)"
|
2018-06-11 09:49:47 +00:00
|
|
|
class="build"
|
2018-01-05 00:18:35 +00:00
|
|
|
>
|
2017-05-06 17:02:06 +00:00
|
|
|
<div class="curve"></div>
|
|
|
|
|
2018-10-17 11:11:52 +00:00
|
|
|
<job-item
|
|
|
|
v-if="group.size === 1"
|
|
|
|
:job="group.jobs[0]"
|
2017-05-06 17:02:06 +00:00
|
|
|
css-class-job-name="build-content"
|
2018-05-15 15:55:07 +00:00
|
|
|
@pipelineActionRequestComplete="pipelineActionRequestComplete"
|
2018-01-05 00:18:35 +00:00
|
|
|
/>
|
2017-05-06 17:02:06 +00:00
|
|
|
|
2018-10-17 11:11:52 +00:00
|
|
|
<job-group-dropdown
|
|
|
|
v-if="group.size > 1"
|
|
|
|
:group="group"
|
2018-05-15 15:55:07 +00:00
|
|
|
@pipelineActionRequestComplete="pipelineActionRequestComplete"
|
2018-01-05 00:18:35 +00:00
|
|
|
/>
|
2017-05-06 17:02:06 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
</template>
|