@magento/venia-ui 9.1.0-beta.1 → 9.2.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/i18n/en_US.json +22 -7
- package/lib/RootComponents/CMS/__tests__/cms.spec.js +50 -20
- package/lib/RootComponents/CMS/cms.js +39 -43
- package/lib/RootComponents/CMS/cms.module.css +17 -14
- package/lib/RootComponents/Category/NoProductsFound/noProductsFound.js +1 -1
- package/lib/RootComponents/Category/__tests__/__snapshots__/category.spec.js.snap +2 -2
- package/lib/RootComponents/Category/__tests__/__snapshots__/categoryContent.spec.js.snap +60 -0
- package/lib/RootComponents/Category/__tests__/category.spec.js +1 -1
- package/lib/RootComponents/Category/__tests__/categoryContent.spec.js +8 -0
- package/lib/RootComponents/Category/category.gql.js +2 -1
- package/lib/RootComponents/Category/category.js +6 -6
- package/lib/RootComponents/Category/categoryContent.js +11 -4
- package/lib/components/Accordion/section.js +6 -2
- package/lib/components/AccountChip/accountChip.gql.js +1 -1
- package/lib/components/AccountInformationPage/accountInformationPage.gql.js +5 -7
- package/lib/components/AccountInformationPage/accountInformationPage.js +5 -1
- package/lib/components/AccountInformationPage/editForm.js +22 -4
- package/lib/components/AccountMenu/accountMenu.js +1 -1
- package/lib/components/AccountMenu/accountMenuItems.js +2 -1
- package/lib/components/AddressBookPage/__tests__/__snapshots__/addressCard.spec.js.snap +5 -0
- package/lib/components/AddressBookPage/addEditDialog.js +36 -10
- package/lib/components/AddressBookPage/addressBookPage.js +5 -2
- package/lib/components/AddressBookPage/addressCard.js +17 -4
- package/lib/components/App/app.js +5 -1
- package/lib/components/App/localeProvider.js +2 -1
- package/lib/components/Breadcrumbs/breadcrumbs.js +3 -3
- package/lib/components/Breadcrumbs/breadcrumbs.module.css +10 -3
- package/lib/components/CartPage/GiftCards/giftCard.js +1 -0
- package/lib/components/CartPage/GiftCards/giftCards.js +2 -0
- package/lib/components/CartPage/PriceAdjustments/CouponCode/couponCode.js +3 -0
- package/lib/components/CartPage/PriceAdjustments/GiftOptions/giftOptions.js +3 -0
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingForm.js +10 -2
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingMethods.js +2 -1
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadio.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/ShippingMethods/shippingRadios.js +1 -1
- package/lib/components/CartPage/PriceAdjustments/giftCardSection.ee.js +1 -0
- package/lib/components/CartPage/PriceAdjustments/priceAdjustments.js +4 -1
- package/lib/components/CartPage/PriceSummary/discountSummary.js +8 -2
- package/lib/components/CartPage/PriceSummary/giftCardSummary.ee.js +4 -1
- package/lib/components/CartPage/PriceSummary/priceSummary.js +10 -3
- package/lib/components/CartPage/PriceSummary/shippingSummary.js +6 -1
- package/lib/components/CartPage/PriceSummary/taxSummary.js +1 -1
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productDetail.spec.js.snap +3 -3
- package/lib/components/CartPage/ProductListing/EditModal/__tests__/__snapshots__/productForm.spec.js.snap +2 -2
- package/lib/components/CartPage/ProductListing/EditModal/productDetail.js +1 -1
- package/lib/components/CartPage/ProductListing/__tests__/__snapshots__/errorMessage.spec.js.snap +11 -0
- package/lib/components/CartPage/ProductListing/__tests__/errorMessage.spec.js +20 -0
- package/lib/components/CartPage/ProductListing/__tests__/product.spec.js +1 -0
- package/lib/components/CartPage/ProductListing/errorMessage.js +31 -0
- package/lib/components/CartPage/ProductListing/errorMessage.module.css +9 -0
- package/lib/components/CartPage/ProductListing/product.js +14 -7
- package/lib/components/CartPage/ProductListing/productListing.js +6 -1
- package/lib/components/CartPage/ProductListing/productListing.module.css +6 -0
- package/lib/components/CartPage/ProductListing/quantity.js +3 -0
- package/lib/components/CartPage/cartPage.js +1 -1
- package/lib/components/CategoryList/__tests__/categoryList.spec.js +2 -0
- package/lib/components/CategoryList/categoryList.js +4 -2
- package/lib/components/CategoryList/categoryList.module.css +2 -0
- package/lib/components/CategoryList/categoryTile.js +2 -0
- package/lib/components/CategoryList/categoryTile.module.css +2 -0
- package/lib/components/CategoryList/index.js +2 -0
- package/lib/components/CategoryTree/categoryBranch.js +2 -1
- package/lib/components/CategoryTree/categoryLeaf.js +1 -0
- package/lib/components/CategoryTree/categoryTree.js +3 -3
- package/lib/components/Checkbox/checkbox.module.css +11 -3
- package/lib/components/Checkout/addressForm.js +2 -3
- package/lib/components/CheckoutPage/GuestSignIn/guestSignIn.js +6 -2
- package/lib/components/CheckoutPage/ItemsReview/__fixtures__/cartItems.js +12 -12
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/item.spec.js.snap +2 -2
- package/lib/components/CheckoutPage/ItemsReview/__tests__/__snapshots__/itemsReview.spec.js.snap +3 -3
- package/lib/components/CheckoutPage/ItemsReview/item.js +1 -1
- package/lib/components/CheckoutPage/ItemsReview/itemsReview.js +4 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/__tests__/__snapshots__/orderConfirmationPage.spec.js.snap +1 -1
- package/lib/components/CheckoutPage/OrderConfirmationPage/createAccount.js +6 -0
- package/lib/components/CheckoutPage/OrderConfirmationPage/orderConfirmationPage.js +10 -4
- package/lib/components/CheckoutPage/OrderSummary/orderSummary.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/braintreeSummary.js +2 -1
- package/lib/components/CheckoutPage/PaymentInformation/creditCard.js +11 -1
- package/lib/components/CheckoutPage/PaymentInformation/editCard.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/editModal.js +1 -1
- package/lib/components/CheckoutPage/PaymentInformation/paymentInformation.js +1 -1
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/__snapshots__/guestForm.spec.js.snap +8 -0
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/__tests__/guestForm.spec.js +56 -1
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/customerForm.js +27 -4
- package/lib/components/CheckoutPage/ShippingInformation/AddressForm/guestForm.js +96 -9
- package/lib/components/CheckoutPage/ShippingInformation/card.js +1 -1
- package/lib/components/CheckoutPage/ShippingInformation/shippingInformation.js +14 -3
- package/lib/components/CheckoutPage/ShippingMethod/completedView.js +1 -0
- package/lib/components/CheckoutPage/ShippingMethod/shippingMethod.js +2 -1
- package/lib/components/CheckoutPage/ShippingMethod/updateModal.js +1 -0
- package/lib/components/CheckoutPage/__tests__/__snapshots__/checkoutPage.spec.js.snap +32 -0
- package/lib/components/CheckoutPage/__tests__/checkoutPage.spec.js +2 -0
- package/lib/components/CheckoutPage/checkoutPage.js +26 -4
- package/lib/components/ContactPage/__tests__/__snapshots__/contactLink.spec.js.snap +11 -0
- package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.shimmer.spec.js.snap +113 -0
- package/lib/components/ContactPage/__tests__/__snapshots__/contactPage.spec.js.snap +312 -0
- package/lib/components/ContactPage/__tests__/contactLink.spec.js +58 -0
- package/lib/components/ContactPage/__tests__/contactPage.shimmer.spec.js +20 -0
- package/lib/components/ContactPage/__tests__/contactPage.spec.js +159 -0
- package/lib/components/ContactPage/contactLink.js +21 -0
- package/lib/components/ContactPage/contactPage.js +270 -0
- package/lib/components/ContactPage/contactPage.module.css +81 -0
- package/lib/components/ContactPage/contactPage.shimmer.js +104 -0
- package/lib/components/ContactPage/contactPage.shimmer.module.css +27 -0
- package/lib/components/ContactPage/index.js +2 -0
- package/lib/components/CreateAccount/createAccount.js +5 -0
- package/lib/components/Dialog/dialog.js +18 -4
- package/lib/components/ErrorMessage/errorMessage.js +7 -2
- package/lib/components/ErrorView/errorView.js +4 -2
- package/lib/components/Field/field.module.css +10 -6
- package/lib/components/FilterModal/CurrentFilters/currentFilter.js +7 -3
- package/lib/components/FilterModal/FilterList/__tests__/filterItem.spec.js +34 -5
- package/lib/components/FilterModal/FilterList/filterDefault.js +3 -2
- package/lib/components/FilterModal/FilterList/filterItem.js +27 -7
- package/lib/components/FilterModal/FilterList/filterList.js +6 -1
- package/lib/components/FilterModal/filterBlock.js +9 -4
- package/lib/components/FilterModal/filterFooter.js +1 -0
- package/lib/components/FilterModal/filterModal.js +6 -1
- package/lib/components/FilterModalOpenButton/filterModalOpenButton.js +1 -0
- package/lib/components/FilterSidebar/filterSidebar.js +6 -1
- package/lib/components/Footer/__tests__/__snapshots__/footer.spec.js.snap +14 -0
- package/lib/components/Footer/__tests__/footer.spec.js +9 -1
- package/lib/components/Footer/footer.js +14 -7
- package/lib/components/Footer/sampleData.js +8 -3
- package/lib/components/ForgotPassword/ForgotPasswordForm/forgotPasswordForm.js +3 -0
- package/lib/components/ForgotPassword/FormSubmissionSuccessful/formSubmissionSuccessful.js +4 -2
- package/lib/components/ForgotPassword/forgotPassword.gql.js +0 -1
- package/lib/components/FormError/formError.js +10 -4
- package/lib/components/Gallery/__tests__/__snapshots__/addToCartButton.spec.js.snap +0 -3
- package/lib/components/Gallery/__tests__/__snapshots__/item.spec.js.snap +1 -0
- package/lib/components/Gallery/addToCartButton.js +24 -20
- package/lib/components/Gallery/item.js +15 -4
- package/lib/components/Gallery/item.module.css +1 -0
- package/lib/components/Head/index.js +2 -1
- package/lib/components/Header/__tests__/header.spec.js +1 -1
- package/lib/components/Header/accountTrigger.js +1 -0
- package/lib/components/Header/cartTrigger.js +4 -1
- package/lib/components/Header/header.js +1 -1
- package/lib/components/Header/navTrigger.js +1 -0
- package/lib/components/Header/searchTrigger.js +1 -0
- package/lib/components/LegacyMiniCart/cartOptions.gql.js +4 -3
- package/lib/components/LegacyMiniCart/editFormFragment.gql.js +7 -3
- package/lib/components/LegacyMiniCart/kebab.js +1 -0
- package/lib/components/LegacyMiniCart/productOptions.js +6 -1
- package/lib/components/LegacyMiniCart/section.js +15 -5
- package/lib/components/Link/link.js +6 -4
- package/lib/components/Mask/mask.js +3 -3
- package/lib/components/MegaMenu/__tests__/MegaMenuItem.spec.js +1 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenu.spec.js.snap +9 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/MegaMenuItem.spec.js.snap +6 -0
- package/lib/components/MegaMenu/__tests__/__snapshots__/Submenu.spec.js.snap +2 -0
- package/lib/components/MegaMenu/megaMenu.js +6 -2
- package/lib/components/MegaMenu/megaMenuItem.js +27 -6
- package/lib/components/MegaMenu/megaMenuItem.module.css +0 -5
- package/lib/components/MegaMenu/submenu.js +5 -3
- package/lib/components/MegaMenu/submenuColumn.js +15 -4
- package/lib/components/MiniCart/ProductList/__tests__/__snapshots__/item.spec.js.snap +4 -4
- package/lib/components/MiniCart/ProductList/item.js +5 -2
- package/lib/components/MiniCart/ProductList/productList.js +5 -1
- package/lib/components/MiniCart/__tests__/__snapshots__/miniCart.spec.js.snap +1 -1
- package/lib/components/MiniCart/miniCart.gql.js +3 -2
- package/lib/components/MiniCart/miniCart.js +9 -4
- package/lib/components/MyAccount/ResetPassword/resetPassword.gql.js +1 -1
- package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.shimmer.spec.js.snap +40 -0
- package/lib/components/Newsletter/__tests__/__snapshots__/newsletter.spec.js.snap +14 -8
- package/lib/components/Newsletter/__tests__/newsletter.shimmer.spec.js +10 -0
- package/lib/components/Newsletter/__tests__/newsletter.spec.js +25 -2
- package/lib/components/Newsletter/newsletter.js +27 -6
- package/lib/components/Newsletter/newsletter.shimmer.js +46 -0
- package/lib/components/Newsletter/newsletter.shimmer.module.css +11 -0
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/item.spec.js.snap +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/__tests__/__snapshots__/shippingMethod.spec.js.snap +3 -0
- package/lib/components/OrderHistoryPage/OrderDetails/billingInformation.js +4 -1
- package/lib/components/OrderHistoryPage/OrderDetails/item.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/items.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/paymentMethod.js +1 -1
- package/lib/components/OrderHistoryPage/OrderDetails/shippingInformation.js +4 -1
- package/lib/components/OrderHistoryPage/OrderDetails/shippingMethod.js +5 -1
- package/lib/components/OrderHistoryPage/orderHistoryPage.js +8 -1
- package/lib/components/Pagination/pagination.js +1 -1
- package/lib/components/Pagination/tile.js +5 -1
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/__snapshots__/boolean.spec.js.snap +20 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/__tests__/boolean.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/boolean.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Boolean/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/__snapshots__/date.spec.js.snap +25 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/__tests__/date.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.js +82 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/date.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Date/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/__snapshots__/dateTime.spec.js.snap +29 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/__tests__/dateTime.spec.js +53 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.js +85 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/dateTime.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/DateTime/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/__snapshots__/multiSelect.spec.js.snap +36 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/__tests__/multiSelect.spec.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.js +99 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Multiselect/multiselect.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/__snapshots__/price.spec.js.snap +23 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/__tests__/price.spec.js +52 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Price/price.module.css +9 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/__snapshots__/select.spec.js.snap +36 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/__tests__/select.spec.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.js +99 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Select/select.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/__snapshots__/text.spec.js.snap +33 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/__tests__/text.spec.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Text/text.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/__snapshots__/textarea.spec.js.snap +33 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/__tests__/textarea.spec.js +74 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.js +88 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/Textarea/textarea.module.css +13 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/__snapshots__/attributeType.spec.js.snap +101 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/__tests__/attributeType.spec.js +173 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/attributeType.js +61 -0
- package/lib/components/ProductFullDetail/CustomAttributes/AttributeType/index.js +1 -0
- package/lib/components/ProductFullDetail/CustomAttributes/__tests__/__snapshots__/customAttributes.spec.js.snap +49 -0
- package/lib/components/ProductFullDetail/CustomAttributes/__tests__/customAttributes.spec.js +78 -0
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.js +66 -0
- package/lib/components/ProductFullDetail/CustomAttributes/customAttributes.module.css +14 -0
- package/lib/components/ProductFullDetail/CustomAttributes/index.js +1 -0
- package/lib/components/ProductFullDetail/__tests__/__snapshots__/productFullDetail.spec.js.snap +39 -0
- package/lib/components/ProductFullDetail/__tests__/productFullDetail.spec.js +3 -1
- package/lib/components/ProductFullDetail/productFullDetail.js +18 -3
- package/lib/components/ProductOptions/__tests__/__snapshots__/option.spec.js.snap +1 -1
- package/lib/components/ProductOptions/__tests__/__snapshots__/options.spec.js.snap +2 -2
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatch.spec.js.snap +44 -2
- package/lib/components/ProductOptions/__tests__/__snapshots__/swatchList.spec.js.snap +22 -1
- package/lib/components/ProductOptions/__tests__/swatch.spec.js +0 -2
- package/lib/components/ProductOptions/option.js +2 -2
- package/lib/components/ProductOptions/swatch.js +7 -5
- package/lib/components/ProductOptions/swatch.module.css +11 -0
- package/lib/components/ProductOptions/tile.js +1 -0
- package/lib/components/ProductSort/__tests__/__snapshots__/sortItem.spec.js.snap +14 -0
- package/lib/components/ProductSort/__tests__/sortItem.spec.js +61 -0
- package/lib/components/ProductSort/productSort.js +84 -40
- package/lib/components/ProductSort/sortItem.js +26 -11
- package/lib/components/RadioGroup/radio.module.css +13 -5
- package/lib/components/RadioGroup/radioGroup.js +2 -1
- package/lib/components/Rating/__tests__/__snapshots__/rating.spec.js.snap +27 -0
- package/lib/components/Rating/__tests__/rating.spec.js +13 -0
- package/lib/components/Rating/index.js +1 -0
- package/lib/components/Rating/rating.js +30 -0
- package/lib/components/Rating/rating.module.css +21 -0
- package/lib/components/RichContent/richContent.module.css +52 -59
- package/lib/components/SearchBar/autocomplete.js +2 -0
- package/lib/components/SearchBar/searchBar.js +1 -1
- package/lib/components/SearchBar/searchField.js +1 -0
- package/lib/components/SearchBar/suggestedCategory.js +1 -1
- package/lib/components/SearchBar/suggestedProduct.js +6 -1
- package/lib/components/SearchPage/__tests__/__snapshots__/searchPage.spec.js.snap +41 -1
- package/lib/components/SearchPage/__tests__/searchPage.spec.js +8 -0
- package/lib/components/SearchPage/searchPage.js +12 -6
- package/lib/components/Shimmer/shimmer.js +11 -2
- package/lib/components/Shimmer/shimmer.module.css +4 -8
- package/lib/components/SignIn/__tests__/__snapshots__/signIn.spec.js.snap +126 -0
- package/lib/components/SignIn/__tests__/signIn.spec.js +11 -0
- package/lib/components/SignIn/signIn.gql.js +8 -4
- package/lib/components/SignIn/signIn.js +24 -4
- package/lib/components/TextArea/textArea.module.css +9 -0
- package/lib/components/TextInput/textInput.module.css +4 -0
- package/lib/components/ToastContainer/toast.js +23 -3
- package/lib/components/ToastContainer/toast.module.css +3 -0
- package/lib/components/Trigger/trigger.js +9 -2
- package/lib/components/Wishlist/AddToListButton/addToListButton.ee.js +1 -0
- package/lib/components/Wishlist/WishlistDialog/CreateWishlistForm/createWishlistForm.js +2 -0
- package/lib/components/Wishlist/WishlistDialog/WishlistLineItem/wishlistLineItem.js +1 -0
- package/lib/components/Wishlist/WishlistDialog/wishlistDialog.js +1 -0
- package/lib/components/WishlistPage/__tests__/__snapshots__/wishlistPage.spec.js.snap +5 -5
- package/lib/components/WishlistPage/createWishlist.ee.js +2 -0
- package/lib/components/WishlistPage/wishlist.js +8 -3
- package/lib/components/WishlistPage/wishlistItem.js +17 -4
- package/lib/components/WishlistPage/wishlistPage.js +5 -3
- package/lib/defaultRoutes.json +6 -0
- package/lib/targets/__tests__/venia-ui-targets.spec.js +2 -0
- package/lib/util/__tests__/shrinkGETQuery.spec.js +1 -1
- package/lib/util/apolloCache.js +2 -2
- package/lib/util/formValidators.js +10 -8
- package/lib/util/toCamelCase.js +3 -0
- package/package.json +17 -14
- package/upward.yml +19 -40
|
@@ -6,9 +6,10 @@ import FilterItem from '../filterItem';
|
|
|
6
6
|
const mockOnApply = jest.fn();
|
|
7
7
|
|
|
8
8
|
jest.mock('../filterDefault', () => {
|
|
9
|
-
const mockedFilterDefault = jest.fn(({
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const mockedFilterDefault = jest.fn(({ onMouseDown }) => {
|
|
10
|
+
onMouseDown({
|
|
11
|
+
button: 0
|
|
12
|
+
});
|
|
12
13
|
return null;
|
|
13
14
|
});
|
|
14
15
|
|
|
@@ -85,7 +86,8 @@ describe('#FilterItem', () => {
|
|
|
85
86
|
expect(mockFilterDefault).toHaveBeenCalledWith(
|
|
86
87
|
expect.objectContaining({
|
|
87
88
|
isSelected: false,
|
|
88
|
-
|
|
89
|
+
onKeyDown: expect.any(Function),
|
|
90
|
+
onMouseDown: expect.any(Function)
|
|
89
91
|
}),
|
|
90
92
|
{}
|
|
91
93
|
);
|
|
@@ -117,10 +119,37 @@ describe('#FilterItem', () => {
|
|
|
117
119
|
|
|
118
120
|
expect(mockFilterDefault).toHaveBeenCalledWith(
|
|
119
121
|
expect.objectContaining({
|
|
120
|
-
|
|
122
|
+
onMouseDown: expect.any(Function),
|
|
123
|
+
onKeyDown: expect.any(Function),
|
|
121
124
|
isSelected: true
|
|
122
125
|
}),
|
|
123
126
|
{}
|
|
124
127
|
);
|
|
125
128
|
});
|
|
129
|
+
|
|
130
|
+
it('calls onApply when keyboard Enter or space is pressed', () => {
|
|
131
|
+
givenOnApply();
|
|
132
|
+
mockFilterDefault.mockImplementationOnce(({ onKeyDown }) => {
|
|
133
|
+
onKeyDown({
|
|
134
|
+
key: 'Enter',
|
|
135
|
+
preventDefault: jest.fn()
|
|
136
|
+
});
|
|
137
|
+
return null;
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
createTestInstance(<Component />);
|
|
141
|
+
expect(mockOnApply).toHaveBeenCalled();
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('does not call onApply with right mouse click', () => {
|
|
145
|
+
givenOnApply();
|
|
146
|
+
mockFilterDefault.mockImplementationOnce(({ onMouseDown }) => {
|
|
147
|
+
onMouseDown({
|
|
148
|
+
button: 1
|
|
149
|
+
});
|
|
150
|
+
return null;
|
|
151
|
+
});
|
|
152
|
+
createTestInstance(<Component />);
|
|
153
|
+
expect(mockOnApply).not.toHaveBeenCalled();
|
|
154
|
+
});
|
|
126
155
|
});
|
|
@@ -17,7 +17,7 @@ const FilterDefault = props => {
|
|
|
17
17
|
? formatMessage(
|
|
18
18
|
{
|
|
19
19
|
id: 'filterModal.item.applyFilter',
|
|
20
|
-
defaultMessage: 'Apply filter'
|
|
20
|
+
defaultMessage: 'Apply filter "{optionName}".'
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
optionName: label
|
|
@@ -26,7 +26,7 @@ const FilterDefault = props => {
|
|
|
26
26
|
: formatMessage(
|
|
27
27
|
{
|
|
28
28
|
id: 'filterModal.item.clearFilter',
|
|
29
|
-
defaultMessage: 'Remove filter'
|
|
29
|
+
defaultMessage: 'Remove filter "{optionName}".'
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
optionName: label
|
|
@@ -40,6 +40,7 @@ const FilterDefault = props => {
|
|
|
40
40
|
fieldValue={!!isSelected}
|
|
41
41
|
label={label}
|
|
42
42
|
ariaLabel={ariaLabel}
|
|
43
|
+
data-cy="FilterDefault-checkbox"
|
|
43
44
|
{...restProps}
|
|
44
45
|
/>
|
|
45
46
|
);
|
|
@@ -19,19 +19,39 @@ const FilterItem = props => {
|
|
|
19
19
|
[title, value]
|
|
20
20
|
);
|
|
21
21
|
|
|
22
|
-
const handleClick = useCallback(
|
|
23
|
-
|
|
22
|
+
const handleClick = useCallback(
|
|
23
|
+
e => {
|
|
24
|
+
// use only left click for selection
|
|
25
|
+
if (e.button !== 0) return;
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
toggleItem({ group, item });
|
|
28
|
+
|
|
29
|
+
if (typeof onApply === 'function') {
|
|
30
|
+
onApply(group, item);
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
[group, item, toggleItem, onApply]
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const handleKeyDown = useCallback(
|
|
37
|
+
e => {
|
|
38
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
toggleItem({ group, item });
|
|
41
|
+
if (typeof onApply === 'function') {
|
|
42
|
+
onApply(group, item);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[group, item, onApply, toggleItem]
|
|
47
|
+
);
|
|
29
48
|
|
|
30
49
|
return (
|
|
31
50
|
<FilterDefault
|
|
32
51
|
isSelected={isSelected}
|
|
33
52
|
item={tileItem}
|
|
34
|
-
|
|
53
|
+
onMouseDown={handleClick}
|
|
54
|
+
onKeyDown={handleKeyDown}
|
|
35
55
|
title={title}
|
|
36
56
|
value={value}
|
|
37
57
|
/>
|
|
@@ -38,7 +38,11 @@ const FilterList = props => {
|
|
|
38
38
|
|
|
39
39
|
// create an element for each item
|
|
40
40
|
const element = (
|
|
41
|
-
<li
|
|
41
|
+
<li
|
|
42
|
+
key={key}
|
|
43
|
+
className={classes.item}
|
|
44
|
+
data-cy="FilterList-item"
|
|
45
|
+
>
|
|
42
46
|
<FilterItem
|
|
43
47
|
filterApi={filterApi}
|
|
44
48
|
filterState={filterState}
|
|
@@ -87,6 +91,7 @@ const FilterList = props => {
|
|
|
87
91
|
<button
|
|
88
92
|
onClick={handleListToggle}
|
|
89
93
|
className={classes.showMoreLessButton}
|
|
94
|
+
data-cy="FilterList-showMoreLessButton"
|
|
90
95
|
>
|
|
91
96
|
{label}
|
|
92
97
|
</button>
|
|
@@ -36,7 +36,7 @@ const FilterBlock = props => {
|
|
|
36
36
|
const itemAriaLabel = formatMessage(
|
|
37
37
|
{
|
|
38
38
|
id: 'filterModal.item.ariaLabel',
|
|
39
|
-
defaultMessage: 'Filter products by'
|
|
39
|
+
defaultMessage: 'Filter products by "{itemName}"'
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
itemName: name
|
|
@@ -47,7 +47,7 @@ const FilterBlock = props => {
|
|
|
47
47
|
? formatMessage(
|
|
48
48
|
{
|
|
49
49
|
id: 'filterModal.item.hideOptions',
|
|
50
|
-
defaultMessage: 'Hide filter item options.'
|
|
50
|
+
defaultMessage: 'Hide "{itemName}" filter item options.'
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
itemName: name
|
|
@@ -56,7 +56,7 @@ const FilterBlock = props => {
|
|
|
56
56
|
: formatMessage(
|
|
57
57
|
{
|
|
58
58
|
id: 'filterModal.item.showOptions',
|
|
59
|
-
defaultMessage: 'Show filter item options.'
|
|
59
|
+
defaultMessage: 'Show "{itemName}" filter item options.'
|
|
60
60
|
},
|
|
61
61
|
{
|
|
62
62
|
itemName: name
|
|
@@ -76,10 +76,15 @@ const FilterBlock = props => {
|
|
|
76
76
|
) : null;
|
|
77
77
|
|
|
78
78
|
return (
|
|
79
|
-
<li
|
|
79
|
+
<li
|
|
80
|
+
className={classes.root}
|
|
81
|
+
aria-label={itemAriaLabel}
|
|
82
|
+
data-cy="FilterBlock-root"
|
|
83
|
+
>
|
|
80
84
|
<button
|
|
81
85
|
className={classes.trigger}
|
|
82
86
|
onClick={handleClick}
|
|
87
|
+
data-cy="FilterBlock-triggerButton"
|
|
83
88
|
type="button"
|
|
84
89
|
aria-expanded={isExpanded}
|
|
85
90
|
aria-label={toggleItemOptionsAriaLabel}
|
|
@@ -79,6 +79,7 @@ const FilterModal = props => {
|
|
|
79
79
|
type="button"
|
|
80
80
|
onClick={handleReset}
|
|
81
81
|
ariaLabel={clearAllAriaLabel}
|
|
82
|
+
data-cy="FilterModal-clearButton"
|
|
82
83
|
>
|
|
83
84
|
<FormattedMessage
|
|
84
85
|
id={'filterModal.action'}
|
|
@@ -97,7 +98,11 @@ const FilterModal = props => {
|
|
|
97
98
|
{/* eslint-disable-next-line jsx-a11y/no-autofocus */}
|
|
98
99
|
<FocusScope contain restoreFocus autoFocus>
|
|
99
100
|
{/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */}
|
|
100
|
-
<aside
|
|
101
|
+
<aside
|
|
102
|
+
className={modalClass}
|
|
103
|
+
onKeyDown={handleKeyDownActions}
|
|
104
|
+
data-cy="FilterModal-root"
|
|
105
|
+
>
|
|
101
106
|
<div className={classes.body}>
|
|
102
107
|
<div className={classes.header}>
|
|
103
108
|
<h2 className={classes.headerTitle}>
|
|
@@ -80,7 +80,11 @@ const FilterSidebar = props => {
|
|
|
80
80
|
|
|
81
81
|
const clearAll = filterState.size ? (
|
|
82
82
|
<div className={classes.action}>
|
|
83
|
-
<LinkButton
|
|
83
|
+
<LinkButton
|
|
84
|
+
type="button"
|
|
85
|
+
onClick={handleReset}
|
|
86
|
+
data-cy="FilterSidebar-clearButton"
|
|
87
|
+
>
|
|
84
88
|
<FormattedMessage
|
|
85
89
|
id={'filterModal.action'}
|
|
86
90
|
defaultMessage={'Clear all'}
|
|
@@ -93,6 +97,7 @@ const FilterSidebar = props => {
|
|
|
93
97
|
<aside
|
|
94
98
|
className={classes.root}
|
|
95
99
|
ref={filterRef}
|
|
100
|
+
data-cy="FilterSidebar-root"
|
|
96
101
|
aria-live="polite"
|
|
97
102
|
aria-busy="false"
|
|
98
103
|
>
|
|
@@ -38,6 +38,20 @@ exports[`footer renders copyright 1`] = `
|
|
|
38
38
|
/>
|
|
39
39
|
</a>
|
|
40
40
|
</li>
|
|
41
|
+
<li
|
|
42
|
+
className="linkItem"
|
|
43
|
+
>
|
|
44
|
+
<a
|
|
45
|
+
className="link"
|
|
46
|
+
href="/comp"
|
|
47
|
+
onClick={[Function]}
|
|
48
|
+
>
|
|
49
|
+
<mock-FormattedMessage
|
|
50
|
+
defaultMessage="comp"
|
|
51
|
+
id="comp"
|
|
52
|
+
/>
|
|
53
|
+
</a>
|
|
54
|
+
</li>
|
|
41
55
|
</ul>
|
|
42
56
|
<ul
|
|
43
57
|
className="linkGroup"
|
|
@@ -21,8 +21,16 @@ jest.mock('@magento/venia-ui/lib/components/Newsletter', () => {
|
|
|
21
21
|
return props => <i {...props} />;
|
|
22
22
|
});
|
|
23
23
|
|
|
24
|
+
const mockLinkComponent = ({ children }) => {
|
|
25
|
+
return children;
|
|
26
|
+
};
|
|
27
|
+
|
|
24
28
|
const links = new Map()
|
|
25
|
-
.set('ab', [
|
|
29
|
+
.set('ab', [
|
|
30
|
+
['a', '/a'],
|
|
31
|
+
['b', '/b'],
|
|
32
|
+
['comp', { path: '/comp', Component: mockLinkComponent }]
|
|
33
|
+
])
|
|
26
34
|
.set('12', [['1', '/1'], ['2', '/2']]);
|
|
27
35
|
|
|
28
36
|
test('footer renders copyright', () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { Fragment } from 'react';
|
|
2
2
|
import { Facebook, Instagram, Twitter } from 'react-feather';
|
|
3
3
|
import { FormattedMessage } from 'react-intl';
|
|
4
4
|
import { Link } from 'react-router-dom';
|
|
@@ -19,10 +19,17 @@ const Footer = props => {
|
|
|
19
19
|
const { copyrightText } = talonProps;
|
|
20
20
|
|
|
21
21
|
const linkGroups = Array.from(links, ([groupKey, linkProps]) => {
|
|
22
|
-
const linkElements = Array.from(linkProps, ([text,
|
|
22
|
+
const linkElements = Array.from(linkProps, ([text, pathInfo]) => {
|
|
23
|
+
let path = pathInfo;
|
|
24
|
+
let Component = Fragment;
|
|
25
|
+
if (pathInfo && typeof pathInfo === 'object') {
|
|
26
|
+
path = pathInfo.path;
|
|
27
|
+
Component = pathInfo.Component;
|
|
28
|
+
}
|
|
29
|
+
|
|
23
30
|
const itemKey = `text: ${text} path:${path}`;
|
|
24
31
|
const child = path ? (
|
|
25
|
-
<Link className={classes.link} to={path}>
|
|
32
|
+
<Link className={classes.link} to={path} data-cy="Footer-link">
|
|
26
33
|
<FormattedMessage id={text} defaultMessage={text} />
|
|
27
34
|
</Link>
|
|
28
35
|
) : (
|
|
@@ -32,9 +39,9 @@ const Footer = props => {
|
|
|
32
39
|
);
|
|
33
40
|
|
|
34
41
|
return (
|
|
35
|
-
<
|
|
36
|
-
{child}
|
|
37
|
-
</
|
|
42
|
+
<Component key={itemKey}>
|
|
43
|
+
<li className={classes.linkItem}>{child}</li>
|
|
44
|
+
</Component>
|
|
38
45
|
);
|
|
39
46
|
});
|
|
40
47
|
|
|
@@ -46,7 +53,7 @@ const Footer = props => {
|
|
|
46
53
|
});
|
|
47
54
|
|
|
48
55
|
return (
|
|
49
|
-
<footer className={classes.root}>
|
|
56
|
+
<footer className={classes.root} data-cy="Footer-root">
|
|
50
57
|
<div className={classes.links}>
|
|
51
58
|
{linkGroups}
|
|
52
59
|
<div className={classes.callout}>
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { ContactLink } from '../ContactPage';
|
|
2
|
+
|
|
1
3
|
const accountLinks = new Map()
|
|
2
4
|
.set('Account', null)
|
|
3
5
|
.set('Sign In', null)
|
|
@@ -6,15 +8,18 @@ const accountLinks = new Map()
|
|
|
6
8
|
.set('Returns', null);
|
|
7
9
|
|
|
8
10
|
const aboutLinks = new Map()
|
|
9
|
-
.set('About Us',
|
|
11
|
+
.set('About Us', '/about-us')
|
|
10
12
|
.set('Our Story', null)
|
|
11
13
|
.set('Email Signup', null)
|
|
12
14
|
.set('Give Back', null);
|
|
13
15
|
|
|
14
16
|
const helpLinks = new Map()
|
|
15
17
|
.set('Help', null)
|
|
16
|
-
.set('
|
|
17
|
-
.set('Contact Us',
|
|
18
|
+
.set('Customer Service', '/customer-service')
|
|
19
|
+
.set('Contact Us', {
|
|
20
|
+
path: '/contact-us',
|
|
21
|
+
Component: ContactLink
|
|
22
|
+
})
|
|
18
23
|
.set('Order Status', null)
|
|
19
24
|
.set('Returns', null);
|
|
20
25
|
|
|
@@ -21,6 +21,7 @@ const ForgotPasswordForm = props => {
|
|
|
21
21
|
className={classes.root}
|
|
22
22
|
initialValues={initialValues}
|
|
23
23
|
onSubmit={onSubmit}
|
|
24
|
+
data-cy="forgotPasswordForm-root"
|
|
24
25
|
>
|
|
25
26
|
<Field
|
|
26
27
|
label={formatMessage({
|
|
@@ -32,6 +33,7 @@ const ForgotPasswordForm = props => {
|
|
|
32
33
|
autoComplete="email"
|
|
33
34
|
field="email"
|
|
34
35
|
validate={isRequired}
|
|
36
|
+
data-cy="email"
|
|
35
37
|
/>
|
|
36
38
|
</Field>
|
|
37
39
|
<div className={classes.buttonContainer}>
|
|
@@ -52,6 +54,7 @@ const ForgotPasswordForm = props => {
|
|
|
52
54
|
disabled={isResettingPassword}
|
|
53
55
|
type="submit"
|
|
54
56
|
priority="high"
|
|
57
|
+
data-cy="forgotPasswordForm-submitButton"
|
|
55
58
|
>
|
|
56
59
|
<FormattedMessage
|
|
57
60
|
id={'forgotPasswordForm.submitButtonText'}
|
|
@@ -14,7 +14,7 @@ const FormSubmissionSuccessful = props => {
|
|
|
14
14
|
{
|
|
15
15
|
id: 'formSubmissionSuccessful.textMessage',
|
|
16
16
|
defaultMessage:
|
|
17
|
-
'If there is an account associated with
|
|
17
|
+
'If there is an account associated with {email} you will receive an email with a link to change your password.'
|
|
18
18
|
},
|
|
19
19
|
{ email }
|
|
20
20
|
);
|
|
@@ -27,7 +27,9 @@ const FormSubmissionSuccessful = props => {
|
|
|
27
27
|
defaultMessage={'Recover Password'}
|
|
28
28
|
/>
|
|
29
29
|
</h2>
|
|
30
|
-
<p className={classes.text}>
|
|
30
|
+
<p className={classes.text} data-cy="formSubmissionSuccessful-text">
|
|
31
|
+
{textMessage}
|
|
32
|
+
</p>
|
|
31
33
|
</div>
|
|
32
34
|
);
|
|
33
35
|
};
|
|
@@ -9,9 +9,14 @@ import ErrorMessage from '../ErrorMessage';
|
|
|
9
9
|
import defaultClasses from './formError.module.css';
|
|
10
10
|
|
|
11
11
|
const FormError = props => {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const {
|
|
13
|
+
classes: propClasses,
|
|
14
|
+
errors,
|
|
15
|
+
scrollOnError,
|
|
16
|
+
allowErrorMessages
|
|
17
|
+
} = props;
|
|
18
|
+
|
|
19
|
+
const talonProps = useFormError({ errors, allowErrorMessages });
|
|
15
20
|
const { errorMessage } = talonProps;
|
|
16
21
|
|
|
17
22
|
const errorRef = useRef(null);
|
|
@@ -35,7 +40,8 @@ FormError.propTypes = {
|
|
|
35
40
|
errorMessage: string
|
|
36
41
|
}),
|
|
37
42
|
errors: arrayOf(instanceOf(Error)),
|
|
38
|
-
scrollOnError: bool
|
|
43
|
+
scrollOnError: bool,
|
|
44
|
+
allowErrorMessages: bool
|
|
39
45
|
};
|
|
40
46
|
|
|
41
47
|
FormError.defaultProps = {
|
|
@@ -21,7 +21,6 @@ exports[`should render add to cart if in stock 1`] = `
|
|
|
21
21
|
<span>
|
|
22
22
|
<span>
|
|
23
23
|
<svg
|
|
24
|
-
className="icon"
|
|
25
24
|
fill="none"
|
|
26
25
|
height={16}
|
|
27
26
|
stroke="currentColor"
|
|
@@ -77,7 +76,6 @@ exports[`should render out of cart if not in stock 1`] = `
|
|
|
77
76
|
<span>
|
|
78
77
|
<span>
|
|
79
78
|
<svg
|
|
80
|
-
className="icon"
|
|
81
79
|
fill="none"
|
|
82
80
|
height={16}
|
|
83
81
|
stroke="currentColor"
|
|
@@ -141,7 +139,6 @@ exports[`should render properly 1`] = `
|
|
|
141
139
|
<span>
|
|
142
140
|
<span>
|
|
143
141
|
<svg
|
|
144
|
-
className="icon"
|
|
145
142
|
fill="none"
|
|
146
143
|
height={16}
|
|
147
144
|
stroke="currentColor"
|
|
@@ -5,32 +5,35 @@ import { useAddToCartButton } from '@magento/peregrine/lib/talons/Gallery/useAdd
|
|
|
5
5
|
import { ShoppingBag, XSquare } from 'react-feather';
|
|
6
6
|
import Icon from '../Icon';
|
|
7
7
|
import Button from '../Button';
|
|
8
|
-
import {
|
|
8
|
+
import { useStyle } from '../../classify';
|
|
9
9
|
import defaultClasses from './addToCartButton.module.css';
|
|
10
10
|
|
|
11
|
-
const AddToCartIcon = (
|
|
12
|
-
<Icon
|
|
13
|
-
classes={{ icon: defaultClasses.icon }}
|
|
14
|
-
src={ShoppingBag}
|
|
15
|
-
attrs={{ width: 16 }}
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
const OutOfStockIcon = (
|
|
19
|
-
<Icon
|
|
20
|
-
classes={{ icon: defaultClasses.icon }}
|
|
21
|
-
src={XSquare}
|
|
22
|
-
attrs={{ width: 16 }}
|
|
23
|
-
/>
|
|
24
|
-
);
|
|
25
|
-
|
|
26
11
|
const AddToCartButton = props => {
|
|
12
|
+
const { item, urlSuffix } = props;
|
|
27
13
|
const talonProps = useAddToCartButton({
|
|
28
|
-
item
|
|
14
|
+
item,
|
|
15
|
+
urlSuffix
|
|
29
16
|
});
|
|
30
17
|
const { handleAddToCart, isDisabled, isInStock } = talonProps;
|
|
31
18
|
const { formatMessage } = useIntl();
|
|
32
19
|
|
|
33
|
-
const classes =
|
|
20
|
+
const classes = useStyle(defaultClasses, props.classes);
|
|
21
|
+
|
|
22
|
+
const AddToCartIcon = (
|
|
23
|
+
<Icon
|
|
24
|
+
classes={{ icon: classes.icon }}
|
|
25
|
+
src={ShoppingBag}
|
|
26
|
+
attrs={{ width: 16 }}
|
|
27
|
+
/>
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const OutOfStockIcon = (
|
|
31
|
+
<Icon
|
|
32
|
+
classes={{ icon: classes.icon }}
|
|
33
|
+
src={XSquare}
|
|
34
|
+
attrs={{ width: 16 }}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
34
37
|
|
|
35
38
|
const buttonInStock = (
|
|
36
39
|
<Button
|
|
@@ -94,7 +97,7 @@ AddToCartButton.propTypes = {
|
|
|
94
97
|
url: string
|
|
95
98
|
}),
|
|
96
99
|
stock_status: string.isRequired,
|
|
97
|
-
|
|
100
|
+
__typename: string.isRequired,
|
|
98
101
|
url_key: string.isRequired,
|
|
99
102
|
url_suffix: string,
|
|
100
103
|
sku: string.isRequired,
|
|
@@ -106,5 +109,6 @@ AddToCartButton.propTypes = {
|
|
|
106
109
|
})
|
|
107
110
|
})
|
|
108
111
|
})
|
|
109
|
-
})
|
|
112
|
+
}),
|
|
113
|
+
urlSuffix: string
|
|
110
114
|
};
|
|
@@ -15,6 +15,8 @@ import defaultClasses from './item.module.css';
|
|
|
15
15
|
import WishlistGalleryButton from '../Wishlist/AddToListButton';
|
|
16
16
|
|
|
17
17
|
import AddToCartbutton from '../Gallery/addToCartButton';
|
|
18
|
+
// eslint-disable-next-line no-unused-vars
|
|
19
|
+
import Rating from '../Rating';
|
|
18
20
|
|
|
19
21
|
// The placeholder image is 4:5, so we should make sure to size our product
|
|
20
22
|
// images appropriately.
|
|
@@ -44,7 +46,9 @@ const GalleryItem = props => {
|
|
|
44
46
|
return <GalleryItemShimmer classes={classes} />;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
|
|
49
|
+
// eslint-disable-next-line no-unused-vars
|
|
50
|
+
const { name, price_range, small_image, url_key, rating_summary } = item;
|
|
51
|
+
|
|
48
52
|
const { url: smallImageURL } = small_image;
|
|
49
53
|
const productLink = resourceUrl(`/${url_key}${productUrlSuffix || ''}`);
|
|
50
54
|
|
|
@@ -53,7 +57,7 @@ const GalleryItem = props => {
|
|
|
53
57
|
) : null;
|
|
54
58
|
|
|
55
59
|
const addButton = isSupportedProductType ? (
|
|
56
|
-
<AddToCartbutton item={item} />
|
|
60
|
+
<AddToCartbutton item={item} urlSuffix={productUrlSuffix} />
|
|
57
61
|
) : (
|
|
58
62
|
<div className={classes.unavailableContainer}>
|
|
59
63
|
<Info />
|
|
@@ -66,6 +70,12 @@ const GalleryItem = props => {
|
|
|
66
70
|
</div>
|
|
67
71
|
);
|
|
68
72
|
|
|
73
|
+
// Hide the Rating component until it is updated with the new look and feel (PWA-2512).
|
|
74
|
+
const ratingAverage = null;
|
|
75
|
+
// const ratingAverage = rating_summary ? (
|
|
76
|
+
// <Rating rating={rating_summary} />
|
|
77
|
+
// ) : null;
|
|
78
|
+
|
|
69
79
|
return (
|
|
70
80
|
<div className={classes.root} aria-live="polite" aria-busy="false">
|
|
71
81
|
<Link
|
|
@@ -85,11 +95,13 @@ const GalleryItem = props => {
|
|
|
85
95
|
resource={smallImageURL}
|
|
86
96
|
widths={IMAGE_WIDTHS}
|
|
87
97
|
/>
|
|
98
|
+
{ratingAverage}
|
|
88
99
|
</Link>
|
|
89
100
|
<Link
|
|
90
101
|
onClick={handleLinkClick}
|
|
91
102
|
to={productLink}
|
|
92
103
|
className={classes.name}
|
|
104
|
+
data-cy="GalleryItem-name"
|
|
93
105
|
>
|
|
94
106
|
<span>{name}</span>
|
|
95
107
|
</Link>
|
|
@@ -130,9 +142,8 @@ GalleryItem.propTypes = {
|
|
|
130
142
|
url: string.isRequired
|
|
131
143
|
}),
|
|
132
144
|
stock_status: string.isRequired,
|
|
133
|
-
|
|
145
|
+
__typename: string.isRequired,
|
|
134
146
|
url_key: string.isRequired,
|
|
135
|
-
url_suffix: string,
|
|
136
147
|
sku: string.isRequired,
|
|
137
148
|
price_range: shape({
|
|
138
149
|
maximum_price: shape({
|