improve api section switch
Dieser Commit ist enthalten in:
Ursprung
1f939c1ca0
Commit
14e7e9c0db
5 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen
|
@ -9,6 +9,7 @@ export default DiscourseRoute.extend({
|
|||
|
||||
setupController(controller, model) {
|
||||
controller.set('notices', A(model.notices));
|
||||
controller.set('api_section', model.api_section);
|
||||
},
|
||||
|
||||
afterModel(model, transition) {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
|
||||
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.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"}}
|
||||
{{/if}}
|
||||
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}
|
||||
|
|
|
@ -5,7 +5,7 @@ class CustomWizard::AdminController < ::Admin::AdminController
|
|||
def index
|
||||
render_json_dump(
|
||||
#TODO replace with appropriate static?
|
||||
api_subscription: ["business"].includes?(CustomWizard::Subscription.type),
|
||||
api_section: ["business"].include?(CustomWizard::Subscription.type),
|
||||
notices: ActiveModel::ArraySerializer.new(
|
||||
CustomWizard::Notice.list,
|
||||
each_serializer: CustomWizard::NoticeSerializer
|
||||
|
|
|
@ -27,6 +27,10 @@ class CustomWizard::Subscription
|
|||
"stripe"
|
||||
end
|
||||
|
||||
def type
|
||||
@subscription.type
|
||||
end
|
||||
|
||||
def client_name
|
||||
"custom-wizard"
|
||||
end
|
||||
|
@ -119,6 +123,10 @@ class CustomWizard::Subscription
|
|||
self.new.subscribed?
|
||||
end
|
||||
|
||||
def self.type
|
||||
self.new.type
|
||||
end
|
||||
|
||||
def self.authorized?
|
||||
self.new.authorized?
|
||||
end
|
||||
|
|
|
@ -13,7 +13,7 @@ class CustomWizard::Subscription::Subscription
|
|||
end
|
||||
|
||||
def types
|
||||
%w(community business)
|
||||
%w(core advanced business)
|
||||
end
|
||||
|
||||
def active?
|
||||
|
|
Laden …
In neuem Issue referenzieren