0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 05:52:52 +01:00
discourse-custom-wizard/assets/javascripts/discourse/components/wizard-custom-step.js.es6
2022-08-02 13:57:19 +01:00

40 Zeilen
895 B
JavaScript

import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
export default Component.extend({
classNames: "wizard-custom-step",
@discourseComputed("step.index")
stepConditionOptions(stepIndex) {
const options = {
inputTypes: "validation",
context: "step",
textSelection: "value",
userFieldSelection: true,
groupSelection: true,
};
if (stepIndex > 0) {
options["wizardFieldSelection"] = true;
options["wizardActionSelection"] = true;
}
return options;
},
actions: {
bannerUploadDone(upload) {
this.setProperties({
"step.banner": upload.url,
"step.banner_upload_id": upload.id,
});
},
bannerUploadDeleted() {
this.setProperties({
"step.banner": null,
"step.banner_upload_id": null,
});
},
},
});