import { alias } from '@ember/object/computed'; import Controller from '@ember/controller'; import { inject as service } from '@ember/service'; import Sortable from 'nomad-ui/mixins/sortable'; import { lazyClick } from 'nomad-ui/helpers/lazy-click'; export default Controller.extend(Sortable, { token: service(), queryParams: { sortProperty: 'sort', sortDescending: 'desc', }, sortProperty: 'name', sortDescending: false, listToSort: alias('model.states'), sortedStates: alias('listSorted'), actions: { gotoTask(allocation, task) { this.transitionToRoute('allocations.allocation.task', task); }, taskClick(allocation, task, event) { lazyClick([() => this.send('gotoTask', allocation, task), event]); }, }, });