Commit bfc273f8 authored by Kev's avatar Kev

Fix confusing button text when importing from GitHub

parent f7447302
......@@ -60,13 +60,17 @@ export default {
},
importAllButtonText() {
return this.hasIncompatibleRepos
? n__(
if (this.isImportingAnyRepo) {
return __('Importing...');
}
if (this.hasIncompatibleRepos)
return n__(
'Import %d compatible repository',
'Import %d compatible repositories',
this.importAllCount,
)
: n__('Import %d repository', 'Import %d repositories', this.importAllCount);
);
return n__('Import %d repository', 'Import %d repositories', this.importAllCount);
},
emptyStateText() {
......
......@@ -14698,6 +14698,9 @@ msgstr ""
msgid "Imported requirements"
msgstr ""
msgid "Importing..."
msgstr ""
msgid "Improve Merge Requests and customer support with GitLab Enterprise Edition."
msgstr ""
......
......@@ -142,6 +142,21 @@ describe('ImportProjectsTable', () => {
},
);
it('sets the button text to "Importing..." when importing repos', () => {
createComponent({
state: {
providerRepos: [providerRepo],
},
getters: {
hasIncompatibleRepos: () => false,
importAllCount: () => 10,
isImportingAnyRepo: () => true,
},
});
expect(findImportAllButton().text()).toBe('Importing...');
});
it('renders an empty state if there are no repositories available', () => {
createComponent({ state: { repositories: [] } });
......
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