Commit 7a94368b authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch 'display-full-name-namespace' into 'master'

Display full name of fork namespace

See merge request gitlab-org/gitlab!65203
parents ca0693df 33e9909a
...@@ -44,7 +44,7 @@ function sortNamespaces(namespaces) { ...@@ -44,7 +44,7 @@ function sortNamespaces(namespaces) {
return namespaces; return namespaces;
} }
return namespaces.sort((a, b) => a.name.localeCompare(b.name)); return namespaces.sort((a, b) => a.full_name.localeCompare(b.full_name));
} }
export default { export default {
...@@ -313,7 +313,7 @@ export default { ...@@ -313,7 +313,7 @@ export default {
<option :value="null" disabled>{{ s__('ForkProject|Select a namespace') }}</option> <option :value="null" disabled>{{ s__('ForkProject|Select a namespace') }}</option>
</template> </template>
<option v-for="namespace in namespaces" :key="namespace.id" :value="namespace"> <option v-for="namespace in namespaces" :key="namespace.id" :value="namespace">
{{ namespace.name }} {{ namespace.full_name }}
</option> </option>
</gl-form-select> </gl-form-select>
</gl-form-input-group> </gl-form-input-group>
......
...@@ -29,10 +29,12 @@ describe('ForkForm component', () => { ...@@ -29,10 +29,12 @@ describe('ForkForm component', () => {
const MOCK_NAMESPACES_RESPONSE = [ const MOCK_NAMESPACES_RESPONSE = [
{ {
name: 'one', name: 'one',
full_name: 'one-group/one',
id: 1, id: 1,
}, },
{ {
name: 'two', name: 'two',
full_name: 'two-group/two',
id: 2, id: 2,
}, },
]; ];
...@@ -178,13 +180,14 @@ describe('ForkForm component', () => { ...@@ -178,13 +180,14 @@ describe('ForkForm component', () => {
const optionsArray = findForkUrlInput().findAll('option'); const optionsArray = findForkUrlInput().findAll('option');
expect(optionsArray).toHaveLength(MOCK_NAMESPACES_RESPONSE.length + 1); expect(optionsArray).toHaveLength(MOCK_NAMESPACES_RESPONSE.length + 1);
expect(optionsArray.at(1).text()).toBe(MOCK_NAMESPACES_RESPONSE[0].name); expect(optionsArray.at(1).text()).toBe(MOCK_NAMESPACES_RESPONSE[0].full_name);
expect(optionsArray.at(2).text()).toBe(MOCK_NAMESPACES_RESPONSE[1].name); expect(optionsArray.at(2).text()).toBe(MOCK_NAMESPACES_RESPONSE[1].full_name);
}); });
it('set namespaces in alphabetical order', async () => { it('set namespaces in alphabetical order', async () => {
const namespace = { const namespace = {
name: 'aaa', name: 'three',
full_name: 'aaa/three',
id: 3, id: 3,
}; };
mockGetRequest({ mockGetRequest({
......
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