Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: set * as the default namespace selector #11357

Merged
merged 3 commits into from
Oct 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/11357.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
ui: Display jobs from all namespaces by default
```
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/jobs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class IndexController extends Controller.extend(Sortable, Searcha
if (!availableNamespaces.mapBy('key').includes(this.qpNamespace)) {
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
3 changes: 3 additions & 0 deletions ui/tests/acceptance/jobs-list-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,10 @@ module('Acceptance | jobs list', function(hooks) {
const job2 = server.create('job', { namespaceId: server.db.namespaces[1].id });

await JobsList.visit();
assert.equal(JobsList.jobs.length, 2, 'All jobs by default');

const firstNamespace = server.db.namespaces[0];
await JobsList.visit({ namespace: firstNamespace.id });
assert.equal(JobsList.jobs.length, 1, 'One job in the default namespace');
assert.equal(JobsList.jobs.objectAt(0).name, job1.name, 'The correct job is shown');

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