2017-09-19 14:47:10 +00:00
|
|
|
import Ember from 'ember';
|
|
|
|
import Sortable from 'nomad-ui/mixins/sortable';
|
2017-10-23 23:59:30 +00:00
|
|
|
import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
const { Controller, computed, inject } = Ember;
|
|
|
|
|
2017-10-23 23:59:30 +00:00
|
|
|
export default Controller.extend(Sortable, WithNamespaceResetting, {
|
2017-10-23 17:26:48 +00:00
|
|
|
system: inject.service(),
|
2017-09-19 14:47:10 +00:00
|
|
|
jobController: inject.controller('jobs.job'),
|
|
|
|
|
|
|
|
queryParams: {
|
|
|
|
currentPage: 'page',
|
|
|
|
sortProperty: 'sort',
|
|
|
|
sortDescending: 'desc',
|
|
|
|
},
|
|
|
|
|
|
|
|
currentPage: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
|
|
|
|
sortProperty: 'name',
|
|
|
|
sortDescending: false,
|
|
|
|
|
|
|
|
breadcrumbs: computed.alias('jobController.breadcrumbs'),
|
|
|
|
job: computed.alias('model'),
|
|
|
|
|
|
|
|
taskGroups: computed('model.taskGroups.[]', function() {
|
|
|
|
return this.get('model.taskGroups') || [];
|
|
|
|
}),
|
|
|
|
|
|
|
|
listToSort: computed.alias('taskGroups'),
|
|
|
|
sortedTaskGroups: computed.alias('listSorted'),
|
|
|
|
|
2017-11-29 01:24:30 +00:00
|
|
|
sortedEvaluations: computed('model.evaluations.@each.modifyIndex', function() {
|
|
|
|
return (this.get('model.evaluations') || []).sortBy('modifyIndex').reverse();
|
|
|
|
}),
|
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
actions: {
|
|
|
|
gotoTaskGroup(taskGroup) {
|
|
|
|
this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|