1
0
Fork 0
Dieser Commit ist enthalten in:
Angus McLeod 2022-09-23 15:54:43 +02:00
Ursprung c79dee3d16
Commit a3db405d93
5 geänderte Dateien mit 27 neuen und 15 gelöschten Zeilen

Datei anzeigen

@ -10,7 +10,9 @@ export default Component.extend(Subscription, {
@discourseComputed("subscribed")
i18nKey(subscribed) {
return `admin.wizard.subscription.cta.${subscribed ? "subscribed" : "none"}`;
return `admin.wizard.subscription.cta.${
subscribed ? "subscribed" : "none"
}`;
},
@discourseComputed("subscribed")

Datei anzeigen

@ -28,7 +28,7 @@ export default SingleSelectComponent.extend(Subscription, {
allowedSubscriptionTypes(feature, attribute, value) {
let attributes = this.subscriptionAttributes[feature];
if (!attributes || !attributes[attribute]) {
return ['none'];
return ["none"];
}
let allowedTypes = [];
Object.keys(attributes[attribute]).forEach((subscriptionType) => {
@ -50,17 +50,20 @@ export default SingleSelectComponent.extend(Subscription, {
value
);
let subscriptionRequired = allowedSubscriptionTypes.length &&
!allowedSubscriptionTypes.includes('none');
let subscriptionRequired =
allowedSubscriptionTypes.length &&
!allowedSubscriptionTypes.includes("none");
let attrs = {
id: value,
name: I18n.t(nameKey(feature, attribute, value)),
subscriptionRequired
subscriptionRequired,
};
if (subscriptionRequired) {
let subscribed = allowedSubscriptionTypes.includes(this.subscriptionType);
let subscribed = allowedSubscriptionTypes.includes(
this.subscriptionType
);
let selectorKey = subscribed ? "subscribed" : "not_subscribed";
let selectorLabel = `admin.wizard.subscription.${selectorKey}.selector`;

Datei anzeigen

@ -5,5 +5,5 @@ export default Controller.extend({
businessSubscription: equal("subscriptionType", "business"),
communitySubscription: equal("subscriptionType", "community"),
standardSubscription: equal("subscriptionType", "standard"),
showApi: or('businessSubscription', 'communitySubscription')
showApi: or("businessSubscription", "communitySubscription"),
});

Datei anzeigen

@ -4,8 +4,10 @@ import { readOnly } from "@ember/object/computed";
import discourseComputed from "discourse-common/utils/decorators";
const PRODUCT_PAGE = "https://custom-wizard.pavilion.tech";
const SUPPORT_MESSAGE = "https://coop.pavilion.tech/new-message?username=support&title=Custom%20Wizard%20Support";
const MANAGER_CATEGORY = "https://discourse.pluginmanager.org/c/discourse-custom-wizard";
const SUPPORT_MESSAGE =
"https://coop.pavilion.tech/new-message?username=support&title=Custom%20Wizard%20Support";
const MANAGER_CATEGORY =
"https://discourse.pluginmanager.org/c/discourse-custom-wizard";
export default Mixin.create({
subscriptionLandingUrl: PRODUCT_PAGE,
@ -36,11 +38,16 @@ export default Mixin.create({
@discourseComputed("subscriptionType")
subscriptionCtaLink(subscriptionType) {
switch (subscriptionType) {
case "none": return PRODUCT_PAGE;
case "standard": return SUPPORT_MESSAGE;
case "business": return SUPPORT_MESSAGE;
case "community": return MANAGER_CATEGORY;
default: return PRODUCT_PAGE;
case "none":
return PRODUCT_PAGE;
case "standard":
return SUPPORT_MESSAGE;
case "business":
return SUPPORT_MESSAGE;
case "community":
return MANAGER_CATEGORY;
default:
return PRODUCT_PAGE;
}
},
});

Datei anzeigen

@ -69,7 +69,7 @@ body.custom-wizard {
}
& > .field-label + .field-description {
margin-left: .5em;
margin-left: 0.5em;
}
}