2017-12-15 21:39:18 +00:00
|
|
|
import Route from '@ember/routing/route';
|
2018-02-27 22:57:57 +00:00
|
|
|
import { watchRelationship } from 'nomad-ui/utils/properties/watch';
|
2017-09-19 14:47:10 +00:00
|
|
|
|
|
|
|
export default Route.extend({
|
|
|
|
model() {
|
|
|
|
const job = this.modelFor('jobs.job');
|
|
|
|
return job.get('versions').then(() => job);
|
|
|
|
},
|
2018-02-27 22:57:57 +00:00
|
|
|
|
|
|
|
setupController(controller, model) {
|
|
|
|
controller.set('watcher', this.get('watchVersions').perform(model));
|
|
|
|
return this._super(...arguments);
|
|
|
|
},
|
|
|
|
|
|
|
|
deactivate() {
|
|
|
|
this.get('watchVersions').cancelAll();
|
|
|
|
return this._super(...arguments);
|
|
|
|
},
|
|
|
|
|
|
|
|
watchVersions: watchRelationship('versions'),
|
2017-09-19 14:47:10 +00:00
|
|
|
});
|