From ea91d7cf29163af0556797f1f0d03b5e97035691 Mon Sep 17 00:00:00 2001 From: Marcin Kwiatkowski Date: Thu, 2 Jun 2022 16:51:28 +0200 Subject: [PATCH] chore: release 1.0.0-rc.8 (#25) --- .babelrc | 16 - .lintstagedrc | 11 - .yarnrc.yml | 1 - README.md | 10 + app/router.scrollBehavior.js | 4 +- components/AddToWishlist.vue | 2 +- components/AppFooter.vue | 7 +- components/AppHeader.vue | 27 +- components/BottomNavigation.vue | 7 +- components/CallToAction.vue | 116 + components/CartSidebar.vue | 61 +- components/Checkout/CartPreview.vue | 18 +- components/Checkout/UserBillingAddresses.vue | 10 +- components/Checkout/UserShippingAddresses.vue | 8 +- components/Checkout/VsfPaymentProvider.vue | 63 +- components/Checkout/VsfShippingProvider.vue | 21 +- components/ContentBlock.vue | 4 +- components/ContentBlocks.vue | 12 +- components/CouponCode.vue | 105 +- components/CurrencySelector.vue | 4 +- components/General/IconSprite.vue | 744 +- components/General/SvgImage.vue | 7 +- components/HTMLContent.vue | 2 +- .../Header/Navigation/HeaderNavigation.vue | 11 +- .../Navigation/HeaderNavigationItem.vue | 9 +- .../HeaderNavigationSubcategories.vue | 24 +- .../__tests__/HeaderNavigation.spec.js | 2 +- .../__tests__/HeaderNavigationItem.spec.js | 2 +- .../HeaderNavigationSubcategories.spec.js | 2 +- components/Header/SearchBar/SearchBar.vue | 62 +- components/Header/SearchBar/SearchResults.vue | 60 +- components/{Hero.vue => HeroSection.vue} | 98 +- components/InstagramFeed.vue | 2 +- components/LoginModal.vue | 38 +- components/MobileStoreBanner.vue | 2 +- components/NewProducts.vue | 8 +- components/Notification.vue | 7 +- components/SkeletonLoader/index.vue | 1 + components/StoreSwitcher.vue | 2 +- components/TopBar/{index.vue => TopBar.vue} | 33 +- components/TopBar/useTopBar.ts | 21 +- components/UserAddressDetails.vue | 6 +- components/__tests__/HTMLContent.spec.ts | 6 + .../__tests__/ProductAddReviewForm.spec.js | 2 +- components/utils/LoadWhenVisible.vue | 2 +- composables/context.ts | 3 + composables/index.ts | 16 +- composables/types.ts | 233 +- composables/useApi/index.ts | 114 +- composables/useBilling/BillingDetails.ts | 17 - composables/useBilling/useBilling.ts | 45 - composables/useConfig/index.ts | 4 +- composables/useConfig/useConfig.ts | 26 +- .../useContent/commands/loadBlocksCommand.ts | 1 + .../useContent/commands/loadContentCommand.ts | 1 - composables/useContent/index.ts | 78 +- composables/useContent/useContent.ts | 133 +- composables/useCountrySearch/index.ts | 4 +- .../useCountrySearch/useCountrySearch.ts | 47 +- composables/useCurrency/index.ts | 6 +- composables/useCurrency/useCurrency.ts | 44 +- composables/useExternalCheckout/index.ts | 11 +- .../useExternalCheckout.ts | 21 +- composables/useFacet/SearchData.ts | 15 - composables/useFacet/_utils.ts | 68 - composables/useFacet/index.ts | 141 - .../useImage/__tests__/useImage.spec.js | 12 +- composables/useImage/index.ts | 10 +- composables/useImage/useImage.ts | 15 +- .../UseMagentoConfiguration.ts | 20 +- composables/useMagentoConfiguration/index.ts | 4 +- .../commands/updateSubscriptionCommand.ts | 8 +- composables/useNewsletter/index.ts | 4 +- composables/useNewsletter/useNewsletter.ts | 25 +- .../usePaymentProvider/PaymentMethodParams.ts | 8 - .../commands/loadCustomerReviewsCommand.ts | 7 +- .../commands/loadReviewMetadataCommand.ts | 1 - composables/useReview/index.ts | 4 +- composables/useReview/useReview.ts | 48 +- .../useShippingProvider.ts | 43 - composables/useStore/index.ts | 4 +- composables/useStore/useStore.ts | 18 +- composables/useUiHelpers/index.ts | 8 +- composables/useUiHelpers/useUiHelpers.ts | 6 +- composables/useUiNotification/index.ts | 4 +- .../useUiNotification/useUiNotification.ts | 2 +- composables/useUiState/index.ts | 4 +- composables/useUiState/useUiState.ts | 2 +- composables/useUrlResolver/UseUrlResolver.ts | 26 +- composables/useUrlResolver/index.ts | 6 +- config.js | 138 - ecosystem.config.js | 2 + enums/cookieNameEnum.js | 2 +- enums/stockStatusEnum.js | 2 +- getters/_utils.ts | 5 +- getters/checkoutGetters.ts | 27 - getters/facetGetters.ts | 95 - getters/index.ts | 9 +- getters/orderGetters.ts | 47 - getters/reviewGetters.ts | 22 +- getters/types.d.ts | 91 +- getters/wishlistGetters.ts | 138 - ...rage.spec.js => asyncLocalStorage.spec.ts} | 43 +- helpers/asyncLocalStorage.ts | 46 +- helpers/cacheControl.js | 11 - helpers/cart/addToCart.ts | 2 +- helpers/checkout/__tests__/steps.spec.js | 15 +- helpers/checkout/address.js | 30 - helpers/checkout/address.ts | 55 + helpers/htmlDecoder.ts | 2 +- helpers/integrationPlugin/context.ts | 27 +- helpers/integrationPlugin/index.ts | 6 +- jest-setup.js | 8 +- lang/de.js | 29 +- lang/en.js | 29 +- layouts/default.vue | 4 +- layouts/error.vue | 9 +- .../__tests__/CategoryEmptyResults.spec.ts | 13 +- .../breadcrumbs/CategoryBreadcrumbs.vue | 51 +- .../__tests__/CategoryBreadcrumbs.spec.ts | 67 + .../cms/__tests__/CmsContent.spec.ts | 6 + .../components/cms/categoryContent.gql.ts | 6 +- .../components/cms/useCategoryContent.ts | 9 +- .../components/filters/CategoryFilters.vue | 24 +- .../FiltersSidebar/SelectedFilters.vue | 36 +- .../__tests__/SelectedFilters.spec.ts | 68 + .../filters/__tests__/CategoryFilters.spec.ts | 125 + .../filters/renderer/CheckboxType.vue | 12 +- .../components/filters/renderer/RadioType.vue | 12 +- .../filters/renderer/SwatchColorType.vue | 1 + .../components/filters/renderer/YesNoType.vue | 2 +- .../renderer/__tests__/CheckboxType.spec.ts | 74 + .../renderer/__tests__/RadioType.spec.ts | 79 + .../__tests__/SwatchColorType.spec.ts | 71 + .../renderer/__tests__/YesNoType.spec.ts | 86 + .../category/components/filters/useFilters.ts | 16 +- .../components/navbar/CategoryNavbar.vue | 11 +- .../navbar/__tests__/CategoryNavbar.spec.js | 80 + .../__tests__/MobileCategorySidebar.spec.ts | 172 + .../components/views/CategoryProductGrid.vue | 15 +- .../components/views/CategoryProductList.vue | 12 +- .../components/views/CategoryProductPrice.vue | 93 + .../__tests__/CategoryProductGrid.spec.ts | 10 + .../__tests__/CategoryProductList.spec.ts | 10 + .../views/useProductsWithCommonCardProps.ts | 108 +- .../category/composables/useCategory/index.ts | 4 +- .../composables/useCategory/useCategory.ts | 6 +- .../composables/useCategorySearch/index.ts | 4 +- .../useCategorySearch/useCategorySearch.ts | 23 +- .../composables/useFacet/getFacetData.gql.ts | 58 + .../category/composables/useFacet/index.ts | 75 + .../createProductAttributeFilterInput.ts | 37 + .../input/createProductAttributeSortInput.ts | 7 + .../composables/useFacet/perPageOptions.ts | 1 + .../composables/useFacet/sortingOptions.ts | 40 + .../composables}/useFacet/useFacet.ts | 45 +- .../catalog/category/config/FiltersConfig.ts | 2 + .../config/__tests__/filtersConfig.spec.ts | 21 +- modules/catalog/category/config/config.ts | 19 +- .../catalog/category/getters/facetGetters.ts | 50 + .../__tests__/useTraverseCategory.spec.ts | 6 +- .../category/helpers/useTraverseCategory.ts | 2 +- .../catalog/category/stores}/category.ts | 0 .../stores}/graphql/categoryList.gql.ts | 0 modules/catalog/category/types.d.ts | 7 - modules/catalog/index.ts | 5 +- modules/catalog/pages/category.vue | 102 +- modules/catalog/pages/product.vue | 804 +- ...getConfigurableProductPriceCommand.spec.ts | 15 + .../getGroupedProductPriceCommand.spec.ts | 9 + .../ConfigurableProductWithSelection.mock.ts | 70 + ...onfigurableProductWithoutSelection.mock.ts | 35 + .../__tests__/mock/GroupedProduct.mock.ts | 142 + .../getConfigurableProductPriceCommand.ts | 9 + ...tConfigurableProductSpecialPriceCommand.ts | 9 + .../pricing/getGroupedProductPriceCommand.ts | 15 + .../components}/ProductAddReviewForm.vue | 16 +- .../product/components/ProductsCarousel.vue | 8 +- .../product-types/bundle/BundleProduct.vue | 242 + .../bundle}/BundleProductSelector.vue | 5 +- .../configurable/ConfigurableProduct.vue | 347 + .../product-types/grouped/GroupedProduct.vue | 219 + .../grouped}/GroupedProductSelector.vue | 24 +- .../product-types/simple/SimpleProduct.vue | 216 + .../components/product-types/styles.scss | 189 + .../product/components/tabs/ProductTabs.vue | 181 + .../commands/getProductDetailsCommand.ts | 6 +- .../commands/getProductListCommand.ts | 6 +- .../product/composables/useProduct/index.ts | 4 +- .../composables/useProduct/useProduct.ts | 4 +- .../composables/useProductGallery/index.ts | 28 + .../useProductGallery/useProductGallery.ts | 33 + .../composables/useProductTabs/index.ts | 58 + .../useProductTabs/useProductTabs.ts | 25 + .../composables/useRelatedProducts/index.ts | 4 +- .../useRelatedProducts/useRelatedProducts.ts | 9 +- .../composables/useUpsellProducts/index.ts | 7 +- .../useUpsellProducts/useUpsellProducts.ts | 6 +- .../catalog/product/enums/ProductTypeEnum.ts | 7 + .../catalog/product/getters/productGetters.ts | 65 +- .../catalog/product/helpers/bundleProduct.ts | 4 +- modules/catalog/product/types.ts | 16 +- modules/catalog/types.d.ts | 17 + .../commands/saveBillingAddressCommand.ts | 0 .../checkout/composables}/useBilling/index.ts | 10 +- .../composables/useBilling/useBilling.ts | 76 + .../useCart/commands/addItemCommand.ts | 4 - .../useCart/commands/applyCouponCommand.ts | 7 +- .../useCart/commands/clearCartCommand.ts | 0 .../useCart/commands/loadCartCommand.ts | 3 +- .../useCart/commands/loadTotalQtyCommand.ts | 0 .../useCart/commands/removeCouponCommand.ts | 6 +- .../useCart/commands/removeItemCommand.ts | 1 - .../useCart/commands/updateItemQtyCommand.ts | 0 .../checkout/composables}/useCart/index.ts | 116 +- .../checkout/composables}/useCart/useCart.ts | 27 +- .../getCustomerShippingMethodsCommand.ts | 0 .../getGuestShippingMethodsCommand.ts | 0 .../useGetShippingMethods/index.ts | 10 +- .../useGetShippingMethods.ts | 12 +- .../commands/placeOrderCommand.ts | 6 +- .../composables}/useMakeOrder/index.ts | 10 +- .../composables}/useMakeOrder/useMakeOrder.ts | 8 +- .../getAvailablePaymentMethodsCommand.ts | 6 +- .../commands/setPaymentMethodOnCartCommand.ts | 8 +- .../composables}/usePaymentProvider/index.ts | 13 +- .../usePaymentProvider/usePaymentProvider.ts | 13 +- .../composables}/useShipping/index.ts | 23 +- .../composables}/useShipping/useShipping.ts | 13 +- .../setShippingMethodsOnCartCommand.ts | 6 +- .../composables}/useShippingProvider/index.ts | 8 +- .../useShippingProvider.ts | 60 + .../checkout/getters}/cartGetters.ts | 80 +- modules/checkout/getters/orderGetters.ts | 25 + modules/checkout/index.ts | 47 + .../checkout/pages}/Checkout.vue | 10 +- .../checkout/pages}/Checkout/Billing.vue | 59 +- .../checkout/pages}/Checkout/Payment.vue | 17 +- .../checkout/pages}/Checkout/Shipping.vue | 52 +- .../checkout/pages}/Checkout/ThankYou.vue | 10 +- .../checkout/pages}/Checkout/UserAccount.vue | 28 +- .../Checkout/__tests__/UserAccount.spec.js | 0 modules/checkout/stores/cart.ts | 14 + modules/checkout/types.ts | 4 + .../composables/useAddresses/index.ts | 2 +- .../composables/useAddresses/useAddresses.ts | 46 +- .../composables/useForgotPassword/index.ts | 8 +- .../useForgotPassword/useForgotPassword.ts | 6 +- .../commands/attachToCartCommand.ts | 5 +- .../composables/useGuestUser/index.ts | 7 +- .../composables/useGuestUser/useGuestUser.ts | 8 +- modules/customer/composables/useUser/index.ts | 35 +- .../useUser/loginStatusPingQuery.gql.ts | 15 - .../customer/composables/useUser/useUser.ts | 29 +- .../commands/createCustomerAddressCommand.ts | 5 +- .../commands/deleteCustomerAddressCommand.ts | 5 +- .../commands/updateCustomerAddressCommand.ts | 5 +- .../composables/useUserAddress/index.ts | 4 +- .../useUserAddress/useUserAddress.ts | 53 +- .../composables/useUserOrder/index.ts | 4 +- .../composables/useUserOrder/useUserOrder.ts | 12 +- modules/customer/enums/OrderStatusEnum.ts | 11 + modules/customer/getters/types.d.ts | 20 +- .../customer/getters/userAddressesGetters.ts | 43 +- .../customer/getters/userBillingGetters.ts | 18 +- .../customer/getters/userShippingGetters.ts | 16 +- modules/customer/helpers/generateUserData.ts | 2 +- modules/customer/index.ts | 85 +- modules/customer/pages/MyAccount.vue | 195 - .../AddressesDetails/AddressEdit.vue | 78 + .../AddressesDetails}/AddressForm.vue | 110 +- .../MyAccount/AddressesDetails/AddressNew.vue | 52 + .../AddressesDetails}/AddressesDetails.vue | 188 +- .../customer/pages/MyAccount/MyAccount.vue | 131 + .../pages/{ => MyAccount}/MyNewsletter.vue | 15 +- .../{ => MyAccount/MyProfile}/MyProfile.vue | 39 +- .../MyProfile}/PasswordResetForm.vue | 21 +- .../MyProfile}/ProfileUpdateForm.vue | 43 +- .../pages/MyAccount/MyProfile/types.ts | 12 + .../pages/{ => MyAccount}/MyReviews.vue | 15 +- .../pages/{ => MyAccount}/MyWishlist.vue | 242 +- .../OrderHistory}/OrderHistory.vue | 181 +- .../OrderInformationAddressColumn.vue | 48 + .../SingleOrder/OrderSummaryRow.vue | 76 + .../OrderHistory/SingleOrder/SingleOrder.vue | 271 + .../pages/MyAccount/useSidebarLinkGroups.ts | 62 + .../customer/stores}/customer.ts | 9 +- modules/customer/types/form.ts | 8 + modules/magento/defaultConfig.ts | 6 +- modules/magento/helpers/index.ts | 6 +- modules/magento/index.ts | 2 +- modules/magento/plugin.ts | 2 +- modules/theme/index.ts | 5 - modules/wishlist/components/EmptyWishlist.vue | 72 + .../components}/WishlistSidebar.vue | 112 +- .../__tests__/EmptyWishlist.spec.ts | 23 + .../wishlist/composables/useWishlist/index.ts | 82 +- .../composables/useWishlist/useWishlist.ts | 27 +- modules/wishlist/getters/wishlistGetters.ts | 127 + nuxt.config.js | 2 +- package.json | 11 +- pages/Checkout/ExternalCheckoutThankYou.vue | 4 +- pages/Checkout/__tests__/Shipping.spec.js | 49 - pages/Home.vue | 130 +- pages/Page.vue | 24 +- pages/ResetPassword.vue | 27 +- plugins/__tests__/token-expired.spec.js | 5 +- plugins/dompurify.ts | 5 +- plugins/fcPlugin.ts | 16 +- plugins/graphqlClient.ts | 2 +- plugins/token-expired.ts | 12 +- routes.js | 37 - serverMiddleware/body-parser.js | 8 +- test-utils.js | 5 + test-utils/mocks/categoryFiltersMock.ts | 44 + test-utils/mocks/categoryNavbarMock.ts | 35 + test-utils/mocks/categoryTreeDataMock.ts | 539 + test-utils/mocks/cmsContentMock.ts | 119 + test-utils/mocks/injectMock.ts | 6 + test-utils/mocks/removableFiltersMock.ts | 27 + test-utils/mocks/useCategoryStore.ts | 6 + test-utils/mocks/useContext.ts | 9 + test-utils/mocks/useRoute.ts | 8 + test-utils/mocks/useRouter.ts | 6 + test-utils/mocks/useTraverseCategoryMock.ts | 193 + test-utils/mocks/useUiHelpersMock.ts | 4 +- .../mocks/{useUiState.js => useUiState.ts} | 4 + test-utils/tests/cmsContent.ts | 14 + tests/e2e/cypress.json | 2 +- tests/e2e/integration/e2e-user-login.spec.ts | 9 +- .../integration/e2e-user-registration.spec.ts | 7 +- tests/e2e/pages/checkout/Billing.ts | 15 + tests/e2e/pages/checkout/Payment.ts | 15 + .../{checkout.ts => checkout/Shipping.ts} | 47 +- tests/e2e/pages/checkout/ThankYou.ts | 7 + tests/e2e/pages/checkout/index.ts | 4 + tests/e2e/plugins/index.js | 25 - tests/e2e/plugins/index.ts | 11 + tests/e2e/support/commands.js | 1 + types/componentTemplateRef.ts | 13 + types/core.ts | 897 +- types/packages.d.ts | 8 + .../click-outside/click-outside-directive.js | 19 - .../click-outside/click-outside-directive.ts | 26 + yarn.lock | 36425 +++++++--------- 345 files changed, 24579 insertions(+), 26307 deletions(-) delete mode 100644 .babelrc delete mode 100644 .lintstagedrc delete mode 100644 .yarnrc.yml create mode 100644 components/CallToAction.vue rename components/{Hero.vue => HeroSection.vue} (61%) rename components/TopBar/{index.vue => TopBar.vue} (58%) create mode 100644 components/__tests__/HTMLContent.spec.ts delete mode 100644 composables/useBilling/BillingDetails.ts delete mode 100644 composables/useBilling/useBilling.ts delete mode 100644 composables/useFacet/SearchData.ts delete mode 100644 composables/useFacet/_utils.ts delete mode 100644 composables/useFacet/index.ts delete mode 100644 composables/usePaymentProvider/PaymentMethodParams.ts delete mode 100644 composables/useShippingProvider/useShippingProvider.ts delete mode 100644 config.js delete mode 100644 getters/checkoutGetters.ts delete mode 100644 getters/facetGetters.ts delete mode 100644 getters/orderGetters.ts delete mode 100644 getters/wishlistGetters.ts rename helpers/__tests__/{asyncLocalStorage.spec.js => asyncLocalStorage.spec.ts} (61%) delete mode 100644 helpers/cacheControl.js delete mode 100644 helpers/checkout/address.js create mode 100644 helpers/checkout/address.ts create mode 100644 modules/catalog/category/components/breadcrumbs/__tests__/CategoryBreadcrumbs.spec.ts create mode 100644 modules/catalog/category/components/cms/__tests__/CmsContent.spec.ts create mode 100644 modules/catalog/category/components/filters/FiltersSidebar/__tests__/SelectedFilters.spec.ts create mode 100644 modules/catalog/category/components/filters/__tests__/CategoryFilters.spec.ts create mode 100644 modules/catalog/category/components/filters/renderer/__tests__/CheckboxType.spec.ts create mode 100644 modules/catalog/category/components/filters/renderer/__tests__/RadioType.spec.ts create mode 100644 modules/catalog/category/components/filters/renderer/__tests__/SwatchColorType.spec.ts create mode 100644 modules/catalog/category/components/filters/renderer/__tests__/YesNoType.spec.ts create mode 100644 modules/catalog/category/components/navbar/__tests__/CategoryNavbar.spec.js create mode 100644 modules/catalog/category/components/sidebar/MobileCategorySidebar/__tests__/MobileCategorySidebar.spec.ts create mode 100644 modules/catalog/category/components/views/CategoryProductPrice.vue create mode 100644 modules/catalog/category/composables/useFacet/getFacetData.gql.ts create mode 100644 modules/catalog/category/composables/useFacet/index.ts create mode 100644 modules/catalog/category/composables/useFacet/input/createProductAttributeFilterInput.ts create mode 100644 modules/catalog/category/composables/useFacet/input/createProductAttributeSortInput.ts create mode 100644 modules/catalog/category/composables/useFacet/perPageOptions.ts create mode 100644 modules/catalog/category/composables/useFacet/sortingOptions.ts rename {composables => modules/catalog/category/composables}/useFacet/useFacet.ts (52%) create mode 100644 modules/catalog/category/getters/facetGetters.ts rename {stores => modules/catalog/category/stores}/category.ts (100%) rename {stores => modules/catalog/category/stores}/graphql/categoryList.gql.ts (100%) create mode 100644 modules/catalog/pricing/__tests__/getConfigurableProductPriceCommand.spec.ts create mode 100644 modules/catalog/pricing/__tests__/getGroupedProductPriceCommand.spec.ts create mode 100644 modules/catalog/pricing/__tests__/mock/ConfigurableProductWithSelection.mock.ts create mode 100644 modules/catalog/pricing/__tests__/mock/ConfigurableProductWithoutSelection.mock.ts create mode 100644 modules/catalog/pricing/__tests__/mock/GroupedProduct.mock.ts create mode 100644 modules/catalog/pricing/getConfigurableProductPriceCommand.ts create mode 100644 modules/catalog/pricing/getConfigurableProductSpecialPriceCommand.ts create mode 100644 modules/catalog/pricing/getGroupedProductPriceCommand.ts rename {components => modules/catalog/product/components}/ProductAddReviewForm.vue (94%) create mode 100644 modules/catalog/product/components/product-types/bundle/BundleProduct.vue rename modules/catalog/product/components/{ => product-types/bundle}/BundleProductSelector.vue (97%) create mode 100644 modules/catalog/product/components/product-types/configurable/ConfigurableProduct.vue create mode 100644 modules/catalog/product/components/product-types/grouped/GroupedProduct.vue rename modules/catalog/product/components/{ => product-types/grouped}/GroupedProductSelector.vue (88%) create mode 100644 modules/catalog/product/components/product-types/simple/SimpleProduct.vue create mode 100644 modules/catalog/product/components/product-types/styles.scss create mode 100644 modules/catalog/product/components/tabs/ProductTabs.vue create mode 100644 modules/catalog/product/composables/useProductGallery/index.ts create mode 100644 modules/catalog/product/composables/useProductGallery/useProductGallery.ts create mode 100644 modules/catalog/product/composables/useProductTabs/index.ts create mode 100644 modules/catalog/product/composables/useProductTabs/useProductTabs.ts create mode 100644 modules/catalog/product/enums/ProductTypeEnum.ts create mode 100644 modules/catalog/types.d.ts rename {composables => modules/checkout/composables}/useBilling/commands/saveBillingAddressCommand.ts (100%) rename {composables => modules/checkout/composables}/useBilling/index.ts (85%) create mode 100644 modules/checkout/composables/useBilling/useBilling.ts rename {composables => modules/checkout/composables}/useCart/commands/addItemCommand.ts (97%) rename {composables => modules/checkout/composables}/useCart/commands/applyCouponCommand.ts (73%) rename {composables => modules/checkout/composables}/useCart/commands/clearCartCommand.ts (100%) rename {composables => modules/checkout/composables}/useCart/commands/loadCartCommand.ts (95%) rename {composables => modules/checkout/composables}/useCart/commands/loadTotalQtyCommand.ts (100%) rename {composables => modules/checkout/composables}/useCart/commands/removeCouponCommand.ts (76%) rename {composables => modules/checkout/composables}/useCart/commands/removeItemCommand.ts (97%) rename {composables => modules/checkout/composables}/useCart/commands/updateItemQtyCommand.ts (100%) rename {composables => modules/checkout/composables}/useCart/index.ts (63%) rename {composables => modules/checkout/composables}/useCart/useCart.ts (82%) rename {composables => modules/checkout/composables}/useGetShippingMethods/commands/getCustomerShippingMethodsCommand.ts (100%) rename {composables => modules/checkout/composables}/useGetShippingMethods/commands/getGuestShippingMethodsCommand.ts (100%) rename {composables => modules/checkout/composables}/useGetShippingMethods/index.ts (70%) rename {composables => modules/checkout/composables}/useGetShippingMethods/useGetShippingMethods.ts (59%) rename {composables => modules/checkout/composables}/useMakeOrder/commands/placeOrderCommand.ts (54%) rename {composables => modules/checkout/composables}/useMakeOrder/index.ts (76%) rename {composables => modules/checkout/composables}/useMakeOrder/useMakeOrder.ts (79%) rename {composables => modules/checkout/composables}/usePaymentProvider/commands/getAvailablePaymentMethodsCommand.ts (59%) rename {composables => modules/checkout/composables}/usePaymentProvider/commands/setPaymentMethodOnCartCommand.ts (51%) rename {composables => modules/checkout/composables}/usePaymentProvider/index.ts (78%) rename {composables => modules/checkout/composables}/usePaymentProvider/usePaymentProvider.ts (82%) rename {composables => modules/checkout/composables}/useShipping/index.ts (84%) rename {composables => modules/checkout/composables}/useShipping/useShipping.ts (86%) rename {composables => modules/checkout/composables}/useShippingProvider/commands/setShippingMethodsOnCartCommand.ts (64%) rename {composables => modules/checkout/composables}/useShippingProvider/index.ts (86%) create mode 100644 modules/checkout/composables/useShippingProvider/useShippingProvider.ts rename {getters => modules/checkout/getters}/cartGetters.ts (62%) create mode 100644 modules/checkout/getters/orderGetters.ts create mode 100644 modules/checkout/index.ts rename {pages => modules/checkout/pages}/Checkout.vue (93%) rename {pages => modules/checkout/pages}/Checkout/Billing.vue (90%) rename {pages => modules/checkout/pages}/Checkout/Payment.vue (93%) rename {pages => modules/checkout/pages}/Checkout/Shipping.vue (91%) rename {pages => modules/checkout/pages}/Checkout/ThankYou.vue (98%) rename {pages => modules/checkout/pages}/Checkout/UserAccount.vue (93%) rename {pages => modules/checkout/pages}/Checkout/__tests__/UserAccount.spec.js (100%) create mode 100644 modules/checkout/stores/cart.ts create mode 100644 modules/checkout/types.ts delete mode 100644 modules/customer/composables/useUser/loginStatusPingQuery.gql.ts create mode 100644 modules/customer/enums/OrderStatusEnum.ts delete mode 100644 modules/customer/pages/MyAccount.vue create mode 100644 modules/customer/pages/MyAccount/AddressesDetails/AddressEdit.vue rename modules/customer/{components => pages/MyAccount/AddressesDetails}/AddressForm.vue (78%) create mode 100644 modules/customer/pages/MyAccount/AddressesDetails/AddressNew.vue rename modules/customer/pages/{ => MyAccount/AddressesDetails}/AddressesDetails.vue (55%) create mode 100644 modules/customer/pages/MyAccount/MyAccount.vue rename modules/customer/pages/{ => MyAccount}/MyNewsletter.vue (91%) rename modules/customer/pages/{ => MyAccount/MyProfile}/MyProfile.vue (69%) rename modules/customer/{components => pages/MyAccount/MyProfile}/PasswordResetForm.vue (85%) rename modules/customer/{components => pages/MyAccount/MyProfile}/ProfileUpdateForm.vue (84%) create mode 100644 modules/customer/pages/MyAccount/MyProfile/types.ts rename modules/customer/pages/{ => MyAccount}/MyReviews.vue (91%) rename modules/customer/pages/{ => MyAccount}/MyWishlist.vue (64%) rename modules/customer/pages/{ => MyAccount/OrderHistory}/OrderHistory.vue (52%) create mode 100644 modules/customer/pages/MyAccount/OrderHistory/SingleOrder/OrderInformationAddressColumn.vue create mode 100644 modules/customer/pages/MyAccount/OrderHistory/SingleOrder/OrderSummaryRow.vue create mode 100644 modules/customer/pages/MyAccount/OrderHistory/SingleOrder/SingleOrder.vue create mode 100644 modules/customer/pages/MyAccount/useSidebarLinkGroups.ts rename {stores => modules/customer/stores}/customer.ts (56%) create mode 100644 modules/customer/types/form.ts delete mode 100644 modules/theme/index.ts create mode 100644 modules/wishlist/components/EmptyWishlist.vue rename modules/{theme/components/wishlist => wishlist/components}/WishlistSidebar.vue (76%) create mode 100644 modules/wishlist/components/__tests__/EmptyWishlist.spec.ts create mode 100644 modules/wishlist/getters/wishlistGetters.ts delete mode 100644 pages/Checkout/__tests__/Shipping.spec.js create mode 100644 test-utils/mocks/categoryFiltersMock.ts create mode 100644 test-utils/mocks/categoryNavbarMock.ts create mode 100644 test-utils/mocks/cmsContentMock.ts create mode 100644 test-utils/mocks/injectMock.ts create mode 100644 test-utils/mocks/removableFiltersMock.ts create mode 100644 test-utils/mocks/useCategoryStore.ts create mode 100644 test-utils/mocks/useContext.ts create mode 100644 test-utils/mocks/useRoute.ts create mode 100644 test-utils/mocks/useRouter.ts create mode 100644 test-utils/mocks/useTraverseCategoryMock.ts rename test-utils/mocks/{useUiState.js => useUiState.ts} (52%) create mode 100644 test-utils/tests/cmsContent.ts create mode 100644 tests/e2e/pages/checkout/Billing.ts create mode 100644 tests/e2e/pages/checkout/Payment.ts rename tests/e2e/pages/{checkout.ts => checkout/Shipping.ts} (65%) mode change 100755 => 100644 create mode 100644 tests/e2e/pages/checkout/ThankYou.ts create mode 100755 tests/e2e/pages/checkout/index.ts delete mode 100755 tests/e2e/plugins/index.js create mode 100755 tests/e2e/plugins/index.ts create mode 100644 types/componentTemplateRef.ts create mode 100644 types/packages.d.ts delete mode 100644 utilities/directives/click-outside/click-outside-directive.js create mode 100644 utilities/directives/click-outside/click-outside-directive.ts diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 84c2e57..0000000 --- a/.babelrc +++ /dev/null @@ -1,16 +0,0 @@ -{ - "env": { - "test": { - "presets": [ - [ - "@babel/preset-env", - { - "targets": { - "node": "current" - } - } - ] - ] - } - } -} diff --git a/.lintstagedrc b/.lintstagedrc deleted file mode 100644 index ceb5029..0000000 --- a/.lintstagedrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "*.{js,jsx}": [ - "eslint --fix" - ], - "*.{ts,tsx}": [ - "eslint --fix" - ], - "*.{vue}": [ - "eslint --fix" - ], -} diff --git a/.yarnrc.yml b/.yarnrc.yml deleted file mode 100644 index 3186f3f..0000000 --- a/.yarnrc.yml +++ /dev/null @@ -1 +0,0 @@ -nodeLinker: node-modules diff --git a/README.md b/README.md index c5247cf..4542b3a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,11 @@ # Magento 2.x theme + +[![All Contributors](https://img.shields.io/badge/all_contributors-21-orange.svg?style=flat-square)](#contributors-) + + + ### Vue Storefront 2 integration with Magento ### Requirements: @@ -91,6 +96,10 @@ Thanks go to these wonderful people 🙌:
Jonathan Ribas

💻
Ali Ghanei

💻
Maya Shavin

📖 +
Alexander Devitsky

💻 + + +
Diego Alba

💻 @@ -100,3 +109,4 @@ Thanks go to these wonderful people 🙌: This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! + diff --git a/app/router.scrollBehavior.js b/app/router.scrollBehavior.js index 4e0816d..64be137 100644 --- a/app/router.scrollBehavior.js +++ b/app/router.scrollBehavior.js @@ -1,6 +1,6 @@ -export default function (_to, _from, savedPosition) { +export default function scrollBehavior(_to, _from, savedPosition) { return savedPosition || { x: 0, y: 0, }; -}; +} diff --git a/components/AddToWishlist.vue b/components/AddToWishlist.vue index f7137a1..f9e88c2 100644 --- a/components/AddToWishlist.vue +++ b/components/AddToWishlist.vue @@ -17,7 +17,7 @@ - diff --git a/components/CartSidebar.vue b/components/CartSidebar.vue index 292189e..8cfbae8 100644 --- a/components/CartSidebar.vue +++ b/components/CartSidebar.vue @@ -202,15 +202,37 @@
+ + + + +
+ + @@ -238,7 +260,7 @@
- diff --git a/components/CurrencySelector.vue b/components/CurrencySelector.vue index f7c9c6e..ebbc34a 100644 --- a/components/CurrencySelector.vue +++ b/components/CurrencySelector.vue @@ -14,7 +14,7 @@ /> - diff --git a/components/TopBar/useTopBar.ts b/components/TopBar/useTopBar.ts index 6c5f113..37ee4ae 100644 --- a/components/TopBar/useTopBar.ts +++ b/components/TopBar/useTopBar.ts @@ -1,20 +1,25 @@ import { ref, onMounted } from '@nuxtjs/composition-api'; +import type { Currency, StoreConfig } from '~/modules/GraphQL/types'; -import useApi from '~/composables/useApi'; +import { useApi } from '~/composables/useApi'; import checkStoresAndCurrencyQuery from './checkStoresAndCurrency.gql'; +type StoresAndCurrencyQueryResponse = { + availableStores: Pick[], + currency: Pick, +}; + export const useTopBar = () => { const { query } = useApi(); - const hasStoresToSelect = ref(null); - const hasCurrencyToSelect = ref(null); + const hasStoresToSelect = ref(null); + const hasCurrencyToSelect = ref(null); onMounted(() => { - query(checkStoresAndCurrencyQuery) + query(checkStoresAndCurrencyQuery) + // eslint-disable-next-line promise/always-return .then((data) => { - hasStoresToSelect.value = data?.availableStores?.length; - hasCurrencyToSelect.value = data?.currency?.available_currency_codes?.length > 1; - - return data; + hasStoresToSelect.value = data.availableStores.length > 1; + hasCurrencyToSelect.value = data.currency.available_currency_codes.length > 1; }) .catch(() => { hasStoresToSelect.value = false; diff --git a/components/UserAddressDetails.vue b/components/UserAddressDetails.vue index beea8b0..1be1d10 100644 --- a/components/UserAddressDetails.vue +++ b/components/UserAddressDetails.vue @@ -37,15 +37,17 @@ - + diff --git a/modules/catalog/category/components/breadcrumbs/__tests__/CategoryBreadcrumbs.spec.ts b/modules/catalog/category/components/breadcrumbs/__tests__/CategoryBreadcrumbs.spec.ts new file mode 100644 index 0000000..98408f4 --- /dev/null +++ b/modules/catalog/category/components/breadcrumbs/__tests__/CategoryBreadcrumbs.spec.ts @@ -0,0 +1,67 @@ +import { mount } from '@vue/test-utils'; +import * as composables from '@nuxtjs/composition-api'; +import { + categoryAncestorsFirstLevelMock, + categoryAncestorsSecondLevelMock, + categoryAncestorsThirdLevelMock, + useTraverseCategoryMock, +} from '~/test-utils/mocks/useTraverseCategoryMock'; +import { useUiHelpers } from '~/composables'; +import { useTraverseCategory } from '~/modules/catalog/category/helpers/useTraverseCategory'; +import CategoryBreadcrumbs from '~/modules/catalog/category/components/breadcrumbs/CategoryBreadcrumbs.vue'; +import type { CategoryTree } from '~/modules/GraphQL/types'; + +jest.mock('@nuxtjs/composition-api', () => { + const originalComposables = jest.requireActual('@nuxtjs/composition-api'); + return { + ...originalComposables, + useContext: jest.fn(), + }; +}); +jest.mock('~/composables'); +jest.mock('~/modules/catalog/category/helpers/useTraverseCategory'); + +(composables.useContext as jest.Mock).mockReturnValue({ + localePath: jest.fn((path: string) => path), +}); +(useUiHelpers as jest.Mock).mockReturnValue({ + getCatLink: jest.fn( + (category: CategoryTree): string => `/c/${category.url_path}${category.url_suffix || ''}`, + ), +}); + +describe('CategoryBreadcrumbs.vue', () => { + it('Breadcrumbs should not render if there is only a first level category', () => { + (useTraverseCategory as jest.Mock).mockReturnValue(useTraverseCategoryMock(categoryAncestorsFirstLevelMock)); + const wrapper = mount(CategoryBreadcrumbs); + expect(wrapper).toBeDefined(); + expect(wrapper.find('li').exists()).toBeFalsy(); + }); + + it('Breadcrumbs must have one item for the second level category', () => { + (useTraverseCategory as jest.Mock).mockReturnValue(useTraverseCategoryMock(categoryAncestorsSecondLevelMock)); + const wrapper = mount(CategoryBreadcrumbs); + expect(wrapper.findAll('li')).toHaveLength(1); + }); + + it('Breadcrumbs must have two item for the third level category', () => { + (useTraverseCategory as jest.Mock).mockReturnValue(useTraverseCategoryMock(categoryAncestorsThirdLevelMock)); + const wrapper = mount(CategoryBreadcrumbs); + expect(wrapper.findAll('li')).toHaveLength(2); + }); + + it('Breadcrumb must have link that should have href attribute', () => { + (useTraverseCategory as jest.Mock).mockReturnValue(useTraverseCategoryMock(categoryAncestorsSecondLevelMock)); + const wrapper = mount(CategoryBreadcrumbs); + const link = wrapper.find('a'); + expect(link).toBeDefined(); + expect(link.attributes('href')).toBeDefined(); + }); + + it('The last breadcrumb must have \'current\' class', () => { + (useTraverseCategory as jest.Mock).mockReturnValue(useTraverseCategoryMock(categoryAncestorsThirdLevelMock)); + const wrapper = mount(CategoryBreadcrumbs); + const links = wrapper.findAll('a'); + expect(links.at(-1).classes()).toContain('current'); + }); +}); diff --git a/modules/catalog/category/components/cms/__tests__/CmsContent.spec.ts b/modules/catalog/category/components/cms/__tests__/CmsContent.spec.ts new file mode 100644 index 0000000..9203bc2 --- /dev/null +++ b/modules/catalog/category/components/cms/__tests__/CmsContent.spec.ts @@ -0,0 +1,6 @@ +import { cmsContentTest } from '~/test-utils/tests/cmsContent'; +import CmsContent from '~/modules/catalog/category/components/cms/CmsContent.vue'; + +describe('CmsContent.vue', () => { + cmsContentTest(CmsContent); +}); diff --git a/modules/catalog/category/components/cms/categoryContent.gql.ts b/modules/catalog/category/components/cms/categoryContent.gql.ts index 0cfc6c0..d0413f3 100644 --- a/modules/catalog/category/components/cms/categoryContent.gql.ts +++ b/modules/catalog/category/components/cms/categoryContent.gql.ts @@ -1,9 +1,9 @@ import { gql } from 'graphql-request'; export default gql` - query category($id: Int!) { - category(id: $id) { - id + query getCategoryContentData($filters: CategoryFilterInput) { + categoryList(filters: $filters) { + uid display_mode landing_page cms_block { diff --git a/modules/catalog/category/components/cms/useCategoryContent.ts b/modules/catalog/category/components/cms/useCategoryContent.ts index bc062e0..dbe633a 100644 --- a/modules/catalog/category/components/cms/useCategoryContent.ts +++ b/modules/catalog/category/components/cms/useCategoryContent.ts @@ -21,10 +21,11 @@ interface CmsContentInterface { export const useCategoryContent = () => { const { query } = useApi(); - const getContentData = async (id: number): Promise => { - const data = await query(categoryContentQuery, { id }); - const cmsBlock = data?.category?.cms_block ?? { cmsBlock: { content: '' } }; - const displayMode = data?.category?.display_mode ?? displayModesEnum.PRODUCTS; + const getContentData = async (uid: string): Promise => { + const data = await query(categoryContentQuery, { filters: { category_uid: { eq: uid } } }); + const category = data.categoryList[0] ?? {}; + const cmsBlock = category?.cms_block ?? { cmsBlock: { content: '' } }; + const displayMode = category?.display_mode ?? displayModesEnum.PRODUCTS; const isShowCms = displayMode === displayModesEnum.PAGE || displayMode === displayModesEnum.PRODUCTS_AND_PAGE; const isShowProducts = displayMode === displayModesEnum.PRODUCTS || displayMode === displayModesEnum.PRODUCTS_AND_PAGE; diff --git a/modules/catalog/category/components/filters/CategoryFilters.vue b/modules/catalog/category/components/filters/CategoryFilters.vue index 1e54535..6494e8a 100644 --- a/modules/catalog/category/components/filters/CategoryFilters.vue +++ b/modules/catalog/category/components/filters/CategoryFilters.vue @@ -3,7 +3,10 @@

{{ $t('Filters') }}

-
+
{{ $t('Apply filters') }} {{ $t('Clear all') }} @@ -67,6 +73,7 @@ :visible="isVisible" class="sidebar-filters smartphone-only" title="Filters" + data-testid="mobile-sidebar" @close="$emit('close')" > @@ -112,7 +119,7 @@ diff --git a/modules/catalog/category/components/views/CategoryProductList.vue b/modules/catalog/category/components/views/CategoryProductList.vue index e6f0634..ab8d168 100644 --- a/modules/catalog/category/components/views/CategoryProductList.vue +++ b/modules/catalog/category/components/views/CategoryProductList.vue @@ -42,6 +42,9 @@ value="white" /> + - + + diff --git a/modules/customer/pages/AddressesDetails.vue b/modules/customer/pages/MyAccount/AddressesDetails/AddressesDetails.vue similarity index 55% rename from modules/customer/pages/AddressesDetails.vue rename to modules/customer/pages/MyAccount/AddressesDetails/AddressesDetails.vue index fc7ed35..ee7d709 100644 --- a/modules/customer/pages/AddressesDetails.vue +++ b/modules/customer/pages/MyAccount/AddressesDetails/AddressesDetails.vue @@ -1,38 +1,52 @@ - + + diff --git a/modules/customer/pages/MyNewsletter.vue b/modules/customer/pages/MyAccount/MyNewsletter.vue similarity index 91% rename from modules/customer/pages/MyNewsletter.vue rename to modules/customer/pages/MyAccount/MyNewsletter.vue index 0154f53..ec7e355 100644 --- a/modules/customer/pages/MyNewsletter.vue +++ b/modules/customer/pages/MyAccount/MyNewsletter.vue @@ -1,8 +1,5 @@ - diff --git a/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/OrderSummaryRow.vue b/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/OrderSummaryRow.vue new file mode 100644 index 0000000..cd4f306 --- /dev/null +++ b/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/OrderSummaryRow.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/SingleOrder.vue b/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/SingleOrder.vue new file mode 100644 index 0000000..0155d28 --- /dev/null +++ b/modules/customer/pages/MyAccount/OrderHistory/SingleOrder/SingleOrder.vue @@ -0,0 +1,271 @@ + + + + + diff --git a/modules/customer/pages/MyAccount/useSidebarLinkGroups.ts b/modules/customer/pages/MyAccount/useSidebarLinkGroups.ts new file mode 100644 index 0000000..7f3032b --- /dev/null +++ b/modules/customer/pages/MyAccount/useSidebarLinkGroups.ts @@ -0,0 +1,62 @@ +import type { RawLocation } from 'vue-router'; +import { useRouter, useContext } from '@nuxtjs/composition-api'; +import { useUser } from '~/modules/customer/composables/useUser'; +import { useCart } from '~/modules/checkout/composables/useCart'; + +type LinkGroup = { title: string, items: LinkGroupItem[] }; +type LinkGroupItem = { label: string, link?: RawLocation, listeners?: Record (Promise | void)> }; + +export const useSidebarLinkGroups = () => { + const { localeRoute } = useContext(); + const { logout } = useUser(); + const { clear } = useCart(); + + const router = useRouter(); + const sidebarLinkGroups : LinkGroup[] = [ + { + title: 'Personal details', + items: [ + { + label: 'My profile', + link: { name: 'customer-my-profile' }, + }, + { + label: 'Addresses details', + link: { name: 'customer-addresses-details' }, + }, + { + label: 'My newsletter', + link: { name: 'customer-my-newsletter' }, + }, + { + label: 'My wishlist', + link: { name: 'customer-my-wishlist' }, + }, + ], + }, + { + title: 'Order details', + items: [ + { + label: 'Order history', + link: { name: 'customer-order-history' }, + }, + { + label: 'My reviews', + link: { name: 'customer-my-reviews' }, + }, + { + label: 'Log out', + listeners: { + click: async () => { + await Promise.all([logout({}), clear({})]); + await router.push(localeRoute({ name: 'home' })); + }, + }, + }, + ], + }, + ]; + + return { sidebarLinkGroups }; +}; diff --git a/stores/customer.ts b/modules/customer/stores/customer.ts similarity index 56% rename from stores/customer.ts rename to modules/customer/stores/customer.ts index d7331b9..f6ebbe9 100644 --- a/stores/customer.ts +++ b/modules/customer/stores/customer.ts @@ -1,19 +1,14 @@ import { defineStore } from 'pinia'; -import type { Cart } from '~/modules/GraphQL/types'; -import type { User } from '~/modules/customer/composables/useUser/useUser'; +import type { Customer } from '~/modules/GraphQL/types'; interface CustomerState { - cart: Cart, - user: User | null, + user: Customer | null, isLoggedIn: boolean, } export const useCustomerStore = defineStore('customer', { state: (): CustomerState => ({ user: null, - cart: { - id: '', is_virtual: false, total_quantity: 0, shipping_addresses: [], - }, isLoggedIn: false, }), actions: { diff --git a/modules/customer/types/form.ts b/modules/customer/types/form.ts new file mode 100644 index 0000000..5dd8422 --- /dev/null +++ b/modules/customer/types/form.ts @@ -0,0 +1,8 @@ +export type OnFormComplete = () => void; +export type OnFormError = (message: string) => void; + +export type SubmitEventPayload = { + form: TForm, + onComplete: OnFormComplete, + onError: OnFormError, +}; diff --git a/modules/magento/defaultConfig.ts b/modules/magento/defaultConfig.ts index c73080c..8a30f32 100644 --- a/modules/magento/defaultConfig.ts +++ b/modules/magento/defaultConfig.ts @@ -8,7 +8,7 @@ export const defaultConfig = { storeCookieName: 'vsf-store', messageCookieName: 'vsf-message', }, - locale: undefined, - country: undefined, - currency: undefined, + locale: undefined as undefined, + country: undefined as undefined, + currency: undefined as undefined, } as const; diff --git a/modules/magento/helpers/index.ts b/modules/magento/helpers/index.ts index d629284..361ee4c 100644 --- a/modules/magento/helpers/index.ts +++ b/modules/magento/helpers/index.ts @@ -1,6 +1,7 @@ +import { NuxtAppOptions } from '@nuxt/types'; import { defaultConfig } from '~/modules/magento/defaultConfig'; -export const getLocaleSettings = (app, moduleOptions, additionalProperties) => { +export const getLocaleSettings = (app: NuxtAppOptions, moduleOptions: Record, additionalProperties: any) => { const localeSettings = moduleOptions.cookies ? { currency: additionalProperties.state.getCurrency(), @@ -16,7 +17,8 @@ export const getLocaleSettings = (app, moduleOptions, additionalProperties) => { }; }; -export const mapConfigToSetupObject = ({ app, moduleOptions, additionalProperties = {} }) => ({ +export const mapConfigToSetupObject = ({ app, moduleOptions, additionalProperties = {} } : +{ app: NuxtAppOptions, moduleOptions: Record, additionalProperties: Record }) => ({ ...defaultConfig, ...moduleOptions, ...additionalProperties, diff --git a/modules/magento/index.ts b/modules/magento/index.ts index 015feef..8e1deaa 100644 --- a/modules/magento/index.ts +++ b/modules/magento/index.ts @@ -3,7 +3,7 @@ import { Module } from '@nuxt/types'; /* eslint-disable unicorn/prefer-module */ const path = require('path'); -const nuxtModule : Module = function (options) { +const nuxtModule : Module = function magentoModule(options) { this.extendBuild((config) => { // eslint-disable-next-line no-param-reassign config.resolve.alias['@vue-storefront/magento-api$'] = require.resolve('@vue-storefront/magento-api'); diff --git a/modules/magento/plugin.ts b/modules/magento/plugin.ts index c8916d7..65c15ec 100644 --- a/modules/magento/plugin.ts +++ b/modules/magento/plugin.ts @@ -7,7 +7,7 @@ import { defaultConfig } from '~/modules/magento/defaultConfig'; const moduleOptions = JSON.parse('<%= JSON.stringify(options) %>'); export default integrationPlugin((plugin) => { - const getCookieName = (property: string) : string => moduleOptions.cookies?.[property] ?? defaultConfig.cookies[property]; + const getCookieName = (property: keyof typeof defaultConfig['cookies']) : string => moduleOptions.cookies?.[property] ?? defaultConfig.cookies[property]; const cookieNames = { cart: getCookieName('cartCookieName'), diff --git a/modules/theme/index.ts b/modules/theme/index.ts deleted file mode 100644 index a5c7dab..0000000 --- a/modules/theme/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Module } from '@nuxt/types'; - -const nuxtModule : Module = function themeModule() {}; - -export default nuxtModule; diff --git a/modules/wishlist/components/EmptyWishlist.vue b/modules/wishlist/components/EmptyWishlist.vue new file mode 100644 index 0000000..c7e5245 --- /dev/null +++ b/modules/wishlist/components/EmptyWishlist.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/modules/theme/components/wishlist/WishlistSidebar.vue b/modules/wishlist/components/WishlistSidebar.vue similarity index 76% rename from modules/theme/components/wishlist/WishlistSidebar.vue rename to modules/wishlist/components/WishlistSidebar.vue index a81d847..dc355ed 100644 --- a/modules/theme/components/wishlist/WishlistSidebar.vue +++ b/modules/wishlist/components/WishlistSidebar.vue @@ -48,14 +48,7 @@ :regular-price=" $fc(getItemPrice(wishlistItem).regular) " - :link=" - localePath( - `/p/${wishlistItem.product.sku}${productGetters.getSlug( - wishlistItem.product, - wishlistItem.product.categories[0] - )}` - ) - " + :link="getItemLink(wishlistItem)" :special-price="getItemPrice(wishlistItem).special && $fc(getItemPrice(wishlistItem).special)" :stock="99999" class="collected-product" @@ -65,16 +58,7 @@