@shopgate/engage 7.31.4-beta.1 → 7.32.0-beta.1
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/account/components/Account/Account.d.ts.map +1 -1
- package/account/components/Account/Account.js +4 -3
- package/account/components/Profile/Profile.provider.d.ts +1 -1
- package/account/components/Profile/Profile.provider.js +1 -1
- package/account/components/Profile/ProfileAddressBook.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressBook.js +9 -11
- package/account/components/Profile/ProfileAddressCard.d.ts.map +1 -1
- package/account/components/Profile/ProfileAddressCard.js +36 -33
- package/account/components/Profile/ProfileForm.js +4 -4
- package/account/components/Profile/ProfileHeader.d.ts.map +1 -1
- package/account/components/Profile/ProfileHeader.js +8 -9
- package/account/components/ProfileContact/ProfileContact.js +4 -3
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.d.ts +7 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.d.ts.map +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/FrontendSettingsPreviewBridge.js +42 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/helpers.d.ts +20 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/helpers.d.ts.map +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/helpers.js +49 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/index.d.ts +2 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/index.d.ts.map +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/index.js +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts +14 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.d.ts.map +1 -0
- package/admin-preview/components/FrontendSettingsPreviewBridge/types.js +1 -0
- package/admin-preview/components/index.d.ts +2 -0
- package/admin-preview/components/index.d.ts.map +1 -0
- package/admin-preview/components/index.js +1 -0
- package/admin-preview/constants/index.d.ts +18 -0
- package/admin-preview/constants/index.d.ts.map +1 -0
- package/admin-preview/constants/index.js +22 -0
- package/admin-preview/helpers/index.d.ts +16 -0
- package/admin-preview/helpers/index.d.ts.map +1 -0
- package/admin-preview/helpers/index.js +19 -0
- package/admin-preview/hooks/index.d.ts +36 -0
- package/admin-preview/hooks/index.d.ts.map +1 -0
- package/admin-preview/hooks/index.js +74 -0
- package/back-in-stock/components/BackInStockButton/index.js +16 -19
- package/back-in-stock/components/Subscriptions/components/Subscription/index.js +20 -21
- package/cart/components/CartHeaderWide/CartHeaderWide.js +4 -3
- package/cart/components/CartItem/CartItemCoupon.js +2 -6
- package/cart/components/CartItem/CartItemCouponDelete.js +3 -3
- package/cart/components/CartItem/CartItemCouponLayout.js +1 -1
- package/cart/components/CartItem/CartItemCouponPrice.js +16 -19
- package/cart/components/CartItem/CartItemCouponTitle.js +4 -4
- package/cart/components/CartItem/CartItemProduct.js +2 -6
- package/cart/components/CartItem/CartItemProductLayout.js +4 -8
- package/cart/components/CartItem/CartItemProductLayoutWide.js +19 -14
- package/cart/components/CartItem/CartItemProductLayoutWideFulfillmentLabel.js +5 -3
- package/cart/components/CartItem/CartItemProductLayoutWideOrderDetails.js +18 -12
- package/cart/components/CartItem/CartItemProductLayoutWideRemoveItem.js +1 -1
- package/cart/components/CartItem/CartItemProductOrderDetails.js +2 -2
- package/cart/components/CartItem/CartItemProductPriceCaption.js +5 -4
- package/cart/components/CartItem/CartItemProductPriceList.js +18 -12
- package/cart/components/CartItem/CartItemProductPriceListPromotion.js +7 -7
- package/cart/components/CartItem/CartItemProductTitle.js +2 -3
- package/cart/components/CartItem/CartItemQuantityPicker.js +2 -7
- package/cart/components/CartItem/CartItemSubstitution.js +1 -2
- package/cart/components/CartItems/CartItemCard.js +3 -4
- package/cart/components/CartItems/CartItemCardReservationAccordion.js +9 -10
- package/cart/components/CartItems/CartItemCardReservationLabel.js +11 -11
- package/cart/components/CartItems/CartItemCardReservationLabelChangeStore.js +3 -3
- package/cart/components/CartItems/CartItemGroupReservation.js +4 -3
- package/cart/components/CartItems/CartItemGroupReservationLabel.js +12 -10
- package/cart/components/CartItems/CartItemGroupShipping.js +7 -5
- package/cart/components/CartItems/CartItems.js +2 -4
- package/cart/components/CartItems/CartItemsHeaderWide.js +43 -18
- package/cart/components/CartSummaryWide/CartSummaryWide.js +9 -16
- package/cart/components/CartSummaryWide/CartSummaryWideCheckoutButton.js +4 -8
- package/cart/components/PaymentBar/PaymentBarCheckoutButton.js +6 -10
- package/cart/components/PaymentBar/PaymentBarContent.js +3 -9
- package/cart/components/PaymentBar/PaymentBarPromotionCouponMessages.js +6 -2
- package/cart/components/PaymentBar/PaymentBarPromotionCoupons.js +5 -5
- package/cart/components/PaymentBar/PaymentBarPromotionalText.js +9 -10
- package/cart/components/PaymentBar/PaymentBarReserveButton.js +6 -10
- package/cart/components/PaymentBar/testUtils/mockFactories.js +64 -0
- package/cart/components/Substitution/connector.js +1 -1
- package/cart/components/SupplementalContent/SupplementalContent.connector.js +2 -1
- package/cart/components/SupplementalContent/SupplementalContent.js +6 -7
- package/category/components/CategoryImage/connector.js +1 -1
- package/category/components/CategoryList/index.js +4 -8
- package/checkout/components/AddressBook/AddressList.js +9 -10
- package/checkout/components/AddressBookContact/AddressBookContact.js +6 -6
- package/checkout/components/Checkout/CheckoutAddress.js +25 -15
- package/checkout/components/Checkout/CheckoutHeader.js +9 -11
- package/checkout/components/Checkout/CheckoutPickupContactForm.js +2 -2
- package/checkout/components/Checkout/CheckoutSection.js +22 -15
- package/checkout/components/Checkout/CheckoutSectionInfo.js +14 -17
- package/checkout/components/Checkout/CheckoutSectionMessages.js +5 -4
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmation.js +15 -14
- package/checkout/components/CheckoutConfirmation/CheckoutConfirmationSection.js +44 -62
- package/checkout/components/GuestCheckout/GuestCheckoutPickup.js +7 -4
- package/checkout/components/PaymentMethodButton/PaymentMethodButton.js +3 -3
- package/checkout/components/ResponsiveBackButton/ResponsiveBackButton.js +2 -2
- package/checkout/components/ShippingMethods/ShippingMethod.js +6 -5
- package/checkout/components/ShippingMethods/ShippingMethods.js +11 -8
- package/checkout/components/SupplementalContent/SupplementalContent.connector.js +2 -1
- package/checkout/components/SupplementalContent/SupplementalContent.js +6 -7
- package/checkout/paymentMethods/index.js +5 -4
- package/checkout/paymentMethods/paypal/PaypalPayButton.js +7 -6
- package/checkout/paymentMethods/stripe/StripeCreditCard.js +6 -9
- package/components/ChipLayout/index.js +4 -4
- package/components/Form/Builder/ElementPhoneNumber.d.ts.map +1 -1
- package/components/Form/Builder/ElementPhoneNumber.js +2 -6
- package/components/Form/Builder/stylePresets.d.ts.map +1 -1
- package/components/Form/Builder/stylePresets.js +12 -17
- package/components/Logo/connector.js +3 -1
- package/components/Menu/components/Item/index.d.ts.map +1 -1
- package/components/Menu/components/Item/index.js +5 -17
- package/components/Menu/index.d.ts.map +1 -1
- package/components/Menu/index.js +2 -3
- package/components/MessageBar/MessageBar.d.ts.map +1 -1
- package/components/MessageBar/MessageBar.js +35 -42
- package/components/NavigationHandler/index.d.ts +2 -2
- package/components/Picker/components/Button/index.js +3 -3
- package/components/Picker/components/List/index.js +3 -3
- package/components/Picker/components/Modal/index.d.ts.map +1 -1
- package/components/Picker/components/Modal/index.js +2 -3
- package/components/Picker/spec.js +48 -41
- package/components/PickerUtilize/components/Button/index.d.ts.map +1 -1
- package/components/PickerUtilize/components/Button/index.js +6 -10
- package/components/PickerUtilize/spec.js +6 -3
- package/components/Radio/Radio.js +6 -5
- package/components/ResponsiveContainer/breakpoints.js +2 -2
- package/components/ScrollHeader/index.js +3 -3
- package/components/SheetList/components/Item/index.js +11 -16
- package/components/SheetList/index.d.ts.map +1 -1
- package/components/SheetList/index.js +3 -7
- package/components/SideNavigation/SideNavigationCategories.js +2 -7
- package/components/SideNavigation/SideNavigationCategoriesItem.js +2 -2
- package/components/SideNavigation/SideNavigationContent.js +3 -3
- package/components/SideNavigation/SideNavigationItem.d.ts.map +1 -1
- package/components/SideNavigation/SideNavigationItem.js +3 -4
- package/components/SideNavigation/SideNavigationNestedItem.js +2 -2
- package/components/Switch/index.d.ts.map +1 -1
- package/components/Switch/index.js +6 -7
- package/components/Tabs/components/TabIndicator.js +3 -3
- package/components/TextLink/TextLink.d.ts.map +1 -1
- package/components/TextLink/TextLink.js +8 -26
- package/components/Toggle/index.js +5 -5
- package/components/Typography/Typography.d.ts +87 -124
- package/components/Typography/Typography.d.ts.map +1 -0
- package/components/Typography/Typography.js +72 -57
- package/components/Typography/index.d.ts +2 -1
- package/components/Typography/index.d.ts.map +1 -0
- package/components/View/components/Content/index.js +2 -2
- package/components/View/index.d.ts.map +1 -1
- package/components/View/index.js +1 -5
- package/components/v2/Button/Button.d.ts +1 -1
- package/core/action-creators/merchantSettings.d.ts +1 -1
- package/core/action-creators/merchantSettings.d.ts.map +1 -1
- package/core/action-creators/merchantSettings.js +3 -11
- package/core/action-creators/shopSettings.d.ts +1 -2
- package/core/action-creators/shopSettings.d.ts.map +1 -1
- package/core/action-creators/shopSettings.js +3 -21
- package/core/constants/merchantSettings.d.ts +1 -11
- package/core/constants/merchantSettings.d.ts.map +1 -1
- package/core/constants/merchantSettings.js +3 -11
- package/core/constants/shopSettings.d.ts +1 -27
- package/core/constants/shopSettings.d.ts.map +1 -1
- package/core/constants/shopSettings.js +3 -27
- package/core/helpers/scrollContainer.js +2 -2
- package/core/initialization/index.js +2 -1
- package/core/selectors/merchantSettings.d.ts +1 -20
- package/core/selectors/merchantSettings.d.ts.map +1 -1
- package/core/selectors/merchantSettings.js +3 -33
- package/core/selectors/shopSettings.d.ts +1 -53
- package/core/selectors/shopSettings.d.ts.map +1 -1
- package/core/selectors/shopSettings.js +3 -80
- package/development/components/ClientInformation/ClientInformation.js +5 -3
- package/development/components/DevelopmentSettings/DevelopmentSettings.js +3 -2
- package/development/components/SimulatedInsets/SimulatedInsetTop.js +4 -4
- package/favorites/components/CommentDialog/CommentDialog.js +17 -15
- package/favorites/components/FavoriteButtonWide/FavoriteButtonWide.js +6 -7
- package/favorites/components/Item/Item.d.ts.map +1 -1
- package/favorites/components/Item/Item.js +14 -15
- package/favorites/components/Item/ItemCharacteristics.d.ts.map +1 -1
- package/favorites/components/Item/ItemCharacteristics.js +6 -14
- package/favorites/components/Item/ItemNotes.js +23 -20
- package/favorites/components/Item/ItemQuantity.js +1 -1
- package/favorites/components/List/List.d.ts.map +1 -1
- package/favorites/components/List/List.js +1 -5
- package/favorites/components/ListChooser/ListChooserItem.js +1 -1
- package/favorites/components/Lists/Lists.js +2 -2
- package/favorites/components/Lists/ListsModal.d.ts.map +1 -1
- package/favorites/components/Lists/ListsModal.js +4 -11
- package/favorites/components/RemoveButton/RemoveButton.d.ts.map +1 -1
- package/favorites/components/RemoveButton/RemoveButton.js +1 -2
- package/filter/components/FilterItem/index.js +5 -8
- package/filter/components/FilterItem/spec.js +3 -3
- package/filter/components/FilterPageContent/components/Selector/components/Selected/spec.js +5 -5
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/index.js +3 -3
- package/filter/components/FilterPageContent/components/Selector/components/Toggle/spec.js +5 -5
- package/filter/components/FilterPageContent/components/Selector/components/ValueButton/index.js +4 -5
- package/filter/components/FilterPageContent/components/Selector/spec.js +3 -3
- package/filter/components/PriceSlider/components/Label/index.js +9 -13
- package/filter/components/PriceSlider/components/Label/spec.js +12 -3
- package/filter/components/PriceSlider/index.js +4 -9
- package/filter/components/PriceSlider/spec.js +10 -5
- package/filter/selectors/index.js +2 -2
- package/locations/components/Cart/CartContextMenuChangeFulfillmentContent.js +1 -1
- package/locations/components/ChangeLocationButton/ChangeLocationButton.js +1 -1
- package/locations/components/FulfillmentPath/FulfillmentPathItem.js +1 -7
- package/locations/components/FulfillmentSelector/FulfillmentSelector.connector.js +2 -2
- package/locations/components/FulfillmentSelector/FulfillmentSelectorAlternativeLocation.js +12 -10
- package/locations/components/FulfillmentSelector/FulfillmentSelectorHeader.js +1 -1
- package/locations/components/FulfillmentSelector/FulfillmentSelectorImpossibleError.js +3 -3
- package/locations/components/FulfillmentSelector/FulfillmentSelectorItem.js +4 -4
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocation.js +18 -15
- package/locations/components/FulfillmentSelector/FulfillmentSelectorLocationMethodNotAvailable.js +3 -3
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotDialog.js +22 -21
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotProvider.connector.js +1 -1
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.connector.js +1 -1
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcher.js +4 -4
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherBar.js +13 -13
- package/locations/components/FulfillmentSlotSwitcher/FulfillmentSlotSwitcherDefault.js +12 -15
- package/locations/components/GlobalLocationSelector/GlobalLocationSelector.js +1 -1
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcher.connector.js +1 -1
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherBar.js +12 -12
- package/locations/components/GlobalLocationSwitcher/GlobalLocationSwitcherDefault.js +12 -12
- package/locations/components/ReservationResponses/ReservationError.js +9 -6
- package/locations/components/ReservationResponses/ReservationSuccess.js +14 -9
- package/locations/components/ReserveForm/ReserveForm.js +6 -5
- package/locations/components/ReserveForm/ReserveFormPhone.js +7 -9
- package/locations/components/StockInfo/StockInfo.js +4 -2
- package/locations/components/StockInfoLists/index.js +5 -7
- package/locations/components/StoreDetails/components/FindMoreStores.js +11 -12
- package/locations/components/StoreDetails/components/GetDirectionsButton.js +3 -5
- package/locations/components/StoreDetails/components/StoreDetails.js +24 -26
- package/locations/components/StoreDetails/components/StoreFinderMap.js +4 -4
- package/locations/components/StoreDetails/components/StoresNearby.js +5 -3
- package/locations/components/StoreDetails/components/StoresNearbyListItem.js +24 -10
- package/locations/components/StoreFinder/StoreFinder.js +1 -1
- package/locations/components/StoreFinder/StoreFinderGetDirectionsButton.js +5 -5
- package/locations/components/StoreFinder/StoreFinderLocationDetails.js +7 -6
- package/locations/components/StoreFinder/StoreFinderLocationHeader.js +17 -21
- package/locations/components/StoreFinder/StoreFinderLocations.js +2 -6
- package/locations/components/StoreFinder/StoreFinderSelectLocationButton.js +3 -3
- package/locations/components/StoreFinder/StoreFinderStoreInfoButton.js +3 -3
- package/locations/components/StoreList/StoreAddress.js +3 -3
- package/locations/components/StoreList/StoreAddressShort.js +10 -12
- package/locations/components/StoreList/StoreDetails.js +1 -2
- package/locations/components/StoreList/StoreDetailsLine.js +3 -3
- package/locations/components/StoreList/StoreDistance.js +6 -17
- package/locations/components/StoreList/StoreHeader.js +7 -7
- package/locations/components/StoreList/StoreHoursToday.js +3 -3
- package/locations/components/StoreList/StoreListLocations.js +20 -18
- package/locations/components/StoreList/StoreListProduct.js +2 -3
- package/locations/components/StoreList/StoreListProductInfo.js +9 -6
- package/locations/components/StoreList/StoreListProductName.js +4 -3
- package/locations/components/StoreList/StoreListSearch.js +10 -11
- package/locations/components/StoreList/StoreListSearchRadius.js +4 -5
- package/locations/components/StoreList/StoreOpeningHours.js +10 -12
- package/locations/components/StoreList/StorePhoneNumber.js +10 -12
- package/locations/components/StoreList/StoreSelectLocationButton.js +3 -3
- package/locations/helpers/showInventoryInLists.js +1 -1
- package/locations/providers/FulfillmentProvider.connector.js +1 -1
- package/locations/reducers/index.js +1 -1
- package/locations/selectors/index.js +2 -1
- package/locations/subscriptions.js +2 -2
- package/login/components/ForgotPassword/ForgotPassword.js +16 -16
- package/orders/components/OrderDetails/OrderDetailsAuthenticate.js +1 -1
- package/orders/components/OrderDetails/OrderDetailsContent.js +5 -4
- package/orders/components/OrderDetails/OrderDetailsOrderHeader.js +7 -8
- package/orders/components/OrderDetails/OrderDetailsOrderPickupLocation.js +2 -2
- package/orders/components/OrderHistory/OrderHistoryList.d.ts.map +1 -1
- package/orders/components/OrderHistory/OrderHistoryList.js +4 -8
- package/orders/components/OrderHistory/OrderHistoryTable.js +1 -1
- package/package.json +9 -8
- package/page/components/NotFound.js +8 -7
- package/page/components/WidgetHeadline/WidgetHeadline.js +4 -3
- package/page/components/WidgetRichText/WidgetRichText.js +1 -1
- package/page/components/Widgets/Tooltip.js +7 -8
- package/page/components/Widgets/Widget.js +4 -4
- package/page/components/Widgets/constants.js +0 -5
- package/page/components/Widgets/hooks.js +5 -96
- package/page/constants/index.js +5 -2
- package/page/selectors/index.js +2 -1
- package/page/widgets/HTML/HTML.js +5 -9
- package/page/widgets/NestedCategoryFilter/NestedCategoryFilter.js +0 -5
- package/page/widgets/NestedCategoryFilter/components/Picker/components/SheetItem/index.js +2 -2
- package/page/widgets/NestedCategoryFilter/components/Picker/index.js +7 -9
- package/page/widgets/Placeholder/Placeholder.js +7 -8
- package/product/components/Availability/Availability.js +0 -4
- package/product/components/Characteristics/Characteristic/components/SheetItem/index.js +4 -8
- package/product/components/Characteristics/Characteristic/index.js +9 -12
- package/product/components/Characteristics/Swatch/index.js +3 -7
- package/product/components/Characteristics/transition.js +4 -4
- package/product/components/Description/index.js +6 -7
- package/product/components/EffectivityDates/index.js +23 -17
- package/product/components/FilterBar/components/Content/components/FilterButton/index.js +5 -7
- package/product/components/FilterBar/components/Content/components/Sort/index.js +6 -8
- package/product/components/FilterBar/components/FilterModal/FilterModalContent.js +3 -7
- package/product/components/FilterBar/components/FilterModal/FilterModalTitle.js +13 -12
- package/product/components/FilterBar/index.js +4 -8
- package/product/components/Header/PriceStriked/index.js +4 -8
- package/product/components/Header/Shipping/index.js +3 -3
- package/product/components/Header/Shipping/spec.js +7 -8
- package/product/components/Header/Tiers/components/Tier/index.js +3 -3
- package/product/components/Header/Tiers/components/Tier/spec.js +4 -4
- package/product/components/Header/Tiers/index.js +5 -3
- package/product/components/Header/Tiers/spec.js +7 -7
- package/product/components/MapPriceHint/index.js +8 -7
- package/product/components/Media/MediaImage.js +2 -2
- package/product/components/Media/MediaPlaceholder.js +3 -4
- package/product/components/Options/components/TextOption/components/OptionInfo/index.js +18 -18
- package/product/components/Options/components/TextOption/components/OptionInfo/spec.js +30 -21
- package/product/components/Options/components/TextOption/index.js +8 -11
- package/product/components/OrderQuantityHint/index.js +10 -16
- package/product/components/PriceDifference/index.js +4 -8
- package/product/components/PriceInfo/PriceInfo.connector.js +2 -2
- package/product/components/PriceInfo/PriceInfo.js +3 -4
- package/product/components/ProductCard/index.js +4 -5
- package/product/components/ProductDiscountBadge/index.js +3 -3
- package/product/components/ProductDiscountBadge/spec.js +5 -5
- package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/index.js +1 -1
- package/product/components/ProductGrid/components/Item/components/ItemFavoritesButton/spec.js +7 -7
- package/product/components/ProductGrid/components/Item/components/ItemImage/spec.js +3 -3
- package/product/components/ProductGrid/components/Item/components/ItemName/index.js +3 -4
- package/product/components/ProductGrid/components/Item/components/ItemName/spec.js +3 -3
- package/product/components/ProductGrid/components/Item/components/ItemPrice/spec.js +4 -4
- package/product/components/ProductGrid/components/Item/index.js +1 -5
- package/product/components/ProductGridPrice/index.js +9 -15
- package/product/components/ProductImage/ProductImagePlaceholder.js +9 -12
- package/product/components/ProductImage/index.js +6 -8
- package/product/components/ProductList/components/Item/index.js +5 -9
- package/product/components/ProductList/components/Layout/index.js +1 -1
- package/product/components/ProductProperties/Content.js +1 -1
- package/product/components/ProductProperties/Group.js +6 -4
- package/product/components/ProductProperties/GroupedProperties.js +1 -1
- package/product/components/ProductProperties/Wrapper.js +4 -2
- package/product/components/ProductSlider/spec.js +5 -5
- package/product/components/Rating/spec.js +9 -8
- package/product/components/RelationsSlider/RelationsSliderContent.js +4 -4
- package/product/components/Swatch/SwatchContent.js +3 -7
- package/product/components/Swatches/Swatches.js +3 -7
- package/product/components/UnitQuantityPicker/ProductUnitQuantityPicker.js +4 -4
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.d.ts.map +1 -1
- package/product/components/UnitQuantityPicker/UnitQuantityPicker.js +9 -12
- package/push-opt-in/components/PushOptInModal/index.js +14 -14
- package/registration/components/GuestRegistration/GuestRegistrationFormPickup.js +2 -2
- package/registration/components/Registration/RegistrationContent.js +2 -1
- package/registration/components/Registration/RegistrationFormBase.config.js +2 -1
- package/registration/providers/GuestRegistrationProvider.actions.js +1 -1
- package/registration/providers/GuestRegistrationProvider.connector.js +3 -2
- package/registration/providers/GuestRegistrationProvider.js +2 -1
- package/registration/providers/RegistrationProvider.actions.js +4 -2
- package/registration/providers/RegistrationProvider.connector.js +2 -2
- package/registration/providers/RegistrationProvider.constraints.js +1 -1
- package/registration/providers/RegistrationProvider.js +2 -1
- package/reviews/components/Reviews/components/Header/components/NoReviews/index.js +1 -1
- package/reviews/components/Reviews/components/Header/components/ReviewsExcerpt/index.js +3 -3
- package/reviews/components/Reviews/components/Header/components/WriteReviewLink/spec.js +43 -26
- package/reviews/components/Reviews/components/Header/spec.js +47 -29
- package/reviews/components/Reviews/components/List/components/Info/index.js +16 -26
- package/reviews/components/Reviews/components/List/components/Text/index.js +4 -2
- package/reviews/components/Reviews/components/List/components/Title/index.js +3 -3
- package/reviews/components/Reviews/components/List/index.js +1 -5
- package/reviews/components/Reviews/components/List/spec.js +68 -29
- package/reviews/components/Reviews/components/RatingCount/index.js +13 -15
- package/reviews/components/Reviews/components/RatingCount/spec.js +25 -5
- package/reviews/components/Reviews/components/ReviewsInfo/index.js +9 -9
- package/reviews/components/Reviews/spec.js +56 -28
- package/settings/action-creators/appSettings.d.ts +12 -0
- package/settings/action-creators/appSettings.d.ts.map +1 -0
- package/settings/action-creators/appSettings.js +10 -0
- package/settings/action-creators/merchantSettings.d.ts +2 -0
- package/settings/action-creators/merchantSettings.d.ts.map +1 -0
- package/settings/action-creators/merchantSettings.js +11 -0
- package/settings/action-creators/shopSettings.d.ts +3 -0
- package/settings/action-creators/shopSettings.d.ts.map +1 -0
- package/settings/action-creators/shopSettings.js +21 -0
- package/settings/constants/appSettings.d.ts +2 -0
- package/settings/constants/appSettings.d.ts.map +1 -0
- package/settings/constants/appSettings.js +1 -0
- package/settings/constants/merchantSettings.d.ts +12 -0
- package/settings/constants/merchantSettings.d.ts.map +1 -0
- package/settings/constants/merchantSettings.js +11 -0
- package/settings/constants/shopSettings.d.ts +28 -0
- package/settings/constants/shopSettings.d.ts.map +1 -0
- package/settings/constants/shopSettings.js +27 -0
- package/settings/reducers/appSettings.d.ts +18 -0
- package/settings/reducers/appSettings.d.ts.map +1 -0
- package/settings/reducers/appSettings.js +42 -0
- package/settings/reducers/index.d.ts +15 -0
- package/settings/reducers/index.d.ts.map +1 -0
- package/{core → settings}/reducers/index.js +4 -3
- package/settings/reducers/merchantSettings.d.ts +18 -0
- package/settings/reducers/merchantSettings.d.ts.map +1 -0
- package/{core → settings}/reducers/merchantSettings.js +9 -3
- package/settings/reducers/shopSettings.d.ts +28 -0
- package/settings/reducers/shopSettings.d.ts.map +1 -0
- package/{core → settings}/reducers/shopSettings.js +10 -4
- package/settings/selectors/appSettings.d.ts +44 -0
- package/settings/selectors/appSettings.d.ts.map +1 -0
- package/settings/selectors/appSettings.js +23 -0
- package/settings/selectors/merchantSettings.d.ts +21 -0
- package/settings/selectors/merchantSettings.d.ts.map +1 -0
- package/settings/selectors/merchantSettings.js +34 -0
- package/settings/selectors/shopSettings.d.ts +54 -0
- package/settings/selectors/shopSettings.d.ts.map +1 -0
- package/settings/selectors/shopSettings.js +81 -0
- package/settings/types/appSettings.d.ts +32 -0
- package/settings/types/appSettings.d.ts.map +1 -0
- package/settings/types/appSettings.js +1 -0
- package/styles/helpers/setPageBackgroundColor.js +2 -2
- package/styles/theme/createDefaultThemeOptions/index.d.ts.map +1 -1
- package/styles/theme/createDefaultThemeOptions/index.js +72 -3
- package/styles/theme/createTheme/createComponents.d.ts +2 -2
- package/styles/theme/createTheme/createComponents.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.js +1 -0
- package/styles/theme/createTheme/createComponents.types.d.ts +149 -0
- package/styles/theme/createTheme/createComponents.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createComponents.types.js +149 -0
- package/styles/theme/createTheme/createCssVarsForColorSchemeThemes.d.ts.map +1 -1
- package/styles/theme/createTheme/createCssVarsForColorSchemeThemes.js +28 -2
- package/styles/theme/createTheme/createPalette.types.d.ts +15 -7
- package/styles/theme/createTheme/createPalette.types.d.ts.map +1 -1
- package/styles/theme/createTheme/createPalette.types.js +16 -8
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts +7 -0
- package/styles/theme/createTheme/createThemeFromColorScheme.d.ts.map +1 -1
- package/styles/theme/createTheme/createThemeFromColorScheme.js +10 -1
- package/styles/theme/createTheme/helpers/cssVarsColorAugmentation.d.ts +2 -1
- package/styles/theme/createTheme/helpers/cssVarsColorAugmentation.d.ts.map +1 -1
- package/styles/theme/createTheme/helpers/cssVarsColorAugmentation.js +84 -6
- package/styles/theme/createTheme/helpers/cssVarsParser.d.ts.map +1 -1
- package/styles/theme/createTheme/helpers/cssVarsParser.js +1 -1
- package/styles/theme/createTheme/index.js +1 -2
- package/styles/theme/createTheme/types.d.ts +8 -2
- package/styles/theme/createTheme/types.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.d.ts.map +1 -1
- package/styles/theme/providers/ThemeProvider.js +5 -3
- package/tracking/components/CookieConsentModal/index.js +12 -12
- package/tracking/components/PrivacySettings/index.js +4 -4
- package/tracking/selectors/cookieConsent.js +2 -2
- package/tsconfig.json +1 -0
|
@@ -1,11 +1,41 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import mockRenderOptions from '@shopgate/pwa-common/helpers/mocks/mockRenderOptions';
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
4
3
|
import List from "./index";
|
|
5
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
-
jest.
|
|
5
|
+
const mockTitle = jest.fn(({
|
|
6
|
+
title
|
|
7
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
8
|
+
"data-testid": "review-title",
|
|
9
|
+
children: title
|
|
10
|
+
}));
|
|
11
|
+
const mockRating = jest.fn(({
|
|
12
|
+
rate
|
|
13
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
14
|
+
"data-testid": "review-rating",
|
|
15
|
+
children: rate
|
|
16
|
+
}));
|
|
17
|
+
const mockText = jest.fn(({
|
|
18
|
+
review
|
|
19
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
20
|
+
"data-testid": "review-text",
|
|
21
|
+
children: review
|
|
22
|
+
}));
|
|
23
|
+
const mockInfo = jest.fn(({
|
|
24
|
+
review
|
|
25
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
26
|
+
"data-testid": "review-info",
|
|
27
|
+
children: review.date
|
|
28
|
+
}));
|
|
29
|
+
jest.mock('@shopgate/engage/components', () => ({
|
|
30
|
+
SurroundPortals: ({
|
|
31
|
+
children
|
|
32
|
+
}) => children
|
|
33
|
+
}));
|
|
34
|
+
jest.mock("./components/Title", () => props => mockTitle(props));
|
|
35
|
+
jest.mock("./components/Rating", () => props => mockRating(props));
|
|
36
|
+
jest.mock("./components/Text", () => props => mockText(props));
|
|
37
|
+
jest.mock("./components/Info", () => props => mockInfo(props));
|
|
7
38
|
describe('<List />', () => {
|
|
8
|
-
let list = null;
|
|
9
39
|
const reviews = [{
|
|
10
40
|
id: 'a',
|
|
11
41
|
author: '',
|
|
@@ -36,34 +66,43 @@ describe('<List />', () => {
|
|
|
36
66
|
review: ''
|
|
37
67
|
}];
|
|
38
68
|
beforeEach(() => {
|
|
39
|
-
|
|
40
|
-
reviews: []
|
|
41
|
-
}), mockRenderOptions);
|
|
69
|
+
jest.clearAllMocks();
|
|
42
70
|
});
|
|
43
|
-
it('should not render when no reviews
|
|
44
|
-
|
|
45
|
-
|
|
71
|
+
it('should not render when no reviews exist', () => {
|
|
72
|
+
const {
|
|
73
|
+
container
|
|
74
|
+
} = render(/*#__PURE__*/_jsx(List, {
|
|
75
|
+
reviews: []
|
|
76
|
+
}));
|
|
77
|
+
expect(container.firstChild).toBeNull();
|
|
78
|
+
expect(screen.queryByRole('list')).toBeNull();
|
|
79
|
+
expect(mockTitle).not.toHaveBeenCalled();
|
|
46
80
|
});
|
|
47
81
|
it('should render list with reviews', () => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
82
|
+
const {
|
|
83
|
+
container
|
|
84
|
+
} = render(/*#__PURE__*/_jsx(List, {
|
|
85
|
+
reviews: reviews
|
|
86
|
+
}));
|
|
87
|
+
expect(screen.getByRole('list')).toBeTruthy();
|
|
88
|
+
expect(container.querySelectorAll('li')).toHaveLength(reviews.length);
|
|
89
|
+
expect(mockTitle).toHaveBeenCalledTimes(reviews.length);
|
|
90
|
+
expect(mockRating).toHaveBeenCalledTimes(reviews.length);
|
|
91
|
+
expect(mockText).toHaveBeenCalledTimes(reviews.length);
|
|
92
|
+
expect(mockInfo).toHaveBeenCalledTimes(reviews.length);
|
|
93
|
+
reviews.forEach((review, i) => {
|
|
94
|
+
expect(mockTitle).toHaveBeenNthCalledWith(i + 1, expect.objectContaining({
|
|
95
|
+
title: review.title
|
|
96
|
+
}));
|
|
97
|
+
expect(mockRating).toHaveBeenNthCalledWith(i + 1, expect.objectContaining({
|
|
98
|
+
rate: review.rate
|
|
99
|
+
}));
|
|
100
|
+
expect(mockText).toHaveBeenNthCalledWith(i + 1, expect.objectContaining({
|
|
101
|
+
review: review.review
|
|
102
|
+
}));
|
|
103
|
+
expect(mockInfo).toHaveBeenNthCalledWith(i + 1, expect.objectContaining({
|
|
104
|
+
review
|
|
105
|
+
}));
|
|
67
106
|
});
|
|
68
107
|
});
|
|
69
108
|
});
|
|
@@ -1,26 +1,20 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { I18n } from '@shopgate/engage/components';
|
|
3
|
+
import { I18n, Typography } from '@shopgate/engage/components';
|
|
4
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
|
-
import { themeConfig } from '@shopgate/pwa-common/helpers/config';
|
|
6
5
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
-
const {
|
|
8
|
-
colors
|
|
9
|
-
} = themeConfig;
|
|
10
|
-
const useStyles = makeStyles()({
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
11
7
|
greyStyle: {
|
|
12
|
-
fontSize: 12,
|
|
13
8
|
margin: '0 0.5em',
|
|
14
9
|
lineHeight: '2em',
|
|
15
|
-
color:
|
|
10
|
+
color: theme.palette.grey.medium
|
|
16
11
|
},
|
|
17
12
|
prominentStyle: {
|
|
18
|
-
fontSize: 12,
|
|
19
13
|
margin: '0 0.5em',
|
|
20
14
|
lineHeight: '2em',
|
|
21
|
-
color:
|
|
15
|
+
color: theme.palette.primary.main
|
|
22
16
|
}
|
|
23
|
-
});
|
|
17
|
+
}));
|
|
24
18
|
|
|
25
19
|
/**
|
|
26
20
|
* @param {Object} props The component props.
|
|
@@ -34,13 +28,17 @@ const RatingCount = props => {
|
|
|
34
28
|
if (!props.count) {
|
|
35
29
|
return null;
|
|
36
30
|
}
|
|
37
|
-
return /*#__PURE__*/_jsx(
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
32
|
+
variant: "caption",
|
|
33
|
+
component: "span",
|
|
40
34
|
className: cx({
|
|
41
35
|
[classes.greyStyle]: true,
|
|
42
36
|
[classes.prominentStyle]: props.prominent
|
|
43
|
-
}, 'engage__reviews__rating-count')
|
|
37
|
+
}, 'engage__reviews__rating-count'),
|
|
38
|
+
children: /*#__PURE__*/_jsx(I18n.Text, {
|
|
39
|
+
string: "reviews.review_count",
|
|
40
|
+
params: props
|
|
41
|
+
})
|
|
44
42
|
});
|
|
45
43
|
};
|
|
46
44
|
RatingCount.defaultProps = {
|
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { render, screen } from '@testing-library/react';
|
|
3
3
|
import RatingCount from "./index";
|
|
4
4
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
5
|
+
const mockText = jest.fn(({
|
|
6
|
+
string
|
|
7
|
+
}) => /*#__PURE__*/_jsx("span", {
|
|
8
|
+
children: string
|
|
9
|
+
}));
|
|
10
|
+
jest.mock('@shopgate/engage/components', () => ({
|
|
11
|
+
Typography: ({
|
|
12
|
+
children
|
|
13
|
+
}) => children,
|
|
14
|
+
I18n: {
|
|
15
|
+
Text: props => mockText(props)
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
5
18
|
describe('<RatingCount>', () => {
|
|
6
19
|
it('should render nothing when count is 0', () => {
|
|
7
|
-
|
|
20
|
+
render(/*#__PURE__*/_jsx(RatingCount, {
|
|
8
21
|
count: 0
|
|
9
22
|
}));
|
|
10
|
-
expect(
|
|
23
|
+
expect(screen.queryByText('reviews.review_count')).toBeNull();
|
|
24
|
+
expect(mockText).not.toHaveBeenCalled();
|
|
11
25
|
});
|
|
12
26
|
it('should render text when count is more than 0', () => {
|
|
13
|
-
|
|
27
|
+
render(/*#__PURE__*/_jsx(RatingCount, {
|
|
14
28
|
count: 1
|
|
15
29
|
}));
|
|
16
|
-
expect(
|
|
30
|
+
expect(screen.getByText('reviews.review_count')).toBeTruthy();
|
|
31
|
+
expect(mockText).toHaveBeenCalledWith(expect.objectContaining({
|
|
32
|
+
string: 'reviews.review_count',
|
|
33
|
+
params: expect.objectContaining({
|
|
34
|
+
count: 1
|
|
35
|
+
})
|
|
36
|
+
}));
|
|
17
37
|
});
|
|
18
38
|
});
|
|
@@ -1,23 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import appConfig from '@shopgate/pwa-common/helpers/config';
|
|
3
|
-
import { Link } from '@shopgate/engage/components';
|
|
3
|
+
import { Link, Typography } from '@shopgate/engage/components';
|
|
4
4
|
import { makeStyles } from '@shopgate/engage/styles';
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
-
const useStyles = makeStyles()({
|
|
6
|
+
const useStyles = makeStyles()(theme => ({
|
|
7
7
|
root: {
|
|
8
|
-
textAlign: 'center',
|
|
9
8
|
marginTop: 8,
|
|
10
|
-
fontSize: '.875rem',
|
|
11
|
-
fontWeight: 300,
|
|
12
|
-
lineHeight: 1.5,
|
|
13
9
|
padding: '0 1rem 1rem'
|
|
14
10
|
},
|
|
15
11
|
link: {
|
|
16
12
|
textAlign: 'center',
|
|
17
|
-
fontWeight:
|
|
13
|
+
fontWeight: theme.typography.fontWeightBold,
|
|
18
14
|
marginTop: 8
|
|
19
15
|
}
|
|
20
|
-
});
|
|
16
|
+
}));
|
|
21
17
|
const {
|
|
22
18
|
reviewsInfo: {
|
|
23
19
|
text,
|
|
@@ -38,7 +34,11 @@ const ReviewsInfo = () => {
|
|
|
38
34
|
if (!text) {
|
|
39
35
|
return null;
|
|
40
36
|
}
|
|
41
|
-
return /*#__PURE__*/_jsx(
|
|
37
|
+
return /*#__PURE__*/_jsx(Typography, {
|
|
38
|
+
variant: "body2",
|
|
39
|
+
component: "div",
|
|
40
|
+
align: "center",
|
|
41
|
+
fontWeight: "light",
|
|
42
42
|
className: cx(classes.root, 'engage__reviews__review_info_text'),
|
|
43
43
|
children: /*#__PURE__*/_jsxs("div", {
|
|
44
44
|
children: [text, linkText && linkUrl && /*#__PURE__*/_jsx(Link, {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Provider } from 'react-redux';
|
|
3
3
|
import configureStore from 'redux-mock-store';
|
|
4
|
-
import {
|
|
5
|
-
import mockRenderOptions from '@shopgate/pwa-common/helpers/mocks/mockRenderOptions';
|
|
4
|
+
import { render, screen } from '@testing-library/react';
|
|
6
5
|
import { mockedStateWithAll, mockedStateWithoutReview, mockedStateWithTwoReviews } from '@shopgate/pwa-common-commerce/reviews/mock';
|
|
7
6
|
import appConfig from '@shopgate/pwa-common/helpers/config';
|
|
8
7
|
import Reviews from "./index";
|
|
@@ -13,13 +12,35 @@ const mockedStore = configureStore();
|
|
|
13
12
|
* @returns {JSX}
|
|
14
13
|
*/
|
|
15
14
|
jest.mock("./components/Header", () => function Header() {
|
|
16
|
-
return /*#__PURE__*/_jsx("div", {
|
|
15
|
+
return /*#__PURE__*/_jsx("div", {
|
|
16
|
+
"data-testid": "reviews-header"
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
jest.mock("./components/List", () => function List() {
|
|
20
|
+
return /*#__PURE__*/_jsx("div", {
|
|
21
|
+
"data-testid": "reviews-list"
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
jest.mock("./components/ReviewsInfo", () => function ReviewsInfo() {
|
|
25
|
+
return /*#__PURE__*/_jsx("div", {
|
|
26
|
+
"data-testid": "reviews-info"
|
|
27
|
+
});
|
|
17
28
|
});
|
|
18
29
|
jest.mock('@shopgate/engage/product', () => ({
|
|
19
30
|
PRODUCT_REVIEWS: 'product.reviews',
|
|
20
31
|
makeIsBaseProductActive: jest.fn(() => () => true)
|
|
21
32
|
}));
|
|
22
|
-
jest.mock('@shopgate/engage/components')
|
|
33
|
+
jest.mock('@shopgate/engage/components', () => ({
|
|
34
|
+
SurroundPortals: ({
|
|
35
|
+
children
|
|
36
|
+
}) => children,
|
|
37
|
+
I18n: {
|
|
38
|
+
Text: () => /*#__PURE__*/_jsx("span", {
|
|
39
|
+
children: "reviews.button_all"
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
jest.mock('@shopgate/pwa-ui-shared/ButtonLink', () => 'a');
|
|
23
44
|
|
|
24
45
|
// Mock the getter of the hasReviews key inside the app config, so that we can turn it off later
|
|
25
46
|
jest.resetModules();
|
|
@@ -31,43 +52,50 @@ Object.defineProperty(appConfig, 'hasReviews', {
|
|
|
31
52
|
/**
|
|
32
53
|
* Creates component with provided store state.
|
|
33
54
|
* @param {Object} mockedState Mocked stage.
|
|
34
|
-
* @
|
|
55
|
+
* @returns {object} Render result.
|
|
35
56
|
*/
|
|
36
|
-
const createComponent = mockedState =>
|
|
57
|
+
const createComponent = mockedState => render(/*#__PURE__*/_jsx(Provider, {
|
|
37
58
|
store: mockedStore(mockedState),
|
|
38
59
|
children: /*#__PURE__*/_jsx(Reviews, {
|
|
39
60
|
productId: "foo"
|
|
40
61
|
})
|
|
41
|
-
})
|
|
62
|
+
}));
|
|
42
63
|
describe('<Reviews />', () => {
|
|
43
|
-
let component = null;
|
|
44
64
|
it('should render when no reviews and rating given', () => {
|
|
45
|
-
|
|
46
|
-
expect(
|
|
47
|
-
expect(
|
|
48
|
-
expect(
|
|
49
|
-
expect(
|
|
65
|
+
createComponent(mockedStateWithoutReview);
|
|
66
|
+
expect(screen.getByTestId('reviews-header')).toBeTruthy();
|
|
67
|
+
expect(screen.getByTestId('reviews-list')).toBeTruthy();
|
|
68
|
+
expect(screen.getByTestId('reviews-info')).toBeTruthy();
|
|
69
|
+
expect(screen.queryByRole('link', {
|
|
70
|
+
name: 'reviews.button_all'
|
|
71
|
+
})).toBeNull();
|
|
50
72
|
});
|
|
51
73
|
it('should render reviews, header and all reviews link', () => {
|
|
52
|
-
|
|
53
|
-
expect(
|
|
54
|
-
expect(
|
|
55
|
-
expect(
|
|
56
|
-
|
|
74
|
+
createComponent(mockedStateWithAll);
|
|
75
|
+
expect(screen.getByTestId('reviews-header')).toBeTruthy();
|
|
76
|
+
expect(screen.getByTestId('reviews-list')).toBeTruthy();
|
|
77
|
+
expect(screen.getByRole('link', {
|
|
78
|
+
name: 'reviews.button_all'
|
|
79
|
+
})).toHaveAttribute('href', '/item/666f6f/reviews');
|
|
57
80
|
});
|
|
58
81
|
it('should render reviews, header, but no all reviews link', () => {
|
|
59
|
-
|
|
60
|
-
expect(
|
|
61
|
-
expect(
|
|
62
|
-
expect(
|
|
63
|
-
|
|
82
|
+
createComponent(mockedStateWithTwoReviews);
|
|
83
|
+
expect(screen.getByTestId('reviews-header')).toBeTruthy();
|
|
84
|
+
expect(screen.getByTestId('reviews-list')).toBeTruthy();
|
|
85
|
+
expect(screen.queryByRole('link', {
|
|
86
|
+
name: 'reviews.button_all'
|
|
87
|
+
})).toBeNull();
|
|
64
88
|
});
|
|
65
89
|
it('should not render when feature flag is off', () => {
|
|
66
90
|
hasReviewsGetter.mockReturnValueOnce(false);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
expect(
|
|
71
|
-
expect(
|
|
91
|
+
const {
|
|
92
|
+
container
|
|
93
|
+
} = createComponent(mockedStateWithAll);
|
|
94
|
+
expect(container.firstChild).toBeNull();
|
|
95
|
+
expect(screen.queryByTestId('reviews-header')).toBeNull();
|
|
96
|
+
expect(screen.queryByTestId('reviews-list')).toBeNull();
|
|
97
|
+
expect(screen.queryByRole('link', {
|
|
98
|
+
name: 'reviews.button_all'
|
|
99
|
+
})).toBeNull();
|
|
72
100
|
});
|
|
73
101
|
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AppSettings } from '../types/appSettings';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the dispatched RECEIVE_APP_SETTINGS action object.
|
|
4
|
+
* @param settings A list of app settings.
|
|
5
|
+
* @returns The dispatched action object.
|
|
6
|
+
*/
|
|
7
|
+
export declare const receiveAppSettings: (settings: AppSettings) => {
|
|
8
|
+
type: string;
|
|
9
|
+
settings: AppSettings;
|
|
10
|
+
};
|
|
11
|
+
export type ReceiveAppSettingsAction = ReturnType<typeof receiveAppSettings>;
|
|
12
|
+
//# sourceMappingURL=appSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/action-creators/appSettings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,GAAI,UAAU,WAAW;;;CAGtD,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RECEIVE_APP_SETTINGS } from "../constants/appSettings";
|
|
2
|
+
/**
|
|
3
|
+
* Creates the dispatched RECEIVE_APP_SETTINGS action object.
|
|
4
|
+
* @param settings A list of app settings.
|
|
5
|
+
* @returns The dispatched action object.
|
|
6
|
+
*/
|
|
7
|
+
export const receiveAppSettings = settings => ({
|
|
8
|
+
type: RECEIVE_APP_SETTINGS,
|
|
9
|
+
settings
|
|
10
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merchantSettings.d.ts","sourceRoot":"","sources":["../../../settings/action-creators/merchantSettings.js"],"names":[],"mappings":"AAOO,0DAFM,MAAM,CAKjB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RECEIVE_MERCHANT_SETTINGS } from "../constants/merchantSettings";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates the dispatched RECEIVE_MERCHANT_SETTINGS action object.
|
|
5
|
+
* @param {Array} settings A list of merchant settings.
|
|
6
|
+
* @returns {Object} The dispatched action object.
|
|
7
|
+
*/
|
|
8
|
+
export const receiveMerchantSettings = settings => ({
|
|
9
|
+
type: RECEIVE_MERCHANT_SETTINGS,
|
|
10
|
+
settings
|
|
11
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopSettings.d.ts","sourceRoot":"","sources":["../../../settings/action-creators/shopSettings.js"],"names":[],"mappings":"AAOO,sDAFM,MAAM,CAKjB;AAOK,yCAHI,MAAM,GACJ,MAAM,CAKjB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RECEIVE_SHOP_SETTINGS, ERROR_SHOP_SETTINGS } from "../constants/shopSettings";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates the dispatched RECEIVE_SHOP_SETTINGS action object.
|
|
5
|
+
* @param {Array} settings A list of shop settings.
|
|
6
|
+
* @returns {Object} The dispatched action object.
|
|
7
|
+
*/
|
|
8
|
+
export const receiveShopSettings = settings => ({
|
|
9
|
+
type: RECEIVE_SHOP_SETTINGS,
|
|
10
|
+
settings
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Creates the dispatched ERROR_SHOP_SETTINGS action object.
|
|
15
|
+
* @param {Object} error An error object.
|
|
16
|
+
* @returns {Object} The dispatched action object.
|
|
17
|
+
*/
|
|
18
|
+
export const errorShopSettings = error => ({
|
|
19
|
+
type: ERROR_SHOP_SETTINGS,
|
|
20
|
+
error
|
|
21
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/constants/appSettings.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const RECEIVE_APP_SETTINGS = 'RECEIVE_APP_SETTINGS';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const RECEIVE_MERCHANT_SETTINGS: "RECEIVE_MERCHANT_SETTINGS";
|
|
2
|
+
export const MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED: "locationBasedShoppingEnabled";
|
|
3
|
+
export const MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED: "enableSubstitutionPreferences";
|
|
4
|
+
export const MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES: "customerAttributes";
|
|
5
|
+
export const MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED: "enableFulfillmentScheduling";
|
|
6
|
+
export const MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS: "restrictMultiLocationOrders";
|
|
7
|
+
export const MERCHANT_SETTINGS_DEFAULT_CURRENCY: "defaultCurrency";
|
|
8
|
+
export const MERCHANT_SETTINGS_ENABLE_WEB_INDEXING: "enableWebIndexing";
|
|
9
|
+
export const MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION: "productShowAlternativeLocation";
|
|
10
|
+
export const MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY: "productListShowInventory";
|
|
11
|
+
export const MERCHANT_SETTINGS_ENABLED_CMS_VERSION: "enabledCmsVersion";
|
|
12
|
+
//# sourceMappingURL=merchantSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merchantSettings.d.ts","sourceRoot":"","sources":["../../../settings/constants/merchantSettings.js"],"names":[],"mappings":"AAAA,wCAAyC,2BAA2B,CAAC;AACrE,gEAAiE,8BAA8B,CAAC;AAChG,iEAAkE,+BAA+B,CAAC;AAClG,oDAAqD,oBAAoB,CAAC;AAC1E,8DAA+D,6BAA6B,CAAC;AAC7F,+DAAgE,6BAA6B,CAAC;AAC9F,iDAAkD,iBAAiB,CAAC;AACpE,oDAAqD,mBAAmB,CAAC;AACzE,kEAAmE,gCAAgC,CAAC;AACpG,2DAA4D,0BAA0B,CAAC;AACvF,oDAAqD,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const RECEIVE_MERCHANT_SETTINGS = 'RECEIVE_MERCHANT_SETTINGS';
|
|
2
|
+
export const MERCHANT_SETTINGS_LOCATION_BASED_SHOPPING_ENABLED = 'locationBasedShoppingEnabled';
|
|
3
|
+
export const MERCHANT_SETTINGS_SUBSTITUTION_PREFERENCES_ENABLED = 'enableSubstitutionPreferences';
|
|
4
|
+
export const MERCHANT_SETTINGS_CUSTOMER_ATTRIBUTES = 'customerAttributes';
|
|
5
|
+
export const MERCHANT_SETTINGS_FULFILLMENT_SCHEDULED_ENABLED = 'enableFulfillmentScheduling';
|
|
6
|
+
export const MERCHANT_SETTINGS_RESTRICT_MULTI_LOCATION_ORDERS = 'restrictMultiLocationOrders';
|
|
7
|
+
export const MERCHANT_SETTINGS_DEFAULT_CURRENCY = 'defaultCurrency';
|
|
8
|
+
export const MERCHANT_SETTINGS_ENABLE_WEB_INDEXING = 'enableWebIndexing';
|
|
9
|
+
export const MERCHANT_SETTINGS_PRODUCT_SHOW_ALTERNATIVE_LOCATION = 'productShowAlternativeLocation';
|
|
10
|
+
export const MERCHANT_SETTINGS_PRODUCTLIST_SHOW_INVENTORY = 'productListShowInventory';
|
|
11
|
+
export const MERCHANT_SETTINGS_ENABLED_CMS_VERSION = 'enabledCmsVersion';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const RECEIVE_SHOP_SETTINGS: "RECEIVE_SHOP_SETTINGS";
|
|
2
|
+
export const ERROR_SHOP_SETTINGS: "ERROR_SHOP_SETTINGS";
|
|
3
|
+
export const CACHE_LEASE_SHOP_SETTINGS: number;
|
|
4
|
+
export const SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE: "googleSiteVerificationCode";
|
|
5
|
+
export const SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT: "cartSupplementalContent";
|
|
6
|
+
export const SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT: "orderSupplementalContent";
|
|
7
|
+
export const SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP: "showShopLogoInApp";
|
|
8
|
+
export const SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB: "showShopLogoInWeb";
|
|
9
|
+
export const SHOP_SETTING_PRODUCTS_SORT_ORDER: "productsSortOrder";
|
|
10
|
+
export const SHOP_SETTING_WISHLIST_MODE: "wishlistMode";
|
|
11
|
+
export const SHOP_SETTING_COOKIE_CONSENT_MODE: "cookieConsentMode";
|
|
12
|
+
export const SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT: "displayPricePerMeasureUnit";
|
|
13
|
+
export const SHOP_SETTING_IMAGES: "images";
|
|
14
|
+
export const SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER: "productPlaceholder";
|
|
15
|
+
export const SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER: "categoryPlaceholder";
|
|
16
|
+
export const SHOP_SETTING_IMAGES_FAVICON: "favicon";
|
|
17
|
+
export const SHOP_SETTING_NUMBER_OF_ADDRESS_LINES: "numberOfAddressLines";
|
|
18
|
+
export const SHOP_SETTINGS_SHOW_CATEGORY_IMAGES: "showCategoryImages";
|
|
19
|
+
export const SHOP_SETTING_REGISTRATION_MODE: "registrationMode";
|
|
20
|
+
export const SHOP_SETTING_REGISTRATION_MODE_SIMPLE: "simple";
|
|
21
|
+
export const SHOP_SETTING_REGISTRATION_MODE_EXTENDED: "extended";
|
|
22
|
+
export const SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED: "wishlistItemQuantityEnabled";
|
|
23
|
+
export const SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED: "wishlistItemNotesEnabled";
|
|
24
|
+
export const SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED: "loadWishlistOnAppStartEnabled";
|
|
25
|
+
export const SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE: "showWishlistItemsCountBadge";
|
|
26
|
+
export const SHOP_SETTING_ENABLE_CMS_2_FOR_ALL_SHOPPERS: "enableCms2ForAllShoppers";
|
|
27
|
+
export const WISHLIST_MODE_PERSIST_ON_ADD: "persistOnAdd";
|
|
28
|
+
//# sourceMappingURL=shopSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shopSettings.d.ts","sourceRoot":"","sources":["../../../settings/constants/shopSettings.js"],"names":[],"mappings":"AAAA,oCAAqC,uBAAuB,CAAC;AAC7D,kCAAmC,qBAAqB,CAAC;AACzD,+CAAwD;AACxD,yDAA0D,4BAA4B,CAAC;AACvF,qDAAsD,yBAAyB,CAAC;AAChF,sDAAuD,0BAA0B,CAAC;AAClF,iDAAkD,mBAAmB,CAAC;AACtE,iDAAkD,mBAAmB,CAAC;AACtE,+CAAgD,mBAAmB,CAAC;AACpE,yCAA0C,cAAc,CAAC;AACzD,+CAAgD,mBAAmB,CAAC;AACpE,0DAA2D,4BAA4B,CAAC;AACxF,kCAAmC,QAAQ,CAAC;AAC5C,sDAAuD,oBAAoB,CAAC;AAC5E,uDAAwD,qBAAqB,CAAC;AAC9E,0CAA2C,SAAS,CAAC;AACrD,mDAAoD,sBAAsB,CAAC;AAC3E,iDAAkD,oBAAoB,CAAC;AACvE,6CAA8C,kBAAkB,CAAC;AACjE,oDAAqD,QAAQ,CAAC;AAC9D,sDAAuD,UAAU,CAAC;AAClE,0DAA2D,6BAA6B,CAAC;AACzF,uDAAwD,0BAA0B,CAAC;AACnF,8DAA+D,+BAA+B,CAAC;AAC/F,2DAA4D,6BAA6B,CAAC;AAC1F,yDAA0D,0BAA0B,CAAC;AAErF,2CAA4C,cAAc,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const RECEIVE_SHOP_SETTINGS = 'RECEIVE_SHOP_SETTINGS';
|
|
2
|
+
export const ERROR_SHOP_SETTINGS = 'ERROR_SHOP_SETTINGS';
|
|
3
|
+
export const CACHE_LEASE_SHOP_SETTINGS = 10 * 60 * 1000; // 10 minutes in milliseconds
|
|
4
|
+
export const SHOP_SETTING_GOOGLE_SITE_VERIFICATION_CODE = 'googleSiteVerificationCode';
|
|
5
|
+
export const SHOP_SETTING_CART_SUPPLEMENTAL_CONTENT = 'cartSupplementalContent';
|
|
6
|
+
export const SHOP_SETTING_ORDER_SUPPLEMENTAL_CONTENT = 'orderSupplementalContent';
|
|
7
|
+
export const SHOP_SETTING_SHOW_SHOP_LOGO_IN_APP = 'showShopLogoInApp';
|
|
8
|
+
export const SHOP_SETTING_SHOW_SHOP_LOGO_IN_WEB = 'showShopLogoInWeb';
|
|
9
|
+
export const SHOP_SETTING_PRODUCTS_SORT_ORDER = 'productsSortOrder';
|
|
10
|
+
export const SHOP_SETTING_WISHLIST_MODE = 'wishlistMode';
|
|
11
|
+
export const SHOP_SETTING_COOKIE_CONSENT_MODE = 'cookieConsentMode';
|
|
12
|
+
export const SHOP_SETTING_DISPLAY_PRICE_PER_MEASURE_UNIT = 'displayPricePerMeasureUnit';
|
|
13
|
+
export const SHOP_SETTING_IMAGES = 'images';
|
|
14
|
+
export const SHOP_SETTING_IMAGES_PRODUCT_PLACEHOLDER = 'productPlaceholder';
|
|
15
|
+
export const SHOP_SETTING_IMAGES_CATEGORY_PLACEHOLDER = 'categoryPlaceholder';
|
|
16
|
+
export const SHOP_SETTING_IMAGES_FAVICON = 'favicon';
|
|
17
|
+
export const SHOP_SETTING_NUMBER_OF_ADDRESS_LINES = 'numberOfAddressLines';
|
|
18
|
+
export const SHOP_SETTINGS_SHOW_CATEGORY_IMAGES = 'showCategoryImages';
|
|
19
|
+
export const SHOP_SETTING_REGISTRATION_MODE = 'registrationMode';
|
|
20
|
+
export const SHOP_SETTING_REGISTRATION_MODE_SIMPLE = 'simple';
|
|
21
|
+
export const SHOP_SETTING_REGISTRATION_MODE_EXTENDED = 'extended';
|
|
22
|
+
export const SHOP_SETTING_WISHLIST_ITEM_QUANTITY_ENABLED = 'wishlistItemQuantityEnabled';
|
|
23
|
+
export const SHOP_SETTING_WISHLIST_ITEM_NOTES_ENABLED = 'wishlistItemNotesEnabled';
|
|
24
|
+
export const SHOP_SETTING_LOAD_WISHLIST_ON_APP_START_ENABLED = 'loadWishlistOnAppStartEnabled';
|
|
25
|
+
export const SHOP_SETTING_SHOW_WISHLIST_ITEMS_COUNT_BADGE = 'showWishlistItemsCountBadge';
|
|
26
|
+
export const SHOP_SETTING_ENABLE_CMS_2_FOR_ALL_SHOPPERS = 'enableCms2ForAllShoppers';
|
|
27
|
+
export const WISHLIST_MODE_PERSIST_ON_ADD = 'persistOnAdd';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Reducer, UnknownAction } from 'redux';
|
|
2
|
+
import type { AppSettingsSlice } from '../types/appSettings';
|
|
3
|
+
import type { ReceiveAppSettingsAction } from '../action-creators/appSettings';
|
|
4
|
+
type AppSettingsAction = ReceiveAppSettingsAction | UnknownAction;
|
|
5
|
+
/**
|
|
6
|
+
* The built-in default app settings. Used as the reducer's initial state and as
|
|
7
|
+
* a safe fallback for selectors when the slice is not present in the store yet.
|
|
8
|
+
*/
|
|
9
|
+
export declare const DEFAULT_APP_SETTINGS: AppSettingsSlice;
|
|
10
|
+
/**
|
|
11
|
+
* Stores the app settings.
|
|
12
|
+
* @param state The current state.
|
|
13
|
+
* @param action The action object.
|
|
14
|
+
* @returns The new state.
|
|
15
|
+
*/
|
|
16
|
+
declare const appSettings: Reducer<AppSettingsSlice, AppSettingsAction>;
|
|
17
|
+
export default appSettings;
|
|
18
|
+
//# sourceMappingURL=appSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appSettings.d.ts","sourceRoot":"","sources":["../../../settings/reducers/appSettings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAG/E,KAAK,iBAAiB,GAAG,wBAAwB,GAAG,aAAa,CAAC;AAQlE;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBAalC,CAAC;AAEF;;;;;GAKG;AACH,QAAA,MAAM,WAAW,EAAE,OAAO,CAAC,gBAAgB,EAAE,iBAAiB,CAW5D,CAAC;AAEH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import _merge from "lodash/merge";
|
|
2
|
+
import { produce } from 'immer';
|
|
3
|
+
import { RECEIVE_APP_SETTINGS } from "../constants/appSettings";
|
|
4
|
+
const isReceiveAppSettingsAction = action => action.type === RECEIVE_APP_SETTINGS && 'settings' in action;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The built-in default app settings. Used as the reducer's initial state and as
|
|
8
|
+
* a safe fallback for selectors when the slice is not present in the store yet.
|
|
9
|
+
*/
|
|
10
|
+
export const DEFAULT_APP_SETTINGS = {
|
|
11
|
+
isHydrated: false,
|
|
12
|
+
navigation: {
|
|
13
|
+
tabBar: {
|
|
14
|
+
variant: 'fixed',
|
|
15
|
+
showLabels: true,
|
|
16
|
+
hideOnScroll: false,
|
|
17
|
+
transition: 'fade',
|
|
18
|
+
fixed: {
|
|
19
|
+
borderEnabled: true
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Stores the app settings.
|
|
27
|
+
* @param state The current state.
|
|
28
|
+
* @param action The action object.
|
|
29
|
+
* @returns The new state.
|
|
30
|
+
*/
|
|
31
|
+
const appSettings = (state, action = {
|
|
32
|
+
type: ''
|
|
33
|
+
}) => produce(state ?? DEFAULT_APP_SETTINGS, draft => {
|
|
34
|
+
if (isReceiveAppSettingsAction(action)) {
|
|
35
|
+
// Deep merge so a partial payload (e.g. only some navigation.tabBar fields)
|
|
36
|
+
// keeps the built-in defaults for anything the source omits, rather than
|
|
37
|
+
// shallow-replacing whole branches and leaving consumers with undefined.
|
|
38
|
+
_merge(draft, action.settings);
|
|
39
|
+
draft.isHydrated = true;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
export default appSettings;
|