Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 11:52:54 +01:00
remove redundant client installed check code
Dieser Commit ist enthalten in:
Ursprung
051d1dbcfd
Commit
2f206f60c7
6 geänderte Dateien mit 5 neuen und 17 gelöschten Zeilen
|
@ -8,7 +8,6 @@ class CustomWizard::AdminController < ::Admin::AdminController
|
|||
subscribed: subcription.subscribed?,
|
||||
subscription_type: subcription.type,
|
||||
subscription_attributes: CustomWizard::Subscription.attributes,
|
||||
subscription_client_installed: CustomWizard::Subscription.client_installed?
|
||||
)
|
||||
end
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ export default class WizardSubscriptionStatus extends Component {
|
|||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
ajax("/admin/plugins/subscription-client/suppliers").then((result) => {
|
||||
ajax(${basePath}).then((result) => {
|
||||
this.supplierId = result.suppliers[0].id;
|
||||
this.authorized = result.suppliers[0].authorized;
|
||||
});
|
||||
|
|
|
@ -24,15 +24,10 @@ export default Mixin.create({
|
|||
communitySubscription: readOnly("adminWizards.communitySubscription"),
|
||||
standardSubscription: readOnly("adminWizards.standardSubscription"),
|
||||
subscriptionAttributes: readOnly("adminWizards.subscriptionAttributes"),
|
||||
subscriptionClientInstalled: readOnly(
|
||||
"adminWizards.subscriptionClientInstalled"
|
||||
),
|
||||
|
||||
@discourseComputed("subscriptionClientInstalled")
|
||||
subscriptionLink(subscriptionClientInstalled) {
|
||||
return subscriptionClientInstalled
|
||||
? this.subscriptionClientUrl
|
||||
: this.subscriptionLandingUrl;
|
||||
@discourseComputed
|
||||
subscriptionLink() {
|
||||
return this.subscriptionLandingUrl;
|
||||
},
|
||||
|
||||
@discourseComputed("subscriptionType")
|
||||
|
|
|
@ -10,8 +10,7 @@ export default DiscourseRoute.extend({
|
|||
controller.setProperties({
|
||||
subscribed: model.subscribed,
|
||||
subscriptionType: model.subscription_type,
|
||||
subscriptionAttributes: model.subscription_attributes,
|
||||
subscriptionClientInstalled: model.subscription_client_installed,
|
||||
subscriptionAttributes: model.subscription_attributes
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ describe CustomWizard::AdminController do
|
|||
get "/admin/wizards.json"
|
||||
expect(response.parsed_body["subscribed"]).to eq(false)
|
||||
expect(response.parsed_body["subscription_attributes"]).to eq(CustomWizard::Subscription.attributes.as_json)
|
||||
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -37,7 +36,6 @@ describe CustomWizard::AdminController do
|
|||
get "/admin/wizards.json"
|
||||
expect(response.parsed_body["subscribed"]).to eq(true)
|
||||
expect(response.parsed_body["subscription_type"]).to eq("standard")
|
||||
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -224,7 +224,6 @@ const getUnsubscribedAdminWizards = {
|
|||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||
},
|
||||
},
|
||||
subscription_client_installed: false,
|
||||
};
|
||||
const getCustomFields = {
|
||||
custom_fields: [
|
||||
|
@ -478,7 +477,6 @@ const getBusinessAdminWizard = {
|
|||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||
},
|
||||
},
|
||||
subscription_client_installed: false,
|
||||
};
|
||||
const getStandardAdminWizard = {
|
||||
subscribed: true,
|
||||
|
@ -589,7 +587,6 @@ const getStandardAdminWizard = {
|
|||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||
},
|
||||
},
|
||||
subscription_client_installed: false,
|
||||
};
|
||||
const getAdminTestingWizard = {
|
||||
id: "this_is_testing_wizard",
|
||||
|
|
Laden …
In neuem Issue referenzieren