Skip to content

Commit

Permalink
Change job search navigation to use id (#8560)
Browse files Browse the repository at this point in the history
This fixes #8548. It was a significant oversight to use the
name instead of the id!
  • Loading branch information
backspace committed Jul 30, 2020
1 parent a63c4fb commit 11fb89d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ui/app/components/global-search/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions ui/tests/acceptance/search-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('/');
Expand All @@ -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');
});

Expand Down

0 comments on commit 11fb89d

Please sign in to comment.