mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
Filter out new records from the job list page
When a prefix is set and the run job button is clicked, the new job causes an error because it has no name yet.
This commit is contained in:
@@ -163,6 +163,7 @@ export default class IndexController extends Controller.extend(Sortable, Searcha
|
||||
|
||||
return this.model
|
||||
.compact()
|
||||
.filter(job => !job.isNew)
|
||||
.filter(job => !hasNamespaces || job.get('namespace.id') === activeNamespace)
|
||||
.filter(job => !job.get('parent.content'));
|
||||
}
|
||||
|
||||
@@ -452,5 +452,19 @@ module('Acceptance | jobs list', function(hooks) {
|
||||
'URL has the correct query param key and value'
|
||||
);
|
||||
});
|
||||
|
||||
test('the run job button works when filters are set', async function(assert) {
|
||||
['pre-one', 'pre-two', 'pre-three'].forEach(name => {
|
||||
server.create('job', { name, createAllocations: false, childrenCount: 0 });
|
||||
});
|
||||
|
||||
await JobsList.visit();
|
||||
|
||||
await JobsList.facets.prefix.toggle();
|
||||
await JobsList.facets.prefix.options[0].toggle();
|
||||
|
||||
await JobsList.runJobButton.click();
|
||||
assert.equal(currentURL(), '/jobs/run');
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user