2017-12-15 21:39:18 +00:00
|
|
|
import Route from '@ember/routing/route';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
export default Route.extend({
|
|
|
|
model() {
|
|
|
|
const job = this.modelFor('jobs.job');
|
2018-11-06 00:06:08 +00:00
|
|
|
if (!job) return;
|
2018-11-05 23:20:31 +00:00
|
|
|
|
2017-09-19 14:47:10 +00:00
|
|
|
return job.fetchRawDefinition().then(definition => ({
|
|
|
|
job,
|
|
|
|
definition,
|
|
|
|
}));
|
|
|
|
},
|
2018-08-21 23:46:24 +00:00
|
|
|
|
|
|
|
resetController(controller, isExiting) {
|
|
|
|
if (isExiting) {
|
|
|
|
const job = controller.get('job');
|
|
|
|
job.rollbackAttributes();
|
|
|
|
job.resetId();
|
|
|
|
controller.set('isEditing', false);
|
|
|
|
}
|
|
|
|
},
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|