Commit 760616cb authored by Phil Hughes's avatar Phil Hughes

Merge branch '291998-aqualls-revise-empty-stage' into 'master'

Revise empty MR state text for tone

See merge request gitlab-org/gitlab!53917
parents 070fd6c6 7a708a8e
<script> <script>
/* eslint-disable vue/no-v-html */ /* eslint-disable vue/no-v-html */
import { GlButton } from '@gitlab/ui'; import { GlButton, GlSprintf, GlLink } from '@gitlab/ui';
import emptyStateSVG from 'icons/_mr_widget_empty_state.svg'; import emptyStateSVG from 'icons/_mr_widget_empty_state.svg';
import { helpPagePath } from '~/helpers/help_page_helper';
export default { export default {
name: 'MRWidgetNothingToMerge', name: 'MRWidgetNothingToMerge',
components: { components: {
GlButton, GlButton,
GlSprintf,
GlLink,
}, },
props: { props: {
mr: { mr: {
...@@ -17,6 +20,7 @@ export default { ...@@ -17,6 +20,7 @@ export default {
data() { data() {
return { emptyStateSVG }; return { emptyStateSVG };
}, },
ciHelpPage: helpPagePath('/ci/quick_start/index.html'),
}; };
</script> </script>
...@@ -30,25 +34,20 @@ export default { ...@@ -30,25 +34,20 @@ export default {
</div> </div>
<div class="text col-md-7 order-md-first col-12"> <div class="text col-md-7 order-md-first col-12">
<p class="highlight"> <p class="highlight">
{{ {{ s__('mrWidgetNothingToMerge|This merge request contains no changes.') }}
s__(
'mrWidgetNothingToMerge|Merge requests are a place to propose changes you have made to a project and discuss those changes with others.',
)
}}
</p> </p>
<p> <p>
{{ <gl-sprintf
:message="
s__( s__(
'mrWidgetNothingToMerge|Interested parties can even contribute by pushing commits if they want to.', 'mrWidgetNothingToMerge|Use merge requests to propose changes to your project and discuss them with your team. To make changes, push a commit or edit this merge request to use a different branch. With %{linkStart}CI/CD%{linkEnd}, automatically test your changes before merging.',
) )
}} "
</p> >
<p> <template #link="{ content }">
{{ <gl-link :href="$options.ciHelpPage" target="_blank">{{ content }}</gl-link>
s__( </template>
"mrWidgetNothingToMerge|Currently there are no changes in this merge request's source branch. Please push new commits or use a different branch.", </gl-sprintf>
)
}}
</p> </p>
<div> <div>
<gl-button <gl-button
...@@ -56,6 +55,7 @@ export default { ...@@ -56,6 +55,7 @@ export default {
:href="mr.newBlobPath" :href="mr.newBlobPath"
category="secondary" category="secondary"
variant="success" variant="success"
data-testid="createFileButton"
> >
{{ __('Create file') }} {{ __('Create file') }}
</gl-button> </gl-button>
......
...@@ -35736,13 +35736,10 @@ msgstr "" ...@@ -35736,13 +35736,10 @@ msgstr ""
msgid "mrWidgetCommitsAdded|1 merge commit" msgid "mrWidgetCommitsAdded|1 merge commit"
msgstr "" msgstr ""
msgid "mrWidgetNothingToMerge|Currently there are no changes in this merge request's source branch. Please push new commits or use a different branch." msgid "mrWidgetNothingToMerge|This merge request contains no changes."
msgstr "" msgstr ""
msgid "mrWidgetNothingToMerge|Interested parties can even contribute by pushing commits if they want to." msgid "mrWidgetNothingToMerge|Use merge requests to propose changes to your project and discuss them with your team. To make changes, push a commit or edit this merge request to use a different branch. With %{linkStart}CI/CD%{linkEnd}, automatically test your changes before merging."
msgstr ""
msgid "mrWidgetNothingToMerge|Merge requests are a place to propose changes you have made to a project and discuss those changes with others."
msgstr "" msgstr ""
msgid "mrWidget| Please restore it or use a different %{missingBranchName} branch" msgid "mrWidget| Please restore it or use a different %{missingBranchName} branch"
......
...@@ -14,20 +14,14 @@ describe('NothingToMerge', () => { ...@@ -14,20 +14,14 @@ describe('NothingToMerge', () => {
it('should have correct elements', () => { it('should have correct elements', () => {
expect(vm.$el.classList.contains('mr-widget-body')).toBeTruthy(); expect(vm.$el.classList.contains('mr-widget-body')).toBeTruthy();
expect(vm.$el.querySelector('a').href).toContain(newBlobPath); expect(vm.$el.querySelector('[data-testid="createFileButton"]').href).toContain(newBlobPath);
expect(vm.$el.innerText).toContain( expect(vm.$el.innerText).toContain('Use merge requests to propose changes to your project');
"Currently there are no changes in this merge request's source branch",
);
expect(vm.$el.innerText.replace(/\s\s+/g, ' ')).toContain(
'Please push new commits or use a different branch.',
);
}); });
it('should not show new blob link if there is no link available', () => { it('should not show new blob link if there is no link available', () => {
vm.mr.newBlobPath = null; vm.mr.newBlobPath = null;
Vue.nextTick(() => { Vue.nextTick(() => {
expect(vm.$el.querySelector('a')).toEqual(null); expect(vm.$el.querySelector('[data-testid="createFileButton"]')).toEqual(null);
}); });
}); });
}); });
......
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