@evershop/evershop 1.1.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/build/index.js +24 -0
- package/bin/extension/index.js +2 -2
- package/bin/lib/addDefaultMiddlewareFuncs.js +7 -2
- package/bin/lib/buildEntry.js +20 -2
- package/bin/lib/onListening.js +7 -4
- package/bin/lib/startUp.js +6 -0
- package/package.json +9 -1
- package/src/components/admin/catalog/productEdit/category/CategoryItem.jsx +2 -7
- package/src/components/admin/catalog/productEdit/category/CategoryTree.jsx +14 -7
- package/src/components/admin/catalog/productEdit/category/CategoryTree.scss +10 -0
- package/src/components/admin/catalog/productEdit/variants/CreateVariant.jsx +2 -2
- package/src/components/admin/catalog/productEdit/variants/CreateVariantGroup.jsx +1 -1
- package/src/components/admin/catalog/productEdit/variants/EditVariant.jsx +1 -1
- package/src/components/admin/catalog/productEdit/variants/New.jsx +2 -2
- package/src/components/admin/catalog/productEdit/variants/Search.jsx +1 -1
- package/src/components/admin/catalog/productEdit/variants/SearchModal.jsx +1 -1
- package/src/components/admin/catalog/productEdit/variants/VariantModal.jsx +6 -6
- package/src/components/admin/catalog/productGrid/rows/ThumbnailRow.jsx +1 -1
- package/src/components/admin/checkout/shippingSetting/Method.jsx +6 -6
- package/src/components/admin/checkout/shippingSetting/MethodForm.jsx +4 -4
- package/src/components/admin/checkout/shippingSetting/Methods.jsx +3 -3
- package/src/components/admin/checkout/shippingSetting/PriceBasedPrice.jsx +2 -2
- package/src/components/admin/checkout/shippingSetting/WeightBasedPrice.jsx +2 -2
- package/src/components/admin/checkout/shippingSetting/Zone.jsx +7 -7
- package/src/components/admin/checkout/shippingSetting/ZoneForm.jsx +1 -1
- package/src/components/admin/cms/Card.jsx +3 -3
- package/src/components/admin/cms/PageHeading.jsx +3 -3
- package/src/components/admin/cms/widget/WidgetTypes.jsx +28 -0
- package/src/components/admin/cms/widget/grid/WidgetTypeRow.jsx +29 -0
- package/src/components/admin/oms/orderEdit/items/ItemVariantOptions.jsx +1 -1
- package/src/components/admin/oms/orderEdit/items/Name.jsx +1 -1
- package/src/components/admin/oms/orderGrid/headers/OrderDateColumnHeader.jsx +1 -1
- package/src/components/admin/promotion/couponEdit/AttributeGroupSelector.jsx +3 -3
- package/src/components/admin/promotion/couponEdit/BuyXGetY.jsx +2 -2
- package/src/components/admin/promotion/couponEdit/CategorySelector.jsx +6 -6
- package/src/components/admin/promotion/couponEdit/CollectionSelector.jsx +3 -3
- package/src/components/admin/promotion/couponEdit/ProductSkuSelector.jsx +4 -4
- package/src/components/admin/promotion/couponEdit/RequireProducts.jsx +2 -2
- package/src/components/admin/promotion/couponEdit/Setting.jsx +1 -1
- package/src/components/admin/promotion/couponEdit/TargetProducts.jsx +4 -4
- package/src/components/admin/tax/taxSetting/Rate.jsx +6 -6
- package/src/components/admin/tax/taxSetting/RateForm.jsx +5 -5
- package/src/components/admin/tax/taxSetting/Rates.jsx +6 -6
- package/src/components/admin/tax/taxSetting/TaxClass.jsx +3 -3
- package/src/components/admin/tax/taxSetting/TaxClassForm.jsx +1 -1
- package/src/components/admin/widgets/BasicMenuSetting.jsx +614 -0
- package/src/components/admin/widgets/BasicMenuSetting.scss +19 -0
- package/src/components/admin/widgets/CollectionProductsSetting.jsx +203 -0
- package/src/components/admin/widgets/TextBlockSetting.jsx +70 -0
- package/src/components/common/Area.jsx +31 -8
- package/src/components/common/Badge.jsx +1 -1
- package/src/components/common/Editor.jsx +193 -0
- package/src/components/common/Notification.scss +1 -0
- package/src/components/common/SimplePagination.jsx +2 -2
- package/src/components/common/form/Form.jsx +1 -1
- package/src/components/common/form/fields/Checkbox.jsx +1 -1
- package/src/components/common/form/fields/Ckeditor.jsx +11 -11
- package/src/components/common/form/fields/Editor.jsx +326 -0
- package/src/components/common/form/fields/Editor.scss +33 -0
- package/src/components/common/form/fields/Radio.jsx +1 -1
- package/src/components/common/form/fields/editor/FileBrowser.jsx +419 -0
- package/src/components/common/form/fields/editor/FileBrowser.scss +37 -0
- package/src/components/common/form/fields/editor/GetColumnClasses.jsx +14 -0
- package/src/components/common/form/fields/editor/GetRowClasses.jsx +18 -0
- package/src/components/common/form/fields/editor/RowTemplates.jsx +154 -0
- package/src/components/common/grid/Pagination.jsx +4 -4
- package/src/components/common/grid/headers/FromTo.jsx +1 -1
- package/src/components/common/grid/headers/Sortable.jsx +1 -1
- package/src/components/common/grid/rows/ThumbnailRow.jsx +1 -1
- package/src/components/common/list/Filter.jsx +1 -1
- package/src/components/common/modal/Alert.jsx +1 -1
- package/src/components/common/modal/Modal.jsx +1 -1
- package/src/components/frontStore/catalog/categoryView/filter/AttributeFilter.jsx +2 -2
- package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.jsx +3 -2
- package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.scss +5 -0
- package/src/components/frontStore/catalog/product/list/List.jsx +4 -4
- package/src/components/frontStore/catalog/product/list/Pagination.jsx +1 -1
- package/src/components/frontStore/catalog/product/list/Sorting.jsx +2 -2
- package/src/components/frontStore/catalog/product/list/item/Name.jsx +1 -1
- package/src/components/frontStore/checkout/cart/Empty.jsx +3 -3
- package/src/components/frontStore/checkout/cart/items/ItemOptions.jsx +1 -1
- package/src/components/frontStore/checkout/cart/items/ItemVariantOptions.jsx +1 -1
- package/src/components/frontStore/checkout/cart/items/Items.jsx +20 -21
- package/src/components/frontStore/checkout/cart/items/Items.scss +47 -0
- package/src/components/frontStore/checkout/cart/items/Quantity.jsx +154 -0
- package/src/components/frontStore/checkout/checkout/StepTitle.jsx +1 -1
- package/src/components/frontStore/checkout/checkout/payment/paymentStep/StepContent.jsx +5 -5
- package/src/components/frontStore/checkout/checkout/shipment/StepContent.jsx +1 -1
- package/src/components/frontStore/checkout/checkout/summary/Cart.jsx +10 -12
- package/src/components/frontStore/checkout/checkout/summary/Items.jsx +9 -9
- package/src/components/frontStore/checkout/checkout/summary/cart/Total.jsx +6 -6
- package/src/components/frontStore/checkout/success/summary/items/ItemOptions.jsx +1 -1
- package/src/components/frontStore/checkout/success/summary/items/Items.jsx +9 -6
- package/src/components/frontStore/checkout/success/summary/order/OrderSummary.jsx +9 -13
- package/src/components/frontStore/checkout/success/summary/order/Total.jsx +5 -5
- package/src/components/frontStore/customer/address/addressForm/AddressFormLoadingSkeleton.jsx +2 -2
- package/src/components/frontStore/customer/address/addressForm/NameAndTelephone.jsx +1 -1
- package/src/components/frontStore/customer/address/addressForm/ProvinceAndPostcode.jsx +1 -1
- package/src/components/frontStore/customer/checkout/Edit.jsx +2 -2
- package/src/components/frontStore/customer/detail/Order.jsx +4 -4
- package/src/components/frontStore/stripe/checkout/CheckoutForm.jsx +2 -2
- package/src/components/frontStore/stripe/checkout/TestCards.jsx +1 -1
- package/src/components/frontStore/widgets/BasicMenu.jsx +129 -0
- package/src/{modules/catalog/pages/frontStore/homepage/FeaturedProducts.jsx → components/frontStore/widgets/CollectionProducts.jsx} +40 -32
- package/src/components/frontStore/widgets/TextBlock.jsx +46 -0
- package/src/lib/componee/getComponentsByRoute.js +15 -2
- package/src/lib/event/event-manager.js +1 -1
- package/src/lib/middleware/tests/app/modules/404page/pages/frontStore/product/route.json +2 -1
- package/src/lib/middlewares/static.js +3 -1
- package/src/lib/response/render.js +5 -6
- package/src/lib/router/Router.js +1 -1
- package/src/lib/router/loadModuleRoutes.js +3 -0
- package/src/lib/router/registerAdminRoute.js +9 -1
- package/src/lib/router/registerFrontStoreRoute.js +2 -0
- package/src/lib/router/scanForRoutes.js +1 -0
- package/src/lib/router/tests/unit/unit.validateRoute.test.js +7 -1
- package/src/lib/util/defaultPaginationFilters.js +19 -17
- package/src/lib/util/getEnabledWidgets.js +34 -0
- package/src/lib/util/merge.js +67 -14
- package/src/lib/util/tests/unit/util.merge.test.js +21 -4
- package/src/lib/util/validateConfiguration.js +83 -0
- package/src/lib/webpack/createBaseConfig.js +4 -1
- package/src/lib/webpack/dev/createConfigClient.js +10 -2
- package/src/lib/webpack/loaders/AreaLoader.js +16 -6
- package/src/lib/webpack/util/keyGenerator.js +9 -0
- package/src/lib/webpack/util/parseGraphql.js +30 -16
- package/src/lib/webpack/util/parseGraphqlByFile.js +16 -2
- package/src/modules/auth/pages/admin/adminLogin/LoginForm.jsx +54 -21
- package/src/modules/auth/pages/admin/all/AdminUser.jsx +3 -3
- package/src/modules/base/bootstrap.js +79 -0
- package/src/modules/base/graphql/types/Route/Route.admin.graphql +15 -0
- package/src/modules/base/graphql/types/Route/Route.admin.resolvers.js +10 -0
- package/src/modules/base/pages/global/response[errorHandler].js +25 -1
- package/src/modules/catalog/bootstrap.js +125 -5
- package/src/modules/catalog/graphql/types/Category/Category.graphql +4 -3
- package/src/modules/catalog/graphql/types/Category/Category.resolvers.js +34 -0
- package/src/modules/catalog/graphql/types/Collection/Collection.graphql +2 -2
- package/src/modules/catalog/graphql/types/Collection/Collection.resolvers.js +34 -0
- package/src/modules/catalog/graphql/types/Product/Attribute/ProductAttribute.resolvers.js +1 -0
- package/src/modules/catalog/graphql/types/Product/Product.graphql +1 -1
- package/src/modules/catalog/graphql/types/Product/Product.resolvers.js +34 -0
- package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.graphql +11 -0
- package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.resolvers.js +8 -0
- package/src/modules/catalog/migration/Version-1.0.0.js +1 -0
- package/src/modules/catalog/migration/Version-1.0.7.js +10 -0
- package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/FormContent.jsx +4 -4
- package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/General.jsx +5 -5
- package/src/modules/catalog/pages/admin/attributeGrid/Grid.jsx +2 -2
- package/src/modules/catalog/pages/admin/categoryEdit/Products.jsx +4 -4
- package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/FormContent.jsx +4 -4
- package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/General.jsx +16 -18
- package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Image.jsx +1 -2
- package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Status.jsx +16 -1
- package/src/modules/catalog/pages/admin/categoryGrid/Grid.jsx +3 -3
- package/src/modules/catalog/pages/admin/collectionEdit/Products.jsx +4 -4
- package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/FormContent.jsx +2 -2
- package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/General.jsx +2 -2
- package/src/modules/catalog/pages/admin/collectionGrid/Grid.jsx +3 -3
- package/src/modules/catalog/pages/admin/productEdit/Collection.jsx +7 -7
- package/src/modules/catalog/pages/admin/productEdit+productNew/Attributes.jsx +8 -3
- package/src/modules/catalog/pages/admin/productEdit+productNew/CustomOptions.jsss +4 -4
- package/src/modules/catalog/pages/admin/productEdit+productNew/FormContent.jsx +4 -4
- package/src/modules/catalog/pages/admin/productEdit+productNew/General.jsx +15 -17
- package/src/modules/catalog/pages/admin/productGrid/Grid.jsx +3 -3
- package/src/modules/catalog/pages/frontStore/catalogSearch/General.jsx +2 -2
- package/src/modules/catalog/pages/frontStore/catalogSearch/Products.jsx +1 -1
- package/src/modules/catalog/pages/frontStore/catalogSearch/route.json +2 -1
- package/src/modules/catalog/pages/frontStore/categoryView/CategoryView.jsx +19 -2
- package/src/modules/catalog/pages/frontStore/categoryView/Filter.scss +1 -0
- package/src/modules/catalog/pages/frontStore/categoryView/General.jsx +6 -8
- package/src/modules/catalog/pages/frontStore/categoryView/General.scss +0 -2
- package/src/modules/catalog/pages/frontStore/categoryView/Pagination.jsx +6 -0
- package/src/modules/catalog/pages/frontStore/categoryView/Products.jsx +8 -1
- package/src/modules/catalog/pages/frontStore/categoryView/route.json +2 -1
- package/src/modules/catalog/pages/frontStore/productView/Description.jsx +15 -4
- package/src/modules/catalog/pages/frontStore/productView/Form.jsx +4 -4
- package/src/modules/catalog/pages/frontStore/productView/Form.scss +1 -0
- package/src/modules/catalog/pages/frontStore/productView/GeneralInfo.jsx +1 -1
- package/src/modules/catalog/pages/frontStore/productView/Images.jsx +1 -1
- package/src/modules/catalog/pages/frontStore/productView/Layout.jsx +1 -1
- package/src/modules/catalog/pages/frontStore/productView/Options.jsx +7 -3
- package/src/modules/catalog/pages/frontStore/productView/Variants.jsx +6 -6
- package/src/modules/catalog/pages/frontStore/productView/route.json +2 -1
- package/src/modules/catalog/services/AttributeCollection.js +10 -10
- package/src/modules/catalog/services/AttributeGroupCollection.js +10 -10
- package/src/modules/catalog/services/CategoryCollection.js +10 -10
- package/src/modules/catalog/services/CollectionCollection.js +10 -10
- package/src/modules/catalog/services/registerCartItemProductUrlField.js +35 -0
- package/src/modules/catalog/services/registerCartItemVariantOptionsField.js +51 -0
- package/src/modules/catalog/services/registerDefaultCategoryCollectionFilters.js +16 -0
- package/src/modules/checkout/api/addShippingNote/[context]bodyParser[auth].js +5 -0
- package/src/modules/checkout/api/addShippingNote/payloadSchema.json +15 -0
- package/src/modules/checkout/api/addShippingNote/route.json +5 -0
- package/src/modules/checkout/api/addShippingNote/saveShippingNote.js +50 -0
- package/src/modules/checkout/api/createCart/createNewCart.js +28 -3
- package/src/modules/checkout/api/updateCartItemQty/[bodyParser]updateQty.js +49 -0
- package/src/modules/checkout/api/updateCartItemQty/[context]bodyParser[auth].js +5 -0
- package/src/modules/checkout/api/updateCartItemQty/payloadSchema.json +21 -0
- package/src/modules/checkout/api/updateCartItemQty/route.json +5 -0
- package/src/modules/checkout/api/updateMineCartItemQty/[context]bodyParser[auth].js +5 -0
- package/src/modules/checkout/api/updateMineCartItemQty/[detectCurrentCart]updateQty.js +51 -0
- package/src/modules/checkout/api/updateMineCartItemQty/[getCurrentCustomer]detectCurrentCart.js +32 -0
- package/src/modules/checkout/api/updateMineCartItemQty/payloadSchema.json +21 -0
- package/src/modules/checkout/api/updateMineCartItemQty/route.json +5 -0
- package/src/modules/checkout/bootstrap.js +27 -0
- package/src/modules/checkout/graphql/types/Cart/Cart.graphql +22 -3
- package/src/modules/checkout/graphql/types/Cart/Cart.resolvers.js +18 -2
- package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.graphql +3 -0
- package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.resolvers.js +7 -0
- package/src/modules/checkout/migration/Version-1.0.0.js +14 -0
- package/src/modules/checkout/migration/Version-1.0.6.js +201 -0
- package/src/modules/checkout/pages/admin/shippingSetting/ShippingSetting.jsx +2 -2
- package/src/modules/checkout/pages/frontStore/all/[context]detectCurrentCart[auth].js +5 -0
- package/src/modules/checkout/pages/frontStore/cart/ShoppingCart.jsx +20 -12
- package/src/modules/checkout/pages/frontStore/cart/Summary.jsx +34 -23
- package/src/modules/checkout/pages/frontStore/cart/route.json +2 -1
- package/src/modules/checkout/pages/frontStore/checkout/Checkout.jsx +5 -5
- package/src/modules/checkout/pages/frontStore/checkout/Checkout.scss +4 -0
- package/src/modules/checkout/pages/frontStore/checkout/ShippingMethods.jsx +2 -2
- package/src/modules/checkout/pages/frontStore/checkout/ShippingNote.jsx +105 -0
- package/src/modules/checkout/pages/frontStore/checkout/Summary.jsx +14 -14
- package/src/modules/checkout/pages/frontStore/checkout/SummaryMobile.jsx +12 -15
- package/src/modules/checkout/pages/frontStore/checkout/route.json +2 -1
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.jsx +1 -1
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.scss +4 -0
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/CustomerInfo.jsx +30 -32
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/ShippingNote.jsx +47 -0
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/Summary.jsx +12 -15
- package/src/modules/checkout/pages/frontStore/checkoutSuccess/route.json +2 -1
- package/src/modules/checkout/services/cart/Cart.js +31 -27
- package/src/modules/checkout/services/cart/registerCartBaseFields.js +133 -41
- package/src/modules/checkout/services/cart/registerCartItemBaseFields.js +300 -374
- package/src/modules/checkout/services/toPrice.js +1 -1
- package/src/modules/checkout/tests/basicSetup.js +85 -0
- package/src/modules/checkout/tests/coupons.js +82 -0
- package/src/modules/checkout/tests/products.js +67 -0
- package/src/modules/checkout/tests/taxRates.js +3 -0
- package/src/modules/checkout/tests/unit/discountAmount.test.js +60 -0
- package/src/modules/checkout/tests/unit/grandTotal.test.js +83 -0
- package/src/modules/checkout/tests/unit/lineTotal.test.js +92 -0
- package/src/modules/checkout/tests/unit/lineTotalWithDiscount.test.js +103 -0
- package/src/modules/checkout/tests/unit/productPrice.test.js +69 -0
- package/src/modules/checkout/tests/unit/subTotal.test.js +85 -0
- package/src/modules/checkout/tests/unit/subTotalWithDiscount.test.js +117 -0
- package/src/modules/checkout/tests/unit/taxAmount.test.js +68 -0
- package/src/modules/checkout/tests/unit/taxAmountRounding.test.js +277 -0
- package/src/modules/cms/api/createWidget/[context]bodyParser[auth].js +5 -0
- package/src/modules/cms/api/createWidget/createWidget[finish].js +17 -0
- package/src/modules/cms/api/createWidget/finish[apiResponse].js +27 -0
- package/src/modules/cms/api/createWidget/payloadSchema.json +18 -0
- package/src/modules/cms/api/createWidget/route.json +5 -0
- package/src/modules/cms/api/deleteWidget/deleteWidget.js +27 -0
- package/src/modules/cms/api/deleteWidget/route.json +5 -0
- package/src/modules/cms/api/updateWidget/[context]bodyParser[auth].js +5 -0
- package/src/modules/cms/api/updateWidget/finish[apiResponse].js +27 -0
- package/src/modules/cms/api/updateWidget/payloadSchema.json +18 -0
- package/src/modules/cms/api/updateWidget/route.json +5 -0
- package/src/modules/cms/api/updateWidget/updateWidget[finish].js +17 -0
- package/src/modules/cms/bootstrap.js +223 -3
- package/src/modules/cms/graphql/types/CmsPage/CmsPage.graphql +1 -2
- package/src/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js +35 -1
- package/src/modules/cms/graphql/types/Widget/Widget.graphql +91 -0
- package/src/modules/cms/graphql/types/Widget/Widget.resolvers.js +142 -0
- package/src/modules/cms/migration/Version-1.1.0.js +22 -0
- package/src/modules/cms/migration/Version-1.1.1.js +103 -0
- package/src/modules/cms/pages/admin/adminNotFound/NotFound.jsx +4 -4
- package/src/modules/cms/pages/admin/all/CmsMenuGroup.jsx +12 -4
- package/src/modules/cms/pages/admin/all/Notification.scss +1 -1
- package/src/modules/cms/pages/admin/all/search/NoResult.jsx +2 -2
- package/src/modules/cms/pages/admin/all/search/Results.jsx +3 -3
- package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/FormContent.jsx +7 -9
- package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/General.jsx +3 -3
- package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Seo.jsx +1 -1
- package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Status.jsx +40 -0
- package/src/modules/cms/pages/admin/cmsPageGrid/Grid.jsx +3 -4
- package/src/modules/cms/pages/admin/dashboard/Layout.jsx +3 -3
- package/src/modules/cms/pages/admin/widgetEdit/WidgetForm.jsx +52 -0
- package/src/modules/cms/pages/admin/widgetEdit/index.js +36 -0
- package/src/modules/cms/pages/admin/widgetEdit/route.json +4 -0
- package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.jsx +69 -0
- package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.scss +7 -0
- package/src/modules/cms/pages/admin/widgetEdit+widgetNew/General.jsx +185 -0
- package/src/modules/cms/pages/admin/widgetEdit+widgetNew/PageHeading.jsx +37 -0
- package/src/modules/cms/pages/admin/widgetEdit+widgetNew/Setting.jsx +55 -0
- package/src/modules/cms/pages/admin/widgetGrid/Grid.jsx +415 -0
- package/src/modules/cms/pages/admin/widgetGrid/Heading.jsx +11 -0
- package/src/modules/cms/pages/admin/widgetGrid/NewWidgetButton.jsx +52 -0
- package/src/modules/cms/pages/admin/widgetGrid/index.js +15 -0
- package/src/modules/cms/pages/admin/widgetGrid/route.json +4 -0
- package/src/modules/cms/pages/admin/widgetNew/WidgetNewForm.jsx +60 -0
- package/src/modules/cms/pages/admin/widgetNew/index.js +11 -0
- package/src/modules/cms/pages/admin/widgetNew/route.json +4 -0
- package/src/modules/cms/pages/admin/widgetNew/typeValidate.js +21 -0
- package/src/modules/cms/pages/frontStore/all/Breadcrumb.jsx +1 -1
- package/src/modules/cms/pages/frontStore/all/Footer.jsx +2 -2
- package/src/modules/cms/pages/frontStore/all/Layout.jsx +3 -3
- package/src/modules/cms/pages/frontStore/all/Layout.scss +13 -0
- package/src/modules/cms/pages/frontStore/all/Logo.jsx +2 -2
- package/src/modules/cms/pages/frontStore/all/Logo.scss +2 -4
- package/src/modules/cms/pages/frontStore/all/Notification.scss +1 -1
- package/src/modules/cms/pages/frontStore/cmsPageView/Layout.jsx +2 -2
- package/src/modules/cms/pages/frontStore/cmsPageView/View.jsx +5 -3
- package/src/modules/cms/pages/frontStore/cmsPageView/index.js +6 -12
- package/src/modules/cms/pages/frontStore/cmsPageView/route.json +2 -1
- package/src/modules/cms/pages/frontStore/homepage/route.json +2 -1
- package/src/modules/cms/pages/frontStore/notFound/NotFound.jsx +4 -4
- package/src/modules/cms/pages/frontStore/notFound/route.json +2 -1
- package/src/modules/cms/pages/frontStore/staticAsset/[context]staticAssets[auth].js +1 -1
- package/src/modules/cms/services/CMSPageCollection.js +10 -10
- package/src/modules/cms/services/WidgetCollection.js +62 -0
- package/src/modules/cms/services/getWidgetsBaseQuery.js +7 -0
- package/src/modules/cms/services/page/createPage.js +1 -2
- package/src/modules/cms/services/page/pageDataSchema.json +0 -4
- package/src/modules/cms/services/registerDefaultWidgetCollectionFilters.js +62 -0
- package/src/modules/cms/services/tailwind.admin.config.js +22 -107
- package/src/modules/cms/services/tailwind.frontStore.config.js +23 -108
- package/src/modules/cms/services/widget/createWidget.js +73 -0
- package/src/modules/cms/services/widget/deleteWidget.js +49 -0
- package/src/modules/cms/services/widget/loadWidgetInstances.js +54 -0
- package/src/modules/cms/services/widget/updateWidget.js +86 -0
- package/src/modules/cms/services/widget/widgetDataSchema.json +29 -0
- package/src/modules/cod/pages/admin/paymentSetting/CODSetting.jsx +2 -2
- package/src/modules/cod/pages/frontStore/checkout/CashOnDelivery.jsx +1 -1
- package/src/modules/customer/bootstrap.js +21 -4
- package/src/modules/customer/pages/admin/customerEdit/CustomerEditForm.jsx +3 -3
- package/src/modules/customer/pages/admin/customerEdit+customerNew/OrderHistory.jsx +1 -1
- package/src/modules/customer/pages/admin/customerGrid/Grid.jsx +3 -3
- package/src/modules/customer/pages/frontStore/account/AccountDetails.jsx +3 -3
- package/src/modules/customer/pages/frontStore/account/Layout.jsx +3 -3
- package/src/modules/customer/pages/frontStore/account/OrderHistory.jsx +1 -1
- package/src/modules/customer/pages/frontStore/account/route.json +2 -1
- package/src/modules/customer/pages/frontStore/login/LoginForm.jsx +2 -2
- package/src/modules/customer/pages/frontStore/login/route.json +2 -1
- package/src/modules/customer/pages/frontStore/register/RegisterForm.jsx +2 -2
- package/src/modules/customer/pages/frontStore/register/route.json +2 -1
- package/src/modules/customer/pages/frontStore/resetPasswordPage/ResetPasswordForm.jsx +2 -2
- package/src/modules/customer/pages/frontStore/resetPasswordPage/route.json +2 -1
- package/src/modules/customer/pages/frontStore/updatePasswordPage/UpdatePasswordForm.jsx +3 -3
- package/src/modules/customer/pages/frontStore/updatePasswordPage/route.json +2 -1
- package/src/modules/customer/services/CustomerCollection.js +10 -10
- package/src/modules/customer/services/CustomerGroupCollection.js +10 -10
- package/src/modules/graphql/pages/global/[bodyParser]buildQuery[graphql].js +241 -6
- package/src/modules/graphql/pages/global/[buildQuery]graphql[notification].js +12 -8
- package/src/modules/oms/bootstrap.js +87 -3
- package/src/modules/oms/graphql/types/Order/Order.graphql +11 -2
- package/src/modules/oms/graphql/types/Order/Order.resolvers.js +7 -1
- package/src/modules/oms/pages/admin/dashboard/Bestsellers.jsx +2 -2
- package/src/modules/oms/pages/admin/dashboard/Lifetimesales.jsx +5 -5
- package/src/modules/oms/pages/admin/orderEdit/AddTrackingButton.jsx +1 -1
- package/src/modules/oms/pages/admin/orderEdit/Items.jsx +7 -7
- package/src/modules/oms/pages/admin/orderEdit/Layout.jsx +3 -3
- package/src/modules/oms/pages/admin/orderEdit/Payment.jsx +6 -6
- package/src/modules/oms/pages/admin/orderEdit/ShipButton.jsx +1 -1
- package/src/modules/oms/pages/admin/orderGrid/Grid.jsx +3 -3
- package/src/modules/oms/services/OrderCollection.js +10 -10
- package/src/modules/paypal/api/paypalCreateOrder/[bodyParser]createOrder.js +55 -24
- package/src/modules/paypal/pages/admin/paymentSetting/PaypalSetting.jsx +6 -6
- package/src/modules/paypal/pages/frontStore/checkout/Paypal.jsx +3 -4
- package/src/modules/promotion/bootstrap.js +19 -101
- package/src/modules/promotion/pages/admin/couponEdit+couponNew/DiscountType.jsx +1 -1
- package/src/modules/promotion/pages/admin/couponEdit+couponNew/FormContent.jsx +5 -5
- package/src/modules/promotion/pages/admin/couponGrid/Grid.jsx +3 -3
- package/src/modules/promotion/pages/frontStore/cart/Coupon.jsx +2 -2
- package/src/modules/promotion/services/CouponCollection.js +10 -10
- package/src/modules/promotion/services/couponValidator.js +4 -7
- package/src/modules/promotion/services/discountCalculator.js +2 -7
- package/src/modules/promotion/services/registerCartItemPromotionFields.js +80 -0
- package/src/modules/promotion/services/registerCartPromotionFields.js +128 -0
- package/src/modules/promotion/services/registerDefaultCalculators.js +48 -20
- package/src/modules/promotion/services/registerDefaultValidators.js +16 -4
- package/src/modules/setting/pages/admin/paymentSetting/PaymentSetting.jsx +2 -2
- package/src/modules/setting/pages/admin/storeSetting/StoreSetting.jsx +98 -35
- package/src/modules/stripe/pages/admin/paymentSetting/StripePayment.jsx +5 -5
- package/src/modules/stripe/pages/frontStore/checkout/Stripe.jsx +1 -1
- package/src/modules/tax/bootstrap.js +40 -5
- package/src/modules/tax/graphql/types/Product/Price/ProductPrice.resolvers.js +6 -39
- package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.graphql +1 -2
- package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.resolvers.js +1 -8
- package/src/modules/tax/pages/admin/taxSetting/TaxSetting.jsx +4 -4
- package/src/modules/tax/services/TaxClassCollection.js +10 -10
- package/src/modules/tax/services/calculateTaxAmount.js +12 -9
- package/src/modules/tax/services/registerCartItemTaxPercentField.js +76 -0
- package/src/modules/auth/services/adminSessionMiddleware.js +0 -0
- package/src/modules/catalog/pages/frontStore/homepage/FeaturedCategories.jsx +0 -58
- package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/StatusAndLayout.jsx +0 -61
- package/src/modules/cms/pages/frontStore/all/Menu.jsx +0 -46
- package/src/modules/cms/pages/frontStore/all/Menu.scss +0 -7
- package/src/modules/cms/pages/frontStore/all/MobileMenu.jsx +0 -73
- package/src/modules/cms/pages/frontStore/all/MobileMenu.scss +0 -35
- package/src/modules/cms/pages/frontStore/homepage/MainBanner.jsx +0 -31
- package/src/modules/cms/pages/frontStore/homepage/MainBanner.scss +0 -48
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { _ } from '@evershop/evershop/src/lib/locale/translate';
|
|
4
4
|
|
|
5
|
-
export function Total({ total,
|
|
5
|
+
export function Total({ total, totalTaxAmount, priceIncludingTax }) {
|
|
6
6
|
return (
|
|
7
7
|
<div className="summary-row grand-total flex justify-between">
|
|
8
|
-
{(
|
|
8
|
+
{(priceIncludingTax && (
|
|
9
9
|
<div>
|
|
10
10
|
<div>
|
|
11
11
|
<div className="font-bold">
|
|
@@ -13,7 +13,7 @@ export function Total({ total, taxAmount, displayCheckoutPriceIncludeTax }) {
|
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
15
|
<span className="italic">
|
|
16
|
-
({_('Inclusive of tax ${
|
|
16
|
+
({_('Inclusive of tax ${totalTaxAmount}', { totalTaxAmount })})
|
|
17
17
|
</span>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -29,10 +29,10 @@ export function Total({ total, taxAmount, displayCheckoutPriceIncludeTax }) {
|
|
|
29
29
|
|
|
30
30
|
Total.propTypes = {
|
|
31
31
|
total: PropTypes.string.isRequired,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
totalTaxAmount: PropTypes.string.isRequired,
|
|
33
|
+
priceIncludingTax: PropTypes.bool
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
Total.defaultProps = {
|
|
37
|
-
|
|
37
|
+
priceIncludingTax: false
|
|
38
38
|
};
|
|
@@ -11,7 +11,7 @@ export function ItemOptions({ options = [] }) {
|
|
|
11
11
|
const language = get(useAppState(), 'language', 'en');
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<div className="cart-item-options mt-
|
|
14
|
+
<div className="cart-item-options mt-2">
|
|
15
15
|
<ul className="list-basic">
|
|
16
16
|
{options.map((o, i) => (
|
|
17
17
|
// eslint-disable-next-line react/no-array-index-key
|
|
@@ -4,7 +4,7 @@ import { ItemVariantOptions } from '@components/frontStore/checkout/cart/items/I
|
|
|
4
4
|
import './Items.scss';
|
|
5
5
|
import ProductNoThumbnail from '@components/common/ProductNoThumbnail';
|
|
6
6
|
|
|
7
|
-
function Items({ items,
|
|
7
|
+
function Items({ items, priceIncludingTax }) {
|
|
8
8
|
return (
|
|
9
9
|
<div id="summary-items">
|
|
10
10
|
<table className="listing items-table">
|
|
@@ -37,9 +37,9 @@ function Items({ items, displayCheckoutPriceIncludeTax }) {
|
|
|
37
37
|
</td>
|
|
38
38
|
<td>
|
|
39
39
|
<span>
|
|
40
|
-
{
|
|
41
|
-
? item.
|
|
42
|
-
: item.
|
|
40
|
+
{priceIncludingTax
|
|
41
|
+
? item.lineTotalInclTax.text
|
|
42
|
+
: item.lineTotal.text}
|
|
43
43
|
</span>
|
|
44
44
|
</td>
|
|
45
45
|
</tr>
|
|
@@ -57,13 +57,16 @@ Items.propTypes = {
|
|
|
57
57
|
productName: PropTypes.string.isRequired,
|
|
58
58
|
qty: PropTypes.number.isRequired,
|
|
59
59
|
thumbnail: PropTypes.string,
|
|
60
|
-
|
|
60
|
+
lineTotalInclTax: PropTypes.shape({
|
|
61
|
+
text: PropTypes.string.isRequired
|
|
62
|
+
}).isRequired,
|
|
63
|
+
lineTotal: PropTypes.shape({
|
|
61
64
|
text: PropTypes.string.isRequired
|
|
62
65
|
}).isRequired,
|
|
63
66
|
variantOptions: PropTypes.string
|
|
64
67
|
})
|
|
65
68
|
).isRequired,
|
|
66
|
-
|
|
69
|
+
priceIncludingTax: PropTypes.bool.isRequired
|
|
67
70
|
};
|
|
68
71
|
|
|
69
72
|
export { Items };
|
|
@@ -12,29 +12,25 @@ function OrderSummary({
|
|
|
12
12
|
subTotalInclTax,
|
|
13
13
|
shippingMethodName,
|
|
14
14
|
shippingFeeInclTax,
|
|
15
|
-
|
|
15
|
+
totalTaxAmount,
|
|
16
16
|
discountAmount,
|
|
17
17
|
coupon,
|
|
18
18
|
grandTotal,
|
|
19
|
-
|
|
19
|
+
priceIncludingTax
|
|
20
20
|
}) {
|
|
21
21
|
return (
|
|
22
22
|
<div className="checkout-summary-block">
|
|
23
23
|
<Subtotal
|
|
24
24
|
count={items.length}
|
|
25
|
-
total={
|
|
26
|
-
displayCheckoutPriceIncludeTax ? subTotalInclTax.text : subTotal.text
|
|
27
|
-
}
|
|
25
|
+
total={priceIncludingTax ? subTotalInclTax.text : subTotal.text}
|
|
28
26
|
/>
|
|
29
27
|
<Shipping method={shippingMethodName} cost={shippingFeeInclTax.text} />
|
|
30
|
-
{!
|
|
31
|
-
<Tax taxClass="" amount={taxAmount.text} />
|
|
32
|
-
)}
|
|
28
|
+
{!priceIncludingTax && <Tax taxClass="" amount={totalTaxAmount.text} />}
|
|
33
29
|
<Discount code={coupon} discount={discountAmount.text} />
|
|
34
30
|
<Total
|
|
35
31
|
total={grandTotal.text}
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
priceIncludingTax={priceIncludingTax}
|
|
33
|
+
totalTaxAmount={totalTaxAmount.text}
|
|
38
34
|
/>
|
|
39
35
|
</div>
|
|
40
36
|
);
|
|
@@ -68,10 +64,10 @@ OrderSummary.propTypes = {
|
|
|
68
64
|
subTotalInclTax: PropTypes.shape({
|
|
69
65
|
text: PropTypes.string
|
|
70
66
|
}),
|
|
71
|
-
|
|
67
|
+
totalTaxAmount: PropTypes.shape({
|
|
72
68
|
text: PropTypes.string
|
|
73
69
|
}),
|
|
74
|
-
|
|
70
|
+
priceIncludingTax: PropTypes.bool.isRequired
|
|
75
71
|
};
|
|
76
72
|
|
|
77
73
|
OrderSummary.defaultProps = {
|
|
@@ -92,7 +88,7 @@ OrderSummary.defaultProps = {
|
|
|
92
88
|
subTotalInclTax: {
|
|
93
89
|
text: '0.00'
|
|
94
90
|
},
|
|
95
|
-
|
|
91
|
+
totalTaxAmount: {
|
|
96
92
|
text: '0.00'
|
|
97
93
|
}
|
|
98
94
|
};
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import { _ } from '@evershop/evershop/src/lib/locale/translate';
|
|
4
4
|
|
|
5
|
-
export function Total({ total,
|
|
5
|
+
export function Total({ total, totalTaxAmount, priceIncludingTax }) {
|
|
6
6
|
return (
|
|
7
7
|
<div className="summary-row grand-total">
|
|
8
|
-
{(
|
|
8
|
+
{(priceIncludingTax && (
|
|
9
9
|
<div>
|
|
10
10
|
<div>
|
|
11
11
|
<div className="font-bold">
|
|
@@ -13,7 +13,7 @@ export function Total({ total, taxAmount, displayCheckoutPriceIncludeTax }) {
|
|
|
13
13
|
</div>
|
|
14
14
|
<div>
|
|
15
15
|
<span className="italic">
|
|
16
|
-
({_('Inclusive of tax ${
|
|
16
|
+
({_('Inclusive of tax ${totalTaxAmount}', { totalTaxAmount })})
|
|
17
17
|
</span>
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
@@ -29,6 +29,6 @@ export function Total({ total, taxAmount, displayCheckoutPriceIncludeTax }) {
|
|
|
29
29
|
|
|
30
30
|
Total.propTypes = {
|
|
31
31
|
total: PropTypes.number.isRequired,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
totalTaxAmount: PropTypes.number.isRequired,
|
|
33
|
+
priceIncludingTax: PropTypes.bool.isRequired
|
|
34
34
|
};
|
package/src/components/frontStore/customer/address/addressForm/AddressFormLoadingSkeleton.jsx
CHANGED
|
@@ -4,14 +4,14 @@ import './AddressFormLoadingSkeleton.scss';
|
|
|
4
4
|
export function AddressFormLoadingSkeleton() {
|
|
5
5
|
return (
|
|
6
6
|
<div className="address-loading-skeleton">
|
|
7
|
-
<div className="grid gap-
|
|
7
|
+
<div className="grid gap-8 grid-cols-2">
|
|
8
8
|
<div className="skeleton" />
|
|
9
9
|
<div className="skeleton" />
|
|
10
10
|
</div>
|
|
11
11
|
<div className="skeleton" />
|
|
12
12
|
<div className="skeleton" />
|
|
13
13
|
<div className="skeleton" />
|
|
14
|
-
<div className="grid gap-
|
|
14
|
+
<div className="grid gap-8 grid-cols-2">
|
|
15
15
|
<div className="skeleton" />
|
|
16
16
|
<div className="skeleton" />
|
|
17
17
|
</div>
|
|
@@ -52,9 +52,9 @@ export function Edit({
|
|
|
52
52
|
|
|
53
53
|
return (
|
|
54
54
|
<div className="">
|
|
55
|
-
<h4 className="mb-
|
|
55
|
+
<h4 className="mb-4 mt-4">{_('Contact information')}</h4>
|
|
56
56
|
{!customer && (
|
|
57
|
-
<div className="mb-
|
|
57
|
+
<div className="mb-4">
|
|
58
58
|
<span>{_('Already have an account?')}</span>{' '}
|
|
59
59
|
<a className="text-interactive hover:underline" href={loginUrl}>
|
|
60
60
|
{_('Login')}
|
|
@@ -6,11 +6,11 @@ import ProductNoThumbnail from '@components/common/ProductNoThumbnail';
|
|
|
6
6
|
export default function Order({ order }) {
|
|
7
7
|
return (
|
|
8
8
|
<div className="order border-divider">
|
|
9
|
-
<div className="order-inner grid grid-cols-1 md:grid-cols-3 gap-
|
|
9
|
+
<div className="order-inner grid grid-cols-1 md:grid-cols-3 gap-8">
|
|
10
10
|
<div className="order-items col-span-2">
|
|
11
11
|
{order.items.map((item) => (
|
|
12
|
-
<div className="order-item mb-
|
|
13
|
-
<div className="thumbnail border border-divider p-
|
|
12
|
+
<div className="order-item mb-4 flex gap-8 items-center">
|
|
13
|
+
<div className="thumbnail border border-divider p-4 rounded">
|
|
14
14
|
{item.thumbnail && (
|
|
15
15
|
<img
|
|
16
16
|
style={{ maxWidth: '6rem' }}
|
|
@@ -42,7 +42,7 @@ export default function Order({ order }) {
|
|
|
42
42
|
<span className="font-bold">
|
|
43
43
|
{_('Order')}: #{order.orderNumber}
|
|
44
44
|
</span>
|
|
45
|
-
<span className="italic pl-
|
|
45
|
+
<span className="italic pl-4">{order.createdAt.text}</span>
|
|
46
46
|
</div>
|
|
47
47
|
</div>
|
|
48
48
|
<div className="order-total-value font-bold">
|
|
@@ -167,7 +167,7 @@ export default function CheckoutForm({ stripePublishableKey }) {
|
|
|
167
167
|
|
|
168
168
|
if (result.error) {
|
|
169
169
|
return (
|
|
170
|
-
<div className="flex p-
|
|
170
|
+
<div className="flex p-8 justify-center items-center text-critical">
|
|
171
171
|
{error.message}
|
|
172
172
|
</div>
|
|
173
173
|
);
|
|
@@ -197,7 +197,7 @@ export default function CheckoutForm({ stripePublishableKey }) {
|
|
|
197
197
|
</div>
|
|
198
198
|
{/* Show any error that happens when processing the payment */}
|
|
199
199
|
{error && (
|
|
200
|
-
<div className="card-error text-critical mb-
|
|
200
|
+
<div className="card-error text-critical mb-8" role="alert">
|
|
201
201
|
{error}
|
|
202
202
|
</div>
|
|
203
203
|
)}
|
|
@@ -68,7 +68,7 @@ function TestCards({ showTestCard, testSuccess, testFailure }) {
|
|
|
68
68
|
<rect x="116.25" y="12.61" width="2.73" height="9.64" />
|
|
69
69
|
</svg>
|
|
70
70
|
</div>
|
|
71
|
-
<div className="self-center flex space-x-
|
|
71
|
+
<div className="self-center flex space-x-4">
|
|
72
72
|
<Button
|
|
73
73
|
onAction={testSuccess}
|
|
74
74
|
title="Test success"
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export default function BasicMenu({
|
|
5
|
+
basicMenuWidget: { menus, isMain, className }
|
|
6
|
+
}) {
|
|
7
|
+
const [isOpen, setIsOpen] = React.useState(!isMain);
|
|
8
|
+
|
|
9
|
+
const toggleMenu = () => {
|
|
10
|
+
setIsOpen(!isOpen);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const listingClasses = isMain
|
|
14
|
+
? 'md:flex md:justify-center md:space-x-10 absolute md:relative left-[-2.5rem] md:left-0 top-full md:top-auto mt-2 md:mt-0 w-screen md:w-auto md:bg-transparent p-4 md:p-0 min-w-[250px] bg-white z-30 divide-y md:divide-y-0'
|
|
15
|
+
: 'flex justify-center space-x-10 relative left-[-2.5rem] md:left-0 top-full md:top-auto mt-2 md:mt-0 w-screen md:w-auto md:bg-transparent p-4 md:p-0 min-w-[250px] bg-white z-30';
|
|
16
|
+
return (
|
|
17
|
+
<div className={className}>
|
|
18
|
+
<div className="flex justify-start gap-6 items-center">
|
|
19
|
+
<nav className="p-4 relative md:flex md:justify-center">
|
|
20
|
+
<div className="flex justify-between items-center">
|
|
21
|
+
{isMain && (
|
|
22
|
+
<div className="md:hidden">
|
|
23
|
+
<a
|
|
24
|
+
href="#"
|
|
25
|
+
onClick={(e) => {
|
|
26
|
+
e.preventDefault();
|
|
27
|
+
toggleMenu();
|
|
28
|
+
}}
|
|
29
|
+
className="text-black focus:outline-none"
|
|
30
|
+
>
|
|
31
|
+
<svg
|
|
32
|
+
className="w-9 h-9"
|
|
33
|
+
fill="none"
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
viewBox="0 0 24 24"
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
strokeLinecap="round"
|
|
40
|
+
strokeLinejoin="round"
|
|
41
|
+
strokeWidth="2"
|
|
42
|
+
d="M4 6h16M4 12h16m-7 6h7"
|
|
43
|
+
/>
|
|
44
|
+
</svg>
|
|
45
|
+
</a>
|
|
46
|
+
</div>
|
|
47
|
+
)}
|
|
48
|
+
<ul className={`${isOpen ? 'block' : 'hidden'} ${listingClasses}`}>
|
|
49
|
+
{menus.map((item, index) => (
|
|
50
|
+
<li key={index} className="relative group">
|
|
51
|
+
<a
|
|
52
|
+
href={item.url}
|
|
53
|
+
className="hover:text-gray-300 transition-colors block md:inline-block px-4 py-4 md:px-0 md:py-0"
|
|
54
|
+
>
|
|
55
|
+
{item.name}
|
|
56
|
+
</a>
|
|
57
|
+
{item.children.length > 0 && (
|
|
58
|
+
<ul className="md:absolute left-0 top-full mt-0 md:mt-3 w-48 bg-white md:shadow-lg rounded-md md:opacity-0 md:group-hover:opacity-100 md:group-hover:translate-y-0 transform transition-all duration-300 ease-in-out min-w-full md:min-w-[250px] z-30 md:border-t-4">
|
|
59
|
+
{item.children.map((subItem, subIndex) => (
|
|
60
|
+
<li key={subIndex}>
|
|
61
|
+
<a
|
|
62
|
+
href={subItem.url}
|
|
63
|
+
className="block px-8 md:px-4 py-3 text-gray-700 hover:bg-gray-100"
|
|
64
|
+
>
|
|
65
|
+
{subItem.name}
|
|
66
|
+
</a>
|
|
67
|
+
</li>
|
|
68
|
+
))}
|
|
69
|
+
</ul>
|
|
70
|
+
)}
|
|
71
|
+
</li>
|
|
72
|
+
))}
|
|
73
|
+
</ul>
|
|
74
|
+
</div>
|
|
75
|
+
</nav>
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
BasicMenu.propTypes = {
|
|
82
|
+
basicMenuWidget: PropTypes.shape({
|
|
83
|
+
menus: PropTypes.arrayOf(
|
|
84
|
+
PropTypes.shape({
|
|
85
|
+
id: PropTypes.string,
|
|
86
|
+
name: PropTypes.string,
|
|
87
|
+
url: PropTypes.string,
|
|
88
|
+
type: PropTypes.string,
|
|
89
|
+
uuid: PropTypes.string,
|
|
90
|
+
children: PropTypes.arrayOf(
|
|
91
|
+
PropTypes.shape({
|
|
92
|
+
name: PropTypes.string,
|
|
93
|
+
url: PropTypes.string,
|
|
94
|
+
type: PropTypes.string,
|
|
95
|
+
uuid: PropTypes.string
|
|
96
|
+
})
|
|
97
|
+
)
|
|
98
|
+
})
|
|
99
|
+
),
|
|
100
|
+
isMain: PropTypes.bool,
|
|
101
|
+
className: PropTypes.string
|
|
102
|
+
}).isRequired
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const query = `
|
|
106
|
+
query Query($settings: JSON) {
|
|
107
|
+
basicMenuWidget(settings: $settings) {
|
|
108
|
+
menus {
|
|
109
|
+
id
|
|
110
|
+
name
|
|
111
|
+
url
|
|
112
|
+
type
|
|
113
|
+
uuid
|
|
114
|
+
children {
|
|
115
|
+
name
|
|
116
|
+
url
|
|
117
|
+
type
|
|
118
|
+
uuid
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
isMain
|
|
122
|
+
className
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
|
|
127
|
+
export const variables = `{
|
|
128
|
+
settings: getWidgetSetting()
|
|
129
|
+
}`;
|
|
@@ -2,23 +2,23 @@ import ProductList from '@components/frontStore/catalog/product/list/List';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
export default function
|
|
5
|
+
export default function CollectionProducts({ collection }) {
|
|
6
6
|
if (!collection) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
9
9
|
return (
|
|
10
|
-
<div className="pt-
|
|
10
|
+
<div className="pt-12">
|
|
11
11
|
<div className="page-width">
|
|
12
|
-
<h3 className="mt-
|
|
13
|
-
{collection
|
|
12
|
+
<h3 className="mt-12 mb-12 text-center uppercase h5 tracking-widest">
|
|
13
|
+
{collection?.name}
|
|
14
14
|
</h3>
|
|
15
|
-
<ProductList products={collection
|
|
15
|
+
<ProductList products={collection?.products?.items} countPerRow={4} />
|
|
16
16
|
</div>
|
|
17
17
|
</div>
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
CollectionProducts.propTypes = {
|
|
22
22
|
collection: PropTypes.shape({
|
|
23
23
|
collectionId: PropTypes.number.isRequired,
|
|
24
24
|
name: PropTypes.string.isRequired,
|
|
@@ -46,41 +46,49 @@ FeaturedProducts.propTypes = {
|
|
|
46
46
|
})
|
|
47
47
|
).isRequired
|
|
48
48
|
}).isRequired
|
|
49
|
+
}).isRequired,
|
|
50
|
+
collectionProductsWidget: PropTypes.shape({
|
|
51
|
+
count: PropTypes.number
|
|
49
52
|
}).isRequired
|
|
50
53
|
};
|
|
51
54
|
|
|
52
|
-
export const layout = {
|
|
53
|
-
areaId: 'content',
|
|
54
|
-
sortOrder: 15
|
|
55
|
-
};
|
|
56
|
-
|
|
57
55
|
export const query = `
|
|
58
|
-
query
|
|
59
|
-
collection (code:
|
|
56
|
+
query Query($collection: String, $count: ID) {
|
|
57
|
+
collection (code: $collection) {
|
|
60
58
|
collectionId
|
|
61
59
|
name
|
|
62
|
-
products (filters: [{key: "limit", operation: eq, value:
|
|
60
|
+
products (filters: [{key: "limit", operation: eq, value: $count}]) {
|
|
63
61
|
items {
|
|
64
|
-
|
|
65
|
-
name
|
|
66
|
-
sku
|
|
67
|
-
price {
|
|
68
|
-
regular {
|
|
69
|
-
value
|
|
70
|
-
text
|
|
71
|
-
}
|
|
72
|
-
special {
|
|
73
|
-
value
|
|
74
|
-
text
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
image {
|
|
78
|
-
alt
|
|
79
|
-
url: listing
|
|
80
|
-
}
|
|
81
|
-
url
|
|
62
|
+
...Product
|
|
82
63
|
}
|
|
83
64
|
}
|
|
84
65
|
}
|
|
85
66
|
}
|
|
86
67
|
`;
|
|
68
|
+
|
|
69
|
+
export const fragments = `
|
|
70
|
+
fragment Product on Product {
|
|
71
|
+
productId
|
|
72
|
+
name
|
|
73
|
+
price {
|
|
74
|
+
regular {
|
|
75
|
+
value
|
|
76
|
+
text
|
|
77
|
+
}
|
|
78
|
+
special {
|
|
79
|
+
value
|
|
80
|
+
text
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
image {
|
|
84
|
+
alt
|
|
85
|
+
url: listing
|
|
86
|
+
}
|
|
87
|
+
url
|
|
88
|
+
}
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
export const variables = `{
|
|
92
|
+
collection: getWidgetSetting("collection"),
|
|
93
|
+
count: getWidgetSetting("count")
|
|
94
|
+
}`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import Editor from '@components/common/Editor';
|
|
4
|
+
|
|
5
|
+
export default function TextBlock({ textWidget: { text, className } }) {
|
|
6
|
+
return (
|
|
7
|
+
<div className={`text-block-widget ${className}`}>
|
|
8
|
+
<Editor rows={text} />
|
|
9
|
+
</div>
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
TextBlock.propTypes = {
|
|
14
|
+
textWidget: PropTypes.shape({
|
|
15
|
+
// eslint-disable-next-line react/forbid-prop-types
|
|
16
|
+
text: PropTypes.array,
|
|
17
|
+
className: PropTypes.string
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
TextBlock.defaultProps = {
|
|
22
|
+
textWidget: {
|
|
23
|
+
text: [],
|
|
24
|
+
className: ''
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const query = `
|
|
29
|
+
query Query($text: String, $className: String) {
|
|
30
|
+
textWidget(text: $text, className: $className) {
|
|
31
|
+
...TextBlockWidget
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const fragments = `
|
|
37
|
+
fragment TextBlockWidget on TextBlockWidget {
|
|
38
|
+
text
|
|
39
|
+
className
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
|
|
43
|
+
export const variables = `{
|
|
44
|
+
text: getWidgetSetting("text"),
|
|
45
|
+
className: getWidgetSetting("className")
|
|
46
|
+
}`;
|
|
@@ -4,6 +4,7 @@ const { getEnabledExtensions } = require('../../../bin/extension');
|
|
|
4
4
|
const { scanRouteComponents } = require('./scanForComponents');
|
|
5
5
|
const { getConfig } = require('../util/getConfig');
|
|
6
6
|
const { CONSTANTS } = require('../helpers');
|
|
7
|
+
const { getEnabledWidgets } = require('../util/getEnabledWidgets');
|
|
7
8
|
|
|
8
9
|
// eslint-disable-next-line no-multi-assign
|
|
9
10
|
module.exports = exports = {};
|
|
@@ -11,11 +12,23 @@ module.exports = exports = {};
|
|
|
11
12
|
exports.getComponentsByRoute = function getComponentsByRoute(route) {
|
|
12
13
|
const modules = [...getCoreModules(), ...getEnabledExtensions()];
|
|
13
14
|
const theme = getConfig('system.theme');
|
|
15
|
+
|
|
16
|
+
let components;
|
|
14
17
|
if (theme) {
|
|
15
|
-
|
|
18
|
+
components = Object.values(
|
|
16
19
|
scanRouteComponents(route, modules, resolve(CONSTANTS.THEMEPATH, theme))
|
|
17
20
|
);
|
|
18
21
|
} else {
|
|
19
|
-
|
|
22
|
+
components = Object.values(scanRouteComponents(route, modules));
|
|
23
|
+
}
|
|
24
|
+
const widgets = getEnabledWidgets();
|
|
25
|
+
if (!route.isAdmin) {
|
|
26
|
+
// Add widgets to components
|
|
27
|
+
return components.concat((widgets || []).map((widget) => widget.component));
|
|
28
|
+
} else {
|
|
29
|
+
// Add widgets to components
|
|
30
|
+
return components.concat(
|
|
31
|
+
(widgets || []).map((widget) => widget.setting_component)
|
|
32
|
+
);
|
|
20
33
|
}
|
|
21
34
|
};
|
|
@@ -20,7 +20,9 @@ module.exports = exports = (request, response, next) => {
|
|
|
20
20
|
request.url = request.originalUrl.replace('/assets', '');
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
if (
|
|
23
|
+
if (path.endsWith('/')) {
|
|
24
|
+
response.status(404).send('Not Found');
|
|
25
|
+
} else if (existsSync(join(CONSTANTS.ROOTPATH, '.evershop/build', path))) {
|
|
24
26
|
staticMiddleware(join(CONSTANTS.ROOTPATH, '.evershop/build'))(
|
|
25
27
|
request,
|
|
26
28
|
response,
|
|
@@ -34,18 +34,16 @@ function renderDevelopment(request, response) {
|
|
|
34
34
|
}
|
|
35
35
|
// We can not get devMiddleware from response.locals
|
|
36
36
|
// because there are 2 build (current route, and notFound)
|
|
37
|
-
const devMiddleware = route.webpackMiddleware;
|
|
38
37
|
const contextValue = {
|
|
39
38
|
graphqlResponse: get(response, 'locals.graphqlResponse', {}),
|
|
40
|
-
propsMap: get(response, 'locals.propsMap', {})
|
|
39
|
+
propsMap: get(response, 'locals.propsMap', {}),
|
|
40
|
+
widgets: get(response, 'locals.widgets', [])
|
|
41
41
|
};
|
|
42
42
|
const safeContextValue = jsesc(contextValue, {
|
|
43
43
|
json: true,
|
|
44
44
|
isScriptContext: true
|
|
45
45
|
});
|
|
46
|
-
const {
|
|
47
|
-
// let stat = jsonWebpackStats.find(st => st.compilation.name === route.id);
|
|
48
|
-
const { assetsByChunkName } = stats.toJson();
|
|
46
|
+
const { assetsByChunkName } = response.locals.jsonWebpackStats;
|
|
49
47
|
|
|
50
48
|
const notFoundFile = request.currentRoute?.isAdmin
|
|
51
49
|
? 'adminNotFound.js'
|
|
@@ -94,7 +92,8 @@ function renderProduction(request, response) {
|
|
|
94
92
|
));
|
|
95
93
|
const contextValue = {
|
|
96
94
|
graphqlResponse: get(response, 'locals.graphqlResponse', {}),
|
|
97
|
-
propsMap: get(response, 'locals.propsMap', {})
|
|
95
|
+
propsMap: get(response, 'locals.propsMap', {}),
|
|
96
|
+
widgets: get(response, 'locals.widgets', [])
|
|
98
97
|
};
|
|
99
98
|
const safeContextValue = jsesc(contextValue, {
|
|
100
99
|
json: true,
|
package/src/lib/router/Router.js
CHANGED
|
@@ -34,7 +34,7 @@ class Router {
|
|
|
34
34
|
|
|
35
35
|
const router = new Router();
|
|
36
36
|
exports.addRoute = (route) => router.addRoute(route);
|
|
37
|
-
exports.getFrontStoreRoutes = () => router.
|
|
37
|
+
exports.getFrontStoreRoutes = () => router.getFrontStoreRoutes();
|
|
38
38
|
exports.getAdminRoutes = () => router.getAdminRoutes();
|
|
39
39
|
exports.getRoutes = () => router.getRoutes();
|
|
40
40
|
exports.empty = () => router.empty();
|