Skip to content

Commit

Permalink
fix(a11y): fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ulates-sap committed Oct 10, 2024
1 parent d730293 commit 84b25d4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 : '',
Expand Down Expand Up @@ -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'),
]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 84b25d4

Please sign in to comment.