@evenicanpm/storefront-core 1.0.4 → 1.0.5
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/package.json +8 -10
- package/src/api-manager/datasources/d365/d365-address.datasource.ts +2 -2
- package/src/api-manager/datasources/d365/d365-cart.datasource.ts +3 -3
- package/src/api-manager/datasources/d365/d365-categories.datasource.ts +2 -2
- package/src/api-manager/datasources/d365/d365-order.datasource.ts +3 -3
- package/src/api-manager/datasources/d365/d365-organization.datasource.ts +2 -2
- package/src/api-manager/datasources/d365/d365-product.datasource.ts +5 -5
- package/src/api-manager/datasources/d365/d365-session.datasource.ts +2 -2
- package/src/api-manager/datasources/d365/d365-user.datasource.ts +2 -2
- package/src/api-manager/datasources/d365/d365.datasource.ts +8 -8
- package/src/api-manager/datasources/d365/index.ts +2 -2
- package/src/api-manager/datasources/e4/address/e4-address.datasource.ts +4 -4
- package/src/api-manager/datasources/e4/address/e4-address.remaps.ts +1 -1
- package/src/api-manager/datasources/e4/address/e4-address.translator.ts +7 -3
- package/src/api-manager/datasources/e4/cart/e4-cart.datasource.ts +7 -7
- package/src/api-manager/datasources/e4/cart/e4-cart.remaps.ts +7 -3
- package/src/api-manager/datasources/e4/cart/e4-cart.translator.ts +2 -2
- package/src/api-manager/datasources/e4/categories/e4-categories.datasource.ts +2 -2
- package/src/api-manager/datasources/e4/categories/e4-categories.translator.ts +1 -1
- package/src/api-manager/datasources/e4/e4.datasource.ts +9 -9
- package/src/api-manager/datasources/e4/graphqlRequestSdk.ts +2175 -138
- package/src/api-manager/datasources/e4/order/e4-order.datasource.ts +6 -3
- package/src/api-manager/datasources/e4/order/e4-order.remaps.ts +2 -2
- package/src/api-manager/datasources/e4/organization/e4-organization.datasource.ts +1 -1
- package/src/api-manager/datasources/e4/product/e4-product.datasource.ts +4 -4
- package/src/api-manager/datasources/e4/product/e4-product.remaps.ts +2 -2
- package/src/api-manager/datasources/e4/product/e4-product.translator.ts +3 -3
- package/src/api-manager/datasources/e4/session/e4-session.datasource.ts +2 -2
- package/src/api-manager/datasources/e4/session/e4-session.translator.ts +1 -1
- package/src/api-manager/datasources/e4/user/e4-user.datasource.ts +4 -4
- package/src/api-manager/datasources/e4/user/e4-user.remaps.ts +5 -2
- package/src/api-manager/datasources/e4/user/e4-user.translator.ts +5 -2
- package/src/api-manager/datasources/e4/utils/unwrap-e4-variants.ts +6 -2
- package/src/api-manager/index.ts +4 -4
- package/src/api-manager/lib/get-graphql-client.ts +1 -1
- package/src/api-manager/schemas/address.schema.ts +1 -1
- package/src/api-manager/schemas/cart.schema.ts +1 -1
- package/src/api-manager/schemas/order.schema.ts +1 -1
- package/src/api-manager/schemas/organization.schema.ts +1 -1
- package/src/api-manager/schemas/product.schema.ts +1 -1
- package/src/api-manager/schemas/session.schema.ts +2 -2
- package/src/api-manager/schemas/user.schema.ts +1 -1
- package/src/api-manager/services/address/mutations/create-address.ts +2 -2
- package/src/api-manager/services/address/mutations/delete-address.ts +2 -2
- package/src/api-manager/services/address/mutations/get-delivery-options.ts +2 -2
- package/src/api-manager/services/address/mutations/update-address.ts +2 -2
- package/src/api-manager/services/address/queries/get-countries.ts +2 -2
- package/src/api-manager/services/address/queries/get-states.ts +4 -1
- package/src/api-manager/services/cart/mutations/add-discount-code.ts +3 -3
- package/src/api-manager/services/cart/mutations/add-to-cart.ts +3 -3
- package/src/api-manager/services/cart/mutations/checkout.ts +2 -2
- package/src/api-manager/services/cart/mutations/delete-cart-line.ts +3 -3
- package/src/api-manager/services/cart/mutations/get-payment-accept-result.ts +2 -2
- package/src/api-manager/services/cart/mutations/remove-cart-line-delivery-mode.ts +3 -3
- package/src/api-manager/services/cart/mutations/remove-discount-code.ts +3 -3
- package/src/api-manager/services/cart/mutations/update-cart-line-delivery-mode.ts +3 -3
- package/src/api-manager/services/cart/mutations/update-cart-lines.ts +3 -3
- package/src/api-manager/services/cart/mutations/update-cart.ts +3 -3
- package/src/api-manager/services/cart/queries/get-cart-lines-inventory.ts +4 -1
- package/src/api-manager/services/cart/queries/get-cart.ts +2 -2
- package/src/api-manager/services/cart/queries/get-payment-accept-point.ts +4 -1
- package/src/api-manager/services/categories/queries/get-categories.ts +5 -2
- package/src/api-manager/services/create-mutation.ts +2 -2
- package/src/api-manager/services/create-query.ts +2 -2
- package/src/api-manager/services/order/queries/get-order-details.ts +4 -1
- package/src/api-manager/services/order/queries/get-orders.ts +4 -1
- package/src/api-manager/services/organization/queries/get-channel-configuration.ts +4 -1
- package/src/api-manager/services/organization/queries/get-stores.ts +4 -1
- package/src/api-manager/services/product/mutations/search-products.ts +1 -1
- package/src/api-manager/services/product/queries/get-product-availability.ts +4 -1
- package/src/api-manager/services/product/queries/get-product-by-id.ts +5 -2
- package/src/api-manager/services/product/queries/get-product-by-ids.ts +5 -2
- package/src/api-manager/services/product/queries/get-product-list.ts +4 -1
- package/src/api-manager/services/product/queries/get-product-prices.ts +4 -1
- package/src/api-manager/services/product/queries/get-related-products.ts +5 -2
- package/src/api-manager/services/product/queries/search-products.ts +4 -1
- package/src/api-manager/services/product/server/product.server.ts +2 -2
- package/src/api-manager/services/session/mutations/session-init.ts +2 -2
- package/src/api-manager/services/session/mutations/session-logout.ts +2 -2
- package/src/api-manager/services/session/queries/get-session.ts +4 -1
- package/src/api-manager/services/user/mutations/add-to-wishlist.ts +5 -3
- package/src/api-manager/services/user/mutations/copy-cart-to-wishlist.ts +2 -2
- package/src/api-manager/services/user/mutations/create-wishlist.ts +2 -2
- package/src/api-manager/services/user/mutations/delete-wishlist.ts +3 -3
- package/src/api-manager/services/user/mutations/remove-from-wishlist.ts +6 -4
- package/src/api-manager/services/user/mutations/update-user.ts +2 -2
- package/src/api-manager/services/user/mutations/update-wishlist.ts +2 -2
- package/src/api-manager/services/user/queries/get-user-counts.ts +4 -1
- package/src/api-manager/services/user/queries/get-user.ts +4 -1
- package/src/api-manager/services/user/queries/get-wishlist-details.ts +4 -1
- package/src/api-manager/services/user/queries/get-wishlists.ts +4 -1
- package/src/api-manager/types/Datasource.ts +2 -2
- package/src/auth/auth-options.test.ts +1 -1
- package/src/auth/auth-options.ts +1 -1
- package/src/auth/providers/index.ts +3 -3
- package/src/auth/refresh-token.ts +2 -2
- package/src/cms/blocks/{BlockManager.tsx → block-manager.tsx} +2 -2
- package/src/cms/blocks/{Components/BrandLogosScroller.tsx → components/brand-logos-scroller.tsx} +1 -1
- package/src/cms/blocks/{Components/CategoryCarousel → components/category-carousel}/index.tsx +3 -3
- package/src/cms/blocks/{Components/FeaturePill.tsx → components/feature-pill.tsx} +1 -1
- package/src/cms/blocks/{Components/FeaturedCategories.tsx → components/featured-categories.tsx} +2 -2
- package/src/cms/blocks/{Components/FeaturedProducts.tsx → components/featured-products.tsx} +2 -2
- package/src/cms/blocks/{Components/Footer → components/footer}/index.tsx +7 -4
- package/src/cms/blocks/{Components/Footer/sections/FooterContact.tsx → components/footer/sections/footer-contact.tsx} +3 -3
- package/src/cms/blocks/{Components/Footer/sections/FooterLinks.tsx → components/footer/sections/footer-links.tsx} +5 -2
- package/src/cms/blocks/{Components/Footer/sections/FooterSocialLinks.tsx → components/footer/sections/footer-social-links.tsx} +1 -1
- package/src/cms/blocks/{Components/Footer.tsx → components/footer.tsx} +1 -1
- package/src/cms/blocks/{Components/HeroCarousel → components/hero-carousel}/index.tsx +1 -1
- package/src/cms/blocks/{Components/Hero.tsx → components/hero.tsx} +1 -1
- package/src/cms/blocks/{Components/Image.tsx → components/image.tsx} +1 -1
- package/src/cms/blocks/{Components/ProductCarousel → components/product-carousel}/index.tsx +2 -2
- package/src/cms/blocks/{Components/ProductSectionFullWidth → components/product-section-fullwidth}/index.tsx +2 -2
- package/src/cms/blocks/{Components/Seo → components/seo}/index.tsx +1 -1
- package/src/cms/blocks/{Components/Services → components/services}/index.tsx +2 -2
- package/src/cms/blocks/{Components/Services → components/services}/service-card.tsx +1 -1
- package/src/cms/blocks/{Icons → icons}/index.ts +7 -7
- package/src/cms/blocks/index.tsx +15 -15
- package/src/cms/blog.ts +2 -2
- package/src/cms/endpoints.ts +1 -1
- package/src/cms/interfaces/navigation.ts +9 -9
- package/src/cms/pages.ts +1 -1
- package/src/components-v2/BazaarMenu.tsx +2 -0
- package/src/components-v2/BazaarTextField.tsx +1 -1
- package/src/components-v2/DropZone.tsx +4 -1
- package/src/components-v2/ImageWithFallback.tsx +1 -1
- package/src/components-v2/accordion/index.ts +1 -1
- package/src/components-v2/carousel/carousel.tsx +3 -3
- package/src/components-v2/carousel/components/carousel-arrows.tsx +1 -1
- package/src/components-v2/carousel/components/carousel-dots.tsx +4 -1
- package/src/components-v2/carousel/index.ts +1 -1
- package/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1.tsx +1 -1
- package/src/components-v2/carousel-cards/carousel-card-1/index.ts +1 -1
- package/src/components-v2/categories/category-list/category-list.tsx +7 -4
- package/src/components-v2/categories/category-list/index.ts +1 -1
- package/src/components-v2/categories/category-list/styles.ts +1 -1
- package/src/components-v2/categories/category-list-item/category-menu-item.tsx +1 -1
- package/src/components-v2/categories/category-list-item/index.ts +1 -1
- package/src/components-v2/categories/category-menu.tsx +1 -1
- package/src/components-v2/categories/mega-menu/column-list.tsx +1 -1
- package/src/components-v2/categories/mega-menu/mega-menu-1.tsx +2 -2
- package/src/components-v2/categories/mega-menu/mega-menu-2.tsx +4 -4
- package/src/components-v2/flex-box/index.ts +3 -3
- package/src/components-v2/header/{components → __tests__}/user.test.tsx +51 -29
- package/src/components-v2/header/components/mobile-header.tsx +3 -3
- package/src/components-v2/header/components/user.tsx +8 -5
- package/src/components-v2/header/header.tsx +8 -5
- package/src/components-v2/header/index.ts +1 -1
- package/src/components-v2/header/sticky-header.tsx +1 -1
- package/src/components-v2/mini-cart/__tests__/cart-item.test.tsx +31 -40
- package/src/components-v2/mini-cart/__tests__/mini-cart.test.tsx +7 -8
- package/src/components-v2/mini-cart/index.ts +1 -1
- package/src/components-v2/mini-cart/mini-cart-trigger.tsx +1 -1
- package/src/components-v2/mini-cart/mini-cart.tsx +7 -7
- package/src/components-v2/mobile-navigation/index.ts +1 -1
- package/src/components-v2/mobile-navigation/mobile-navigation-bar.tsx +6 -1
- package/src/components-v2/nav-link/index.ts +3 -3
- package/src/components-v2/navbar/categories.tsx +1 -1
- package/src/components-v2/navbar/category-based-menu/category-based-menu.tsx +2 -2
- package/src/components-v2/navbar/category-based-menu/index.ts +1 -1
- package/src/components-v2/navbar/index.ts +1 -1
- package/src/components-v2/navbar/mega-menu/index.ts +1 -1
- package/src/components-v2/navbar/mega-menu/mega-menu.tsx +6 -1
- package/src/components-v2/navbar/mobile-menu/index.ts +1 -1
- package/src/components-v2/navbar/mobile-menu/mobile-menu.test.tsx +7 -13
- package/src/components-v2/navbar/mobile-menu/mobile-menu.tsx +1 -1
- package/src/components-v2/navbar/nav-list/cms-nav.test.tsx +16 -10
- package/src/components-v2/navbar/nav-list/index.ts +1 -1
- package/src/components-v2/navbar/nav-list/nav-item-child.tsx +4 -1
- package/src/components-v2/navbar/nav-list/nav-list.tsx +8 -4
- package/src/components-v2/navbar/navbar.tsx +6 -3
- package/src/components-v2/navbar/utils/transform-nav.test.ts +4 -1
- package/src/components-v2/product-cards/product-card/components/hover-actions.tsx +1 -1
- package/src/components-v2/product-cards/product-card/index.ts +1 -1
- package/src/components-v2/product-cards/product-card/product-card.tsx +10 -6
- package/src/components-v2/product-cards/product-card-plp/index.ts +1 -1
- package/src/components-v2/product-cards/product-card-plp/product-card.tsx +5 -5
- package/src/components-v2/product-cards/product-card-plp-list/index.ts +1 -1
- package/src/components-v2/product-cards/product-card-plp-list/product-card.tsx +7 -8
- package/src/components-v2/product-cards/product-card-search/index.ts +1 -1
- package/src/components-v2/product-cards/product-card-search/product-card.tsx +2 -2
- package/src/components-v2/product-dialog/compound/product-dialog.tsx +61 -45
- package/src/components-v2/product-dialog/index.tsx +1 -2
- package/src/components-v2/product-dimensions/compound/dimensions-group-error.tsx +3 -3
- package/src/components-v2/product-dimensions/compound/dimensions-group-label.tsx +1 -1
- package/src/components-v2/product-dimensions/compound/dimensions-group-list-chip.tsx +1 -1
- package/src/components-v2/product-dimensions/compound/dimensions-group-list.tsx +2 -2
- package/src/components-v2/product-dimensions/compound/dimensions-group.tsx +3 -3
- package/src/components-v2/product-dimensions/compound/dimensions.tsx +1 -1
- package/src/components-v2/product-dimensions/index.tsx +1 -1
- package/src/components-v2/product-quantity-buttons/compound/quantity-buttons-root.tsx +1 -1
- package/src/components-v2/product-quantity-buttons/index.tsx +2 -2
- package/src/components-v2/products-view/compound/products-grid-view.tsx +2 -2
- package/src/components-v2/products-view/compound/products-list-view.tsx +2 -2
- package/src/components-v2/products-view/compound/types.ts +1 -1
- package/src/components-v2/products-view/index.tsx +2 -2
- package/src/components-v2/progress/index.ts +1 -1
- package/src/components-v2/scrollbar/index.ts +1 -1
- package/src/components-v2/scrollbar/scrollbar.tsx +1 -1
- package/src/components-v2/search-bar/compound/results-item-lg.tsx +4 -1
- package/src/components-v2/search-bar/compound/results-item-sm.tsx +4 -1
- package/src/components-v2/search-bar/compound/results-suspense.tsx +4 -4
- package/src/components-v2/search-bar/compound/results.tsx +5 -2
- package/src/components-v2/search-bar/compound/search-bar-root.tsx +5 -5
- package/src/components-v2/search-bar/compound/textfield-adornment-category.tsx +2 -2
- package/src/components-v2/search-bar/compound/textfield.tsx +5 -5
- package/src/components-v2/search-bar/index.tsx +1 -1
- package/src/components-v2/section/compound/section-header.tsx +6 -3
- package/src/components-v2/section/compound/section.tsx +1 -1
- package/src/components-v2/section/index.ts +1 -1
- package/src/components-v2/side-nav/index.ts +1 -1
- package/src/components-v2/sticky/index.ts +1 -1
- package/src/components-v2/sticky/sticky.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/__tests__/create-new-list.test.tsx +82 -0
- package/src/components-v2/wishlist-dialogs/__tests__/wishlistDetailData.json +280 -0
- package/src/components-v2/wishlist-dialogs/__tests__/wishlistsData.json +38 -0
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/add-to-wishlist-button.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-bottom-ui.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-dialog.tsx +4 -4
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/add-to-wishlist-list.tsx +5 -2
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/context.ts +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-header.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/compound/wishlist-dialog-item.tsx +6 -3
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/hooks/use-add-to-wishlist.ts +1 -1
- package/src/components-v2/wishlist-dialogs/add-to-wishlist/index.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-bottom-ui.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-dialog.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/create-wishlist/compound/create-wishlist-form.tsx +2 -2
- package/src/components-v2/wishlist-dialogs/create-wishlist/create-wishlist-button.tsx +1 -1
- package/src/components-v2/wishlist-dialogs/create-wishlist/index.tsx +1 -1
- package/src/lib/build-detail-url.ts +1 -1
- package/src/lib/cart-cookie-handler.ts +1 -1
- package/src/pages-v2/account/account-navigation.tsx +183 -0
- package/src/pages-v2/account/addresses/address-form.tsx +187 -186
- package/src/pages-v2/account/addresses/address-item.tsx +118 -56
- package/src/pages-v2/account/dashboard-header.tsx +103 -76
- package/src/pages-v2/account/orders/order-progress.tsx +104 -65
- package/src/pages-v2/account/orders/order-row.tsx +69 -32
- package/src/pages-v2/account/orders/order-summary.tsx +96 -62
- package/src/pages-v2/account/orders/ordered-products.tsx +128 -87
- package/src/pages-v2/account/profile/profile-button.test.tsx +1 -1
- package/src/pages-v2/account/profile/user-info.tsx +59 -34
- package/src/pages-v2/account/wishlist/create-new-list.tsx +181 -127
- package/src/pages-v2/account/wishlist/create-wishlist-button.tsx +16 -3
- package/src/pages-v2/account/wishlist/wishlist-item.tsx +93 -42
- package/src/pages-v2/cart/__tests__/cart-item.test.tsx +225 -0
- package/src/pages-v2/cart/__tests__/cart-with-items.json +811 -0
- package/src/pages-v2/cart/__tests__/checkout-form.test.tsx +148 -0
- package/src/pages-v2/cart/__tests__/conutries.json +19407 -0
- package/src/pages-v2/cart/__tests__/estimate-shipping.test.tsx +86 -0
- package/src/pages-v2/cart/cart-item.tsx +387 -258
- package/src/pages-v2/cart/checkout-form.tsx +141 -48
- package/src/pages-v2/cart/coupon-entry.tsx +121 -58
- package/src/pages-v2/cart/estimate-shipping.tsx +174 -118
- package/src/pages-v2/checkout/checkout-alt-form/checkout-form.tsx +153 -76
- package/src/pages-v2/checkout/checkout-alt-form/checkout-step.tsx +128 -77
- package/src/pages-v2/checkout/checkout-alt-form/index.ts +1 -1
- package/src/pages-v2/checkout/checkout-alt-form/{heading.tsx → step-heading.tsx} +1 -1
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/address-card.tsx +131 -0
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/delivery-address.tsx +450 -0
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/new-address-form.tsx +322 -0
- package/src/pages-v2/checkout/checkout-alt-form/steps/address/styles.ts +27 -0
- package/src/pages-v2/checkout/checkout-alt-form/steps/customer-info/customer-information.tsx +139 -0
- package/src/pages-v2/checkout/checkout-alt-form/{payment-details.tsx → steps/payment/payment-details.tsx} +123 -141
- package/src/pages-v2/checkout/checkout-alt-form/{delivery-date.tsx → steps/shipping/delivery-date.tsx} +3 -3
- package/src/pages-v2/checkout/checkout-alt-form/{delivery-options.tsx → steps/shipping/delivery-options.tsx} +97 -50
- package/src/pages-v2/checkout/checkout-alt-summary/cart-item.tsx +58 -28
- package/src/pages-v2/checkout/checkout-alt-summary/checkout-alt-summary.tsx +69 -22
- package/src/pages-v2/checkout/checkout-alt-summary/index.ts +1 -1
- package/src/pages-v2/checkout/checkout-alt-summary/list-item.tsx +56 -14
- package/src/pages-v2/confirmation/address.tsx +37 -15
- package/src/pages-v2/confirmation/confirmation-summary.tsx +80 -41
- package/src/pages-v2/confirmation/ordered-products.tsx +127 -95
- package/src/pages-v2/product-details/bopis/find-in-store-button.tsx +2 -2
- package/src/pages-v2/product-details/bopis/find-in-store-modal.tsx +4 -4
- package/src/pages-v2/product-details/bopis/pickup-option-select.tsx +1 -1
- package/src/pages-v2/product-details/bopis/store-card/index.ts +1 -1
- package/src/pages-v2/product-details/bopis/store-card/shop-card.tsx +3 -3
- package/src/pages-v2/product-details/frequently-bought.tsx +1 -1
- package/src/pages-v2/product-details/product-filter-card.tsx +2 -2
- package/src/pages-v2/product-details/product-intro/compound/context.ts +1 -4
- package/src/pages-v2/product-details/product-intro/compound/product-info.tsx +6 -3
- package/src/pages-v2/product-details/product-intro/compound/product-intro-images.tsx +6 -3
- package/src/pages-v2/product-details/product-intro/compound/product-intro.tsx +4 -4
- package/src/pages-v2/product-details/product-intro/utils.ts +0 -1
- package/src/pages-v2/product-details/product-review.tsx +5 -2
- package/src/pages-v2/product-details/product-tabs.tsx +1 -1
- package/src/pages-v2/quickorder/context.ts +39 -0
- package/src/pages-v2/quickorder/index.tsx +31 -0
- package/src/pages-v2/quickorder/order-upload.tsx +19 -26
- package/src/pages-v2/quickorder/provider.tsx +187 -0
- package/src/pages-v2/quickorder/quick-order-actions.tsx +30 -0
- package/src/pages-v2/quickorder/quick-order-header.tsx +22 -0
- package/src/pages-v2/quickorder/quick-order-row.tsx +8 -17
- package/src/pages-v2/quickorder/quick-order-table.tsx +63 -0
- package/src/pages-v2/quickorder/quick-order-upload.tsx +20 -0
- package/src/providers/nav-provider/index.tsx +1 -1
- package/src/providers/notifications/notification-context.tsx +1 -1
- package/src/providers/notifications/use-notification.ts +1 -1
- package/tsconfig.json +2 -1
- package/src/api-manager/lib/get-graphql-client.test.ts +0 -106
- package/src/components/_components/header/components/user.test.tsx +0 -200
- package/src/components/_components/mini-cart/__tests__/cart-item.test.tsx +0 -174
- package/src/components/_components/mini-cart/__tests__/mini-cart.test.tsx +0 -121
- package/src/components/_components/mini-cart/__tests__/test-cart-empty.json +0 -84
- package/src/components/_components/mini-cart/__tests__/test-cart-with-item.json +0 -244
- package/src/components/_components/navbar/mobile-menu/render-levels.test.tsx +0 -71
- package/src/components/_components/navbar/nav-list/cms-nav.test.tsx +0 -84
- package/src/components/_components/navbar/utils/transform-nav.test.ts +0 -209
- package/src/components/_components/search-box/__test__/search-input-category.test.tsx +0 -110
- package/src/components/_components/search-box/__test__/search-input.test.tsx +0 -137
- package/src/components/_components/search-box/__test__/search-results.json +0 -165
- package/src/components/_components/search-box/search-input-category.test.tsx +0 -110
- package/src/components/_components/search-box/search-input.test.tsx +0 -41
- package/src/components-v2/bazaar-types.ts +0 -84
- package/src/pages-v2/account/navigation.tsx +0 -87
- package/src/pages-v2/checkout/checkout-alt-form/address-card.tsx +0 -76
- package/src/pages-v2/checkout/checkout-alt-form/customer-information.tsx +0 -94
- package/src/pages-v2/checkout/checkout-alt-form/delivery-address.tsx +0 -174
- package/src/pages-v2/checkout/checkout-alt-form/edit-address-form.tsx +0 -130
- package/src/pages-v2/checkout/checkout-alt-form/new-address-form.tsx +0 -299
- package/src/pages-v2/quickorder/quick-order-form.tsx +0 -346
- /package/src/cms/blocks/{Components/CategoryCard.tsx → components/category-card.tsx} +0 -0
- /package/src/cms/blocks/{Components/Footer → components/footer}/data/index.ts +0 -0
- /package/src/cms/blocks/{Components/Footer → components/footer}/interfaces.ts +0 -0
- /package/src/cms/blocks/{Components/Footer/sections/FooterAppStore.tsx → components/footer/sections/footer-app-store.tsx} +0 -0
- /package/src/cms/blocks/{Components/Footer/sections/FooterLogo.tsx → components/footer/sections/footer-logo.tsx} +0 -0
- /package/src/cms/blocks/{Components/Footer → components/footer}/styles/index.ts +0 -0
- /package/src/cms/blocks/{Components/MediaCard.tsx → components/media-card.tsx} +0 -0
- /package/src/cms/blocks/{Components/RichText.tsx → components/rich-text.tsx} +0 -0
- /package/src/cms/blocks/{Components → components}/shared/featured-product-card.tsx +0 -0
- /package/src/cms/blocks/{Components → components}/shared/product-category-item.tsx +0 -0
- /package/src/cms/blocks/{Components → components}/shared/product-grid.tsx +0 -0
- /package/src/cms/blocks/{Components → components}/shared/top-categories-card.tsx +0 -0
- /package/src/cms/blocks/{Components → components}/shared/top-rating-product-card.tsx +0 -0
- /package/src/cms/blocks/{Icons/Components/Category.tsx → icons/components/category.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/DottedStar.tsx → icons/components/dotted-star.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/FallbackIcon.tsx → icons/components/fallback-icon.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/GiftBox.tsx → icons/components/gift-box.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/Light.tsx → icons/components/light.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/NewArrival.tsx → icons/components/new-arrival.tsx} +0 -0
- /package/src/cms/blocks/{Icons/Components/RankBadge.tsx → icons/components/rank-badge.tsx} +0 -0
- /package/src/cms/interfaces/{productData.ts → product-data.ts} +0 -0
- /package/src/pages-v2/checkout/checkout-alt-form/{safe-card-preview-data.tsx → steps/payment/safe-card-preview-data.tsx} +0 -0
package/src/cms/blocks/index.tsx
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// From scratch components
|
|
2
|
-
export { default as BrandLogosScroller } from "
|
|
3
|
-
export { default as CategoryCard } from "
|
|
4
|
-
export { default as FeaturedCategories } from "
|
|
5
|
-
export { default as FeaturedProducts } from "
|
|
6
|
-
export { default as FeaturePill } from "
|
|
7
|
-
export { default as Footer } from "
|
|
8
|
-
export { default as Hero } from "
|
|
9
|
-
export { default as MediaCard } from "
|
|
10
|
-
export { default as RichText } from "
|
|
11
|
-
export { default as Image } from "
|
|
12
|
-
export { default as HeroCarousel } from "
|
|
13
|
-
export { default as Services } from "
|
|
14
|
-
export { default as ProductCarousel } from "
|
|
15
|
-
export { default as ProductSectionFullWidth } from "
|
|
16
|
-
export { default as CategoryCarousel } from "
|
|
2
|
+
export { default as BrandLogosScroller } from "@/cms/blocks/components/brand-logos-scroller";
|
|
3
|
+
export { default as CategoryCard } from "@/cms/blocks/components/category-card";
|
|
4
|
+
export { default as FeaturedCategories } from "@/cms/blocks/components/featured-categories";
|
|
5
|
+
export { default as FeaturedProducts } from "@/cms/blocks/components/featured-products";
|
|
6
|
+
export { default as FeaturePill } from "@/cms/blocks/components/feature-pill";
|
|
7
|
+
export { default as Footer } from "@/cms/blocks/components/footer";
|
|
8
|
+
export { default as Hero } from "@/cms/blocks/components/hero";
|
|
9
|
+
export { default as MediaCard } from "@/cms/blocks/components/media-card";
|
|
10
|
+
export { default as RichText } from "@/cms/blocks/components/rich-text";
|
|
11
|
+
export { default as Image } from "@/cms/blocks/components/image";
|
|
12
|
+
export { default as HeroCarousel } from "@/cms/blocks/components/hero-carousel/index";
|
|
13
|
+
export { default as Services } from "@/cms/blocks/components/services/index";
|
|
14
|
+
export { default as ProductCarousel } from "@/cms/blocks/components/product-carousel/index";
|
|
15
|
+
export { default as ProductSectionFullWidth } from "@/cms/blocks/components/product-section-fullwidth/index";
|
|
16
|
+
export { default as CategoryCarousel } from "@/cms/blocks/components/category-carousel/index";
|
package/src/cms/blog.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import cms from "
|
|
1
|
+
import cms from "@/cms/endpoints";
|
|
2
2
|
import { type BlocksContent } from "@strapi/blocks-react-renderer";
|
|
3
|
-
import { Formats } from "
|
|
3
|
+
import { Formats } from "@/cms/interfaces/product-data";
|
|
4
4
|
|
|
5
5
|
export interface Blogs {
|
|
6
6
|
data: Array<{
|
package/src/cms/endpoints.ts
CHANGED
|
@@ -40,13 +40,13 @@ export interface CmsNavRelated {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface CmsNavItem {
|
|
43
|
-
title
|
|
44
|
-
menuAttached
|
|
45
|
-
path
|
|
46
|
-
type
|
|
47
|
-
uiRouterKey
|
|
48
|
-
slug
|
|
49
|
-
related
|
|
50
|
-
external
|
|
51
|
-
items
|
|
43
|
+
title?: string;
|
|
44
|
+
menuAttached?: boolean;
|
|
45
|
+
path?: string;
|
|
46
|
+
type?: "INTERNAL" | "EXTERNAL" | "WRAPPER";
|
|
47
|
+
uiRouterKey?: string;
|
|
48
|
+
slug?: string;
|
|
49
|
+
related?: CmsNavRelated | null;
|
|
50
|
+
external?: boolean;
|
|
51
|
+
items?: CmsNavItem[];
|
|
52
52
|
}
|
package/src/cms/pages.ts
CHANGED
|
@@ -19,6 +19,7 @@ export default function BazaarMenu({
|
|
|
19
19
|
handler,
|
|
20
20
|
options,
|
|
21
21
|
direction = "left",
|
|
22
|
+
sx,
|
|
22
23
|
...props
|
|
23
24
|
}: Props) {
|
|
24
25
|
const [anchorEl, setAnchorEl] = useState<HTMLElement | null>(null);
|
|
@@ -38,6 +39,7 @@ export default function BazaarMenu({
|
|
|
38
39
|
open={open !== undefined ? open : !!anchorEl}
|
|
39
40
|
anchorOrigin={{ vertical: "bottom", horizontal: direction }}
|
|
40
41
|
transformOrigin={{ vertical: "top", horizontal: direction }}
|
|
42
|
+
sx={sx}
|
|
41
43
|
{...props}
|
|
42
44
|
>
|
|
43
45
|
{options(handleClose)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Box, { BoxProps } from "@mui/material/Box";
|
|
2
2
|
import TextField, { TextFieldProps } from "@mui/material/TextField";
|
|
3
3
|
// CUSTOM COMPONENT
|
|
4
|
-
import { H6 } from "
|
|
4
|
+
import { H6 } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
5
5
|
|
|
6
6
|
// ==============================================================
|
|
7
7
|
type Props = TextFieldProps & BoxProps;
|
|
@@ -6,7 +6,10 @@ import Divider from "@mui/material/Divider";
|
|
|
6
6
|
// DROPZONE
|
|
7
7
|
import { Accept, FileRejection, useDropzone } from "react-dropzone";
|
|
8
8
|
// LOCAL CUSTOM COMPONENT
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
H5,
|
|
11
|
+
Small,
|
|
12
|
+
} from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
10
13
|
import { useTranslations } from "next-intl";
|
|
11
14
|
|
|
12
15
|
// ========================================================
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect } from "react";
|
|
4
4
|
import { ImageProps } from "next/image";
|
|
5
|
-
import LazyImage from "
|
|
5
|
+
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
6
6
|
|
|
7
7
|
export interface ImageWithFallbackProps extends ImageProps {
|
|
8
8
|
fallbackSrc?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as AccordionHeader } from "
|
|
1
|
+
export { default as AccordionHeader } from "@evenicanpm/storefront-core/src/components-v2/accordion/accordion-header";
|
|
@@ -6,9 +6,9 @@ import Slider from "react-slick";
|
|
|
6
6
|
import { Settings, CustomArrowProps } from "react-slick";
|
|
7
7
|
import "slick-carousel/slick/slick.css";
|
|
8
8
|
import "slick-carousel/slick/slick-theme.css";
|
|
9
|
-
import { createArrows } from "
|
|
10
|
-
import { createDots } from "
|
|
11
|
-
import { RootStyle } from "
|
|
9
|
+
import { createArrows } from "@evenicanpm/storefront-core/src/components-v2/carousel/components/carousel-arrows";
|
|
10
|
+
import { createDots } from "@evenicanpm/storefront-core/src/components-v2/carousel/components/carousel-dots";
|
|
11
|
+
import { RootStyle } from "@evenicanpm/storefront-core/src/components-v2/carousel/styles/index";
|
|
12
12
|
|
|
13
13
|
type ArrowConfig = {
|
|
14
14
|
sx?: SxProps<Theme>;
|
|
@@ -4,7 +4,7 @@ import { SxProps, Theme } from "@mui/material/styles";
|
|
|
4
4
|
import ArrowBack from "@mui/icons-material/ArrowBack";
|
|
5
5
|
import ArrowForward from "@mui/icons-material/ArrowForward";
|
|
6
6
|
// STYLED COMPONENT
|
|
7
|
-
import { ArrowButton } from "
|
|
7
|
+
import { ArrowButton } from "@evenicanpm/storefront-core/src/components-v2/carousel/styles/index";
|
|
8
8
|
|
|
9
9
|
type ArrowConfig = {
|
|
10
10
|
sx?: SxProps<Theme>;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Settings } from "react-slick";
|
|
2
2
|
import { SxProps, Theme } from "@mui/material/styles";
|
|
3
3
|
// STYLED COMPONENTS
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
Dot,
|
|
6
|
+
DotList,
|
|
7
|
+
} from "@evenicanpm/storefront-core/src/components-v2/carousel/styles/index";
|
|
5
8
|
|
|
6
9
|
type DotConfig = {
|
|
7
10
|
dotColor?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as Carousel } from "
|
|
1
|
+
export { default as Carousel } from "@evenicanpm/storefront-core/src/components-v2/carousel/carousel";
|
|
@@ -5,7 +5,7 @@ import Button from "@mui/material/Button";
|
|
|
5
5
|
import BazaarImage from "@evenicanpm/storefront-core/src/components-v2/BazaarImage";
|
|
6
6
|
import { Paragraph } from "@evenicanpm/storefront-core/src/components-v2/Typography";
|
|
7
7
|
// STYLED COMPONENT
|
|
8
|
-
import { StyledRoot } from "
|
|
8
|
+
import { StyledRoot } from "@evenicanpm/storefront-core/src/components-v2/carousel-cards/carousel-card-1/styles";
|
|
9
9
|
|
|
10
10
|
type CarouselCard1Props = {
|
|
11
11
|
children: ReactNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "
|
|
1
|
+
export { default } from "@evenicanpm/storefront-core/src/components-v2/carousel-cards/carousel-card-1/carousel-card-1";
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import React, { createContext, useContext, ReactNode } from "react";
|
|
4
|
-
import getCategories from "
|
|
5
|
-
import { CategoryHierarchy } from "
|
|
6
|
-
import {
|
|
4
|
+
import getCategories from "@evenicanpm/storefront-core/src/api-manager/services/categories/queries/get-categories";
|
|
5
|
+
import { CategoryHierarchy } from "@evenicanpm/storefront-core/src/lib/category-helpers";
|
|
6
|
+
import {
|
|
7
|
+
StyledRoot,
|
|
8
|
+
SubMenuStyledRoot,
|
|
9
|
+
} from "@evenicanpm/storefront-core/src/components-v2/categories/category-list/styles";
|
|
7
10
|
|
|
8
11
|
import MegaMenu1 from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/mega-menu-1";
|
|
9
12
|
import MegaMenu2 from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/mega-menu-2";
|
|
10
|
-
import CategoryListItem from "
|
|
13
|
+
import CategoryListItem from "@evenicanpm/storefront-core/src/components-v2/categories/category-list-item/index";
|
|
11
14
|
|
|
12
15
|
type MegaMenuType = "default" | "mega-menu-1" | "mega-menu-2";
|
|
13
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "
|
|
1
|
+
export { default } from "@evenicanpm/storefront-core/src/components-v2/categories/category-list/category-list";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "@mui/material/styles/styled";
|
|
2
|
-
import { Props } from "
|
|
2
|
+
import { Props } from "@evenicanpm/storefront-core/src/components-v2/categories/category-list/types";
|
|
3
3
|
import Card from "@mui/material/Card";
|
|
4
4
|
|
|
5
5
|
interface StyledRootProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
@@ -4,7 +4,7 @@ import { ReactNode } from "react";
|
|
|
4
4
|
import { SvgIconComponent } from "@mui/icons-material";
|
|
5
5
|
import ChevronRight from "@mui/icons-material/ChevronRight";
|
|
6
6
|
// STYLED COMPONENT
|
|
7
|
-
import { Wrapper } from "
|
|
7
|
+
import { Wrapper } from "@evenicanpm/storefront-core/src/components-v2/categories/category-list-item/styles";
|
|
8
8
|
|
|
9
9
|
// =============================================================
|
|
10
10
|
interface Props {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "
|
|
1
|
+
export { default } from "@evenicanpm/storefront-core/src/components-v2/categories/category-list-item/category-menu-item";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { MouseEvent, useCallback, useEffect, useState } from "react";
|
|
4
4
|
import styled from "@mui/material/styles/styled";
|
|
5
|
-
import CategoryList from "
|
|
5
|
+
import CategoryList from "@evenicanpm/storefront-core/src/components-v2/categories/category-list/index";
|
|
6
6
|
|
|
7
7
|
// STYLED COMPONENT
|
|
8
8
|
const Wrapper = styled("div", {
|
|
@@ -7,7 +7,7 @@ import Grid from "@mui/material/Grid2";
|
|
|
7
7
|
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
8
8
|
import { FlexBox } from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
9
9
|
import { NavLink } from "@evenicanpm/storefront-core/src/components-v2/nav-link/index";
|
|
10
|
-
import { StyledRoot } from "
|
|
10
|
+
import { StyledRoot } from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/styles";
|
|
11
11
|
|
|
12
12
|
interface RootProps extends PropsWithChildren {
|
|
13
13
|
minWidth?: number;
|
|
@@ -4,9 +4,9 @@ import Box from "@mui/material/Box";
|
|
|
4
4
|
// GLOBAL CUSTOM COMPONENTS
|
|
5
5
|
import LazyImage from "@evenicanpm/storefront-core/src/components-v2/LazyImage";
|
|
6
6
|
// LOCAL CUSTOM COMPONENTS
|
|
7
|
-
import ColumnList from "
|
|
7
|
+
import ColumnList from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/column-list";
|
|
8
8
|
// DATA TYPE
|
|
9
|
-
import { CategoryItemOffer } from "
|
|
9
|
+
import { CategoryItemOffer } from "@evenicanpm/storefront-core/src/components-v2/categories/types";
|
|
10
10
|
import { CategoryHierarchy } from "@/lib/category-helpers";
|
|
11
11
|
|
|
12
12
|
// =========================================================
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// LOCAL CUSTOM COMPONENTS
|
|
2
|
-
import OfferBanner from "
|
|
3
|
-
import ColumnList from "
|
|
4
|
-
import CategoryMenuItem from "
|
|
2
|
+
import OfferBanner from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/banner";
|
|
3
|
+
import ColumnList from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/column-list";
|
|
4
|
+
import CategoryMenuItem from "@evenicanpm/storefront-core/src/components-v2/categories/category-list-item/index";
|
|
5
5
|
// STYLED COMPONENT
|
|
6
|
-
import { StyledRoot } from "
|
|
6
|
+
import { StyledRoot } from "@evenicanpm/storefront-core/src/components-v2/categories/mega-menu/styles";
|
|
7
7
|
// DATA TYPE
|
|
8
8
|
import { CategoryHierarchy } from "@/lib/category-helpers";
|
|
9
9
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import FlexBox from "
|
|
2
|
-
import FlexBetween from "
|
|
3
|
-
import FlexRowCenter from "
|
|
1
|
+
import FlexBox from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-box";
|
|
2
|
+
import FlexBetween from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-between";
|
|
3
|
+
import FlexRowCenter from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-row-center";
|
|
4
4
|
|
|
5
5
|
export { FlexBox, FlexBetween, FlexRowCenter };
|
|
@@ -1,24 +1,32 @@
|
|
|
1
|
-
/*
|
|
2
1
|
import { render, screen, fireEvent, waitFor } from "@testing-library/react";
|
|
3
2
|
import { useSession } from "next-auth/react";
|
|
4
3
|
import { NextIntlClientProvider } from "next-intl";
|
|
5
4
|
import { vi } from "vitest";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import signOut from "@/lib/auth/signout";
|
|
5
|
+
import Header from "@evenicanpm/storefront-core/src/components-v2/header/header";
|
|
6
|
+
import signOut from "@evenicanpm/storefront-core/src/auth/signout";
|
|
9
7
|
|
|
10
|
-
vi.mock(
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
vi.mock(
|
|
9
|
+
"@evenicanpm/storefront-core/src/api-manager/services/session/mutations/session-init",
|
|
10
|
+
() => ({
|
|
11
|
+
default: () => ({ mutateAsync: vi.fn() }),
|
|
12
|
+
}),
|
|
13
|
+
);
|
|
13
14
|
|
|
14
15
|
const mockMutate = vi.fn().mockResolvedValue({});
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
const mockHandleRedirectPromise = vi.fn().mockResolvedValue(null);
|
|
17
|
+
vi.mock(
|
|
18
|
+
"@evenicanpm/storefront-core/src/api-manager/services/user/mutations/update-user",
|
|
19
|
+
() => ({
|
|
20
|
+
default: () => ({ mutateAsync: mockMutate }),
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
18
23
|
|
|
19
|
-
vi.mock(
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
vi.mock(
|
|
25
|
+
"@evenicanpm/storefront-core/src/api-manager/services/session/mutations/session-logout",
|
|
26
|
+
() => ({
|
|
27
|
+
default: () => ({ mutateAsync: vi.fn() }),
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
22
30
|
|
|
23
31
|
vi.mock("next/navigation", () => ({
|
|
24
32
|
useRouter: () => ({
|
|
@@ -32,19 +40,19 @@ vi.mock("next-auth/react", () => ({
|
|
|
32
40
|
signIn: vi.fn(),
|
|
33
41
|
}));
|
|
34
42
|
|
|
35
|
-
vi.mock("
|
|
36
|
-
|
|
37
|
-
handleRedirectPromise:
|
|
38
|
-
},
|
|
43
|
+
vi.mock("@evenicanpm/storefront-core/src/auth/msal", () => ({
|
|
44
|
+
getMsalInstance: () => ({
|
|
45
|
+
handleRedirectPromise: mockHandleRedirectPromise,
|
|
46
|
+
}),
|
|
39
47
|
initializeMsal: vi.fn().mockResolvedValue(undefined),
|
|
40
48
|
}));
|
|
41
49
|
|
|
42
|
-
vi.mock("
|
|
50
|
+
vi.mock("@evenicanpm/storefront-core/src/auth/signout", () => ({
|
|
43
51
|
default: vi.fn(),
|
|
44
52
|
}));
|
|
45
53
|
|
|
46
54
|
describe("User Component", async () => {
|
|
47
|
-
const messages = (await import("
|
|
55
|
+
const messages = (await import("@messages/en-US.json")).default;
|
|
48
56
|
|
|
49
57
|
it("renders login button when user is not authenticated", () => {
|
|
50
58
|
(useSession as jest.Mock).mockReturnValue({
|
|
@@ -54,7 +62,9 @@ describe("User Component", async () => {
|
|
|
54
62
|
|
|
55
63
|
render(
|
|
56
64
|
<NextIntlClientProvider locale="en" messages={messages}>
|
|
57
|
-
<
|
|
65
|
+
<Header className="">
|
|
66
|
+
<Header.User />
|
|
67
|
+
</Header>
|
|
58
68
|
</NextIntlClientProvider>,
|
|
59
69
|
);
|
|
60
70
|
|
|
@@ -72,7 +82,9 @@ describe("User Component", async () => {
|
|
|
72
82
|
|
|
73
83
|
render(
|
|
74
84
|
<NextIntlClientProvider locale="en" messages={messages}>
|
|
75
|
-
<
|
|
85
|
+
<Header>
|
|
86
|
+
<Header.User />
|
|
87
|
+
</Header>
|
|
76
88
|
</NextIntlClientProvider>,
|
|
77
89
|
);
|
|
78
90
|
|
|
@@ -88,7 +100,11 @@ describe("User Component", async () => {
|
|
|
88
100
|
status: "authenticated",
|
|
89
101
|
});
|
|
90
102
|
|
|
91
|
-
render(
|
|
103
|
+
render(
|
|
104
|
+
<Header>
|
|
105
|
+
<Header.User />
|
|
106
|
+
</Header>,
|
|
107
|
+
);
|
|
92
108
|
|
|
93
109
|
expect(signOut).toHaveBeenCalled();
|
|
94
110
|
});
|
|
@@ -103,7 +119,9 @@ describe("User Component", async () => {
|
|
|
103
119
|
|
|
104
120
|
render(
|
|
105
121
|
<NextIntlClientProvider locale="en" messages={messages}>
|
|
106
|
-
<
|
|
122
|
+
<Header>
|
|
123
|
+
<Header.User />
|
|
124
|
+
</Header>
|
|
107
125
|
</NextIntlClientProvider>,
|
|
108
126
|
);
|
|
109
127
|
|
|
@@ -126,7 +144,7 @@ describe("User Component", async () => {
|
|
|
126
144
|
status: "authenticated",
|
|
127
145
|
});
|
|
128
146
|
|
|
129
|
-
vi.mocked(
|
|
147
|
+
vi.mocked(mockHandleRedirectPromise).mockResolvedValue({
|
|
130
148
|
authority: "https://login.microsoftonline.com/some_authority",
|
|
131
149
|
uniqueId: "some_unique_id",
|
|
132
150
|
tenantId: "some_tenant_id",
|
|
@@ -152,7 +170,9 @@ describe("User Component", async () => {
|
|
|
152
170
|
|
|
153
171
|
render(
|
|
154
172
|
<NextIntlClientProvider locale="en" messages={messages}>
|
|
155
|
-
<
|
|
173
|
+
<Header>
|
|
174
|
+
<Header.User />
|
|
175
|
+
</Header>
|
|
156
176
|
</NextIntlClientProvider>,
|
|
157
177
|
);
|
|
158
178
|
|
|
@@ -178,23 +198,25 @@ describe("User Component", async () => {
|
|
|
178
198
|
status: "authenticated",
|
|
179
199
|
});
|
|
180
200
|
|
|
181
|
-
vi.mocked(
|
|
201
|
+
vi.mocked(mockHandleRedirectPromise).mockRejectedValue(
|
|
182
202
|
new Error("MSAL Error"),
|
|
183
203
|
);
|
|
184
204
|
|
|
185
205
|
render(
|
|
186
206
|
<NextIntlClientProvider locale="en" messages={messages}>
|
|
187
|
-
<
|
|
207
|
+
<Header>
|
|
208
|
+
<Header.User />
|
|
209
|
+
</Header>
|
|
188
210
|
</NextIntlClientProvider>,
|
|
189
211
|
);
|
|
190
212
|
|
|
191
213
|
await waitFor(() =>
|
|
192
214
|
expect(consoleErrorSpy).toHaveBeenCalledWith(
|
|
193
|
-
"MSAL
|
|
215
|
+
"MSAL redirect error:",
|
|
194
216
|
expect.any(Error),
|
|
195
217
|
),
|
|
196
218
|
);
|
|
197
219
|
|
|
198
220
|
consoleErrorSpy.mockRestore();
|
|
199
221
|
});
|
|
200
|
-
})
|
|
222
|
+
});
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
FlexBox,
|
|
12
12
|
} from "@evenicanpm/storefront-core/src/components-v2/flex-box/index";
|
|
13
13
|
import SiteLogo from "@evenicanpm/storefront-core/src/components-v2/site-logo";
|
|
14
|
-
import MiniCartTrigger from "
|
|
15
|
-
import User from "
|
|
14
|
+
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components-v2/mini-cart/mini-cart-trigger";
|
|
15
|
+
import User from "@evenicanpm/storefront-core/src/components-v2/header/components/user";
|
|
16
16
|
// ICONS
|
|
17
17
|
import { MdClear as Clear } from "react-icons/md";
|
|
18
18
|
import Search from "@evenicanpm/storefront-core/src/components-v2/icons/search";
|
|
@@ -20,7 +20,7 @@ import MobileCartBag from "@evenicanpm/storefront-core/src/components-v2/icons/c
|
|
|
20
20
|
// API
|
|
21
21
|
import getCart from "@/api-manager/services/cart/queries/get-cart";
|
|
22
22
|
|
|
23
|
-
import useHeader from "
|
|
23
|
+
import useHeader from "@evenicanpm/storefront-core/src/components-v2/header/hooks/use-header";
|
|
24
24
|
import { SearchBarViewSm as SearchBar } from "@evenicanpm/storefront-core/src/components-v2/search-bar";
|
|
25
25
|
import {
|
|
26
26
|
transformCategoryNav,
|
|
@@ -24,12 +24,15 @@ import { NavLink } from "@evenicanpm/storefront-core/src/components-v2/nav-link"
|
|
|
24
24
|
import T from "@evenicanpm/storefront-core/src/components-v2/T";
|
|
25
25
|
// Auth components
|
|
26
26
|
import { signIn, useSession } from "next-auth/react";
|
|
27
|
-
import {
|
|
28
|
-
|
|
27
|
+
import {
|
|
28
|
+
getMsalInstance,
|
|
29
|
+
initializeMsal,
|
|
30
|
+
} from "@evenicanpm/storefront-core/src/auth/msal";
|
|
31
|
+
import signOutCustom from "@evenicanpm/storefront-core/src/auth/signout";
|
|
29
32
|
// API hooks
|
|
30
|
-
import useUpdateUser from "
|
|
31
|
-
import useSessionInit from "
|
|
32
|
-
import useSessionLogout from "
|
|
33
|
+
import useUpdateUser from "@evenicanpm/storefront-core/src/api-manager/services/user/mutations/update-user";
|
|
34
|
+
import useSessionInit from "@evenicanpm/storefront-core/src/api-manager/services/session/mutations/session-init";
|
|
35
|
+
import useSessionLogout from "@evenicanpm/storefront-core/src/api-manager/services/session/mutations/session-logout";
|
|
33
36
|
|
|
34
37
|
interface IdTokenClaims {
|
|
35
38
|
given_name?: string;
|
|
@@ -7,13 +7,16 @@ import { MdOutlineShoppingBag } from "react-icons/md";
|
|
|
7
7
|
import FlexBox from "@evenicanpm/storefront-core/src/components-v2/flex-box/flex-box";
|
|
8
8
|
import SiteLogo from "@evenicanpm/storefront-core/src/components-v2/site-logo";
|
|
9
9
|
// LOCAL CUSTOM COMPONENTS
|
|
10
|
-
import CategoriesMenu from "
|
|
11
|
-
import User from "
|
|
12
|
-
import MiniCartTrigger from "
|
|
10
|
+
import CategoriesMenu from "@evenicanpm/storefront-core/src/components-v2/header/components/categories-menu";
|
|
11
|
+
import User from "@evenicanpm/storefront-core/src/components-v2/header/components/user";
|
|
12
|
+
import MiniCartTrigger from "@evenicanpm/storefront-core/src/components-v2/mini-cart/mini-cart-trigger";
|
|
13
13
|
// STYLED COMPONENTS
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
HeaderWrapper,
|
|
16
|
+
StyledContainer,
|
|
17
|
+
} from "@evenicanpm/storefront-core/src/components-v2/header/styles/index";
|
|
15
18
|
// API
|
|
16
|
-
import getCart from "
|
|
19
|
+
import getCart from "@evenicanpm/storefront-core/src/api-manager/services/cart/queries/get-cart";
|
|
17
20
|
|
|
18
21
|
import { useSession } from "next-auth/react";
|
|
19
22
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from "
|
|
1
|
+
export { default } from "@evenicanpm/storefront-core/src/components-v2/header/header";
|
|
@@ -7,7 +7,7 @@ import { useCallback, useState } from "react";
|
|
|
7
7
|
|
|
8
8
|
import useTheme from "@mui/material/styles/useTheme";
|
|
9
9
|
import useMediaQuery from "@mui/material/useMediaQuery";
|
|
10
|
-
import MobileHeader from "
|
|
10
|
+
import MobileHeader from "@evenicanpm/storefront-core/src/components-v2/header/components/mobile-header";
|
|
11
11
|
|
|
12
12
|
export default function StickyHeader() {
|
|
13
13
|
const [isFixed, setIsFixed] = useState(false);
|