@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
|
@@ -44,7 +44,9 @@ const CartTrigger = props => {
|
|
|
44
44
|
: classes.triggerContainer;
|
|
45
45
|
|
|
46
46
|
const maybeItemCounter = itemCount ? (
|
|
47
|
-
<span className={classes.counter}>
|
|
47
|
+
<span className={classes.counter} data-cy="CartTrigger-counter">
|
|
48
|
+
{itemCountDisplay}
|
|
49
|
+
</span>
|
|
48
50
|
) : null;
|
|
49
51
|
|
|
50
52
|
const cartTrigger = hideCartTrigger ? null : (
|
|
@@ -57,6 +59,7 @@ const CartTrigger = props => {
|
|
|
57
59
|
aria-label={buttonAriaLabel}
|
|
58
60
|
className={classes.trigger}
|
|
59
61
|
onClick={handleTriggerClick}
|
|
62
|
+
data-cy="CartTrigger-trigger"
|
|
60
63
|
>
|
|
61
64
|
<Icon src={ShoppingCartIcon} />
|
|
62
65
|
{maybeItemCounter}
|
|
@@ -3,8 +3,9 @@ import { CartPageFragment } from '@magento/peregrine/lib/talons/CartPage/cartPag
|
|
|
3
3
|
|
|
4
4
|
export const REMOVE_ITEM_MUTATION = gql`
|
|
5
5
|
mutation RemoveItemForOptions($cartId: String!, $itemId: ID!) {
|
|
6
|
-
removeItemFromCart(
|
|
7
|
-
|
|
6
|
+
removeItemFromCart(
|
|
7
|
+
input: { cart_id: $cartId, cart_item_uid: $itemId }
|
|
8
|
+
) {
|
|
8
9
|
cart {
|
|
9
10
|
id
|
|
10
11
|
# If this mutation causes "free" to become available we need to know.
|
|
@@ -30,7 +31,7 @@ export const UPDATE_ITEM_MUTATION = gql`
|
|
|
30
31
|
cart_id: $cartId
|
|
31
32
|
cart_items: [{ cart_item_uid: $itemId, quantity: $quantity }]
|
|
32
33
|
}
|
|
33
|
-
)
|
|
34
|
+
) {
|
|
34
35
|
cart {
|
|
35
36
|
id
|
|
36
37
|
# If this mutation causes "free" to become available we need to know.
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { gql } from '@apollo/client';
|
|
2
2
|
|
|
3
3
|
export const EditFormFragment = gql`
|
|
4
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
4
5
|
fragment EditFormFragment on ProductInterface {
|
|
5
|
-
|
|
6
|
+
uid
|
|
6
7
|
name
|
|
7
8
|
sku
|
|
8
9
|
url_key
|
|
9
10
|
__typename
|
|
11
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
10
12
|
... on ConfigurableProduct {
|
|
13
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
11
14
|
configurable_options {
|
|
12
15
|
attribute_code
|
|
13
16
|
attribute_id
|
|
14
|
-
|
|
17
|
+
uid
|
|
15
18
|
label
|
|
16
19
|
values {
|
|
17
20
|
default_label
|
|
@@ -32,8 +35,9 @@ export const EditFormFragment = gql`
|
|
|
32
35
|
code
|
|
33
36
|
value_index
|
|
34
37
|
}
|
|
38
|
+
# eslint-disable-next-line @graphql-eslint/require-id-when-available
|
|
35
39
|
product {
|
|
36
|
-
|
|
40
|
+
uid
|
|
37
41
|
media_gallery_entries {
|
|
38
42
|
id
|
|
39
43
|
disabled
|
|
@@ -19,7 +19,12 @@ const ProductOptions = props => {
|
|
|
19
19
|
<dt className={classes.optionName}>
|
|
20
20
|
{optionLabelString}
|
|
21
21
|
</dt>
|
|
22
|
-
<dd
|
|
22
|
+
<dd
|
|
23
|
+
className={classes.optionValue}
|
|
24
|
+
data-cy="ProductOptions-optionValue"
|
|
25
|
+
>
|
|
26
|
+
{value_label}
|
|
27
|
+
</dd>
|
|
23
28
|
</div>
|
|
24
29
|
);
|
|
25
30
|
}),
|
|
@@ -17,9 +17,16 @@ const icons = new Map()
|
|
|
17
17
|
.set('Trash', TrashIcon);
|
|
18
18
|
|
|
19
19
|
const Section = props => {
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const {
|
|
21
|
+
icon,
|
|
22
|
+
isFilled,
|
|
23
|
+
onClick,
|
|
24
|
+
text,
|
|
25
|
+
classes: propClasses,
|
|
26
|
+
...restProps
|
|
27
|
+
} = props;
|
|
28
|
+
|
|
29
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
23
30
|
const iconClasses = { root: classes.icon };
|
|
24
31
|
const iconSrc = icons.get(icon);
|
|
25
32
|
|
|
@@ -28,8 +35,11 @@ const Section = props => {
|
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
return (
|
|
31
|
-
<li className={classes.menuItem}>
|
|
32
|
-
<button
|
|
38
|
+
<li className={classes.menuItem} {...restProps}>
|
|
39
|
+
<button
|
|
40
|
+
onMouseDown={onClick}
|
|
41
|
+
data-cy="LegacyMiniCart-Section-button"
|
|
42
|
+
>
|
|
33
43
|
<Icon classes={iconClasses} size={16} src={iconSrc} />
|
|
34
44
|
<span className={classes.text}>{text}</span>
|
|
35
45
|
</button>
|
|
@@ -10,11 +10,13 @@ const removeProps = (props, exclude) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Use for links to pages within your app.
|
|
14
|
-
*
|
|
15
13
|
* @kind functional component
|
|
16
|
-
*
|
|
17
|
-
* @
|
|
14
|
+
*
|
|
15
|
+
* @property {bool} prefetchType `true` activates prefetching the target page when the link becomes visible in the viewport.
|
|
16
|
+
* @property {string} to From [react-router-dom Link](https://knowbody.github.io/react-router-docs/api/Link.html). The absolute path to the target page of the link. Uses the `to` prop from the `react-router-dom Link`.
|
|
17
|
+
*
|
|
18
|
+
* @example <caption>Basic usage</caption>
|
|
19
|
+
* <Link prefetchType={true} to="/about/">About Us</Link>
|
|
18
20
|
*/
|
|
19
21
|
const Link = props => {
|
|
20
22
|
const talonProps = useLink(props);
|
|
@@ -13,11 +13,11 @@ import defaultClasses from './mask.module.css';
|
|
|
13
13
|
*
|
|
14
14
|
*/
|
|
15
15
|
const Mask = props => {
|
|
16
|
-
const { dismiss, isActive } = props;
|
|
17
|
-
const classes = useStyle(defaultClasses,
|
|
16
|
+
const { dismiss, isActive, classes: propClasses, ...restProps } = props;
|
|
17
|
+
const classes = useStyle(defaultClasses, propClasses);
|
|
18
18
|
const className = isActive ? classes.root_active : classes.root;
|
|
19
19
|
|
|
20
|
-
return <button className={className} onClick={dismiss} />;
|
|
20
|
+
return <button className={className} onClick={dismiss} {...restProps} />;
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
export default Mask;
|
|
@@ -14,6 +14,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
|
|
|
14
14
|
>
|
|
15
15
|
<div
|
|
16
16
|
className="megaMenuItem"
|
|
17
|
+
onMouseEnter={[Function]}
|
|
18
|
+
onMouseLeave={[Function]}
|
|
19
|
+
onTouchStart={[Function]}
|
|
17
20
|
>
|
|
18
21
|
<a
|
|
19
22
|
aria-label="Category: Women. 1 sub-categories"
|
|
@@ -76,6 +79,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
|
|
|
76
79
|
</div>
|
|
77
80
|
<div
|
|
78
81
|
className="megaMenuItem"
|
|
82
|
+
onMouseEnter={[Function]}
|
|
83
|
+
onMouseLeave={[Function]}
|
|
84
|
+
onTouchStart={[Function]}
|
|
79
85
|
>
|
|
80
86
|
<a
|
|
81
87
|
className="megaMenuLink"
|
|
@@ -88,6 +94,9 @@ exports[`#MegaMenu renders menu if in viewport 1`] = `
|
|
|
88
94
|
</div>
|
|
89
95
|
<div
|
|
90
96
|
className="megaMenuItem"
|
|
97
|
+
onMouseEnter={[Function]}
|
|
98
|
+
onMouseLeave={[Function]}
|
|
99
|
+
onTouchStart={[Function]}
|
|
91
100
|
>
|
|
92
101
|
<a
|
|
93
102
|
className="megaMenuLink"
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
exports[`Mega menu item renders correctly it does not render submenu when item does not have children 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
className="megaMenuItem"
|
|
6
|
+
onMouseEnter={[Function]}
|
|
7
|
+
onMouseLeave={[Function]}
|
|
8
|
+
onTouchStart={[Function]}
|
|
6
9
|
>
|
|
7
10
|
<mock-Submenu
|
|
8
11
|
categoryUrlSuffix=".html"
|
|
@@ -34,6 +37,9 @@ exports[`Mega menu item renders correctly it does not render submenu when item d
|
|
|
34
37
|
exports[`Mega menu item renders correctly it renders correctly 1`] = `
|
|
35
38
|
<div
|
|
36
39
|
className="megaMenuItem"
|
|
40
|
+
onMouseEnter={[Function]}
|
|
41
|
+
onMouseLeave={[Function]}
|
|
42
|
+
onTouchStart={[Function]}
|
|
37
43
|
>
|
|
38
44
|
<mock-Submenu
|
|
39
45
|
categoryUrlSuffix=".html"
|
|
@@ -30,6 +30,7 @@ exports[`Submenu renders correctly it renders correctly 1`] = `
|
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
categoryUrlSuffix=".html"
|
|
33
|
+
handleCloseSubMenu={[MockFunction handleCloseSubMenu]}
|
|
33
34
|
index={0}
|
|
34
35
|
keyboardProps={Object {}}
|
|
35
36
|
/>
|
|
@@ -44,6 +45,7 @@ exports[`Submenu renders correctly it renders correctly 1`] = `
|
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
categoryUrlSuffix=".html"
|
|
48
|
+
handleCloseSubMenu={[MockFunction handleCloseSubMenu]}
|
|
47
49
|
index={1}
|
|
48
50
|
keyboardProps={
|
|
49
51
|
Object {
|
|
@@ -20,7 +20,8 @@ const MegaMenu = props => {
|
|
|
20
20
|
disableFocus,
|
|
21
21
|
handleSubMenuFocus,
|
|
22
22
|
categoryUrlSuffix,
|
|
23
|
-
handleNavigate
|
|
23
|
+
handleNavigate,
|
|
24
|
+
handleClickOutside
|
|
24
25
|
} = useMegaMenu({ mainNavRef });
|
|
25
26
|
|
|
26
27
|
const classes = useStyle(defaultClasses, props.classes);
|
|
@@ -57,9 +58,11 @@ const MegaMenu = props => {
|
|
|
57
58
|
categoryUrlSuffix={categoryUrlSuffix}
|
|
58
59
|
mainNavWidth={mainNavWidth}
|
|
59
60
|
onNavigate={handleNavigate}
|
|
60
|
-
key={category.
|
|
61
|
+
key={category.uid}
|
|
61
62
|
subMenuState={subMenuState}
|
|
62
63
|
disableFocus={disableFocus}
|
|
64
|
+
handleSubMenuFocus={handleSubMenuFocus}
|
|
65
|
+
handleClickOutside={handleClickOutside}
|
|
63
66
|
/>
|
|
64
67
|
);
|
|
65
68
|
})
|
|
@@ -69,6 +72,7 @@ const MegaMenu = props => {
|
|
|
69
72
|
<nav
|
|
70
73
|
ref={mainNavRef}
|
|
71
74
|
className={classes.megaMenu}
|
|
75
|
+
data-cy="MegaMenu-megaMenu"
|
|
72
76
|
role="navigation"
|
|
73
77
|
onFocus={handleSubMenuFocus}
|
|
74
78
|
>
|
|
@@ -15,7 +15,7 @@ import Icon from '../Icon';
|
|
|
15
15
|
* The MegaMenuItem component displays mega menu item
|
|
16
16
|
*
|
|
17
17
|
* @param {MegaMenuCategory} props.category
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {String} props.activeCategoryId - uid of active category
|
|
19
19
|
* @param {int} props.mainNavWidth - width of the main nav. It's used for setting min-width of the submenu
|
|
20
20
|
* @param {function} props.onNavigate - function called when clicking on Link
|
|
21
21
|
*/
|
|
@@ -27,7 +27,9 @@ const MegaMenuItem = props => {
|
|
|
27
27
|
categoryUrlSuffix,
|
|
28
28
|
subMenuState,
|
|
29
29
|
disableFocus,
|
|
30
|
-
onNavigate
|
|
30
|
+
onNavigate,
|
|
31
|
+
handleSubMenuFocus,
|
|
32
|
+
handleClickOutside
|
|
31
33
|
} = props;
|
|
32
34
|
|
|
33
35
|
const classes = useStyle(defaultClasses, props.classes);
|
|
@@ -45,6 +47,7 @@ const MegaMenuItem = props => {
|
|
|
45
47
|
const {
|
|
46
48
|
isFocused,
|
|
47
49
|
isActive,
|
|
50
|
+
handleMenuItemFocus,
|
|
48
51
|
handleCloseSubMenu,
|
|
49
52
|
isMenuActive,
|
|
50
53
|
handleKeyDown
|
|
@@ -89,13 +92,29 @@ const MegaMenuItem = props => {
|
|
|
89
92
|
: {};
|
|
90
93
|
|
|
91
94
|
return (
|
|
92
|
-
<div
|
|
95
|
+
<div
|
|
96
|
+
className={megaMenuItemClassname}
|
|
97
|
+
data-cy="MegaMenu-MegaMenuItem-megaMenuItem"
|
|
98
|
+
onMouseEnter={() => {
|
|
99
|
+
handleSubMenuFocus();
|
|
100
|
+
handleMenuItemFocus();
|
|
101
|
+
}}
|
|
102
|
+
onTouchStart={() => {
|
|
103
|
+
handleSubMenuFocus();
|
|
104
|
+
handleMenuItemFocus();
|
|
105
|
+
}}
|
|
106
|
+
onMouseLeave={e => {
|
|
107
|
+
handleClickOutside(e);
|
|
108
|
+
handleCloseSubMenu();
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
93
111
|
<Link
|
|
94
112
|
{...linkAttributes}
|
|
95
113
|
onKeyDown={handleKeyDown}
|
|
96
114
|
className={
|
|
97
115
|
isActive ? classes.megaMenuLinkActive : classes.megaMenuLink
|
|
98
116
|
}
|
|
117
|
+
data-cy="MegaMenu-MegaMenuItem-link"
|
|
99
118
|
to={categoryUrl}
|
|
100
119
|
onClick={onNavigate}
|
|
101
120
|
>
|
|
@@ -112,7 +131,7 @@ export default MegaMenuItem;
|
|
|
112
131
|
MegaMenuItem.propTypes = {
|
|
113
132
|
category: PropTypes.shape({
|
|
114
133
|
children: PropTypes.array,
|
|
115
|
-
|
|
134
|
+
uid: PropTypes.string.isRequired,
|
|
116
135
|
include_in_menu: PropTypes.number,
|
|
117
136
|
isActive: PropTypes.bool.isRequired,
|
|
118
137
|
name: PropTypes.string.isRequired,
|
|
@@ -120,8 +139,10 @@ MegaMenuItem.propTypes = {
|
|
|
120
139
|
position: PropTypes.number.isRequired,
|
|
121
140
|
url_path: PropTypes.string.isRequired
|
|
122
141
|
}).isRequired,
|
|
123
|
-
activeCategoryId: PropTypes.
|
|
142
|
+
activeCategoryId: PropTypes.string,
|
|
124
143
|
mainNavWidth: PropTypes.number.isRequired,
|
|
125
144
|
categoryUrlSuffix: PropTypes.string,
|
|
126
|
-
onNavigate: PropTypes.func.isRequired
|
|
145
|
+
onNavigate: PropTypes.func.isRequired,
|
|
146
|
+
handleSubMenuFocus: PropTypes.func.isRequired,
|
|
147
|
+
handleClickOutside: PropTypes.func.isRequired
|
|
127
148
|
};
|
|
@@ -46,10 +46,11 @@ const Submenu = props => {
|
|
|
46
46
|
<SubmenuColumn
|
|
47
47
|
index={index}
|
|
48
48
|
keyboardProps={keyboardProps}
|
|
49
|
-
key={category.
|
|
49
|
+
key={category.uid}
|
|
50
50
|
category={category}
|
|
51
51
|
categoryUrlSuffix={categoryUrlSuffix}
|
|
52
52
|
onNavigate={onNavigate}
|
|
53
|
+
handleCloseSubMenu={handleCloseSubMenu}
|
|
53
54
|
/>
|
|
54
55
|
);
|
|
55
56
|
});
|
|
@@ -72,7 +73,7 @@ Submenu.propTypes = {
|
|
|
72
73
|
items: PropTypes.arrayOf(
|
|
73
74
|
PropTypes.shape({
|
|
74
75
|
children: PropTypes.array.isRequired,
|
|
75
|
-
|
|
76
|
+
uid: PropTypes.string.isRequired,
|
|
76
77
|
include_in_menu: PropTypes.number.isRequired,
|
|
77
78
|
isActive: PropTypes.bool.isRequired,
|
|
78
79
|
name: PropTypes.string.isRequired,
|
|
@@ -83,5 +84,6 @@ Submenu.propTypes = {
|
|
|
83
84
|
).isRequired,
|
|
84
85
|
mainNavWidth: PropTypes.number.isRequired,
|
|
85
86
|
categoryUrlSuffix: PropTypes.string,
|
|
86
|
-
onNavigate: PropTypes.func.isRequired
|
|
87
|
+
onNavigate: PropTypes.func.isRequired,
|
|
88
|
+
handleCloseSubMenu: PropTypes.func.isRequired
|
|
87
89
|
};
|
|
@@ -14,7 +14,12 @@ import PropTypes from 'prop-types';
|
|
|
14
14
|
* @param {function} props.onNavigate - function called when clicking on Link
|
|
15
15
|
*/
|
|
16
16
|
const SubmenuColumn = props => {
|
|
17
|
-
const {
|
|
17
|
+
const {
|
|
18
|
+
category,
|
|
19
|
+
categoryUrlSuffix,
|
|
20
|
+
onNavigate,
|
|
21
|
+
handleCloseSubMenu
|
|
22
|
+
} = props;
|
|
18
23
|
const classes = useStyle(defaultClasses, props.classes);
|
|
19
24
|
|
|
20
25
|
const categoryUrl = resourceUrl(
|
|
@@ -40,6 +45,7 @@ const SubmenuColumn = props => {
|
|
|
40
45
|
<Link
|
|
41
46
|
{...keyboardProps}
|
|
42
47
|
className={isActive ? classes.linkActive : classes.link}
|
|
48
|
+
data-cy="MegaMenu-SubmenuColumn-link"
|
|
43
49
|
to={categoryUrl}
|
|
44
50
|
onClick={onNavigate}
|
|
45
51
|
>
|
|
@@ -60,8 +66,12 @@ const SubmenuColumn = props => {
|
|
|
60
66
|
<Link
|
|
61
67
|
{...keyboardProps}
|
|
62
68
|
className={classes.link}
|
|
69
|
+
data-cy="MegaMenu-SubmenuColumn-link"
|
|
63
70
|
to={categoryUrl}
|
|
64
|
-
onClick={
|
|
71
|
+
onClick={() => {
|
|
72
|
+
handleCloseSubMenu();
|
|
73
|
+
onNavigate();
|
|
74
|
+
}}
|
|
65
75
|
>
|
|
66
76
|
<span className={classes.heading}>{category.name}</span>
|
|
67
77
|
</Link>
|
|
@@ -75,7 +85,7 @@ export default SubmenuColumn;
|
|
|
75
85
|
SubmenuColumn.propTypes = {
|
|
76
86
|
category: PropTypes.shape({
|
|
77
87
|
children: PropTypes.array,
|
|
78
|
-
|
|
88
|
+
uid: PropTypes.string.isRequired,
|
|
79
89
|
include_in_menu: PropTypes.number,
|
|
80
90
|
isActive: PropTypes.bool.isRequired,
|
|
81
91
|
name: PropTypes.string.isRequired,
|
|
@@ -84,5 +94,6 @@ SubmenuColumn.propTypes = {
|
|
|
84
94
|
url_path: PropTypes.string.isRequired
|
|
85
95
|
}).isRequired,
|
|
86
96
|
categoryUrlSuffix: PropTypes.string,
|
|
87
|
-
onNavigate: PropTypes.func.isRequired
|
|
97
|
+
onNavigate: PropTypes.func.isRequired,
|
|
98
|
+
handleCloseSubMenu: PropTypes.func.isRequired
|
|
88
99
|
};
|
|
@@ -67,7 +67,7 @@ exports[`Should disable delete icon while loading 1`] = `
|
|
|
67
67
|
className="quantity"
|
|
68
68
|
>
|
|
69
69
|
<mock-FormattedMessage
|
|
70
|
-
defaultMessage="Qty :"
|
|
70
|
+
defaultMessage="Qty : {quantity}"
|
|
71
71
|
id="productList.quantity"
|
|
72
72
|
values={
|
|
73
73
|
Object {
|
|
@@ -213,7 +213,7 @@ exports[`Should render correctly 1`] = `
|
|
|
213
213
|
className="quantity"
|
|
214
214
|
>
|
|
215
215
|
<mock-FormattedMessage
|
|
216
|
-
defaultMessage="Qty :"
|
|
216
|
+
defaultMessage="Qty : {quantity}"
|
|
217
217
|
id="productList.quantity"
|
|
218
218
|
values={
|
|
219
219
|
Object {
|
|
@@ -359,7 +359,7 @@ exports[`Should render correctly when configured to use variant thumbnail 1`] =
|
|
|
359
359
|
className="quantity"
|
|
360
360
|
>
|
|
361
361
|
<mock-FormattedMessage
|
|
362
|
-
defaultMessage="Qty :"
|
|
362
|
+
defaultMessage="Qty : {quantity}"
|
|
363
363
|
id="productList.quantity"
|
|
364
364
|
values={
|
|
365
365
|
Object {
|
|
@@ -505,7 +505,7 @@ exports[`Should render correctly with out of stock product 1`] = `
|
|
|
505
505
|
className="quantity"
|
|
506
506
|
>
|
|
507
507
|
<mock-FormattedMessage
|
|
508
|
-
defaultMessage="Qty :"
|
|
508
|
+
defaultMessage="Qty : {quantity}"
|
|
509
509
|
id="productList.quantity"
|
|
510
510
|
values={
|
|
511
511
|
Object {
|
|
@@ -53,11 +53,12 @@ const Item = props => {
|
|
|
53
53
|
const configured_variant = configuredVariant(configurable_options, product);
|
|
54
54
|
|
|
55
55
|
return (
|
|
56
|
-
<div className={rootClass}>
|
|
56
|
+
<div className={rootClass} data-cy="MiniCart-Item-root">
|
|
57
57
|
<Link
|
|
58
58
|
className={classes.thumbnailContainer}
|
|
59
59
|
to={itemLink}
|
|
60
60
|
onClick={closeMiniCart}
|
|
61
|
+
data-cy="item-thumbnailContainer"
|
|
61
62
|
>
|
|
62
63
|
<Image
|
|
63
64
|
alt={product.name}
|
|
@@ -77,6 +78,7 @@ const Item = props => {
|
|
|
77
78
|
className={classes.name}
|
|
78
79
|
to={itemLink}
|
|
79
80
|
onClick={closeMiniCart}
|
|
81
|
+
data-cy="item-name"
|
|
80
82
|
>
|
|
81
83
|
{product.name}
|
|
82
84
|
</Link>
|
|
@@ -89,7 +91,7 @@ const Item = props => {
|
|
|
89
91
|
<span className={classes.quantity}>
|
|
90
92
|
<FormattedMessage
|
|
91
93
|
id={'productList.quantity'}
|
|
92
|
-
defaultMessage={'Qty :'}
|
|
94
|
+
defaultMessage={'Qty : {quantity}'}
|
|
93
95
|
values={{ quantity }}
|
|
94
96
|
/>
|
|
95
97
|
</span>
|
|
@@ -109,6 +111,7 @@ const Item = props => {
|
|
|
109
111
|
type="button"
|
|
110
112
|
className={classes.deleteButton}
|
|
111
113
|
disabled={isDeleting}
|
|
114
|
+
data-cy="MiniCart-Item-deleteButton"
|
|
112
115
|
>
|
|
113
116
|
<Icon
|
|
114
117
|
size={16}
|
|
@@ -38,7 +38,11 @@ const ProductList = props => {
|
|
|
38
38
|
storeUrlSuffix
|
|
39
39
|
]);
|
|
40
40
|
|
|
41
|
-
return
|
|
41
|
+
return (
|
|
42
|
+
<div className={classes.root} data-cy="MiniCart-ProductList-root">
|
|
43
|
+
{cartItems}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
42
46
|
};
|
|
43
47
|
|
|
44
48
|
export default ProductList;
|
|
@@ -19,8 +19,9 @@ export const MINI_CART_QUERY = gql`
|
|
|
19
19
|
|
|
20
20
|
export const REMOVE_ITEM_MUTATION = gql`
|
|
21
21
|
mutation RemoveItemForMiniCart($cartId: String!, $itemId: ID!) {
|
|
22
|
-
removeItemFromCart(
|
|
23
|
-
|
|
22
|
+
removeItemFromCart(
|
|
23
|
+
input: { cart_id: $cartId, cart_item_uid: $itemId }
|
|
24
|
+
) {
|
|
24
25
|
cart {
|
|
25
26
|
id
|
|
26
27
|
...MiniCartFragment
|
|
@@ -83,7 +83,7 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
83
83
|
<span className={quantityClassName}>
|
|
84
84
|
<FormattedMessage
|
|
85
85
|
id={'miniCart.totalQuantity'}
|
|
86
|
-
defaultMessage={'Items'}
|
|
86
|
+
defaultMessage={'{totalQuantity} Items'}
|
|
87
87
|
values={{ totalQuantity }}
|
|
88
88
|
/>
|
|
89
89
|
</span>
|
|
@@ -104,7 +104,10 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
104
104
|
|
|
105
105
|
const contents = isCartEmpty ? (
|
|
106
106
|
<div className={classes.emptyCart}>
|
|
107
|
-
<div
|
|
107
|
+
<div
|
|
108
|
+
className={classes.emptyMessage}
|
|
109
|
+
data-cy="MiniCart-emptyMessage"
|
|
110
|
+
>
|
|
108
111
|
<FormattedMessage
|
|
109
112
|
id={'miniCart.emptyMessage'}
|
|
110
113
|
defaultMessage={'There are no items in your cart.'}
|
|
@@ -114,7 +117,7 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
114
117
|
) : (
|
|
115
118
|
<Fragment>
|
|
116
119
|
<div className={classes.header}>{header}</div>
|
|
117
|
-
<div className={classes.body}>
|
|
120
|
+
<div className={classes.body} data-cy="MiniCart-body">
|
|
118
121
|
<ProductList
|
|
119
122
|
items={productList}
|
|
120
123
|
loading={loading}
|
|
@@ -130,6 +133,7 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
130
133
|
priority="high"
|
|
131
134
|
className={classes.checkoutButton}
|
|
132
135
|
disabled={loading || isCartEmpty}
|
|
136
|
+
data-cy="Minicart-checkoutButton"
|
|
133
137
|
>
|
|
134
138
|
<Icon
|
|
135
139
|
size={16}
|
|
@@ -148,6 +152,7 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
148
152
|
priority="high"
|
|
149
153
|
className={classes.editCartButton}
|
|
150
154
|
disabled={loading || isCartEmpty}
|
|
155
|
+
data-cy="Minicart-editCartButton"
|
|
151
156
|
>
|
|
152
157
|
<FormattedMessage
|
|
153
158
|
id={'miniCart.editCartButton'}
|
|
@@ -159,7 +164,7 @@ const MiniCart = React.forwardRef((props, ref) => {
|
|
|
159
164
|
);
|
|
160
165
|
|
|
161
166
|
return (
|
|
162
|
-
<aside className={rootClass}>
|
|
167
|
+
<aside className={rootClass} data-cy="MiniCart-root">
|
|
163
168
|
<div ref={ref} className={contentsClass}>
|
|
164
169
|
{contents}
|
|
165
170
|
</div>
|