Commit a34e36ec authored by Phil Hughes's avatar Phil Hughes

Merge branch 'ee-10021-mr-widget-ee' into 'master'

Moves EE diferences to CE for mr_widget_pipeline

See merge request gitlab-org/gitlab-ee!9793
parents 10405e06 2f854516
...@@ -5,7 +5,7 @@ import PipelineStage from '~/pipelines/components/stage.vue'; ...@@ -5,7 +5,7 @@ import PipelineStage from '~/pipelines/components/stage.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import LinkedPipelinesMiniList from 'ee/vue_shared/components/linked_pipelines_mini_list.vue'; import mrWidgetPipelineMixin from 'ee_else_ce/vue_merge_request_widget/mixins/mr_widget_pipeline';
export default { export default {
name: 'MRWidgetPipeline', name: 'MRWidgetPipeline',
...@@ -14,8 +14,10 @@ export default { ...@@ -14,8 +14,10 @@ export default {
CiIcon, CiIcon,
Icon, Icon,
TooltipOnTruncate, TooltipOnTruncate,
LinkedPipelinesMiniList, LinkedPipelinesMiniList: () =>
import('ee_component/vue_shared/components/linked_pipelines_mini_list.vue'),
}, },
mixins: [mrWidgetPipelineMixin],
props: { props: {
pipeline: { pipeline: {
type: Object, type: Object,
...@@ -76,17 +78,6 @@ export default { ...@@ -76,17 +78,6 @@ export default {
false, false,
); );
}, },
/* We typically set defaults ([]) in the store or prop declarations, but because triggered
* and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we
* need to check their length here to prevent initializing linked-pipeline-mini-lists
* unneccessarily. */
triggered() {
return this.pipeline.triggered || [];
},
triggeredBy() {
const response = this.pipeline.triggered_by;
return response ? [response] : [];
},
}, },
}; };
</script> </script>
...@@ -94,8 +85,7 @@ export default { ...@@ -94,8 +85,7 @@ export default {
<div v-if="hasPipeline || hasCIError" class="ci-widget media"> <div v-if="hasPipeline || hasCIError" class="ci-widget media">
<template v-if="hasCIError"> <template v-if="hasCIError">
<div <div
class="add-border ci-status-icon ci-status-icon-failed ci-error class="add-border ci-status-icon ci-status-icon-failed ci-error js-ci-error append-right-default"
js-ci-error append-right-default"
> >
<icon :size="32" name="status_failed_borderless" /> <icon :size="32" name="status_failed_borderless" />
</div> </div>
...@@ -113,16 +103,13 @@ export default { ...@@ -113,16 +103,13 @@ export default {
<a :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number" <a :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number"
>#{{ pipeline.id }}</a >#{{ pipeline.id }}</a
> >
{{ pipeline.details.status.label }} {{ pipeline.details.status.label }}
<template v-if="hasCommitInfo"> <template v-if="hasCommitInfo">
for for
<a <a
:href="pipeline.commit.commit_path" :href="pipeline.commit.commit_path"
class="commit-sha js-commit-link font-weight-normal" class="commit-sha js-commit-link font-weight-normal"
> >{{ pipeline.commit.short_id }}</a
{{ pipeline.commit.short_id }}</a
> >
on on
<tooltip-on-truncate <tooltip-on-truncate
...@@ -145,10 +132,9 @@ export default { ...@@ -145,10 +132,9 @@ export default {
v-for="(stage, i) in pipeline.details.stages" v-for="(stage, i) in pipeline.details.stages"
:key="i" :key="i"
:class="{ :class="{
'has-downstream': i === pipeline.details.stages.length - 1 && triggered.length, 'has-downstream': hasDownstream(i),
}" }"
class="stage-container dropdown js-mini-pipeline-graph class="stage-container dropdown js-mini-pipeline-graph mr-widget-pipeline-stages"
mr-widget-pipeline-stages"
> >
<pipeline-stage :stage="stage" /> <pipeline-stage :stage="stage" />
</div> </div>
......
export default {
computed: {
triggered() {
return [];
},
triggeredBy() {
return [];
},
},
methods: {
hasDownstream() {
return false;
},
},
};
export default {
computed: {
/* We typically set defaults ([]) in the store or prop declarations, but because triggered
* and triggeredBy are appended to `pipeline`, we can't set defaults in the store, and we
* need to check their length here to prevent initializing linked-pipeline-mini-lists
* unneccessarily. */
triggered() {
return this.pipeline.triggered || [];
},
triggeredBy() {
const response = this.pipeline.triggered_by;
return response ? [response] : [];
},
},
methods: {
hasDownstream(i) {
return i === this.pipeline.details.stages.length - 1 && this.triggered.length;
},
},
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment