@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
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import React, { Fragment } from 'react';
|
|
1
|
+
import React, { Fragment, useEffect, useRef } from 'react';
|
|
2
2
|
import { FormattedMessage, useIntl } from 'react-intl';
|
|
3
3
|
import { Form } from 'informed';
|
|
4
4
|
import { func, shape, string, arrayOf, number } from 'prop-types';
|
|
5
|
+
import { AlertCircle } from 'react-feather';
|
|
5
6
|
import { useGuestForm } from '@magento/peregrine/lib/talons/CheckoutPage/ShippingInformation/AddressForm/useGuestForm';
|
|
7
|
+
import { useToasts } from '@magento/peregrine';
|
|
6
8
|
|
|
7
9
|
import { useStyle } from '../../../../classify';
|
|
8
10
|
import { isRequired } from '../../../../util/formValidators';
|
|
@@ -13,22 +15,29 @@ import FormError from '../../../FormError';
|
|
|
13
15
|
import Region from '../../../Region';
|
|
14
16
|
import Postcode from '../../../Postcode';
|
|
15
17
|
import TextInput from '../../../TextInput';
|
|
18
|
+
import Icon from '../../../Icon';
|
|
16
19
|
import defaultClasses from './guestForm.module.css';
|
|
17
20
|
|
|
21
|
+
const AlertCircleIcon = <Icon src={AlertCircle} attrs={{ width: 20 }} />;
|
|
22
|
+
|
|
18
23
|
const GuestForm = props => {
|
|
19
24
|
const {
|
|
20
25
|
afterSubmit,
|
|
21
26
|
classes: propClasses,
|
|
22
27
|
onCancel,
|
|
23
28
|
onSuccess,
|
|
24
|
-
shippingData
|
|
29
|
+
shippingData,
|
|
30
|
+
toggleSignInContent,
|
|
31
|
+
setGuestSignInUsername
|
|
25
32
|
} = props;
|
|
26
33
|
|
|
27
34
|
const talonProps = useGuestForm({
|
|
28
35
|
afterSubmit,
|
|
29
36
|
onCancel,
|
|
30
37
|
onSuccess,
|
|
31
|
-
shippingData
|
|
38
|
+
shippingData,
|
|
39
|
+
toggleSignInContent,
|
|
40
|
+
setGuestSignInUsername
|
|
32
41
|
});
|
|
33
42
|
const {
|
|
34
43
|
errors,
|
|
@@ -36,9 +45,19 @@ const GuestForm = props => {
|
|
|
36
45
|
handleSubmit,
|
|
37
46
|
initialValues,
|
|
38
47
|
isSaving,
|
|
39
|
-
isUpdate
|
|
48
|
+
isUpdate,
|
|
49
|
+
handleValidateEmail,
|
|
50
|
+
showSignInToast,
|
|
51
|
+
handleToastAction
|
|
40
52
|
} = talonProps;
|
|
41
53
|
|
|
54
|
+
const formApiRef = useRef();
|
|
55
|
+
const getFormApi = api => {
|
|
56
|
+
formApiRef.current = api;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const [, { addToast }] = useToasts();
|
|
60
|
+
|
|
42
61
|
const { formatMessage } = useIntl();
|
|
43
62
|
const classes = useStyle(defaultClasses, propClasses);
|
|
44
63
|
|
|
@@ -77,13 +96,45 @@ const GuestForm = props => {
|
|
|
77
96
|
type: 'submit'
|
|
78
97
|
};
|
|
79
98
|
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (showSignInToast) {
|
|
101
|
+
addToast({
|
|
102
|
+
type: 'info',
|
|
103
|
+
icon: AlertCircleIcon,
|
|
104
|
+
message: formatMessage({
|
|
105
|
+
id: 'checkoutPage.suggestSignInMessage',
|
|
106
|
+
defaultMessage:
|
|
107
|
+
'The email you provided is associated with an existing Venia account. Would you like to sign into this account?'
|
|
108
|
+
}),
|
|
109
|
+
timeout: false,
|
|
110
|
+
dismissable: true,
|
|
111
|
+
hasDismissAction: true,
|
|
112
|
+
dismissActionText: formatMessage({
|
|
113
|
+
id: 'checkoutPage.suggestSignInDeclineMessage',
|
|
114
|
+
defaultMessage: 'No, thanks'
|
|
115
|
+
}),
|
|
116
|
+
actionText: formatMessage({
|
|
117
|
+
id: 'checkoutPage.suggestSignInConfirmMessage',
|
|
118
|
+
defaultMessage: 'Yes, sign in'
|
|
119
|
+
}),
|
|
120
|
+
onAction: removeToast =>
|
|
121
|
+
handleToastAction(
|
|
122
|
+
removeToast,
|
|
123
|
+
formApiRef.current.getValue('email')
|
|
124
|
+
)
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}, [addToast, formatMessage, showSignInToast, handleToastAction]);
|
|
128
|
+
|
|
80
129
|
return (
|
|
81
130
|
<Fragment>
|
|
82
131
|
<FormError errors={Array.from(errors.values())} />
|
|
83
132
|
<Form
|
|
84
133
|
className={classes.root}
|
|
134
|
+
data-cy="GuestForm-root"
|
|
85
135
|
initialValues={initialValues}
|
|
86
136
|
onSubmit={handleSubmit}
|
|
137
|
+
getApi={getFormApi}
|
|
87
138
|
>
|
|
88
139
|
<div className={classes.email}>
|
|
89
140
|
<Field
|
|
@@ -94,9 +145,22 @@ const GuestForm = props => {
|
|
|
94
145
|
})}
|
|
95
146
|
>
|
|
96
147
|
<TextInput
|
|
148
|
+
autoComplete="off"
|
|
97
149
|
field="email"
|
|
98
150
|
id="email"
|
|
151
|
+
data-cy="GuestForm-email"
|
|
99
152
|
validate={isRequired}
|
|
153
|
+
onBlur={() =>
|
|
154
|
+
handleValidateEmail(
|
|
155
|
+
formApiRef.current.getValue('email')
|
|
156
|
+
)
|
|
157
|
+
}
|
|
158
|
+
onPaste={e => {
|
|
159
|
+
const text = e.clipboardData.getData(
|
|
160
|
+
'text/plain'
|
|
161
|
+
);
|
|
162
|
+
handleValidateEmail(text);
|
|
163
|
+
}}
|
|
100
164
|
/>
|
|
101
165
|
{guestEmailMessage}
|
|
102
166
|
</Field>
|
|
@@ -112,6 +176,7 @@ const GuestForm = props => {
|
|
|
112
176
|
<TextInput
|
|
113
177
|
field="firstname"
|
|
114
178
|
id="firstname"
|
|
179
|
+
data-cy="GuestForm-firstName"
|
|
115
180
|
validate={isRequired}
|
|
116
181
|
/>
|
|
117
182
|
</Field>
|
|
@@ -127,12 +192,16 @@ const GuestForm = props => {
|
|
|
127
192
|
<TextInput
|
|
128
193
|
field="lastname"
|
|
129
194
|
id="lastname"
|
|
195
|
+
data-cy="GuestForm-lastName"
|
|
130
196
|
validate={isRequired}
|
|
131
197
|
/>
|
|
132
198
|
</Field>
|
|
133
199
|
</div>
|
|
134
200
|
<div className={classes.country}>
|
|
135
|
-
<Country
|
|
201
|
+
<Country
|
|
202
|
+
validate={isRequired}
|
|
203
|
+
data-cy="GuestForm-country"
|
|
204
|
+
/>
|
|
136
205
|
</div>
|
|
137
206
|
<div className={classes.street0}>
|
|
138
207
|
<Field
|
|
@@ -145,6 +214,7 @@ const GuestForm = props => {
|
|
|
145
214
|
<TextInput
|
|
146
215
|
field="street[0]"
|
|
147
216
|
id="street0"
|
|
217
|
+
data-cy="GuestForm-street0"
|
|
148
218
|
validate={isRequired}
|
|
149
219
|
/>
|
|
150
220
|
</Field>
|
|
@@ -158,7 +228,11 @@ const GuestForm = props => {
|
|
|
158
228
|
})}
|
|
159
229
|
optional={true}
|
|
160
230
|
>
|
|
161
|
-
<TextInput
|
|
231
|
+
<TextInput
|
|
232
|
+
field="street[1]"
|
|
233
|
+
id="street1"
|
|
234
|
+
data-cy="GuestForm-street1"
|
|
235
|
+
/>
|
|
162
236
|
</Field>
|
|
163
237
|
</div>
|
|
164
238
|
<div className={classes.city}>
|
|
@@ -172,6 +246,7 @@ const GuestForm = props => {
|
|
|
172
246
|
<TextInput
|
|
173
247
|
field="city"
|
|
174
248
|
id="city"
|
|
249
|
+
data-cy="GuestForm-city"
|
|
175
250
|
validate={isRequired}
|
|
176
251
|
/>
|
|
177
252
|
</Field>
|
|
@@ -182,10 +257,14 @@ const GuestForm = props => {
|
|
|
182
257
|
fieldInput={'region[region]'}
|
|
183
258
|
fieldSelect={'region[region_id]'}
|
|
184
259
|
optionValueKey={'id'}
|
|
260
|
+
data-cy="GuestForm-region"
|
|
185
261
|
/>
|
|
186
262
|
</div>
|
|
187
263
|
<div className={classes.postcode}>
|
|
188
|
-
<Postcode
|
|
264
|
+
<Postcode
|
|
265
|
+
validate={isRequired}
|
|
266
|
+
data-cy="GuestForm-postcode"
|
|
267
|
+
/>
|
|
189
268
|
</div>
|
|
190
269
|
<div className={classes.telephone}>
|
|
191
270
|
<Field
|
|
@@ -198,13 +277,19 @@ const GuestForm = props => {
|
|
|
198
277
|
<TextInput
|
|
199
278
|
field="telephone"
|
|
200
279
|
id="telephone"
|
|
280
|
+
data-cy="GuestForm-telephone"
|
|
201
281
|
validate={isRequired}
|
|
202
282
|
/>
|
|
203
283
|
</Field>
|
|
204
284
|
</div>
|
|
205
285
|
<div className={classes.buttons}>
|
|
206
286
|
{cancelButton}
|
|
207
|
-
<Button
|
|
287
|
+
<Button
|
|
288
|
+
{...submitButtonProps}
|
|
289
|
+
data-cy="GuestForm-submitButton"
|
|
290
|
+
>
|
|
291
|
+
{submitButtonText}
|
|
292
|
+
</Button>
|
|
208
293
|
</div>
|
|
209
294
|
</Form>
|
|
210
295
|
</Fragment>
|
|
@@ -260,5 +345,7 @@ GuestForm.propTypes = {
|
|
|
260
345
|
}).isRequired,
|
|
261
346
|
street: arrayOf(string),
|
|
262
347
|
telephone: string
|
|
263
|
-
})
|
|
348
|
+
}),
|
|
349
|
+
toggleSignInContent: func.isRequired,
|
|
350
|
+
setGuestSignInUsername: func.isRequired
|
|
264
351
|
};
|
|
@@ -28,7 +28,7 @@ const Card = props => {
|
|
|
28
28
|
const additionalAddressString = `${city}, ${region} ${postcode} ${country}`;
|
|
29
29
|
|
|
30
30
|
return (
|
|
31
|
-
<div className={classes.root}>
|
|
31
|
+
<div className={classes.root} data-cy="Card-root">
|
|
32
32
|
<span>{email}</span>
|
|
33
33
|
<span>{nameString}</span>
|
|
34
34
|
<span>{telephone}</span>
|
|
@@ -19,7 +19,9 @@ const ShippingInformation = props => {
|
|
|
19
19
|
classes: propClasses,
|
|
20
20
|
onSave,
|
|
21
21
|
onSuccess,
|
|
22
|
-
toggleActiveContent
|
|
22
|
+
toggleActiveContent,
|
|
23
|
+
toggleSignInContent,
|
|
24
|
+
setGuestSignInUsername
|
|
23
25
|
} = props;
|
|
24
26
|
const talonProps = useShippingInformation({
|
|
25
27
|
onSave,
|
|
@@ -71,6 +73,7 @@ const ShippingInformation = props => {
|
|
|
71
73
|
<LinkButton
|
|
72
74
|
onClick={handleEditShipping}
|
|
73
75
|
className={classes.editButton}
|
|
76
|
+
data-cy="ShippingInformation-editButton"
|
|
74
77
|
>
|
|
75
78
|
<Icon
|
|
76
79
|
size={16}
|
|
@@ -100,12 +103,18 @@ const ShippingInformation = props => {
|
|
|
100
103
|
<AddressForm
|
|
101
104
|
onSuccess={onSuccess}
|
|
102
105
|
shippingData={shippingData}
|
|
106
|
+
toggleSignInContent={toggleSignInContent}
|
|
107
|
+
setGuestSignInUsername={setGuestSignInUsername}
|
|
103
108
|
/>
|
|
104
109
|
</div>
|
|
105
110
|
</Fragment>
|
|
106
111
|
);
|
|
107
112
|
|
|
108
|
-
return
|
|
113
|
+
return (
|
|
114
|
+
<div className={rootClassName} data-cy="ShippingInformation-root">
|
|
115
|
+
{shippingInformation}
|
|
116
|
+
</div>
|
|
117
|
+
);
|
|
109
118
|
};
|
|
110
119
|
|
|
111
120
|
export default ShippingInformation;
|
|
@@ -124,5 +133,7 @@ ShippingInformation.propTypes = {
|
|
|
124
133
|
}),
|
|
125
134
|
onSave: func.isRequired,
|
|
126
135
|
onSuccess: func.isRequired,
|
|
127
|
-
toggleActiveContent: func.isRequired
|
|
136
|
+
toggleActiveContent: func.isRequired,
|
|
137
|
+
toggleSignInContent: func.isRequired,
|
|
138
|
+
setGuestSignInUsername: func.isRequired
|
|
128
139
|
};
|
|
@@ -58,7 +58,7 @@ const ShippingMethod = props => {
|
|
|
58
58
|
|
|
59
59
|
contents = (
|
|
60
60
|
<Fragment>
|
|
61
|
-
<div className={classes.done}>
|
|
61
|
+
<div className={classes.done} data-cy="ShippingMethod-done">
|
|
62
62
|
<CompletedView
|
|
63
63
|
selectedShippingMethod={selectedShippingMethod}
|
|
64
64
|
showUpdateMode={showUpdateMode}
|
|
@@ -100,6 +100,7 @@ const ShippingMethod = props => {
|
|
|
100
100
|
/>
|
|
101
101
|
<div className={classes.formButtons}>
|
|
102
102
|
<Button
|
|
103
|
+
data-cy="ShippingMethod-submitButton"
|
|
103
104
|
priority="normal"
|
|
104
105
|
type="submit"
|
|
105
106
|
disabled={pageIsUpdating || isLoading}
|
|
@@ -53,7 +53,9 @@ exports[`CheckoutPage renders address book for customer 1`] = `
|
|
|
53
53
|
/>
|
|
54
54
|
<ShippingInformation
|
|
55
55
|
onSave={[MockFunction setShippingInformationDone]}
|
|
56
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
56
57
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
58
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
57
59
|
/>
|
|
58
60
|
</div>
|
|
59
61
|
<div
|
|
@@ -193,7 +195,9 @@ exports[`CheckoutPage renders an error and disables review order button if there
|
|
|
193
195
|
/>
|
|
194
196
|
<ShippingInformation
|
|
195
197
|
onSave={[MockFunction setShippingInformationDone]}
|
|
198
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
196
199
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
200
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
197
201
|
/>
|
|
198
202
|
</div>
|
|
199
203
|
<div
|
|
@@ -257,6 +261,11 @@ exports[`CheckoutPage renders an error and disables review order button if there
|
|
|
257
261
|
</div>
|
|
258
262
|
</div>
|
|
259
263
|
<GuestSignIn
|
|
264
|
+
initialValues={
|
|
265
|
+
Object {
|
|
266
|
+
"email": "",
|
|
267
|
+
}
|
|
268
|
+
}
|
|
260
269
|
isActive={false}
|
|
261
270
|
toggleActiveContent={[MockFunction toggleSignInContent]}
|
|
262
271
|
/>
|
|
@@ -316,7 +325,9 @@ exports[`CheckoutPage renders checkout content for customer - default address 1`
|
|
|
316
325
|
/>
|
|
317
326
|
<ShippingInformation
|
|
318
327
|
onSave={[MockFunction setShippingInformationDone]}
|
|
328
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
319
329
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
330
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
320
331
|
/>
|
|
321
332
|
</div>
|
|
322
333
|
<div
|
|
@@ -414,7 +425,9 @@ exports[`CheckoutPage renders checkout content for customer - no default address
|
|
|
414
425
|
/>
|
|
415
426
|
<ShippingInformation
|
|
416
427
|
onSave={[MockFunction setShippingInformationDone]}
|
|
428
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
417
429
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
430
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
418
431
|
/>
|
|
419
432
|
</div>
|
|
420
433
|
<div
|
|
@@ -550,7 +563,9 @@ exports[`CheckoutPage renders checkout content for guest on desktop 1`] = `
|
|
|
550
563
|
/>
|
|
551
564
|
<ShippingInformation
|
|
552
565
|
onSave={[MockFunction setShippingInformationDone]}
|
|
566
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
553
567
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
568
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
554
569
|
/>
|
|
555
570
|
</div>
|
|
556
571
|
<div
|
|
@@ -589,6 +604,11 @@ exports[`CheckoutPage renders checkout content for guest on desktop 1`] = `
|
|
|
589
604
|
</div>
|
|
590
605
|
</div>
|
|
591
606
|
<GuestSignIn
|
|
607
|
+
initialValues={
|
|
608
|
+
Object {
|
|
609
|
+
"email": "",
|
|
610
|
+
}
|
|
611
|
+
}
|
|
592
612
|
isActive={false}
|
|
593
613
|
toggleActiveContent={[MockFunction toggleSignInContent]}
|
|
594
614
|
/>
|
|
@@ -686,7 +706,9 @@ exports[`CheckoutPage renders checkout content for guest on mobile 1`] = `
|
|
|
686
706
|
/>
|
|
687
707
|
<ShippingInformation
|
|
688
708
|
onSave={[MockFunction setShippingInformationDone]}
|
|
709
|
+
setGuestSignInUsername={[MockFunction setGuestSignInUsername]}
|
|
689
710
|
toggleActiveContent={[MockFunction toggleAddressBookContent]}
|
|
711
|
+
toggleSignInContent={[MockFunction toggleSignInContent]}
|
|
690
712
|
/>
|
|
691
713
|
</div>
|
|
692
714
|
<div
|
|
@@ -725,6 +747,11 @@ exports[`CheckoutPage renders checkout content for guest on mobile 1`] = `
|
|
|
725
747
|
</div>
|
|
726
748
|
</div>
|
|
727
749
|
<GuestSignIn
|
|
750
|
+
initialValues={
|
|
751
|
+
Object {
|
|
752
|
+
"email": "",
|
|
753
|
+
}
|
|
754
|
+
}
|
|
728
755
|
isActive={false}
|
|
729
756
|
toggleActiveContent={[MockFunction toggleSignInContent]}
|
|
730
757
|
/>
|
|
@@ -756,6 +783,11 @@ exports[`CheckoutPage renders empty cart 1`] = `
|
|
|
756
783
|
</h3>
|
|
757
784
|
</div>
|
|
758
785
|
<GuestSignIn
|
|
786
|
+
initialValues={
|
|
787
|
+
Object {
|
|
788
|
+
"email": "",
|
|
789
|
+
}
|
|
790
|
+
}
|
|
759
791
|
isActive={false}
|
|
760
792
|
toggleActiveContent={[MockFunction toggleSignInContent]}
|
|
761
793
|
/>
|
|
@@ -65,6 +65,7 @@ const defaultTalonProps = {
|
|
|
65
65
|
checkoutStep: 1,
|
|
66
66
|
customer: null,
|
|
67
67
|
error: false,
|
|
68
|
+
guestSignInUsername: '',
|
|
68
69
|
handleSignIn: jest.fn().mockName('handleSignIn'),
|
|
69
70
|
handlePlaceOrder: jest.fn().mockName('handlePlaceOrder'),
|
|
70
71
|
hasError: false,
|
|
@@ -76,6 +77,7 @@ const defaultTalonProps = {
|
|
|
76
77
|
orderDetailsLoading: false,
|
|
77
78
|
orderNumber: null,
|
|
78
79
|
placeOrderLoading: false,
|
|
80
|
+
setGuestSignInUsername: jest.fn().mockName('setGuestSignInUsername'),
|
|
79
81
|
setIsUpdating: jest.fn().mockName('setIsUpdating'),
|
|
80
82
|
setShippingInformationDone: jest
|
|
81
83
|
.fn()
|
|
@@ -49,6 +49,7 @@ const CheckoutPage = props => {
|
|
|
49
49
|
checkoutStep,
|
|
50
50
|
customer,
|
|
51
51
|
error,
|
|
52
|
+
guestSignInUsername,
|
|
52
53
|
handlePlaceOrder,
|
|
53
54
|
hasError,
|
|
54
55
|
isCartEmpty,
|
|
@@ -60,6 +61,7 @@ const CheckoutPage = props => {
|
|
|
60
61
|
orderNumber,
|
|
61
62
|
placeOrderLoading,
|
|
62
63
|
setCheckoutStep,
|
|
64
|
+
setGuestSignInUsername,
|
|
63
65
|
setIsUpdating,
|
|
64
66
|
setShippingInformationDone,
|
|
65
67
|
scrollShippingInformationIntoView,
|
|
@@ -131,7 +133,12 @@ const CheckoutPage = props => {
|
|
|
131
133
|
checkoutContent = (
|
|
132
134
|
<div className={classes.empty_cart_container}>
|
|
133
135
|
<div className={classes.heading_container}>
|
|
134
|
-
<h1
|
|
136
|
+
<h1
|
|
137
|
+
className={classes.heading}
|
|
138
|
+
data-cy="ChekoutPage-heading"
|
|
139
|
+
>
|
|
140
|
+
{heading}
|
|
141
|
+
</h1>
|
|
135
142
|
</div>
|
|
136
143
|
<h3>
|
|
137
144
|
<FormattedMessage
|
|
@@ -152,6 +159,7 @@ const CheckoutPage = props => {
|
|
|
152
159
|
</span>
|
|
153
160
|
<Button
|
|
154
161
|
className={classes.signInButton}
|
|
162
|
+
data-cy="CheckoutPage-signInButton"
|
|
155
163
|
onClick={toggleSignInContent}
|
|
156
164
|
priority="normal"
|
|
157
165
|
>
|
|
@@ -231,6 +239,7 @@ const CheckoutPage = props => {
|
|
|
231
239
|
onClick={handleReviewOrder}
|
|
232
240
|
priority="high"
|
|
233
241
|
className={classes.review_order_button}
|
|
242
|
+
data-cy="CheckoutPage-reviewOrderButton"
|
|
234
243
|
disabled={
|
|
235
244
|
reviewOrderButtonClicked ||
|
|
236
245
|
isUpdating ||
|
|
@@ -257,6 +266,7 @@ const CheckoutPage = props => {
|
|
|
257
266
|
onClick={handlePlaceOrder}
|
|
258
267
|
priority="high"
|
|
259
268
|
className={classes.place_order_button}
|
|
269
|
+
data-cy="CheckoutPage-placeOrderButton"
|
|
260
270
|
disabled={
|
|
261
271
|
isUpdating || placeOrderLoading || orderDetailsLoading
|
|
262
272
|
}
|
|
@@ -293,7 +303,10 @@ const CheckoutPage = props => {
|
|
|
293
303
|
});
|
|
294
304
|
} else {
|
|
295
305
|
headerText = formatMessage(
|
|
296
|
-
{
|
|
306
|
+
{
|
|
307
|
+
id: 'checkoutPage.greeting',
|
|
308
|
+
defaultMessage: 'Welcome {firstname}!'
|
|
309
|
+
},
|
|
297
310
|
{ firstname: customer.firstname }
|
|
298
311
|
);
|
|
299
312
|
}
|
|
@@ -332,7 +345,12 @@ const CheckoutPage = props => {
|
|
|
332
345
|
cartItems={cartItems}
|
|
333
346
|
message={stockStatusMessageElement}
|
|
334
347
|
/>
|
|
335
|
-
<h1
|
|
348
|
+
<h1
|
|
349
|
+
className={classes.heading}
|
|
350
|
+
data-cy="ChekoutPage-headerText"
|
|
351
|
+
>
|
|
352
|
+
{headerText}
|
|
353
|
+
</h1>
|
|
336
354
|
</div>
|
|
337
355
|
{signInContainerElement}
|
|
338
356
|
<div className={classes.shipping_information_container}>
|
|
@@ -341,6 +359,8 @@ const CheckoutPage = props => {
|
|
|
341
359
|
onSave={setShippingInformationDone}
|
|
342
360
|
onSuccess={scrollShippingInformationIntoView}
|
|
343
361
|
toggleActiveContent={toggleAddressBookContent}
|
|
362
|
+
toggleSignInContent={toggleSignInContent}
|
|
363
|
+
setGuestSignInUsername={setGuestSignInUsername}
|
|
344
364
|
/>
|
|
345
365
|
</ScrollAnchor>
|
|
346
366
|
</div>
|
|
@@ -371,13 +391,15 @@ const CheckoutPage = props => {
|
|
|
371
391
|
|
|
372
392
|
const signInElement = isGuestCheckout ? (
|
|
373
393
|
<GuestSignIn
|
|
394
|
+
key={guestSignInUsername}
|
|
374
395
|
isActive={activeContent === 'signIn'}
|
|
375
396
|
toggleActiveContent={toggleSignInContent}
|
|
397
|
+
initialValues={{ email: guestSignInUsername }}
|
|
376
398
|
/>
|
|
377
399
|
) : null;
|
|
378
400
|
|
|
379
401
|
return (
|
|
380
|
-
<div className={classes.root}>
|
|
402
|
+
<div className={classes.root} data-cy="CheckoutPage-root">
|
|
381
403
|
<StoreTitle>
|
|
382
404
|
{formatMessage({
|
|
383
405
|
id: 'checkoutPage.titleCheckout',
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`it renders 1`] = `
|
|
4
|
+
<article>
|
|
5
|
+
<div>
|
|
6
|
+
<Shimmer
|
|
7
|
+
classes={
|
|
8
|
+
Object {
|
|
9
|
+
"root_rectangle": undefined,
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
/>
|
|
13
|
+
</div>
|
|
14
|
+
<div>
|
|
15
|
+
<div>
|
|
16
|
+
<div>
|
|
17
|
+
<Shimmer
|
|
18
|
+
classes={
|
|
19
|
+
Object {
|
|
20
|
+
"root_rectangle": "shimmer-class",
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
>
|
|
24
|
+
|
|
25
|
+
</Shimmer>
|
|
26
|
+
</div>
|
|
27
|
+
<div>
|
|
28
|
+
<Shimmer
|
|
29
|
+
classes={
|
|
30
|
+
Object {
|
|
31
|
+
"root_rectangle": "shimmer-class",
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
>
|
|
35
|
+
|
|
36
|
+
</Shimmer>
|
|
37
|
+
</div>
|
|
38
|
+
<div>
|
|
39
|
+
<div>
|
|
40
|
+
<Shimmer
|
|
41
|
+
classes={
|
|
42
|
+
Object {
|
|
43
|
+
"root_rectangle": undefined,
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
>
|
|
47
|
+
|
|
48
|
+
</Shimmer>
|
|
49
|
+
<Shimmer
|
|
50
|
+
type="textInput"
|
|
51
|
+
/>
|
|
52
|
+
</div>
|
|
53
|
+
<div>
|
|
54
|
+
<Shimmer
|
|
55
|
+
classes={
|
|
56
|
+
Object {
|
|
57
|
+
"root_rectangle": undefined,
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
>
|
|
61
|
+
|
|
62
|
+
</Shimmer>
|
|
63
|
+
<Shimmer
|
|
64
|
+
type="textInput"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<Shimmer
|
|
69
|
+
classes={
|
|
70
|
+
Object {
|
|
71
|
+
"root_rectangle": undefined,
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
>
|
|
75
|
+
|
|
76
|
+
</Shimmer>
|
|
77
|
+
<Shimmer
|
|
78
|
+
type="textInput"
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<Shimmer
|
|
83
|
+
classes={
|
|
84
|
+
Object {
|
|
85
|
+
"root_rectangle": undefined,
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
>
|
|
89
|
+
|
|
90
|
+
</Shimmer>
|
|
91
|
+
<Shimmer
|
|
92
|
+
type="textArea"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
<div>
|
|
96
|
+
<Shimmer
|
|
97
|
+
type="button"
|
|
98
|
+
/>
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
<div>
|
|
103
|
+
<Shimmer
|
|
104
|
+
classes={
|
|
105
|
+
Object {
|
|
106
|
+
"root_rectangle": undefined,
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/>
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
</article>
|
|
113
|
+
`;
|