diff --git a/ui/app/controllers/clients/client/index.js b/ui/app/controllers/clients/client/index.js
index b3cc6fea0..a918a7b82 100644
--- a/ui/app/controllers/clients/client/index.js
+++ b/ui/app/controllers/clients/client/index.js
@@ -61,19 +61,16 @@ export default class ClientController extends Controller.extend(Sortable, Search
onlyPreemptions = false;
- @computed(
- 'model.allocations.[]',
- 'preemptions.[]',
- 'onlyPreemptions',
- 'selectionNamespace',
- 'selectionJob',
- 'selectionStatus'
- )
+ @computed('model.allocations.[]', 'preemptions.[]', 'onlyPreemptions')
get visibleAllocations() {
- const allocations = this.onlyPreemptions ? this.preemptions : this.model.allocations;
+ return this.onlyPreemptions ? this.preemptions : this.model.allocations;
+ }
+
+ @computed('visibleAllocations.[]', 'selectionNamespace', 'selectionJob', 'selectionStatus')
+ get filteredAllocations() {
const { selectionNamespace, selectionJob, selectionStatus } = this;
- return allocations.filter(alloc => {
+ return this.visibleAllocations.filter(alloc => {
if (selectionNamespace.length && !selectionNamespace.includes(alloc.get('namespace'))) {
return false;
}
@@ -87,7 +84,7 @@ export default class ClientController extends Controller.extend(Sortable, Search
});
}
- @alias('visibleAllocations') listToSort;
+ @alias('filteredAllocations') listToSort;
@alias('listSorted') listToSearch;
@alias('listSearched') sortedAllocations;
diff --git a/ui/app/templates/clients/client/index.hbs b/ui/app/templates/clients/client/index.hbs
index 429cbce55..7e623678c 100644
--- a/ui/app/templates/clients/client/index.hbs
+++ b/ui/app/templates/clients/client/index.hbs
@@ -325,47 +325,66 @@
/>
-
-
-
-
- |
- ID
- Created
- Modified
- Status
- Job
- Version
- Volume |
- CPU |
- Memory |
-
-
-
-
-
-
diff --git a/ui/tests/acceptance/client-detail-test.js b/ui/tests/acceptance/client-detail-test.js
index f44718255..cfd9042ad 100644
--- a/ui/tests/acceptance/client-detail-test.js
+++ b/ui/tests/acceptance/client-detail-test.js
@@ -130,6 +130,15 @@ module('Acceptance | client detail', function(hooks) {
);
});
+ test('/clients/:id should show empty message if there are no allocations on the node', async function(assert) {
+ const emptyNode = server.create('node');
+
+ await ClientDetail.visit({ id: emptyNode.id });
+
+ assert.true(ClientDetail.emptyAllocations.isVisible, 'Empty message is visible');
+ assert.equal(ClientDetail.emptyAllocations.headline, 'No Allocations');
+ });
+
test('each allocation should have high-level details for the allocation', async function(assert) {
const allocation = server.db.allocations
.where({ nodeId: node.id })
@@ -1028,6 +1037,19 @@ module('Acceptance | client detail', function(hooks) {
},
filter: (alloc, selection) => selection.includes(alloc.clientStatus),
});
+
+ test('fiter results with no matches display empty message', async function(assert) {
+ const job = server.create('job', { createAllocations: false });
+ server.create('allocation', { jobId: job.id, clientStatus: 'running' });
+
+ await ClientDetail.visit({ id: node.id });
+ const statusFacet = ClientDetail.facets.status;
+ await statusFacet.toggle();
+ await statusFacet.options.objectAt(0).toggle();
+
+ assert.true(ClientDetail.emptyAllocations.isVisible);
+ assert.equal(ClientDetail.emptyAllocations.headline, 'No Matches');
+ });
});
module('Acceptance | client detail (multi-namespace)', function(hooks) {
diff --git a/ui/tests/pages/clients/detail.js b/ui/tests/pages/clients/detail.js
index daa6e647a..bcfe0d2de 100644
--- a/ui/tests/pages/clients/detail.js
+++ b/ui/tests/pages/clients/detail.js
@@ -39,6 +39,12 @@ export default create({
...allocations(),
+ emptyAllocations: {
+ scope: '[data-test-empty-allocations-list]',
+ headline: text('[data-test-empty-allocations-list-headline]'),
+ body: text('[data-test-empty-allocations-list-body]'),
+ },
+
allocationFilter: {
preemptions: clickable('[data-test-filter-preemptions]'),
all: clickable('[data-test-filter-all]'),