0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-25 02:30:28 +01:00

strip out redundant code from admin wizards route and controller

Dieser Commit ist enthalten in:
merefield 2023-09-24 12:05:07 +01:00
Ursprung d5bd3c3c47
Commit db7d9c14bc
2 geänderte Dateien mit 8 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -1,9 +1,12 @@
import Controller from "@ember/controller";
import { equal, or } from "@ember/object/computed";
import { or } from "@ember/object/computed";
import { inject as service } from "@ember/service";
export default Controller.extend({
businessSubscription: equal("subscriptionType", "business"),
communitySubscription: equal("subscriptionType", "community"),
standardSubscription: equal("subscriptionType", "standard"),
showApi: or("businessSubscription", "communitySubscription"),
subscription: service(),
showApi: or(
"subscription.businessSubscription",
"subscription.communitySubscription"
),
});

Datei anzeigen

@ -1,19 +1,6 @@
import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";
export default DiscourseRoute.extend({
model() {
return ajax("/admin/wizards");
},
setupController(controller, model) {
controller.setProperties({
subscribed: model.subscribed,
subscriptionType: model.subscription_type,
subscriptionAttributes: model.subscription_attributes,
});
},
afterModel(model, transition) {
if (transition.targetName === "adminWizards.index") {
this.transitionTo("adminWizardsWizard");