Skip to content
Snippets Groups Projects

Show indicator to Pipelines for merge train

Merged Shinya Maeda requested to merge indicator-for-pipeline-for-merge-train into master
All threads resolved!
6 files
+ 115
17
Compare changes
  • Side-by-side
  • Inline
Files
6
@@ -6,6 +6,16 @@ import PipelineStage from '~/pipelines/components/stage.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import { s__ } from '~/locale';
import {
BRANCH_PIPELINE,
TAG_PIPELINE,
DETACHED_MERGE_REQUEST_PIPELINE,
MERGED_RESULT_PIPELINE,
MERGE_TRAIN_PIPELINE,
OTHER_PIPELINE,
} from '../constants';
import mrWidgetPipelineMixin from 'ee_else_ce/vue_merge_request_widget/mixins/mr_widget_pipeline';
export default {
@@ -89,6 +99,35 @@ export default {
isMergeRequestPipeline() {
return Boolean(this.pipeline.flags && this.pipeline.flags.merge_request_pipeline);
},
pipelineType() {
if (this.pipeline.flags.merge_train_pipeline) {
return MERGE_TRAIN_PIPELINE;
} else if (this.pipeline.flags.merge_request_pipeline) {
return MERGED_RESULT_PIPELINE;
} else if (this.pipeline.flags.detached_merge_request_pipeline) {
return DETACHED_MERGE_REQUEST_PIPELINE;
} else if (this.pipeline.ref.branch) {
return BRANCH_PIPELINE;
} else if (this.pipeline.ref.tag) {
return TAG_PIPELINE;
}
return OTHER_PIPELINE;
},
pipelineTypeLabel() {
if (this.pipelineType === DETACHED_MERGE_REQUEST_PIPELINE) {
return s__('Pipeline|Detached merge request pipeline');
} else if (this.pipelineType === MERGED_RESULT_PIPELINE) {
return s__('Pipeline|Merged result pipeline');
} else if (this.pipelineType === MERGE_TRAIN_PIPELINE) {
return s__('Pipeline|Merge train pipeline');
}
return s__('Pipeline|Pipeline');
},
showSourceBranch() {
return this.pipelineType === BRANCH_PIPELINE;
},
},
};
</script>
@@ -108,7 +147,33 @@ export default {
<div class="ci-widget-content">
<div class="media-body">
<div class="font-weight-bold js-pipeline-info-container">
{{ s__('Pipeline|Pipeline') }}
{{ pipelineTypeLabel }}
<gl-link :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number"
>#{{ pipeline.id }}</gl-link
>
{{ pipeline.details.status.label }}
<template v-if="hasCommitInfo">
{{ s__('Pipeline|for') }}
<gl-link
:href="pipeline.commit.commit_path"
class="commit-sha js-commit-link font-weight-normal"
>{{ pipeline.commit.short_id }}</gl-link
>
</template>
<template v-if="showSourceBranch">
{{ s__('Pipeline|on') }}
<tooltip-on-truncate
:title="sourceBranch"
truncate-target="child"
class="label-branch label-truncate"
>
<gl-link :href="sourceBranchLink" class="font-weight-normal">{{
sourceBranch
}}</gl-link>
</tooltip-on-truncate>
</template>
<!-- {{ s__('Pipeline|Pipeline') }}
<gl-link :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number"
>#{{ pipeline.id }}</gl-link
>
@@ -164,7 +229,7 @@ export default {
class="label-branch label-truncate"
v-html="sourceBranchLink"
/>
</template>
</template> -->
</div>
<div v-if="pipeline.coverage" class="coverage">
{{ s__('Pipeline|Coverage') }} {{ pipeline.coverage }}%
Loading