2017-10-13 15:02:34 +02:00
|
|
|
export default Ember.Route.extend({
|
2017-09-29 13:27:03 +02:00
|
|
|
beforeModel() {
|
2017-10-13 15:02:34 +02:00
|
|
|
const appModel = this.modelFor('custom');
|
2017-12-03 08:57:40 +01:00
|
|
|
if (appModel && appModel.permitted && !appModel.completed && appModel.start) {
|
2017-11-29 10:48:49 +01:00
|
|
|
this.replaceWith('custom.step', appModel.start);
|
2017-10-13 15:02:34 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2017-11-29 10:48:49 +01:00
|
|
|
model() {
|
|
|
|
return this.modelFor('custom');
|
|
|
|
},
|
|
|
|
|
|
|
|
setupController(controller, model) {
|
2017-12-03 08:57:40 +01:00
|
|
|
if (model) {
|
|
|
|
const completed = model.get('completed');
|
|
|
|
const permitted = model.get('permitted');
|
2018-05-09 07:06:43 +02:00
|
|
|
const wizardId = model.get('id');
|
2019-06-19 07:23:10 +02:00
|
|
|
const user = model.get('user');
|
2019-06-19 07:39:39 +02:00
|
|
|
const name = model.get('name');
|
2018-05-09 07:06:43 +02:00
|
|
|
|
2017-12-03 08:57:40 +01:00
|
|
|
controller.setProperties({
|
2019-06-19 07:23:10 +02:00
|
|
|
requiresLogin: !user,
|
|
|
|
user,
|
2019-06-19 07:39:39 +02:00
|
|
|
name,
|
2017-12-03 08:57:40 +01:00
|
|
|
completed,
|
|
|
|
notPermitted: !permitted,
|
2018-05-09 07:06:43 +02:00
|
|
|
wizardId
|
2017-12-03 08:57:40 +01:00
|
|
|
});
|
|
|
|
} else {
|
|
|
|
controller.set('noWizard', true);
|
|
|
|
}
|
2017-09-29 13:27:03 +02:00
|
|
|
}
|
|
|
|
});
|