Skip to content

Commit 11fb89d

Browse files
authored
Change job search navigation to use id (#8560)
This fixes #8548. It was a significant oversight to use the name instead of the id!
1 parent a63c4fb commit 11fb89d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ui/app/components/global-search/control.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export default class GlobalSearchControl extends Component {
9292
const itemModelName = model.constructor.modelName;
9393

9494
if (itemModelName === 'job') {
95-
this.router.transitionTo('jobs.job', model.name, {
95+
this.router.transitionTo('jobs.job', model.plainId, {
9696
queryParams: { namespace: model.get('namespace.name') },
9797
});
9898
} else if (itemModelName === 'node') {

ui/tests/acceptance/search-test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module('Acceptance | search', function(hooks) {
2222
const otherNode = server.create('node', { name: 'aaa' });
2323

2424
server.create('job', { id: 'vwxyz', namespaceId: 'default' });
25-
server.create('job', { id: 'xyz', namespace: 'default' });
25+
server.create('job', { id: 'xyz', name: 'xyz job', namespace: 'default' });
2626
server.create('job', { id: 'abc', namespace: 'default' });
2727

2828
await visit('/');
@@ -43,7 +43,7 @@ module('Acceptance | search', function(hooks) {
4343
search.groups[0].as(jobs => {
4444
assert.equal(jobs.name, 'Jobs (2)');
4545
assert.equal(jobs.options.length, 2);
46-
assert.equal(jobs.options[0].text, 'xyz');
46+
assert.equal(jobs.options[0].text, 'xyz job');
4747
assert.equal(jobs.options[1].text, 'vwxyz');
4848
});
4949

0 commit comments

Comments
 (0)