Commit 7c0d1f83 authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '291994-remove-the-merge-manually-message-from-mrs' into 'master'

Resolve "Remove the merge manually message from MRs"

See merge request gitlab-org/gitlab!56016
parents 6881e483 2de6f11d
<script>
import { GlButton, GlModalDirective } from '@gitlab/ui';
import { sprintf, s__ } from '~/locale';
export default {
name: 'MRWidgetMergeHelp',
components: {
GlButton,
},
directives: {
GlModalDirective,
},
props: {
missingBranch: {
type: String,
required: false,
default: '',
},
},
computed: {
missingBranchInfo() {
return sprintf(
s__(
'mrWidget|If the %{branch} branch exists in your local repository, you can merge this merge request manually using the',
),
{ branch: this.missingBranch },
);
},
},
};
</script>
<template>
<section class="gl-py-3 gl-pr-3 gl-pl-5 gl-ml-7 mr-widget-help gl-font-style-italic">
<template v-if="missingBranch">
{{ missingBranchInfo }}
</template>
<template v-else>
{{ s__('mrWidget|You can merge this merge request manually using the') }}
</template>
<gl-button
v-gl-modal-directive="'modal-merge-info'"
variant="link"
class="gl-mt-n2 js-open-modal-help"
>
{{ s__('mrWidget|command line') }}
</gl-button>
</section>
</template>
......@@ -18,7 +18,6 @@ import GroupedTestReportsApp from '../reports/grouped_test_report/grouped_test_r
import Loading from './components/loading.vue';
import MrWidgetAlertMessage from './components/mr_widget_alert_message.vue';
import WidgetHeader from './components/mr_widget_header.vue';
import WidgetMergeHelp from './components/mr_widget_merge_help.vue';
import MrWidgetPipelineContainer from './components/mr_widget_pipeline_container.vue';
import WidgetRelatedLinks from './components/mr_widget_related_links.vue';
import WidgetSuggestPipeline from './components/mr_widget_suggest_pipeline.vue';
......@@ -59,7 +58,6 @@ export default {
// ExtensionsContainer,
'mr-widget-header': WidgetHeader,
'mr-widget-suggest-pipeline': WidgetSuggestPipeline,
'mr-widget-merge-help': WidgetMergeHelp,
MrWidgetPipelineContainer,
'mr-widget-related-links': WidgetRelatedLinks,
MrWidgetAlertMessage,
......@@ -140,9 +138,6 @@ export default {
componentName() {
return stateMaps.stateToComponentMap[this.mr.state];
},
shouldRenderMergeHelp() {
return stateMaps.statesToShowHelpWidget.indexOf(this.mr.state) > -1;
},
hasPipelineMustSucceedConflict() {
return !this.mr.hasCI && this.mr.onlyAllowMergeIfPipelineSucceeds;
},
......@@ -530,9 +525,6 @@ export default {
<source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" />
</div>
</div>
<div v-if="shouldRenderMergeHelp" class="mr-widget-footer">
<mr-widget-merge-help />
</div>
</div>
<mr-widget-pipeline-container
v-if="shouldRenderMergedPipeline"
......
---
title: Remove merge manually message
merge_request: 56016
author:
type: fixed
......@@ -424,7 +424,6 @@ export default {
<source-branch-removal-status v-if="shouldRenderSourceBranchRemovalStatus" />
</div>
</div>
<div v-if="shouldRenderMergeHelp" class="mr-widget-footer"><mr-widget-merge-help /></div>
</div>
<mr-widget-pipeline-container
v-if="shouldRenderMergedPipeline"
......
......@@ -36051,9 +36051,6 @@ msgstr ""
msgid "mrWidget|Fork project merge requests do not create merge request pipelines that validate a post merge result unless invoked by a project member."
msgstr ""
msgid "mrWidget|If the %{branch} branch exists in your local repository, you can merge this merge request manually using the"
msgstr ""
msgid "mrWidget|If the %{missingBranchName} branch exists in your local repository, you can merge this merge request manually using the command line"
msgstr ""
......@@ -36204,18 +36201,12 @@ msgstr ""
msgid "mrWidget|You can merge after removing denied licenses"
msgstr ""
msgid "mrWidget|You can merge this merge request manually using the"
msgstr ""
msgid "mrWidget|Your password"
msgstr ""
msgid "mrWidget|branch does not exist."
msgstr ""
msgid "mrWidget|command line"
msgstr ""
msgid "mrWidget|into"
msgstr ""
......
import { shallowMount } from '@vue/test-utils';
import MergeHelpComponent from '~/vue_merge_request_widget/components/mr_widget_merge_help.vue';
describe('MRWidgetMergeHelp', () => {
let wrapper;
const createComponent = ({ props = {} } = {}) => {
wrapper = shallowMount(MergeHelpComponent, {
propsData: {
missingBranch: 'this-is-not-the-branch-you-are-looking-for',
...props,
},
});
};
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
describe('with missing branch', () => {
beforeEach(() => {
createComponent();
});
it('renders missing branch information', () => {
expect(wrapper.find('.mr-widget-help').text()).toContain(
'If the this-is-not-the-branch-you-are-looking-for branch exists in your local repository',
);
});
});
describe('without missing branch', () => {
beforeEach(() => {
createComponent({
props: { missingBranch: '' },
});
});
it('renders information about how to merge manually', () => {
expect(wrapper.find('.mr-widget-help').text()).toContain(
'You can merge this merge request manually',
);
});
});
});
......@@ -91,18 +91,6 @@ describe('MrWidgetOptions', () => {
});
});
describe('shouldRenderMergeHelp', () => {
it('should return false for the initial merged state', () => {
expect(wrapper.vm.shouldRenderMergeHelp).toBeFalsy();
});
it('should return true for a state which requires help widget', () => {
wrapper.vm.mr.state = 'conflicts';
expect(wrapper.vm.shouldRenderMergeHelp).toBeTruthy();
});
});
describe('shouldRenderPipelines', () => {
it('should return true when hasCI is true', () => {
wrapper.vm.mr.hasCI = true;
......
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