Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-26 11:00:28 +01:00
cf50a7deb3
* Apply prettier * applied prettier for similar-topics-validator Co-authored-by: Faizaan Gagan <fzngagan@gmail.com>
38 Zeilen
843 B
JavaScript
38 Zeilen
843 B
JavaScript
export default Ember.Route.extend({
|
|
beforeModel() {
|
|
const appModel = this.modelFor("custom");
|
|
if (
|
|
appModel &&
|
|
appModel.permitted &&
|
|
!appModel.completed &&
|
|
appModel.start
|
|
) {
|
|
this.replaceWith("custom.step", appModel.start);
|
|
}
|
|
},
|
|
|
|
model() {
|
|
return this.modelFor("custom");
|
|
},
|
|
|
|
setupController(controller, model) {
|
|
if (model) {
|
|
const completed = model.get("completed");
|
|
const permitted = model.get("permitted");
|
|
const wizardId = model.get("id");
|
|
const user = model.get("user");
|
|
const name = model.get("name");
|
|
|
|
controller.setProperties({
|
|
requiresLogin: !user,
|
|
user,
|
|
name,
|
|
completed,
|
|
notPermitted: !permitted,
|
|
wizardId,
|
|
});
|
|
} else {
|
|
controller.set("noWizard", true);
|
|
}
|
|
},
|
|
});
|