From a0262ed974b20901a2556bea49dcedfd9226d16d Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 28 Nov 2023 15:04:54 -0500 Subject: [PATCH 1/2] CSR-1819 add screenreader text to improve accessibility. --- src/fmg-components/cart/cart.vue | 39 +++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index c1a9608a8..242d37c11 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -5,7 +5,7 @@ class="row vin-toggle flex align-items-center pt-4" :class="[isExpanded ? 'expanded' : '']" @click="toggleIsExpanded()"> - + {{ amountDueText }} {{ getFormattedAmount("", amountDue) }} @@ -13,7 +13,8 @@
- + + {{screenReaderTotalAmountDueText}} {{ getFormattedAmount("", packagePrice) }}
@@ -27,7 +28,11 @@ linkType="text" :text="removeLinkText" href="#!" - @click-event="removeItem(cartItem.cartItemType, cartItem.category)" /> + @click-event="removeItem(cartItem.cartItemType, cartItem.category)"> + +
@@ -56,25 +61,25 @@ {{ recycleFeeCartItem.name }} - {{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} + {{screenReaderRecycleFeeText}}{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}
{{ subtotalText }}{{ getFormattedAmount("", subTotal) }} + >{{screenReaderSubTotalText}}{{ getFormattedAmount("", subTotal) }}
{{ salesTaxText }}{{ getFormattedAmount("", salesTax) }} + >{{screenReaderSalesTaxText}}{{ getFormattedAmount("", salesTax) }}
{{ amountPaidText }}{{ getFormattedAmount("", amountPaid) }} + >{{screenReaderAmountPaidText}}{{ getFormattedAmount("", amountPaid) }}
{{ amountDueText }}{{ getFormattedAmount("", amountDue) }} + >{{screenReaderTotalAmountDueText}}{{ getFormattedAmount("", amountDue) }}
@@ -187,6 +192,24 @@ export default { }, }, computed: { + screenReaderTotalAmountDueText() { + return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); + }, + screenReaderRemoveVapsText() { + return this.getCmsContent("ScreenReaderRemoveVapsWidget", "Text"); + }, + screenReaderRecycleFeeText() { + return this.getCmsContent("ScreenReaderRecycleFeeWidget", "Text"); + }, + screenReaderSubTotalText() { + return this.getCmsContent("ScreenReaderSubTotalWidget", "Text"); + }, + screenReaderAmountPaidText() { + return this.getCmsContent("ScreenReaderAmountPaidWidget", "Text"); + }, + screenReaderSalesTaxText() { + return this.getCmsContent("ScreenReaderSalesTaxWidget", "Text"); + }, availableLineItems() { if (!this.lineItems || this.lineItems.length < 1) { return []; From c48951cb868632a5d3be630e9ef3bdcff5765081 Mon Sep 17 00:00:00 2001 From: Bryan Mauger Date: Tue, 28 Nov 2023 15:06:47 -0500 Subject: [PATCH 2/2] Format code. --- src/fmg-components/cart/cart.vue | 44 ++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/src/fmg-components/cart/cart.vue b/src/fmg-components/cart/cart.vue index 242d37c11..1180b3152 100644 --- a/src/fmg-components/cart/cart.vue +++ b/src/fmg-components/cart/cart.vue @@ -5,7 +5,10 @@ class="row vin-toggle flex align-items-center pt-4" :class="[isExpanded ? 'expanded' : '']" @click="toggleIsExpanded()"> - + {{ amountDueText }} {{ getFormattedAmount("", amountDue) }} @@ -14,7 +17,7 @@
- {{screenReaderTotalAmountDueText}} + {{ screenReaderTotalAmountDueText }} {{ getFormattedAmount("", packagePrice) }}
@@ -61,25 +64,40 @@ {{ recycleFeeCartItem.name }} - {{screenReaderRecycleFeeText}}{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }} + {{ screenReaderRecycleFeeText }}{{ getFormattedAmount(cartItem.category, cartItem.subTotal) }}
{{ subtotalText }}{{screenReaderSubTotalText}}{{ getFormattedAmount("", subTotal) }} + >{{ screenReaderSubTotalText }}{{ getFormattedAmount("", subTotal) }}
{{ salesTaxText }}{{screenReaderSalesTaxText}}{{ getFormattedAmount("", salesTax) }} + >{{ screenReaderSalesTaxText }}{{ getFormattedAmount("", salesTax) }}
{{ amountPaidText }}{{screenReaderAmountPaidText}}{{ getFormattedAmount("", amountPaid) }} + >{{ screenReaderAmountPaidText }}{{ getFormattedAmount("", amountPaid) }}
{{ amountDueText }}{{screenReaderTotalAmountDueText}}{{ getFormattedAmount("", amountDue) }} + >{{ screenReaderTotalAmountDueText }}{{ getFormattedAmount("", amountDue) }}
@@ -193,22 +211,22 @@ export default { }, computed: { screenReaderTotalAmountDueText() { - return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); + return this.getCmsContent("ScreenReaderTotalAmountDueWidget", "Text"); }, screenReaderRemoveVapsText() { - return this.getCmsContent("ScreenReaderRemoveVapsWidget", "Text"); + return this.getCmsContent("ScreenReaderRemoveVapsWidget", "Text"); }, screenReaderRecycleFeeText() { - return this.getCmsContent("ScreenReaderRecycleFeeWidget", "Text"); + return this.getCmsContent("ScreenReaderRecycleFeeWidget", "Text"); }, screenReaderSubTotalText() { - return this.getCmsContent("ScreenReaderSubTotalWidget", "Text"); + return this.getCmsContent("ScreenReaderSubTotalWidget", "Text"); }, screenReaderAmountPaidText() { - return this.getCmsContent("ScreenReaderAmountPaidWidget", "Text"); + return this.getCmsContent("ScreenReaderAmountPaidWidget", "Text"); }, screenReaderSalesTaxText() { - return this.getCmsContent("ScreenReaderSalesTaxWidget", "Text"); + return this.getCmsContent("ScreenReaderSalesTaxWidget", "Text"); }, availableLineItems() { if (!this.lineItems || this.lineItems.length < 1) {