Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
strip out redundant code from admin wizards route and controller
Dieser Commit ist enthalten in:
Ursprung
d5bd3c3c47
Commit
db7d9c14bc
2 geänderte Dateien mit 8 neuen und 18 gelöschten Zeilen
|
@ -1,9 +1,12 @@
|
||||||
import Controller from "@ember/controller";
|
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({
|
export default Controller.extend({
|
||||||
businessSubscription: equal("subscriptionType", "business"),
|
subscription: service(),
|
||||||
communitySubscription: equal("subscriptionType", "community"),
|
|
||||||
standardSubscription: equal("subscriptionType", "standard"),
|
showApi: or(
|
||||||
showApi: or("businessSubscription", "communitySubscription"),
|
"subscription.businessSubscription",
|
||||||
|
"subscription.communitySubscription"
|
||||||
|
),
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,19 +1,6 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
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) {
|
afterModel(model, transition) {
|
||||||
if (transition.targetName === "adminWizards.index") {
|
if (transition.targetName === "adminWizards.index") {
|
||||||
this.transitionTo("adminWizardsWizard");
|
this.transitionTo("adminWizardsWizard");
|
||||||
|
|
Laden …
In neuem Issue referenzieren