From 1c9d52bcfc672fe988e6a55fd747234b58544a67 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 13 May 2022 12:06:38 +0200 Subject: [PATCH] Fix linting --- .../wizard-subscription-selector.js.es6 | 60 ++++++++++--------- 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/assets/javascripts/discourse/components/wizard-subscription-selector.js.es6 b/assets/javascripts/discourse/components/wizard-subscription-selector.js.es6 index d6db8875..8ef6896a 100644 --- a/assets/javascripts/discourse/components/wizard-subscription-selector.js.es6 +++ b/assets/javascripts/discourse/components/wizard-subscription-selector.js.es6 @@ -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() {