Commit 32173740 authored by Paul Slaughter's avatar Paul Slaughter

I18n createTempEntry flash message

Also consolidates very similar message in modal.vue so that
there is only one gitlab.pot entry.
parent e40ded8c
......@@ -67,8 +67,8 @@ export default {
if (this.entryModal.type === modalTypes.rename) {
if (this.entries[this.entryName] && !this.entries[this.entryName].deleted) {
flash(
sprintf(s__('The name %{entryName} is already taken in this directory.'), {
entryName: this.entryName,
sprintf(s__('The name "%{name}" is already taken in this directory.'), {
name: this.entryName,
}),
'alert',
document,
......
......@@ -72,7 +72,9 @@ export const createTempEntry = (
if (state.entries[name] && !state.entries[name].deleted) {
flash(
`The name "${name.split('/').pop()}" is already taken in this directory.`,
sprintf(__('The name "%{name}" is already taken in this directory.'), {
name: name.split('/').pop(),
}),
'alert',
document,
null,
......
......@@ -18224,7 +18224,7 @@ msgstr ""
msgid "The merge request can now be merged."
msgstr ""
msgid "The name %{entryName} is already taken in this directory."
msgid "The name \"%{name}\" is already taken in this directory."
msgstr ""
msgid "The number of changes to be fetched from GitLab when cloning a repository. This can speed up Pipelines execution. Keep empty or set to 0 to disable shallow clone by default and make GitLab CI fetch all branches and tags each time."
......
......@@ -132,9 +132,19 @@ describe('new file modal component', () => {
vm = createComponentWithStore(Component, store).$mount();
const flashSpy = spyOnDependency(modal, 'flash');
expect(flashSpy).not.toHaveBeenCalled();
vm.submitForm();
expect(flashSpy).toHaveBeenCalled();
expect(flashSpy).toHaveBeenCalledWith(
'The name "test-path/test" is already taken in this directory.',
'alert',
jasmine.anything(),
null,
false,
true,
);
});
});
});
......@@ -356,7 +356,9 @@ describe('Multi-file store actions', () => {
type: 'blob',
})
.then(() => {
expect(document.querySelector('.flash-alert')).not.toBeNull();
expect(document.querySelector('.flash-alert')?.textContent.trim()).toEqual(
`The name "${f.name}" is already taken in this directory.`,
);
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