diff --git a/ui/app/components/global-search/control.js b/ui/app/components/global-search/control.js index 6c97b767f39..ef125dda5ef 100644 --- a/ui/app/components/global-search/control.js +++ b/ui/app/components/global-search/control.js @@ -92,7 +92,7 @@ export default class GlobalSearchControl extends Component { const itemModelName = model.constructor.modelName; if (itemModelName === 'job') { - this.router.transitionTo('jobs.job', model.name, { + this.router.transitionTo('jobs.job', model.plainId, { queryParams: { namespace: model.get('namespace.name') }, }); } else if (itemModelName === 'node') { diff --git a/ui/tests/acceptance/search-test.js b/ui/tests/acceptance/search-test.js index a07869c1066..055f3624759 100644 --- a/ui/tests/acceptance/search-test.js +++ b/ui/tests/acceptance/search-test.js @@ -22,7 +22,7 @@ module('Acceptance | search', function(hooks) { const otherNode = server.create('node', { name: 'aaa' }); server.create('job', { id: 'vwxyz', namespaceId: 'default' }); - server.create('job', { id: 'xyz', namespace: 'default' }); + server.create('job', { id: 'xyz', name: 'xyz job', namespace: 'default' }); server.create('job', { id: 'abc', namespace: 'default' }); await visit('/'); @@ -43,7 +43,7 @@ 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, 'xyz'); + assert.equal(jobs.options[0].text, 'xyz job'); assert.equal(jobs.options[1].text, 'vwxyz'); });