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?,
|
subscribed: subcription.subscribed?,
|
||||||
subscription_type: subcription.type,
|
subscription_type: subcription.type,
|
||||||
subscription_attributes: CustomWizard::Subscription.attributes,
|
subscription_attributes: CustomWizard::Subscription.attributes,
|
||||||
subscription_client_installed: CustomWizard::Subscription.client_installed?
|
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ export default class WizardSubscriptionStatus extends Component {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super(...arguments);
|
super(...arguments);
|
||||||
ajax("/admin/plugins/subscription-client/suppliers").then((result) => {
|
ajax(${basePath}).then((result) => {
|
||||||
this.supplierId = result.suppliers[0].id;
|
this.supplierId = result.suppliers[0].id;
|
||||||
this.authorized = result.suppliers[0].authorized;
|
this.authorized = result.suppliers[0].authorized;
|
||||||
});
|
});
|
||||||
|
|
|
@ -24,15 +24,10 @@ export default Mixin.create({
|
||||||
communitySubscription: readOnly("adminWizards.communitySubscription"),
|
communitySubscription: readOnly("adminWizards.communitySubscription"),
|
||||||
standardSubscription: readOnly("adminWizards.standardSubscription"),
|
standardSubscription: readOnly("adminWizards.standardSubscription"),
|
||||||
subscriptionAttributes: readOnly("adminWizards.subscriptionAttributes"),
|
subscriptionAttributes: readOnly("adminWizards.subscriptionAttributes"),
|
||||||
subscriptionClientInstalled: readOnly(
|
|
||||||
"adminWizards.subscriptionClientInstalled"
|
|
||||||
),
|
|
||||||
|
|
||||||
@discourseComputed("subscriptionClientInstalled")
|
@discourseComputed
|
||||||
subscriptionLink(subscriptionClientInstalled) {
|
subscriptionLink() {
|
||||||
return subscriptionClientInstalled
|
return this.subscriptionLandingUrl;
|
||||||
? this.subscriptionClientUrl
|
|
||||||
: this.subscriptionLandingUrl;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@discourseComputed("subscriptionType")
|
@discourseComputed("subscriptionType")
|
||||||
|
|
|
@ -10,8 +10,7 @@ export default DiscourseRoute.extend({
|
||||||
controller.setProperties({
|
controller.setProperties({
|
||||||
subscribed: model.subscribed,
|
subscribed: model.subscribed,
|
||||||
subscriptionType: model.subscription_type,
|
subscriptionType: model.subscription_type,
|
||||||
subscriptionAttributes: model.subscription_attributes,
|
subscriptionAttributes: model.subscription_attributes
|
||||||
subscriptionClientInstalled: model.subscription_client_installed,
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,6 @@ describe CustomWizard::AdminController do
|
||||||
get "/admin/wizards.json"
|
get "/admin/wizards.json"
|
||||||
expect(response.parsed_body["subscribed"]).to eq(false)
|
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_attributes"]).to eq(CustomWizard::Subscription.attributes.as_json)
|
||||||
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ describe CustomWizard::AdminController do
|
||||||
get "/admin/wizards.json"
|
get "/admin/wizards.json"
|
||||||
expect(response.parsed_body["subscribed"]).to eq(true)
|
expect(response.parsed_body["subscribed"]).to eq(true)
|
||||||
expect(response.parsed_body["subscription_type"]).to eq("standard")
|
expect(response.parsed_body["subscription_type"]).to eq("standard")
|
||||||
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -224,7 +224,6 @@ const getUnsubscribedAdminWizards = {
|
||||||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
subscription_client_installed: false,
|
|
||||||
};
|
};
|
||||||
const getCustomFields = {
|
const getCustomFields = {
|
||||||
custom_fields: [
|
custom_fields: [
|
||||||
|
@ -478,7 +477,6 @@ const getBusinessAdminWizard = {
|
||||||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
subscription_client_installed: false,
|
|
||||||
};
|
};
|
||||||
const getStandardAdminWizard = {
|
const getStandardAdminWizard = {
|
||||||
subscribed: true,
|
subscribed: true,
|
||||||
|
@ -589,7 +587,6 @@ const getStandardAdminWizard = {
|
||||||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
subscription_client_installed: false,
|
|
||||||
};
|
};
|
||||||
const getAdminTestingWizard = {
|
const getAdminTestingWizard = {
|
||||||
id: "this_is_testing_wizard",
|
id: "this_is_testing_wizard",
|
||||||
|
|
Laden …
In neuem Issue referenzieren