Commit aa0ae7eb authored by Phil Hughes's avatar Phil Hughes

Merge branch '324177-update-merged-widget-state-to-match-designs' into 'master'

Resolve "Update merged widget state to match designs"

See merge request gitlab-org/gitlab!65611
parents 17d99676 ebe417d6
<script> <script>
/* eslint-disable @gitlab/vue-require-i18n-strings */ /* eslint-disable @gitlab/vue-require-i18n-strings */
import { GlLoadingIcon, GlButton, GlTooltipDirective } from '@gitlab/ui'; import { GlLoadingIcon, GlButton, GlTooltipDirective, GlIcon } from '@gitlab/ui';
import createFlash from '~/flash'; import createFlash from '~/flash';
import { s__, __ } from '~/locale'; import { s__, __ } from '~/locale';
import { OPEN_REVERT_MODAL, OPEN_CHERRY_PICK_MODAL } from '~/projects/commit/constants'; import { OPEN_REVERT_MODAL, OPEN_CHERRY_PICK_MODAL } from '~/projects/commit/constants';
...@@ -8,7 +8,6 @@ import modalEventHub from '~/projects/commit/event_hub'; ...@@ -8,7 +8,6 @@ import modalEventHub from '~/projects/commit/event_hub';
import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import eventHub from '../../event_hub'; import eventHub from '../../event_hub';
import MrWidgetAuthorTime from '../mr_widget_author_time.vue'; import MrWidgetAuthorTime from '../mr_widget_author_time.vue';
import statusIcon from '../mr_widget_status_icon.vue';
export default { export default {
name: 'MRWidgetMerged', name: 'MRWidgetMerged',
...@@ -17,7 +16,7 @@ export default { ...@@ -17,7 +16,7 @@ export default {
}, },
components: { components: {
MrWidgetAuthorTime, MrWidgetAuthorTime,
statusIcon, GlIcon,
ClipboardButton, ClipboardButton,
GlLoadingIcon, GlLoadingIcon,
GlButton, GlButton,
...@@ -116,7 +115,7 @@ export default { ...@@ -116,7 +115,7 @@ export default {
</script> </script>
<template> <template>
<div class="mr-widget-body media"> <div class="mr-widget-body media">
<status-icon status="success" /> <gl-icon name="merge" :size="24" class="gl-text-blue-500 gl-mr-3 gl-mt-1" />
<div class="media-body"> <div class="media-body">
<div class="space-children"> <div class="space-children">
<mr-widget-author-time <mr-widget-author-time
...@@ -131,7 +130,6 @@ export default { ...@@ -131,7 +130,6 @@ export default {
:title="revertTitle" :title="revertTitle"
size="small" size="small"
category="secondary" category="secondary"
variant="warning"
data-qa-selector="revert_button" data-qa-selector="revert_button"
@click="openRevertModal" @click="openRevertModal"
> >
...@@ -144,7 +142,6 @@ export default { ...@@ -144,7 +142,6 @@ export default {
:title="revertTitle" :title="revertTitle"
size="small" size="small"
category="secondary" category="secondary"
variant="warning"
data-method="post" data-method="post"
> >
{{ revertLabel }} {{ revertLabel }}
...@@ -169,6 +166,15 @@ export default { ...@@ -169,6 +166,15 @@ export default {
> >
{{ cherryPickLabel }} {{ cherryPickLabel }}
</gl-button> </gl-button>
<gl-button
v-if="shouldShowRemoveSourceBranch"
:disabled="isMakingRequest"
size="small"
class="js-remove-branch-button"
@click="removeSourceBranch"
>
{{ s__('mrWidget|Delete source branch') }}
</gl-button>
</div> </div>
<section class="mr-info-list" data-qa-selector="merged_status_content"> <section class="mr-info-list" data-qa-selector="merged_status_content">
<p> <p>
...@@ -196,17 +202,6 @@ export default { ...@@ -196,17 +202,6 @@ export default {
<p v-if="mr.sourceBranchRemoved"> <p v-if="mr.sourceBranchRemoved">
{{ s__('mrWidget|The source branch has been deleted') }} {{ s__('mrWidget|The source branch has been deleted') }}
</p> </p>
<p v-if="shouldShowRemoveSourceBranch" class="space-children">
<span>{{ s__('mrWidget|You can delete the source branch now') }}</span>
<gl-button
:disabled="isMakingRequest"
size="small"
class="js-remove-branch-button"
@click="removeSourceBranch"
>
{{ s__('mrWidget|Delete source branch') }}
</gl-button>
</p>
<p v-if="shouldShowSourceBranchRemoving"> <p v-if="shouldShowSourceBranchRemoving">
<gl-loading-icon size="sm" :inline="true" /> <gl-loading-icon size="sm" :inline="true" />
<span> {{ s__('mrWidget|The source branch is being deleted') }} </span> <span> {{ s__('mrWidget|The source branch is being deleted') }} </span>
......
...@@ -39411,9 +39411,6 @@ msgstr "" ...@@ -39411,9 +39411,6 @@ msgstr ""
msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes." msgid "mrWidget|You are not allowed to edit this project directly. Please fork to make changes."
msgstr "" msgstr ""
msgid "mrWidget|You can delete the source branch now"
msgstr ""
msgid "mrWidget|You can merge after removing denied licenses" msgid "mrWidget|You can merge after removing denied licenses"
msgstr "" msgstr ""
......
...@@ -217,7 +217,6 @@ describe('MRWidgetMerged', () => { ...@@ -217,7 +217,6 @@ describe('MRWidgetMerged', () => {
vm.mr.sourceBranchRemoved = false; vm.mr.sourceBranchRemoved = false;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.innerText).toContain('You can delete the source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been deleted'); expect(vm.$el.innerText).not.toContain('The source branch has been deleted');
done(); done();
}); });
...@@ -229,7 +228,6 @@ describe('MRWidgetMerged', () => { ...@@ -229,7 +228,6 @@ describe('MRWidgetMerged', () => {
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.innerText).toContain('The source branch is being deleted'); expect(vm.$el.innerText).toContain('The source branch is being deleted');
expect(vm.$el.innerText).not.toContain('You can delete the source branch now');
expect(vm.$el.innerText).not.toContain('The source branch has been deleted'); expect(vm.$el.innerText).not.toContain('The source branch has been deleted');
done(); done();
}); });
......
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