2017-12-15 21:39:18 +00:00
|
|
|
import { alias } from '@ember/object/computed';
|
2018-06-27 20:39:57 +00:00
|
|
|
import Controller from '@ember/controller';
|
2018-08-30 00:18:42 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
2017-10-30 20:39:15 +00:00
|
|
|
import Sortable from 'nomad-ui/mixins/sortable';
|
2018-06-06 21:25:48 +00:00
|
|
|
import { lazyClick } from 'nomad-ui/helpers/lazy-click';
|
2017-10-30 20:39:15 +00:00
|
|
|
|
|
|
|
export default Controller.extend(Sortable, {
|
2018-08-30 00:18:42 +00:00
|
|
|
token: service(),
|
|
|
|
|
2017-10-30 20:39:15 +00:00
|
|
|
queryParams: {
|
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
|
|
|
},
|
|
|
|
|
|
|
|
sortProperty: 'name',
|
|
|
|
sortDescending: false,
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
listToSort: alias('model.states'),
|
|
|
|
sortedStates: alias('listSorted'),
|
2018-06-06 21:25:48 +00:00
|
|
|
|
|
|
|
actions: {
|
|
|
|
gotoTask(allocation, task) {
|
|
|
|
this.transitionToRoute('allocations.allocation.task', task);
|
|
|
|
},
|
|
|
|
|
|
|
|
taskClick(allocation, task, event) {
|
|
|
|
lazyClick([() => this.send('gotoTask', allocation, task), event]);
|
|
|
|
},
|
|
|
|
},
|
2017-10-30 20:39:15 +00:00
|
|
|
});
|