2017-09-19 14:47:10 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
import Sortable from 'nomad-ui/mixins/sortable';
|
|
|
|
import Searchable from 'nomad-ui/mixins/searchable';
|
|
|
|
|
|
|
|
const { Controller, computed } = Ember;
|
|
|
|
|
|
|
|
export default Controller.extend(Sortable, Searchable, {
|
|
|
|
queryParams: {
|
|
|
|
currentPage: 'page',
|
|
|
|
searchTerm: 'search',
|
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
|
|
|
},
|
|
|
|
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 8,
|
|
|
|
|
|
|
|
sortProperty: 'modifyIndex',
|
|
|
|
sortDescending: true,
|
|
|
|
|
2017-10-18 19:52:24 +00:00
|
|
|
searchProps: computed(() => ['shortId', 'name']),
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
listToSort: computed.alias('model.allocations'),
|
|
|
|
listToSearch: computed.alias('listSorted'),
|
|
|
|
sortedAllocations: computed.alias('listSearched'),
|
|
|
|
|
|
|
|
actions: {
|
|
|
|
gotoAllocation(allocation) {
|
|
|
|
this.transitionToRoute('allocations.allocation', allocation);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|