From 56c96818c120b9d2986af681e4c58ea1acba272d Mon Sep 17 00:00:00 2001 From: Aanchal Pawar <97873570+glo82145@users.noreply.github.com> Date: Wed, 16 Nov 2022 02:54:10 +0530 Subject: [PATCH 1/3] AC-2487::Accordions do not indicate current state (#3977) * AC-2487::Accordions do not indicate current state * AC-2487::fixed failing test cases * AC-2487::fixed failing test cases * AC-2487::run prettier command for filterModalOpenButton.js * AC-2487::added translation as suggested * AC-2487::fixed failing test case * AC-2487::worked on failing test cases * AC-2487::worked on failing test cases --- packages/venia-ui/i18n/en_US.json | 3 +++ .../filterModalOpenButton.js | 14 ++++++++++++-- .../__snapshots__/orderRow.spec.js.snap | 4 ++++ .../lib/components/OrderHistoryPage/orderRow.js | 1 + .../__snapshots__/productSort.spec.js.snap | 1 + .../lib/components/ProductSort/productSort.js | 17 +++++++++++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) diff --git a/packages/venia-ui/i18n/en_US.json b/packages/venia-ui/i18n/en_US.json index b21dec20a7..4db67d96c8 100644 --- a/packages/venia-ui/i18n/en_US.json +++ b/packages/venia-ui/i18n/en_US.json @@ -184,6 +184,7 @@ "filterModal.item.clearFilter": "Remove filter \"{optionName}\".", "filterModal.item.hideOptions": "Hide \"{itemName}\" filter item options.", "filterModal.item.showOptions": "Show \"{itemName}\" filter item options.", + "filterModalOpenButton.ariaLabel": "Filter Button for Filter Options.", "filterSearch.name": "Enter a {name}", "footer.calloutText": "Lorem ipsum dolor sit amet, consectetur adipsicing elit, sed do eiusmod tempor incididunt ut labore et dolore.", "footer.followText": "Follow Us!", @@ -373,6 +374,8 @@ "productQuantity.label": "product's quantity", "productSort.sortByButton": "Sort by", "productSort.sortButton": "Sort", + "productSort.sortButtonCollapsed": "Sort Button Collapsed", + "productSort.sortButtonExpanded": "Sort Button Expanded", "quantity.buttonDecrement": "Decrease Quantity", "quantity.buttonIncrement": "Increase Quantity", "quantity.input": "Item Quantity", diff --git a/packages/venia-ui/lib/components/FilterModalOpenButton/filterModalOpenButton.js b/packages/venia-ui/lib/components/FilterModalOpenButton/filterModalOpenButton.js index f42237c61a..be645baacf 100644 --- a/packages/venia-ui/lib/components/FilterModalOpenButton/filterModalOpenButton.js +++ b/packages/venia-ui/lib/components/FilterModalOpenButton/filterModalOpenButton.js @@ -1,6 +1,6 @@ import React from 'react'; import { shape, string, array } from 'prop-types'; -import { FormattedMessage } from 'react-intl'; +import { FormattedMessage, useIntl } from 'react-intl'; import Button from '../Button'; import { useStyle } from '../../classify'; import defaultClasses from './filterModalOpenButton.module.css'; @@ -10,7 +10,12 @@ const FilterModalOpenButton = props => { const { filters, classes: propsClasses } = props; const classes = useStyle(defaultClasses, propsClasses); const { handleOpen } = useFilterModal({ filters }); - + const handleKeypress = e => { + if (e.code == 'Enter') { + handleOpen; + } + }; + const { formatMessage } = useIntl(); return ( diff --git a/packages/venia-ui/lib/components/ProductSort/__tests__/__snapshots__/productSort.spec.js.snap b/packages/venia-ui/lib/components/ProductSort/__tests__/__snapshots__/productSort.spec.js.snap index 9f766d280e..f30825021a 100644 --- a/packages/venia-ui/lib/components/ProductSort/__tests__/__snapshots__/productSort.spec.js.snap +++ b/packages/venia-ui/lib/components/ProductSort/__tests__/__snapshots__/productSort.spec.js.snap @@ -5,6 +5,7 @@ exports[`renders correctly 1`] = ` aria-busy="false" >