0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 09:20:29 +01:00
Dieser Commit ist enthalten in:
Angus McLeod 2022-05-13 12:06:38 +02:00
Ursprung 45f52d56c0
Commit 1c9d52bcfc

Datei anzeigen

@ -52,34 +52,38 @@ export default SingleSelectComponent.extend(Subscription, {
@discourseComputed("feature", "attribute")
content(feature, attribute) {
return wizardSchema[feature][attribute].map((value) => {
let requiredSubscriptionType = this.requiredSubscriptionType(
feature,
attribute,
value
);
return {
id: value,
name: I18n.t(nameKey(feature, attribute, value)),
subscriptionType: requiredSubscriptionType,
disabled: !subscriptionTypeSufficient(
this.subscriptionType,
requiredSubscriptionType
),
};
}).sort(function(a, b) {
if (a.subscriptionType && !b.subscriptionType) {
return 1;
}
if (!a.subscriptionType && b.subscriptionType) {
return -1;
}
if (a.subscriptionType == b.subscriptionType) {
return a.subscriptionType ? a.subscriptionType.localeCompare(b.subscriptionType) : 0;
} else {
return a.subscriptionType === 'standard' ? -1 : 0;
}
});
return wizardSchema[feature][attribute]
.map((value) => {
let requiredSubscriptionType = this.requiredSubscriptionType(
feature,
attribute,
value
);
return {
id: value,
name: I18n.t(nameKey(feature, attribute, value)),
subscriptionType: requiredSubscriptionType,
disabled: !subscriptionTypeSufficient(
this.subscriptionType,
requiredSubscriptionType
),
};
})
.sort(function (a, b) {
if (a.subscriptionType && !b.subscriptionType) {
return 1;
}
if (!a.subscriptionType && b.subscriptionType) {
return -1;
}
if (a.subscriptionType === b.subscriptionType) {
return a.subscriptionType
? a.subscriptionType.localeCompare(b.subscriptionType)
: 0;
} else {
return a.subscriptionType === "standard" ? -1 : 0;
}
});
},
modifyComponentForRow() {