Commit 1fedd4af authored by Phil Hughes's avatar Phil Hughes

Merge branch '343780-aqualls-adds-commit-string' into 'master'

Standardize merge details messaging

See merge request gitlab-org/gitlab!73871
parents 2d1e7c20 9ea97063
...@@ -40,9 +40,9 @@ export default { ...@@ -40,9 +40,9 @@ export default {
}, },
message() { message() {
return this.isFastForwardEnabled return this.isFastForwardEnabled
? s__('mrWidgetCommitsAdded|%{commitCount} will be added to %{targetBranch}.') ? s__('mrWidgetCommitsAdded|Adds %{commitCount} to %{targetBranch}.')
: s__( : s__(
'mrWidgetCommitsAdded|%{commitCount} and %{mergeCommitCount} will be added to %{targetBranch}%{squashedCommits}.', 'mrWidgetCommitsAdded|Adds %{commitCount} and %{mergeCommitCount} to %{targetBranch}%{squashedCommits}.',
); );
}, },
textDecorativeComponent() { textDecorativeComponent() {
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
</template> </template>
<template #squashedCommits> <template #squashedCommits>
<template v-if="glFeatures.restructuredMrWidget && isSquashEnabled"> <template v-if="glFeatures.restructuredMrWidget && isSquashEnabled">
{{ __('(commits will be squashed)') }}</template {{ n__('(squashes %d commit)', '(squashes %d commits)', commitsCount) }}</template
></template ></template
> >
</gl-sprintf> </gl-sprintf>
......
...@@ -4,7 +4,7 @@ import { __ } from '../../locale'; ...@@ -4,7 +4,7 @@ import { __ } from '../../locale';
export default { export default {
i18n: { i18n: {
removesBranchText: __('The source branch will be deleted'), removesBranchText: __('Deletes the source branch'),
tooltipTitle: __('A user with write access to the source branch selected this option'), tooltipTitle: __('A user with write access to the source branch selected this option'),
}, },
components: { components: {
......
...@@ -177,10 +177,10 @@ export default { ...@@ -177,10 +177,10 @@ export default {
</h4> </h4>
<section class="mr-info-list"> <section class="mr-info-list">
<p v-if="shouldRemoveSourceBranch"> <p v-if="shouldRemoveSourceBranch">
{{ s__('mrWidget|The source branch will be deleted') }} {{ s__('mrWidget|Deletes the source branch') }}
</p> </p>
<p v-else class="gl-display-flex"> <p v-else class="gl-display-flex">
<span class="gl-mr-3">{{ s__('mrWidget|The source branch will not be deleted') }}</span> <span class="gl-mr-3">{{ s__('mrWidget|Does not delete the source branch') }}</span>
<gl-button <gl-button
v-if="canRemoveSourceBranch" v-if="canRemoveSourceBranch"
:loading="isRemovingSourceBranch" :loading="isRemovingSourceBranch"
......
...@@ -32,7 +32,7 @@ export default { ...@@ -32,7 +32,7 @@ export default {
</h4> </h4>
<section class="mr-info-list"> <section class="mr-info-list">
<p> <p>
{{ s__('mrWidget|The changes will be merged into') }} {{ s__('mrWidget|Merges changes into') }}
<span class="label-branch"> <span class="label-branch">
<a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a> <a :href="mr.targetBranchPath">{{ mr.targetBranch }}</a>
</span> </span>
......
...@@ -710,10 +710,10 @@ export default { ...@@ -710,10 +710,10 @@ export default {
</li> </li>
<li class="gl-line-height-normal"> <li class="gl-line-height-normal">
<template v-if="removeSourceBranch"> <template v-if="removeSourceBranch">
{{ __('Source branch will be deleted.') }} {{ __('Deletes the source branch.') }}
</template> </template>
<template v-else> <template v-else>
{{ __('Source branch will not be deleted.') }} {{ __('Does not delete the source branch.') }}
</template> </template>
</li> </li>
<li v-if="mr.relatedLinks" class="gl-line-height-normal"> <li v-if="mr.relatedLinks" class="gl-line-height-normal">
......
...@@ -57,7 +57,7 @@ RSpec.describe 'User adds a merge request to a merge train', :js do ...@@ -57,7 +57,7 @@ RSpec.describe 'User adds a merge request to a merge train', :js do
it 'informs merge request that auto merge is enabled' do it 'informs merge request that auto merge is enabled' do
within('.mr-widget-section') do within('.mr-widget-section') do
expect(page).to have_content("Added to the merge train by #{user.name}") expect(page).to have_content("Added to the merge train by #{user.name}")
expect(page).to have_content('The source branch will not be deleted') expect(page).to have_content('Does not delete the source branch')
expect(page).to have_button('Remove from merge train') expect(page).to have_button('Remove from merge train')
expect(page).to have_button('Delete source branch') expect(page).to have_button('Delete source branch')
end end
...@@ -102,7 +102,7 @@ RSpec.describe 'User adds a merge request to a merge train', :js do ...@@ -102,7 +102,7 @@ RSpec.describe 'User adds a merge request to a merge train', :js do
it 'updates the merge option' do it 'updates the merge option' do
within('.mr-widget-section') do within('.mr-widget-section') do
expect(page).to have_content('The source branch will be deleted') expect(page).to have_content('Deletes the source branch')
end end
end end
end end
......
...@@ -58,7 +58,7 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do ...@@ -58,7 +58,7 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do
it 'informs merge request that auto merge is enabled' do it 'informs merge request that auto merge is enabled' do
within('.mr-widget-section') do within('.mr-widget-section') do
expect(page).to have_content("Set by #{user.name} to start a merge train when the pipeline succeeds") expect(page).to have_content("Set by #{user.name} to start a merge train when the pipeline succeeds")
expect(page).to have_content('The source branch will not be deleted') expect(page).to have_content('Does not delete the source branch')
expect(page).to have_button('Cancel auto-merge') expect(page).to have_button('Cancel auto-merge')
expect(page).to have_button('Delete source branch') expect(page).to have_button('Delete source branch')
end end
...@@ -85,7 +85,7 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do ...@@ -85,7 +85,7 @@ RSpec.describe 'User adds to merge train when pipeline succeeds', :js do
it 'updates the merge option' do it 'updates the merge option' do
within('.mr-widget-section') do within('.mr-widget-section') do
expect(page).to have_content('The source branch will be deleted') expect(page).to have_content('Deletes the source branch')
end end
end end
end end
......
...@@ -1097,7 +1097,7 @@ describe('ee merge request widget options', () => { ...@@ -1097,7 +1097,7 @@ describe('ee merge request widget options', () => {
nextTick(() => { nextTick(() => {
const tooltip = wrapper.find('[data-testid="question-o-icon"]'); const tooltip = wrapper.find('[data-testid="question-o-icon"]');
expect(wrapper.text()).toContain('The source branch will be deleted'); expect(wrapper.text()).toContain('Deletes the source branch');
expect(tooltip.attributes('title')).toBe( expect(tooltip.attributes('title')).toBe(
'A user with write access to the source branch selected this option', 'A user with write access to the source branch selected this option',
); );
......
...@@ -1107,9 +1107,6 @@ msgstr "" ...@@ -1107,9 +1107,6 @@ msgstr ""
msgid "(check progress)" msgid "(check progress)"
msgstr "" msgstr ""
msgid "(commits will be squashed)"
msgstr ""
msgid "(deleted)" msgid "(deleted)"
msgstr "" msgstr ""
...@@ -1128,6 +1125,11 @@ msgstr "" ...@@ -1128,6 +1125,11 @@ msgstr ""
msgid "(revoked)" msgid "(revoked)"
msgstr "" msgstr ""
msgid "(squashes %d commit)"
msgid_plural "(squashes %d commits)"
msgstr[0] ""
msgstr[1] ""
msgid "(this user)" msgid "(this user)"
msgstr "" msgstr ""
...@@ -11176,6 +11178,12 @@ msgstr "" ...@@ -11176,6 +11178,12 @@ msgstr ""
msgid "Deleted projects cannot be restored!" msgid "Deleted projects cannot be restored!"
msgstr "" msgstr ""
msgid "Deletes the source branch"
msgstr ""
msgid "Deletes the source branch."
msgstr ""
msgid "Deleting" msgid "Deleting"
msgstr "" msgstr ""
...@@ -12226,6 +12234,9 @@ msgstr "" ...@@ -12226,6 +12234,9 @@ msgstr ""
msgid "Does not apply to projects in personal namespaces, which are deleted immediately on request." msgid "Does not apply to projects in personal namespaces, which are deleted immediately on request."
msgstr "" msgstr ""
msgid "Does not delete the source branch."
msgstr ""
msgid "Domain" msgid "Domain"
msgstr "" msgstr ""
...@@ -32521,12 +32532,6 @@ msgstr "" ...@@ -32521,12 +32532,6 @@ msgstr ""
msgid "Source branch" msgid "Source branch"
msgstr "" msgstr ""
msgid "Source branch will be deleted."
msgstr ""
msgid "Source branch will not be deleted."
msgstr ""
msgid "Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}" msgid "Source branch: %{source_branch_open}%{source_branch}%{source_branch_close}"
msgstr "" msgstr ""
...@@ -34522,9 +34527,6 @@ msgstr "" ...@@ -34522,9 +34527,6 @@ msgstr ""
msgid "The snippet is visible to any logged in user except external users." msgid "The snippet is visible to any logged in user except external users."
msgstr "" msgstr ""
msgid "The source branch will be deleted"
msgstr ""
msgid "The specified tab is invalid, please select another" msgid "The specified tab is invalid, please select another"
msgstr "" msgstr ""
...@@ -41034,13 +41036,13 @@ msgstr "" ...@@ -41034,13 +41036,13 @@ msgstr ""
msgid "most recent deployment" msgid "most recent deployment"
msgstr "" msgstr ""
msgid "mrWidgetCommitsAdded|%{commitCount} and %{mergeCommitCount} will be added to %{targetBranch}%{squashedCommits}." msgid "mrWidgetCommitsAdded|1 merge commit"
msgstr "" msgstr ""
msgid "mrWidgetCommitsAdded|%{commitCount} will be added to %{targetBranch}." msgid "mrWidgetCommitsAdded|Adds %{commitCount} and %{mergeCommitCount} to %{targetBranch}%{squashedCommits}."
msgstr "" msgstr ""
msgid "mrWidgetCommitsAdded|1 merge commit" msgid "mrWidgetCommitsAdded|Adds %{commitCount} to %{targetBranch}."
msgstr "" msgstr ""
msgid "mrWidgetNothingToMerge|This merge request contains no changes." msgid "mrWidgetNothingToMerge|This merge request contains no changes."
...@@ -41150,6 +41152,9 @@ msgstr "" ...@@ -41150,6 +41152,9 @@ msgstr ""
msgid "mrWidget|Delete source branch" msgid "mrWidget|Delete source branch"
msgstr "" msgstr ""
msgid "mrWidget|Deletes the source branch"
msgstr ""
msgid "mrWidget|Deployment statistics are not available currently" msgid "mrWidget|Deployment statistics are not available currently"
msgstr "" msgstr ""
...@@ -41159,6 +41164,9 @@ msgstr "" ...@@ -41159,6 +41164,9 @@ msgstr ""
msgid "mrWidget|Dismiss" msgid "mrWidget|Dismiss"
msgstr "" msgstr ""
msgid "mrWidget|Does not delete the source branch"
msgstr ""
msgid "mrWidget|Email patches" msgid "mrWidget|Email patches"
msgstr "" msgstr ""
...@@ -41215,6 +41223,9 @@ msgstr "" ...@@ -41215,6 +41223,9 @@ msgstr ""
msgid "mrWidget|Merged by" msgid "mrWidget|Merged by"
msgstr "" msgstr ""
msgid "mrWidget|Merges changes into"
msgstr ""
msgid "mrWidget|Merging! Changes are being shipped…" msgid "mrWidget|Merging! Changes are being shipped…"
msgstr "" msgstr ""
...@@ -41299,9 +41310,6 @@ msgstr "" ...@@ -41299,9 +41310,6 @@ msgstr ""
msgid "mrWidget|The changes were not merged into" msgid "mrWidget|The changes were not merged into"
msgstr "" msgstr ""
msgid "mrWidget|The changes will be merged into"
msgstr ""
msgid "mrWidget|The pipeline for this merge request did not complete. Push a new commit to fix the failure, or check the %{linkStart}troubleshooting documentation%{linkEnd} to see other possible actions." msgid "mrWidget|The pipeline for this merge request did not complete. Push a new commit to fix the failure, or check the %{linkStart}troubleshooting documentation%{linkEnd} to see other possible actions."
msgstr "" msgstr ""
...@@ -41317,12 +41325,6 @@ msgstr "" ...@@ -41317,12 +41325,6 @@ msgstr ""
msgid "mrWidget|The source branch is being deleted" msgid "mrWidget|The source branch is being deleted"
msgstr "" msgstr ""
msgid "mrWidget|The source branch will be deleted"
msgstr ""
msgid "mrWidget|The source branch will not be deleted"
msgstr ""
msgid "mrWidget|There are merge conflicts" msgid "mrWidget|There are merge conflicts"
msgstr "" msgstr ""
......
...@@ -36,7 +36,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -36,7 +36,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
click_button "Merge when pipeline succeeds" click_button "Merge when pipeline succeeds"
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds" expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds"
expect(page).to have_content "The source branch will not be deleted" expect(page).to have_content "Does not delete the source branch"
expect(page).to have_selector ".js-cancel-auto-merge" expect(page).to have_selector ".js-cancel-auto-merge"
visit project_merge_request_path(project, merge_request) # Needed to refresh the page visit project_merge_request_path(project, merge_request) # Needed to refresh the page
expect(page).to have_content /enabled an automatic merge when the pipeline for \h{8} succeeds/i expect(page).to have_content /enabled an automatic merge when the pipeline for \h{8} succeeds/i
...@@ -126,7 +126,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do ...@@ -126,7 +126,7 @@ RSpec.describe 'Merge request > User merges when pipeline succeeds', :js do
it 'allows to delete source branch' do it 'allows to delete source branch' do
click_button "Delete source branch" click_button "Delete source branch"
expect(page).to have_content "The source branch will be deleted" expect(page).to have_content "Deletes the source branch"
end end
context 'when pipeline succeeds' do context 'when pipeline succeeds' do
......
...@@ -426,7 +426,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do ...@@ -426,7 +426,7 @@ RSpec.describe 'Merge request > User sees merge widget', :js do
it 'user cannot remove source branch', :sidekiq_might_not_need_inline do it 'user cannot remove source branch', :sidekiq_might_not_need_inline do
expect(page).not_to have_field('remove-source-branch-input') expect(page).not_to have_field('remove-source-branch-input')
expect(page).to have_content('The source branch will be deleted') expect(page).to have_content('Deletes the source branch')
end end
end end
......
...@@ -50,7 +50,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have ...@@ -50,7 +50,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is disabled template should have
<span <span
class="gl-mr-3" class="gl-mr-3"
> >
The source branch will not be deleted Does not delete the source branch
</span> </span>
<gl-button-stub <gl-button-stub
...@@ -122,7 +122,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c ...@@ -122,7 +122,7 @@ exports[`MRWidgetAutoMergeEnabled when graphql is enabled template should have c
<span <span
class="gl-mr-3" class="gl-mr-3"
> >
The source branch will not be deleted Does not delete the source branch
</span> </span>
<gl-button-stub <gl-button-stub
......
...@@ -270,8 +270,8 @@ describe('MRWidgetAutoMergeEnabled', () => { ...@@ -270,8 +270,8 @@ describe('MRWidgetAutoMergeEnabled', () => {
const normalizedText = wrapper.text().replace(/\s+/g, ' '); const normalizedText = wrapper.text().replace(/\s+/g, ' ');
expect(normalizedText).toContain('The source branch will be deleted'); expect(normalizedText).toContain('Deletes the source branch');
expect(normalizedText).not.toContain('The source branch will not be deleted'); expect(normalizedText).not.toContain('Does not delete the source branch');
}); });
it('should not show delete source branch button when user not able to delete source branch', () => { it('should not show delete source branch button when user not able to delete source branch', () => {
......
...@@ -42,7 +42,7 @@ describe('MRWidgetMerging', () => { ...@@ -42,7 +42,7 @@ describe('MRWidgetMerging', () => {
.trim() .trim()
.replace(/\s\s+/g, ' ') .replace(/\s\s+/g, ' ')
.replace(/[\r\n]+/g, ' '), .replace(/[\r\n]+/g, ' '),
).toEqual('The changes will be merged into branch'); ).toEqual('Merges changes into branch');
expect(wrapper.find('a').attributes('href')).toBe('/branch-path'); expect(wrapper.find('a').attributes('href')).toBe('/branch-path');
}); });
......
...@@ -543,7 +543,7 @@ describe('MrWidgetOptions', () => { ...@@ -543,7 +543,7 @@ describe('MrWidgetOptions', () => {
nextTick(() => { nextTick(() => {
const tooltip = wrapper.find('[data-testid="question-o-icon"]'); const tooltip = wrapper.find('[data-testid="question-o-icon"]');
expect(wrapper.text()).toContain('The source branch will be deleted'); expect(wrapper.text()).toContain('Deletes the source branch');
expect(tooltip.attributes('title')).toBe( expect(tooltip.attributes('title')).toBe(
'A user with write access to the source branch selected this option', 'A user with write access to the source branch selected this option',
); );
...@@ -559,7 +559,7 @@ describe('MrWidgetOptions', () => { ...@@ -559,7 +559,7 @@ describe('MrWidgetOptions', () => {
nextTick(() => { nextTick(() => {
expect(wrapper.text()).toContain('The source branch has been deleted'); expect(wrapper.text()).toContain('The source branch has been deleted');
expect(wrapper.text()).not.toContain('The source branch will be deleted'); expect(wrapper.text()).not.toContain('Deletes the source branch');
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