27 Zeilen
641 B
JavaScript
27 Zeilen
641 B
JavaScript
import CustomWizard from '../models/custom-wizard';
|
|
|
|
export default Discourse.Route.extend({
|
|
model(params) {
|
|
return Ember.RSVP.hash({
|
|
submissions: CustomWizard.submissions(params.wizard_id),
|
|
wizard: this.modelFor('admin-wizards-submissions').findBy('id', params.wizard_id)
|
|
});
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
let fields = ['user_id', 'completed'];
|
|
|
|
model.wizard.steps.forEach((s) => {
|
|
if (s.fields) {
|
|
s.fields.forEach((f) => {
|
|
fields.push(f.id);
|
|
});
|
|
};
|
|
});
|
|
|
|
controller.setProperties({
|
|
submissions: model.submissions,
|
|
fields
|
|
});
|
|
}
|
|
});
|