From 84b25d4089ddace67e4eb74b5b5a7436c62247c4 Mon Sep 17 00:00:00 2001 From: Uros Lates Date: Thu, 10 Oct 2024 15:16:53 +0200 Subject: [PATCH] fix(a11y): fix linting issues --- .../checkout-delivery-address.component.ts | 14 +++++++++----- .../checkout-payment-method.component.ts | 13 +++++++++---- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.ts b/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.ts index 37b0c0ca2a2..b3a13892819 100644 --- a/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.ts +++ b/feature-libs/checkout/base/components/checkout-delivery-address/checkout-delivery-address.component.ts @@ -118,10 +118,12 @@ export class CheckoutDeliveryAddressComponent implements OnInit { const numbers = getAddressNumbers(address, textPhone, textMobile); const isSelected: boolean = selected && selected.id === address.id; - const isButtonRole = this.featureConfigService?.isEnabled('a11ySelectLabelWithContextForSelectedAddrOrPayment') && !isSelected; + const isButtonRole = + this.featureConfigService?.isEnabled( + 'a11ySelectLabelWithContextForSelectedAddrOrPayment' + ) && !isSelected; const role = isButtonRole ? 'button' : 'region'; - return { role, title: address.defaultAddress ? textDefaultDeliveryAddress : '', @@ -229,9 +231,11 @@ export class CheckoutDeliveryAddressComponent implements OnInit { 'checkoutAddress.defaultDeliveryAddress' ), this.translationService.translate('checkoutAddress.shipToThisAddress'), - this.featureConfigService?.isEnabled('a11ySelectLabelWithContextForSelectedAddrOrPayment') ? - this.translationService.translate('addressCard.selectedAddress') : - this.translationService.translate('addressCard.selected'), + this.featureConfigService?.isEnabled( + 'a11ySelectLabelWithContextForSelectedAddrOrPayment' + ) + ? this.translationService.translate('addressCard.selectedAddress') + : this.translationService.translate('addressCard.selected'), this.translationService.translate('addressCard.phoneNumber'), this.translationService.translate('addressCard.mobileNumber'), ]); diff --git a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.ts b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.ts index 567eb39ae29..cc9b0c9a391 100644 --- a/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.ts +++ b/feature-libs/checkout/base/components/checkout-payment-method/checkout-payment-method.component.ts @@ -151,9 +151,11 @@ export class CheckoutPaymentMethodComponent implements OnInit, OnDestroy { this.selectedMethod$, this.translationService.translate('paymentForm.useThisPayment'), this.translationService.translate('paymentCard.defaultPaymentMethod'), - this.featureConfigService?.isEnabled('a11ySelectLabelWithContextForSelectedAddrOrPayment') ? - this.translationService.translate('paymentCard.selectedPayment') : - this.translationService.translate('paymentCard.selected'), + this.featureConfigService?.isEnabled( + 'a11ySelectLabelWithContextForSelectedAddrOrPayment' + ) + ? this.translationService.translate('paymentCard.selectedPayment') + : this.translationService.translate('paymentCard.selected'), ]).pipe( tap(([paymentMethods, selectedMethod]) => this.selectDefaultPaymentMethod(paymentMethods, selectedMethod) @@ -301,7 +303,10 @@ export class CheckoutPaymentMethodComponent implements OnInit, OnDestroy { 'a11yHideSelectBtnForSelectedAddrOrPayment' ); const isSelected = selected?.id === paymentDetails.id; - const isButtonRole = this.featureConfigService?.isEnabled('a11ySelectLabelWithContextForSelectedAddrOrPayment') && !isSelected; + const isButtonRole = + this.featureConfigService?.isEnabled( + 'a11ySelectLabelWithContextForSelectedAddrOrPayment' + ) && !isSelected; const role = isButtonRole ? 'button' : 'region'; return {