c1cc51a057
This is no longer needed! https://guides.emberjs.com/release/upgrading/current-edition/native-classes/#toc_properties-and-fields
36 lines
671 B
JavaScript
36 lines
671 B
JavaScript
import Route from '@ember/routing/route';
|
|
import { inject as service } from '@ember/service';
|
|
import classic from 'ember-classic-decorator';
|
|
|
|
@classic
|
|
export default class RunRoute extends Route {
|
|
@service can;
|
|
@service store;
|
|
@service system;
|
|
|
|
breadcrumbs = [
|
|
{
|
|
label: 'Run',
|
|
args: ['jobs.run'],
|
|
},
|
|
];
|
|
|
|
beforeModel() {
|
|
if (this.can.cannot('run job')) {
|
|
this.transitionTo('jobs');
|
|
}
|
|
}
|
|
|
|
model() {
|
|
return this.store.createRecord('job', {
|
|
namespace: this.get('system.activeNamespace'),
|
|
});
|
|
}
|
|
|
|
resetController(controller, isExiting) {
|
|
if (isExiting) {
|
|
controller.model.deleteRecord();
|
|
}
|
|
}
|
|
}
|