0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00

improve api section switch

Dieser Commit ist enthalten in:
Robert Barrow 2021-10-12 09:54:52 +01:00
Ursprung 1f939c1ca0
Commit 14e7e9c0db
5 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -9,6 +9,7 @@ export default DiscourseRoute.extend({
setupController(controller, model) { setupController(controller, model) {
controller.set('notices', A(model.notices)); controller.set('notices', A(model.notices));
controller.set('api_section', model.api_section);
}, },
afterModel(model, transition) { afterModel(model, transition) {

Datei anzeigen

@ -2,7 +2,7 @@
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}} {{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}} {{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}}
{{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}} {{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}}
{{#if api_subscription}} {{#if api_section}}
{{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}} {{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}}
{{/if}} {{/if}}
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}} {{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}

Datei anzeigen

@ -5,7 +5,7 @@ class CustomWizard::AdminController < ::Admin::AdminController
def index def index
render_json_dump( render_json_dump(
#TODO replace with appropriate static? #TODO replace with appropriate static?
api_subscription: ["business"].includes?(CustomWizard::Subscription.type), api_section: ["business"].include?(CustomWizard::Subscription.type),
notices: ActiveModel::ArraySerializer.new( notices: ActiveModel::ArraySerializer.new(
CustomWizard::Notice.list, CustomWizard::Notice.list,
each_serializer: CustomWizard::NoticeSerializer each_serializer: CustomWizard::NoticeSerializer

Datei anzeigen

@ -27,6 +27,10 @@ class CustomWizard::Subscription
"stripe" "stripe"
end end
def type
@subscription.type
end
def client_name def client_name
"custom-wizard" "custom-wizard"
end end
@ -119,6 +123,10 @@ class CustomWizard::Subscription
self.new.subscribed? self.new.subscribed?
end end
def self.type
self.new.type
end
def self.authorized? def self.authorized?
self.new.authorized? self.new.authorized?
end end

Datei anzeigen

@ -13,7 +13,7 @@ class CustomWizard::Subscription::Subscription
end end
def types def types
%w(community business) %w(core advanced business)
end end
def active? def active?