diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-26 18:08:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-26 18:08:29 +0300 |
commit | cac0926ddbef9d1505c2a23ccad60fd47c7d050a (patch) | |
tree | ef6808933314a104d004528f7c84716dc472d93a /app/assets/javascripts/vue_merge_request_widget/components | |
parent | afd476d5fd62d31c7e0b7509691fa18e632a60df (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/vue_merge_request_widget/components')
3 files changed, 2 insertions, 107 deletions
diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue deleted file mode 100644 index e1d88099580..00000000000 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_header.vue +++ /dev/null @@ -1,100 +0,0 @@ -<script> -import { - GlLink, - GlTooltipDirective, - GlModalDirective, - GlSafeHtmlDirective as SafeHtml, - GlSprintf, -} from '@gitlab/ui'; -import { constructWebIDEPath } from '~/lib/utils/url_utility'; -import { s__ } from '~/locale'; -import clipboardButton from '~/vue_shared/components/clipboard_button.vue'; -import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue'; -import MrWidgetIcon from './mr_widget_icon.vue'; - -export default { - name: 'MRWidgetHeader', - components: { - clipboardButton, - TooltipOnTruncate, - MrWidgetIcon, - GlLink, - GlSprintf, - }, - directives: { - GlTooltip: GlTooltipDirective, - GlModalDirective, - SafeHtml, - }, - props: { - mr: { - type: Object, - required: true, - }, - }, - computed: { - shouldShowCommitsBehindText() { - return this.mr.divergedCommitsCount > 0; - }, - branchNameClipboardData() { - // This supports code in app/assets/javascripts/copy_to_clipboard.js that - // works around ClipboardJS limitations to allow the context-specific - // copy/pasting of plain text or GFM. - return JSON.stringify({ - text: this.mr.sourceBranch, - gfm: `\`${this.mr.sourceBranch}\``, - }); - }, - webIdePath() { - return constructWebIDEPath(this.mr); - }, - isFork() { - return this.mr.sourceProjectFullPath !== this.mr.targetProjectFullPath; - }, - }, - i18n: { - webIdeText: s__('mrWidget|Open in Web IDE'), - gitpodText: s__('mrWidget|Open in Gitpod'), - }, -}; -</script> -<template> - <div class="gl-display-flex mr-source-target"> - <mr-widget-icon name="git-merge" /> - <div class="git-merge-container d-flex"> - <div class="normal"> - <strong> - {{ s__('mrWidget|Request to merge') }} - <tooltip-on-truncate - v-safe-html="mr.sourceBranchLink" - :title="mr.sourceBranch" - truncate-target="child" - class="label-branch label-truncate js-source-branch" - /><clipboard-button - data-testid="mr-widget-copy-clipboard" - :text="branchNameClipboardData" - :title="__('Copy branch name')" - category="tertiary" - /> - {{ s__('mrWidget|into') }} - <tooltip-on-truncate - :title="mr.targetBranch" - truncate-target="child" - class="label-branch label-truncate" - > - <a :href="mr.targetBranchTreePath" class="js-target-branch"> {{ mr.targetBranch }} </a> - </tooltip-on-truncate> - </strong> - <div v-if="shouldShowCommitsBehindText" class="diverged-commits-count"> - <gl-sprintf :message="s__('mrWidget|The source branch is %{link} the target branch')"> - <template #link> - <gl-link :href="mr.targetBranchPath">{{ - n__('%d commit behind', '%d commits behind', mr.divergedCommitsCount) - }}</gl-link> - </template> - </gl-sprintf> - </div> - </div> - </div> - </div> -</template> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue index b8a1f89d232..913aa0e1e34 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_related_links.vue @@ -93,9 +93,7 @@ export default { </span> </p> <div - v-if=" - divergedCommitsCount > 0 && glFeatures.updatedMrHeader && !glFeatures.restructuredMrWidget - " + v-if="divergedCommitsCount > 0 && !glFeatures.restructuredMrWidget" class="diverged-commits-count" > <gl-sprintf :message="s__('mrWidget|The source branch is %{link} the target branch')"> diff --git a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue index 41d35f68790..cf482410bef 100644 --- a/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue +++ b/app/assets/javascripts/vue_merge_request_widget/components/states/ready_to_merge.vue @@ -722,10 +722,7 @@ export default { {{ __('Merge details') }} </strong> <ul class="gl-pl-4 gl-m-0"> - <li - v-if="mr.divergedCommitsCount > 0 && glFeatures.updatedMrHeader" - class="gl-line-height-normal" - > + <li v-if="mr.divergedCommitsCount > 0" class="gl-line-height-normal"> <gl-sprintf :message="s__('mrWidget|The source branch is %{link} the target branch')" > |