diff options
author | Nathan Friend <nathan@gitlab.com> | 2019-09-10 15:18:39 -0300 |
---|---|---|
committer | Nathan Friend <nathan@gitlab.com> | 2019-09-11 07:27:58 -0300 |
commit | 11f1305ec7b71721a24352ab2346d3ed865883c4 (patch) | |
tree | e714bad8becb45bc2249179c0d48a52027ef2ce4 /app | |
parent | 1ba9f029e89e99a245a201c21a98f4f79dc7b302 (diff) | |
download | gitlab-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')
-rw-r--r-- | app/assets/javascripts/vue_merge_request_widget/components/mr_widget_pipeline.vue | 52 | ||||
-rw-r--r-- | app/models/ci/pipeline.rb | 8 |
2 files changed, 14 insertions, 46 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> diff --git a/app/models/ci/pipeline.rb b/app/models/ci/pipeline.rb index d2271c1335c..4aaabed6b7b 100644 --- a/app/models/ci/pipeline.rb +++ b/app/models/ci/pipeline.rb @@ -835,12 +835,12 @@ module Ci return unless merge_request_event? strong_memoize(:merge_request_event_type) do - if detached_merge_request_pipeline? - :detached + if merge_train_pipeline? + :merge_train elsif merge_request_pipeline? :merged_result - elsif merge_train_pipeline? - :merge_train + elsif detached_merge_request_pipeline? + :detached end end end |