Skip to content

Commit

Permalink
ui: set * as the default namespace selector for optimize and volume list
Browse files Browse the repository at this point in the history
  • Loading branch information
lgfa29 committed Oct 20, 2021
1 parent c5735c2 commit 67255b5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ui/app/controllers/csi/volumes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class IndexController extends Controller.extend(
// eslint-disable-next-line ember/no-incorrect-calls-with-inline-anonymous-functions
scheduleOnce('actions', () => {
// eslint-disable-next-line ember/no-side-effects
this.set('qpNamespace', this.system.cachedNamespace || 'default');
this.set('qpNamespace', this.system.cachedNamespace || '*');
});
}

Expand Down
2 changes: 1 addition & 1 deletion ui/app/controllers/optimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default class OptimizeController extends Controller {
if (!availableNamespaces.mapBy('key').includes(this.qpNamespace)) {
scheduleOnce('actions', () => {
// eslint-disable-next-line ember/no-side-effects
this.qpNamespace = this.system.cachedNamespace || 'default';
this.qpNamespace = this.system.cachedNamespace || '*';
});
}
Expand Down
2 changes: 1 addition & 1 deletion ui/tests/acceptance/optimize-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ module('Acceptance | optimize', function(hooks) {
window.localStorage.nomadTokenSecret = clientToken.secretId;
await Optimize.visit();

assert.equal(currentURL(), '/jobs?namespace=default');
assert.equal(currentURL(), '/jobs?namespace=*');
assert.ok(Layout.gutter.optimize.isHidden);
});

Expand Down
2 changes: 1 addition & 1 deletion ui/tests/acceptance/task-detail-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ module('Acceptance | task detail (different namespace)', function(hooks) {
const job = server.db.jobs.find(jobId);

await Layout.breadcrumbFor('jobs.index').visit();
assert.equal(currentURL(), '/jobs?namespace=default', 'Jobs breadcrumb links correctly');
assert.equal(currentURL(), '/jobs?namespace=*', 'Jobs breadcrumb links correctly');

await Task.visit({ id: allocation.id, name: task.name });
await Layout.breadcrumbFor('jobs.job.index').visit();
Expand Down
3 changes: 3 additions & 0 deletions ui/tests/acceptance/volumes-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ module('Acceptance | volumes list', function(hooks) {
const volume2 = server.create('csi-volume', { namespaceId: server.db.namespaces[1].id });

await VolumesList.visit();
assert.equal(VolumesList.volumes.length, 2);

const firstNamespace = server.db.namespaces[0];
await VolumesList.visit({ namespace: firstNamespace.id });
assert.equal(VolumesList.volumes.length, 1);
assert.equal(VolumesList.volumes.objectAt(0).name, volume1.id);

Expand Down

0 comments on commit 67255b5

Please sign in to comment.