From 77cf33472fc464ebaec1013aa31146c3727cb70f Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Tue, 17 Oct 2017 17:51:00 -0700 Subject: [PATCH] Make ModifyIndex the default sort property for alloc tables --- ui/app/components/list-table/sort-by.js | 2 ++ ui/app/controllers/jobs/job/task-group.js | 4 ++-- ui/mirage/factories/allocation.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/app/components/list-table/sort-by.js b/ui/app/components/list-table/sort-by.js index eac7deae0..9edcb61e7 100644 --- a/ui/app/components/list-table/sort-by.js +++ b/ui/app/components/list-table/sort-by.js @@ -5,6 +5,8 @@ const { Component, computed } = Ember; export default Component.extend({ tagName: 'th', + attributeBindings: ['title'], + // The prop that the table is currently sorted by currentProp: '', diff --git a/ui/app/controllers/jobs/job/task-group.js b/ui/app/controllers/jobs/job/task-group.js index 89974810b..1b408a22c 100644 --- a/ui/app/controllers/jobs/job/task-group.js +++ b/ui/app/controllers/jobs/job/task-group.js @@ -17,8 +17,8 @@ export default Controller.extend(Sortable, Searchable, { currentPage: 1, pageSize: 10, - sortProperty: 'name', - sortDescending: false, + sortProperty: 'modifyIndex', + sortDescending: true, searchProps: computed(() => ['id', 'name']), diff --git a/ui/mirage/factories/allocation.js b/ui/mirage/factories/allocation.js index 8ae323ef7..097ac61d0 100644 --- a/ui/mirage/factories/allocation.js +++ b/ui/mirage/factories/allocation.js @@ -9,6 +9,8 @@ const DESIRED_STATUSES = ['run', 'stop', 'evict']; export default Factory.extend({ id: i => (i >= 100 ? `${UUIDS[i % 100]}-${i}` : UUIDS[i]), + modifyIndex: () => faker.random.number({ min: 10, max: 2000 }), + clientStatus: faker.list.random(...CLIENT_STATUSES), desiredStatus: faker.list.random(...DESIRED_STATUSES),