diff --git a/ui/app/components/global-search/control.js b/ui/app/components/global-search/control.js index 653617cdd162..8f3967cca356 100644 --- a/ui/app/components/global-search/control.js +++ b/ui/app/components/global-search/control.js @@ -64,7 +64,7 @@ export default class GlobalSearchControl extends Component { type: 'job', id, namespace, - label: `${name} > ${namespace}`, + label: `${namespace} > ${name}`, })); const nodeResults = allNodeResults @@ -80,7 +80,7 @@ export default class GlobalSearchControl extends Component { .map(({ ID: name, Scope: [namespace, id] }) => ({ type: 'allocation', id, - label: `${name} > ${namespace}`, + label: `${namespace} > ${name}`, })); const taskGroupResults = allTaskGroupResults @@ -90,7 +90,7 @@ export default class GlobalSearchControl extends Component { id, namespace, jobId, - label: id, + label: `${namespace} > ${jobId} > ${id}`, })); const csiPluginResults = allCSIPluginResults.slice(0, MAXIMUM_RESULTS).map(({ ID: id }) => ({ diff --git a/ui/tests/acceptance/search-test.js b/ui/tests/acceptance/search-test.js index 45238e95470d..635aa0ee9b5b 100644 --- a/ui/tests/acceptance/search-test.js +++ b/ui/tests/acceptance/search-test.js @@ -46,8 +46,8 @@ module('Acceptance | search', function(hooks) { search.groups[0].as(jobs => { assert.equal(jobs.name, 'Jobs (2)'); assert.equal(jobs.options.length, 2); - assert.equal(jobs.options[0].text, 'vwxyz > default'); - assert.equal(jobs.options[1].text, 'xyz job > default'); + assert.equal(jobs.options[0].text, 'default > vwxyz'); + assert.equal(jobs.options[1].text, 'default > xyz job'); }); search.groups[1].as(clients => { @@ -83,13 +83,16 @@ module('Acceptance | search', function(hooks) { await selectSearch(Layout.navbar.search.scope, firstAllocation.name); assert.equal( Layout.navbar.search.groups[2].options[0].text, - `${firstAllocation.name} > ${firstAllocation.namespace}` + `${firstAllocation.namespace} > ${firstAllocation.name}` ); await Layout.navbar.search.groups[2].options[0].click(); assert.equal(currentURL(), `/allocations/${firstAllocation.id}`); await selectSearch(Layout.navbar.search.scope, firstTaskGroup.name); - assert.equal(Layout.navbar.search.groups[3].options[0].text, firstTaskGroup.name); + assert.equal( + Layout.navbar.search.groups[3].options[0].text, + `default > vwxyz > ${firstTaskGroup.name}` + ); await Layout.navbar.search.groups[3].options[0].click(); assert.equal(currentURL(), `/jobs/vwxyz/${firstTaskGroup.name}`);