summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorNathan Friend <nathan@gitlab.com>2019-09-10 15:18:39 -0300
committerNathan Friend <nathan@gitlab.com>2019-09-11 07:27:58 -0300
commit11f1305ec7b71721a24352ab2346d3ed865883c4 (patch)
treee714bad8becb45bc2249179c0d48a52027ef2ce4 /app/assets/javascripts
parent1ba9f029e89e99a245a201c21a98f4f79dc7b302 (diff)
downloadgitlab-ce-11f1305ec7b71721a24352ab2346d3ed865883c4.tar.gz
Make MR pipeline widget text more descriptive (CE)ce-indicator-for-pipeline-for-merge-train
This change updates the text of the pipeline widget that appears on the merge request page. The text has been made more consistent between different types of pipelines; this makes the front-end implementation simpler and more maintainable. In addition, the type of pipeline is (i.e. regular pipeline, merge request pipeline, detached pipeline) included in the text, making this type more obvious to the end user. Some information has been removed from the widget as part of this change; however, any information that was removed already appears elsewhere on the merge request page.
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue52
1 files changed, 10 insertions, 42 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
index 40c095aa954..4b5201bbca7 100644
--- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
+++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue
@@ -1,7 +1,7 @@
<script>
/* eslint-disable vue/require-default-prop */
import { GlTooltipDirective, GlLink } from '@gitlab/ui';
-import { sprintf, __ } from '~/locale';
+import { sprintf, s__ } from '~/locale';
import PipelineStage from '~/pipelines/components/stage.vue';
import CiIcon from '~/vue_shared/components/ci_icon.vue';
import Icon from '~/vue_shared/components/icon.vue';
@@ -73,8 +73,8 @@ export default {
},
errorText() {
return sprintf(
- __(
- 'Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation.%{linkEnd}',
+ s__(
+ 'Pipeline|Could not retrieve the pipeline status. For troubleshooting steps, read the %{linkStart}documentation.%{linkEnd}',
),
{
linkStart: `<a href="${this.troubleshootingDocsPath}">`,
@@ -89,6 +89,9 @@ export default {
isMergeRequestPipeline() {
return Boolean(this.pipeline.flags && this.pipeline.flags.merge_request_pipeline);
},
+ showSourceBranch() {
+ return Boolean(this.pipeline.ref.branch);
+ },
},
};
</script>
@@ -109,7 +112,7 @@ export default {
<div class="ci-widget-content">
<div class="media-body">
<div class="font-weight-bold js-pipeline-info-container">
- {{ s__('Pipeline|Pipeline') }}
+ {{ pipeline.details.name }}
<gl-link :href="pipeline.path" class="pipeline-id font-weight-normal pipeline-number"
>#{{ pipeline.id }}</gl-link
>
@@ -121,48 +124,13 @@ export default {
class="commit-sha js-commit-link font-weight-normal"
>{{ pipeline.commit.short_id }}</gl-link
>
+ </template>
+ <template v-if="showSourceBranch">
{{ s__('Pipeline|on') }}
- <template v-if="isTriggeredByMergeRequest">
- <gl-link
- v-gl-tooltip
- :href="pipeline.merge_request.path"
- :title="pipeline.merge_request.title"
- class="font-weight-normal"
- >!{{ pipeline.merge_request.iid }}</gl-link
- >
- {{ s__('Pipeline|with') }}
- <tooltip-on-truncate
- :title="pipeline.merge_request.source_branch"
- truncate-target="child"
- class="label-branch label-truncate"
- >
- <gl-link
- :href="pipeline.merge_request.source_branch_path"
- class="font-weight-normal"
- >{{ pipeline.merge_request.source_branch }}</gl-link
- >
- </tooltip-on-truncate>
-
- <template v-if="isMergeRequestPipeline">
- {{ s__('Pipeline|into') }}
- <tooltip-on-truncate
- :title="pipeline.merge_request.target_branch"
- truncate-target="child"
- class="label-branch label-truncate"
- >
- <gl-link
- :href="pipeline.merge_request.target_branch_path"
- class="font-weight-normal"
- >{{ pipeline.merge_request.target_branch }}</gl-link
- >
- </tooltip-on-truncate>
- </template>
- </template>
<tooltip-on-truncate
- v-else
:title="sourceBranch"
truncate-target="child"
- class="label-branch label-truncate"
+ class="label-branch label-truncate font-weight-normal"
v-html="sourceBranchLink"
/>
</template>