635263b8aa
It doesn't work well for highly precise values, or small datasets, or prefixes. Which are our three use cases.
33 lines
780 B
JavaScript
33 lines
780 B
JavaScript
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,
|
|
|
|
searchProps: computed(() => ['shortId', 'name']),
|
|
|
|
listToSort: computed.alias('model.allocations'),
|
|
listToSearch: computed.alias('listSorted'),
|
|
sortedAllocations: computed.alias('listSearched'),
|
|
|
|
actions: {
|
|
gotoAllocation(allocation) {
|
|
this.transitionToRoute('allocations.allocation', allocation);
|
|
},
|
|
},
|
|
});
|