@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
package/i18n/en_US.json
CHANGED
|
@@ -104,6 +104,9 @@
|
|
|
104
104
|
"checkoutPage.step4": "Saved Credit Card Information Successfully",
|
|
105
105
|
"checkoutPage.stockStatusMessage": "An item in your cart is currently out-of-stock and must be removed in order to Checkout. Please return to your cart to remove the item.",
|
|
106
106
|
"checkoutPage.subscribe": "Subscribe to news and updates",
|
|
107
|
+
"checkoutPage.suggestSignInConfirmMessage": "Yes, sign in",
|
|
108
|
+
"checkoutPage.suggestSignInDeclineMessage": "No, thanks",
|
|
109
|
+
"checkoutPage.suggestSignInMessage'": "The email you provided is associated with an existing Venia account. Would you like to sign into this account?",
|
|
107
110
|
"checkoutPage.thankYou": "Thank you for your order!",
|
|
108
111
|
"checkoutPage.titleCheckout": "Checkout",
|
|
109
112
|
"checkoutPage.titleReceipt": "Receipt",
|
|
@@ -120,6 +123,15 @@
|
|
|
120
123
|
"completedView.errorLoading": "Error loading selected shipping method. Please select again.",
|
|
121
124
|
"completedView.shippingMethod": "Shipping Method",
|
|
122
125
|
"Contact Us": "Contact Us",
|
|
126
|
+
"contactPage.title": "Contact Us",
|
|
127
|
+
"contactPage.loadingText": "Sending",
|
|
128
|
+
"contactPage.titleText": "Contact Us",
|
|
129
|
+
"contactPage.infoText": "Drop us a line and we'll get back to you as soon as possible.",
|
|
130
|
+
"contactPage.telephone": "Phone Number",
|
|
131
|
+
"contactPage.telephonePlaceholder": "(222)-222-2222",
|
|
132
|
+
"contactPage.comment": "Message",
|
|
133
|
+
"contactPage.commentPlaceholder": "Tell us what's on your mind",
|
|
134
|
+
"contactPage.submit": "Send",
|
|
123
135
|
"country.label": "Country",
|
|
124
136
|
"couponCode.apply": "Apply",
|
|
125
137
|
"couponCode.couponCode": "Coupon Code",
|
|
@@ -143,6 +155,8 @@
|
|
|
143
155
|
"createWishlistForm.privateRadio": "Private",
|
|
144
156
|
"createWishlistForm.publicRadio": "Public",
|
|
145
157
|
"createWishlistForm.saveButton": "Save",
|
|
158
|
+
"customAttributes.title": "Details",
|
|
159
|
+
"Customer Service": "Customer Service",
|
|
146
160
|
"customerForm.defaultShipping": "Make this my default address",
|
|
147
161
|
"customerForm.formMessage": "The shipping address you enter will be saved to your address book and set as your default for future purchases.",
|
|
148
162
|
"customerForm.loading": "Fetching Customer Details...",
|
|
@@ -211,6 +225,7 @@
|
|
|
211
225
|
"global.deleteButton": "Delete",
|
|
212
226
|
"global.editButton": "Edit",
|
|
213
227
|
"global.email": "Email",
|
|
228
|
+
"global.emailPlaceholder": "abc@xyz.com",
|
|
214
229
|
"global.firstName": "First Name",
|
|
215
230
|
"global.free": "Free",
|
|
216
231
|
"global.home": "Home",
|
|
@@ -234,7 +249,6 @@
|
|
|
234
249
|
"guestForm.continueToNextStep": "Continue to Shipping Method",
|
|
235
250
|
"guestForm.emailMessage": "Set a password at the end of guest checkout to create an account in one easy step.",
|
|
236
251
|
"Help": "Help",
|
|
237
|
-
"Live Chat": "Live Chat",
|
|
238
252
|
"loadingIndicator.message": "Fetching Data...",
|
|
239
253
|
"logo.title": "Venia",
|
|
240
254
|
"magentoRoute.internalError": "Something went wrong. Sorry about that.",
|
|
@@ -251,6 +265,11 @@
|
|
|
251
265
|
"navHeader.myAccountText": "My Account",
|
|
252
266
|
"navHeader.signInText": "Sign In",
|
|
253
267
|
"navigationTrigger.ariaLabel": "Toggle navigation panel",
|
|
268
|
+
"newsletter.subscribeMessage": "The email address is subscribed.",
|
|
269
|
+
"newsletter.loadingText": "Subscribing",
|
|
270
|
+
"newsletter.titleText": "Subscribe to Venia",
|
|
271
|
+
"newsletter.subscribeText": "Subscribe",
|
|
272
|
+
"newsletter.infoText": "Recieve the latest news, update and special offers right to your inbox.",
|
|
254
273
|
"noProductsFound.noProductsFound": "Sorry! We couldn't find any products.",
|
|
255
274
|
"noProductsFound.tryOneOfTheseCategories": "Try one of these categories",
|
|
256
275
|
"Order Status": "Order Status",
|
|
@@ -393,6 +412,7 @@
|
|
|
393
412
|
"sortItem.priceAsc": "Price: Low to High",
|
|
394
413
|
"sortItem.priceDesc": "Price: High to Low",
|
|
395
414
|
"sortItem.relevance": "Best Match",
|
|
415
|
+
"sortItem.position": "Position",
|
|
396
416
|
"stockStatusMessage.message": "An item in your cart is currently out-of-stock and must be removed in order to Checkout.",
|
|
397
417
|
"storedPayments.creditCard": "Credit Card",
|
|
398
418
|
"storedPayments.delete": "Delete",
|
|
@@ -439,10 +459,5 @@
|
|
|
439
459
|
"wishlistPage.wishlistDisabledMessage": "The wishlist is not currently available.",
|
|
440
460
|
"wishlist.itemCountOpen": "Showing {currentCount} of {count} items in this list",
|
|
441
461
|
"wishlist.itemCountClosed": "You have {count} {count, plural, one {item} other {items}} in this list",
|
|
442
|
-
"wishlist.loadMore": "Load More"
|
|
443
|
-
"newsletter.subscribeMessage": "The email address is subscribed.",
|
|
444
|
-
"newsletter.loadingText": "Subscribing",
|
|
445
|
-
"newsletter.titleText": "Subscribe to Venia",
|
|
446
|
-
"newsletter.subscribeText": "Subscribe",
|
|
447
|
-
"newsletter.infoText": "Recieve the latest news, update and special offers right to your inbox."
|
|
462
|
+
"wishlist.loadMore": "Load More"
|
|
448
463
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import createTestInstance from '@magento/peregrine/lib/util/createTestInstance';
|
|
3
3
|
import { useQuery } from '@apollo/client';
|
|
4
|
-
import CategoryList from '../../../components/CategoryList';
|
|
5
4
|
import RichContent from '../../../components/RichContent';
|
|
6
5
|
import { StoreTitle } from '../../../components/Head';
|
|
7
6
|
import CMSPage from '../cms';
|
|
@@ -20,7 +19,6 @@ jest.mock('../../../components/LoadingIndicator', () => {
|
|
|
20
19
|
};
|
|
21
20
|
});
|
|
22
21
|
jest.mock('../../../components/RichContent', () => 'RichContent');
|
|
23
|
-
jest.mock('../../../components/CategoryList', () => 'CategoryList');
|
|
24
22
|
|
|
25
23
|
jest.mock('@magento/peregrine/lib/context/app', () => {
|
|
26
24
|
const state = {
|
|
@@ -73,9 +71,6 @@ test('page is set to loading when checking the network for updates', () => {
|
|
|
73
71
|
cmsPage: {
|
|
74
72
|
url_key: 'cached_page',
|
|
75
73
|
content: 'Cached Page.'
|
|
76
|
-
},
|
|
77
|
-
storeConfig: {
|
|
78
|
-
root_category_id: 2
|
|
79
74
|
}
|
|
80
75
|
},
|
|
81
76
|
error: false,
|
|
@@ -99,16 +94,14 @@ test('page is set to loading when checking the network for updates', () => {
|
|
|
99
94
|
expect(mockSetPageLoading).toHaveBeenCalledWith(true);
|
|
100
95
|
});
|
|
101
96
|
|
|
102
|
-
test('
|
|
97
|
+
test('renders default content', () => {
|
|
103
98
|
useQuery.mockImplementation(() => {
|
|
104
99
|
return {
|
|
105
100
|
data: {
|
|
106
101
|
cmsPage: {
|
|
102
|
+
title: 'Home Page',
|
|
107
103
|
url_key: 'homepage',
|
|
108
104
|
content: 'CMS homepage content goes here.'
|
|
109
|
-
},
|
|
110
|
-
storeConfig: {
|
|
111
|
-
root_category_id: 2
|
|
112
105
|
}
|
|
113
106
|
},
|
|
114
107
|
error: false,
|
|
@@ -117,13 +110,13 @@ test('render CategoryList when default content is present', () => {
|
|
|
117
110
|
});
|
|
118
111
|
|
|
119
112
|
const { root } = createTestInstance(<CMSPage {...props} />);
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
expect(
|
|
123
|
-
expect(
|
|
113
|
+
const pageTitle = root.findByType(StoreTitle).props.children;
|
|
114
|
+
const pageContent = root.findByType(RichContent).props.html;
|
|
115
|
+
expect(pageTitle).toEqual('Home Page');
|
|
116
|
+
expect(pageContent).toEqual('CMS homepage content goes here.');
|
|
124
117
|
});
|
|
125
118
|
|
|
126
|
-
test('render RichContent when
|
|
119
|
+
test('render RichContent when content is present', () => {
|
|
127
120
|
useQuery.mockImplementation(() => {
|
|
128
121
|
return {
|
|
129
122
|
data: {
|
|
@@ -132,9 +125,6 @@ test('render RichContent when default content is not present', () => {
|
|
|
132
125
|
content_heading: 'This is a rich content heading',
|
|
133
126
|
content:
|
|
134
127
|
'<div class="richContent">This is rich content</div>'
|
|
135
|
-
},
|
|
136
|
-
storeConfig: {
|
|
137
|
-
root_category_id: 2
|
|
138
128
|
}
|
|
139
129
|
},
|
|
140
130
|
error: false,
|
|
@@ -152,6 +142,49 @@ test('render RichContent when default content is not present', () => {
|
|
|
152
142
|
);
|
|
153
143
|
});
|
|
154
144
|
|
|
145
|
+
test('do not render heading when empty', () => {
|
|
146
|
+
useQuery.mockImplementation(() => {
|
|
147
|
+
return {
|
|
148
|
+
data: {
|
|
149
|
+
cmsPage: {
|
|
150
|
+
url_key: 'homepage',
|
|
151
|
+
content_heading: '',
|
|
152
|
+
content:
|
|
153
|
+
'<div class="richContent">This is rich content</div>'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
error: false,
|
|
157
|
+
loading: false
|
|
158
|
+
};
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const { root } = createTestInstance(<CMSPage {...props} />);
|
|
162
|
+
|
|
163
|
+
expect(() => root.findByType('h1')).toThrow();
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
test('render root class with layout when defined', () => {
|
|
167
|
+
useQuery.mockImplementation(() => {
|
|
168
|
+
return {
|
|
169
|
+
data: {
|
|
170
|
+
cmsPage: {
|
|
171
|
+
url_key: 'homepage',
|
|
172
|
+
content_heading: 'This is a rich content heading',
|
|
173
|
+
content:
|
|
174
|
+
'<div class="richContent">This is rich content</div>',
|
|
175
|
+
page_layout: '1column'
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
error: false,
|
|
179
|
+
loading: false
|
|
180
|
+
};
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
const { root } = createTestInstance(<CMSPage {...props} />);
|
|
184
|
+
|
|
185
|
+
expect(root.findByProps({ className: 'root_1column' })).toBeTruthy();
|
|
186
|
+
});
|
|
187
|
+
|
|
155
188
|
test('render meta information based on meta data from GraphQL', () => {
|
|
156
189
|
useQuery.mockImplementation(() => {
|
|
157
190
|
return {
|
|
@@ -162,9 +195,6 @@ test('render meta information based on meta data from GraphQL', () => {
|
|
|
162
195
|
title: 'Test Title',
|
|
163
196
|
meta_title: 'Test Meta Title',
|
|
164
197
|
meta_description: 'Test Meta Description'
|
|
165
|
-
},
|
|
166
|
-
storeConfig: {
|
|
167
|
-
root_category_id: 2
|
|
168
198
|
}
|
|
169
199
|
},
|
|
170
200
|
error: false,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
|
+
|
|
3
4
|
import { fullPageLoadingIndicator } from '../../components/LoadingIndicator';
|
|
4
5
|
import { useCmsPage } from '@magento/peregrine/lib/talons/Cms/useCmsPage';
|
|
5
6
|
import RichContent from '../../components/RichContent';
|
|
6
|
-
import CategoryList from '../../components/CategoryList';
|
|
7
7
|
import { Meta, StoreTitle } from '../../components/Head';
|
|
8
8
|
import { useStyle } from '../../classify';
|
|
9
|
-
import {
|
|
9
|
+
import { toCamelCase } from '../../util/toCamelCase';
|
|
10
10
|
|
|
11
11
|
import defaultClasses from './cms.module.css';
|
|
12
12
|
|
|
@@ -14,62 +14,58 @@ const CMSPage = props => {
|
|
|
14
14
|
const { identifier } = props;
|
|
15
15
|
|
|
16
16
|
const talonProps = useCmsPage({ identifier });
|
|
17
|
-
const {
|
|
18
|
-
cmsPage,
|
|
19
|
-
hasContent,
|
|
20
|
-
rootCategoryId,
|
|
21
|
-
shouldShowLoadingIndicator
|
|
22
|
-
} = talonProps;
|
|
23
|
-
const { formatMessage } = useIntl();
|
|
17
|
+
const { cmsPage, shouldShowLoadingIndicator } = talonProps;
|
|
24
18
|
const classes = useStyle(defaultClasses, props.classes);
|
|
25
19
|
|
|
26
20
|
if (shouldShowLoadingIndicator) {
|
|
27
21
|
return fullPageLoadingIndicator;
|
|
28
22
|
}
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
const {
|
|
25
|
+
content_heading,
|
|
26
|
+
title,
|
|
27
|
+
meta_title,
|
|
28
|
+
meta_description,
|
|
29
|
+
page_layout,
|
|
30
|
+
content
|
|
31
|
+
} = cmsPage;
|
|
38
32
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
33
|
+
const headingElement =
|
|
34
|
+
content_heading !== '' ? (
|
|
35
|
+
<h1 className={classes.heading}>{content_heading}</h1>
|
|
36
|
+
) : null;
|
|
43
37
|
|
|
44
|
-
|
|
38
|
+
const pageTitle = meta_title || title;
|
|
39
|
+
const rootClassName = page_layout
|
|
40
|
+
? classes[`root_${toCamelCase(page_layout)}`]
|
|
41
|
+
: classes.root;
|
|
45
42
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
return (
|
|
44
|
+
<Fragment>
|
|
45
|
+
<StoreTitle>{pageTitle}</StoreTitle>
|
|
46
|
+
<Meta name="title" content={pageTitle} />
|
|
47
|
+
<Meta name="description" content={meta_description} />
|
|
48
|
+
<article className={rootClassName}>
|
|
51
49
|
{headingElement}
|
|
52
50
|
<RichContent html={content} />
|
|
53
|
-
</
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// Fallback to a category list if there is no cms content.
|
|
58
|
-
return (
|
|
59
|
-
<CategoryList
|
|
60
|
-
title={formatMessage({
|
|
61
|
-
id: 'cms.shopByCategory',
|
|
62
|
-
defaultMessage: 'Shop by category'
|
|
63
|
-
})}
|
|
64
|
-
id={rootCategoryId}
|
|
65
|
-
/>
|
|
51
|
+
</article>
|
|
52
|
+
</Fragment>
|
|
66
53
|
);
|
|
67
54
|
};
|
|
68
55
|
|
|
69
56
|
CMSPage.propTypes = {
|
|
70
|
-
|
|
57
|
+
identifier: string,
|
|
71
58
|
classes: shape({
|
|
72
|
-
|
|
59
|
+
root: string,
|
|
60
|
+
heading: string,
|
|
61
|
+
root_empty: string,
|
|
62
|
+
root_1column: string,
|
|
63
|
+
root_2columnsLeft: string,
|
|
64
|
+
root_2columnsRight: string,
|
|
65
|
+
root_3columns: string,
|
|
66
|
+
root_cmsFullWidth: string,
|
|
67
|
+
root_categoryFullWidth: string,
|
|
68
|
+
root_productFullWidth: string
|
|
73
69
|
})
|
|
74
70
|
};
|
|
75
71
|
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
.root {
|
|
2
|
-
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.title {
|
|
6
|
-
font-size: 1.5rem;
|
|
7
|
-
font-weight: 400;
|
|
8
|
-
margin: 0 0 1rem;
|
|
9
|
-
padding: 0.5rem;
|
|
2
|
+
composes: px-4 from global;
|
|
10
3
|
}
|
|
11
4
|
|
|
12
5
|
.heading {
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
composes: mb-2 from global;
|
|
7
|
+
composes: mt-4 from global;
|
|
8
|
+
composes: text-center from global;
|
|
9
|
+
composes: text-3xl from global;
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
/* Medium */
|
|
12
|
+
composes: md_mb-10 from global;
|
|
13
|
+
composes: md_text-5xl from global;
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
.
|
|
21
|
-
|
|
16
|
+
.root_empty,
|
|
17
|
+
.root_1column,
|
|
18
|
+
.root_2columnsLeft,
|
|
19
|
+
.root_2columnsRight,
|
|
20
|
+
.root_3columns,
|
|
21
|
+
.root_cmsFullWidth,
|
|
22
|
+
.root_categoryFullWidth,
|
|
23
|
+
.root_productFullWidth {
|
|
24
|
+
composes: root;
|
|
22
25
|
}
|
|
@@ -4,7 +4,7 @@ exports[`Category Root Component error view does not render when data is present
|
|
|
4
4
|
Array [
|
|
5
5
|
"Meta",
|
|
6
6
|
<CategoryContent
|
|
7
|
-
categoryId=
|
|
7
|
+
categoryId="Mg=="
|
|
8
8
|
classes={Object {}}
|
|
9
9
|
data={
|
|
10
10
|
Object {
|
|
@@ -93,7 +93,7 @@ exports[`Category Root Component renders the correct tree 1`] = `
|
|
|
93
93
|
Array [
|
|
94
94
|
"Meta",
|
|
95
95
|
<CategoryContent
|
|
96
|
-
categoryId=
|
|
96
|
+
categoryId="Mg=="
|
|
97
97
|
classes={Object {}}
|
|
98
98
|
data={
|
|
99
99
|
Object {
|
|
@@ -41,6 +41,16 @@ Array [
|
|
|
41
41
|
className="headerButtons"
|
|
42
42
|
>
|
|
43
43
|
<ProductSort
|
|
44
|
+
availableSortMethods={
|
|
45
|
+
Array [
|
|
46
|
+
Object {
|
|
47
|
+
"attribute": "sortItem.attribute",
|
|
48
|
+
"id": "sortItem.method",
|
|
49
|
+
"sortDirection": "ASC",
|
|
50
|
+
"text": "sortItem.text",
|
|
51
|
+
},
|
|
52
|
+
]
|
|
53
|
+
}
|
|
44
54
|
sortProps={
|
|
45
55
|
Array [
|
|
46
56
|
Object {
|
|
@@ -135,6 +145,16 @@ Array [
|
|
|
135
145
|
}
|
|
136
146
|
/>
|
|
137
147
|
<ProductSort
|
|
148
|
+
availableSortMethods={
|
|
149
|
+
Array [
|
|
150
|
+
Object {
|
|
151
|
+
"attribute": "sortItem.attribute",
|
|
152
|
+
"id": "sortItem.method",
|
|
153
|
+
"sortDirection": "ASC",
|
|
154
|
+
"text": "sortItem.text",
|
|
155
|
+
},
|
|
156
|
+
]
|
|
157
|
+
}
|
|
138
158
|
sortProps={
|
|
139
159
|
Array [
|
|
140
160
|
Object {
|
|
@@ -236,6 +256,16 @@ Array [
|
|
|
236
256
|
}
|
|
237
257
|
/>
|
|
238
258
|
<ProductSort
|
|
259
|
+
availableSortMethods={
|
|
260
|
+
Array [
|
|
261
|
+
Object {
|
|
262
|
+
"attribute": "sortItem.attribute",
|
|
263
|
+
"id": "sortItem.method",
|
|
264
|
+
"sortDirection": "ASC",
|
|
265
|
+
"text": "sortItem.text",
|
|
266
|
+
},
|
|
267
|
+
]
|
|
268
|
+
}
|
|
239
269
|
sortProps={
|
|
240
270
|
Array [
|
|
241
271
|
Object {
|
|
@@ -345,6 +375,16 @@ Array [
|
|
|
345
375
|
}
|
|
346
376
|
/>
|
|
347
377
|
<ProductSort
|
|
378
|
+
availableSortMethods={
|
|
379
|
+
Array [
|
|
380
|
+
Object {
|
|
381
|
+
"attribute": "sortItem.attribute",
|
|
382
|
+
"id": "sortItem.method",
|
|
383
|
+
"sortDirection": "ASC",
|
|
384
|
+
"text": "sortItem.text",
|
|
385
|
+
},
|
|
386
|
+
]
|
|
387
|
+
}
|
|
348
388
|
sortProps={
|
|
349
389
|
Array [
|
|
350
390
|
Object {
|
|
@@ -557,6 +597,16 @@ Array [
|
|
|
557
597
|
className="headerButtons"
|
|
558
598
|
>
|
|
559
599
|
<ProductSort
|
|
600
|
+
availableSortMethods={
|
|
601
|
+
Array [
|
|
602
|
+
Object {
|
|
603
|
+
"attribute": "sortItem.attribute",
|
|
604
|
+
"id": "sortItem.method",
|
|
605
|
+
"sortDirection": "ASC",
|
|
606
|
+
"text": "sortItem.text",
|
|
607
|
+
},
|
|
608
|
+
]
|
|
609
|
+
}
|
|
560
610
|
sortProps={
|
|
561
611
|
Array [
|
|
562
612
|
Object {
|
|
@@ -694,6 +744,16 @@ Array [
|
|
|
694
744
|
className="headerButtons"
|
|
695
745
|
>
|
|
696
746
|
<ProductSort
|
|
747
|
+
availableSortMethods={
|
|
748
|
+
Array [
|
|
749
|
+
Object {
|
|
750
|
+
"attribute": "sortItem.attribute",
|
|
751
|
+
"id": "sortItem.method",
|
|
752
|
+
"sortDirection": "ASC",
|
|
753
|
+
"text": "sortItem.text",
|
|
754
|
+
},
|
|
755
|
+
]
|
|
756
|
+
}
|
|
697
757
|
sortProps={
|
|
698
758
|
Array [
|
|
699
759
|
Object {
|
|
@@ -75,6 +75,14 @@ const defaultProps = {
|
|
|
75
75
|
};
|
|
76
76
|
|
|
77
77
|
const talonProps = {
|
|
78
|
+
availableSortMethods: [
|
|
79
|
+
{
|
|
80
|
+
id: 'sortItem.method',
|
|
81
|
+
text: 'sortItem.text',
|
|
82
|
+
attribute: 'sortItem.attribute',
|
|
83
|
+
sortDirection: 'ASC'
|
|
84
|
+
}
|
|
85
|
+
],
|
|
78
86
|
categoryName: 'Name',
|
|
79
87
|
categoryDescription: 'test',
|
|
80
88
|
filters: {},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { Fragment } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { shape, string } from 'prop-types';
|
|
3
3
|
import { useCategory } from '@magento/peregrine/lib/talons/RootComponents/Category';
|
|
4
4
|
import { useStyle } from '../../classify';
|
|
5
5
|
|
|
@@ -10,10 +10,10 @@ import { GET_PAGE_SIZE } from './category.gql';
|
|
|
10
10
|
import ErrorView from '@magento/venia-ui/lib/components/ErrorView';
|
|
11
11
|
|
|
12
12
|
const Category = props => {
|
|
13
|
-
const {
|
|
13
|
+
const { uid } = props;
|
|
14
14
|
|
|
15
15
|
const talonProps = useCategory({
|
|
16
|
-
id,
|
|
16
|
+
id: uid,
|
|
17
17
|
queries: {
|
|
18
18
|
getPageSize: GET_PAGE_SIZE
|
|
19
19
|
}
|
|
@@ -45,7 +45,7 @@ const Category = props => {
|
|
|
45
45
|
<Fragment>
|
|
46
46
|
<Meta name="description" content={metaDescription} />
|
|
47
47
|
<CategoryContent
|
|
48
|
-
categoryId={
|
|
48
|
+
categoryId={uid}
|
|
49
49
|
classes={classes}
|
|
50
50
|
data={categoryData}
|
|
51
51
|
isLoading={loading}
|
|
@@ -63,11 +63,11 @@ Category.propTypes = {
|
|
|
63
63
|
root: string,
|
|
64
64
|
title: string
|
|
65
65
|
}),
|
|
66
|
-
|
|
66
|
+
uid: string
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
Category.defaultProps = {
|
|
70
|
-
|
|
70
|
+
uid: 'Mg=='
|
|
71
71
|
};
|
|
72
72
|
|
|
73
73
|
export default Category;
|
|
@@ -46,6 +46,7 @@ const CategoryContent = props => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const {
|
|
49
|
+
availableSortMethods,
|
|
49
50
|
categoryName,
|
|
50
51
|
categoryDescription,
|
|
51
52
|
filters,
|
|
@@ -64,7 +65,7 @@ const CategoryContent = props => {
|
|
|
64
65
|
const shouldShowFilterShimmer = filters === null;
|
|
65
66
|
|
|
66
67
|
// If there are no products we can hide the sort button.
|
|
67
|
-
const shouldShowSortButtons = totalPagesFromData;
|
|
68
|
+
const shouldShowSortButtons = totalPagesFromData && availableSortMethods;
|
|
68
69
|
const shouldShowSortShimmer = !totalPagesFromData && isLoading;
|
|
69
70
|
|
|
70
71
|
const maybeFilterButtons = shouldShowFilterButtons ? (
|
|
@@ -84,7 +85,10 @@ const CategoryContent = props => {
|
|
|
84
85
|
) : null;
|
|
85
86
|
|
|
86
87
|
const maybeSortButton = shouldShowSortButtons ? (
|
|
87
|
-
<ProductSort
|
|
88
|
+
<ProductSort
|
|
89
|
+
sortProps={sortProps}
|
|
90
|
+
availableSortMethods={availableSortMethods}
|
|
91
|
+
/>
|
|
88
92
|
) : shouldShowSortShimmer ? (
|
|
89
93
|
<ProductSortShimmer />
|
|
90
94
|
) : null;
|
|
@@ -149,10 +153,13 @@ const CategoryContent = props => {
|
|
|
149
153
|
<Fragment>
|
|
150
154
|
<Breadcrumbs categoryId={categoryId} />
|
|
151
155
|
<StoreTitle>{categoryName}</StoreTitle>
|
|
152
|
-
<article className={classes.root}>
|
|
156
|
+
<article className={classes.root} data-cy="CategoryContent-root">
|
|
153
157
|
<div className={classes.categoryHeader}>
|
|
154
158
|
<h1 className={classes.title}>
|
|
155
|
-
<div
|
|
159
|
+
<div
|
|
160
|
+
className={classes.categoryTitle}
|
|
161
|
+
data-cy="CategoryContent-categoryTitle"
|
|
162
|
+
>
|
|
156
163
|
{categoryTitle}
|
|
157
164
|
</div>
|
|
158
165
|
</h1>
|
|
@@ -8,7 +8,10 @@ import { useStyle } from '../../classify';
|
|
|
8
8
|
import defaultClasses from './section.module.css';
|
|
9
9
|
|
|
10
10
|
const Section = props => {
|
|
11
|
-
const { children, id, title } = props;
|
|
11
|
+
const { children, id, title, ...restProps } = props;
|
|
12
|
+
|
|
13
|
+
// Remove isOpen from restProps to avoid having it in the root container
|
|
14
|
+
delete restProps.isOpen;
|
|
12
15
|
|
|
13
16
|
const { handleSectionToggle, openSectionIds } = useAccordionContext();
|
|
14
17
|
|
|
@@ -27,9 +30,10 @@ const Section = props => {
|
|
|
27
30
|
: classes.contents_container_closed;
|
|
28
31
|
|
|
29
32
|
return (
|
|
30
|
-
<div className={classes.root}>
|
|
33
|
+
<div className={classes.root} {...restProps}>
|
|
31
34
|
<button
|
|
32
35
|
className={classes.title_container}
|
|
36
|
+
data-cy="Section-titleContainer"
|
|
33
37
|
onClick={handleSectionToggleWithId}
|
|
34
38
|
type="button"
|
|
35
39
|
>
|