1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/routes/admin-wizard-submissions.js.es6

28 Zeilen
641 B
Text

2017-10-22 05:37:58 +02:00
import CustomWizard from '../models/custom-wizard';
2017-10-05 02:36:46 +02:00
export default Discourse.Route.extend({
model(params) {
2017-10-30 07:24:51 +01:00
return Ember.RSVP.hash({
submissions: CustomWizard.submissions(params.wizard_id),
wizard: this.modelFor('admin-wizards-submissions').findBy('id', params.wizard_id)
});
2017-10-05 02:36:46 +02:00
},
setupController(controller, model) {
2017-10-30 07:24:51 +01:00
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
});
2017-10-05 02:36:46 +02:00
}
});