0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-30 04:30:29 +01:00
discourse-custom-wizard/assets/javascripts/discourse/routes/admin-wizards-submissions-show.js.es6
Keegan George 0bc151fc7b WIP: Edit Columns modal functionality
Currently modal and edit columns works but removes only field and not corresponding submission.
2021-08-30 16:33:48 -07:00

24 Zeilen
674 B
JavaScript

import { A } from "@ember/array";
import EmberObject from "@ember/object";
import DiscourseRoute from "discourse/routes/discourse";
import CustomWizard from "../models/custom-wizard";
export default DiscourseRoute.extend({
model(params) {
return CustomWizard.submissions(params.wizardId);
},
setupController(controller, model) {
const fields = model.fields.map((f) => {
const fieldsObject = EmberObject.create(f);
fieldsObject.enabled = true;
return fieldsObject;
});
controller.setProperties({
wizard: model.wizard,
fields: A(fields),
submissions: A(model.submissions),
total: model.total,
});
},
});