@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.
Files changed (391) hide show
  1. package/bin/build/index.js +24 -0
  2. package/bin/extension/index.js +2 -2
  3. package/bin/lib/addDefaultMiddlewareFuncs.js +7 -2
  4. package/bin/lib/buildEntry.js +20 -2
  5. package/bin/lib/onListening.js +7 -4
  6. package/bin/lib/startUp.js +6 -0
  7. package/package.json +9 -1
  8. package/src/components/admin/catalog/productEdit/category/CategoryItem.jsx +2 -7
  9. package/src/components/admin/catalog/productEdit/category/CategoryTree.jsx +14 -7
  10. package/src/components/admin/catalog/productEdit/category/CategoryTree.scss +10 -0
  11. package/src/components/admin/catalog/productEdit/variants/CreateVariant.jsx +2 -2
  12. package/src/components/admin/catalog/productEdit/variants/CreateVariantGroup.jsx +1 -1
  13. package/src/components/admin/catalog/productEdit/variants/EditVariant.jsx +1 -1
  14. package/src/components/admin/catalog/productEdit/variants/New.jsx +2 -2
  15. package/src/components/admin/catalog/productEdit/variants/Search.jsx +1 -1
  16. package/src/components/admin/catalog/productEdit/variants/SearchModal.jsx +1 -1
  17. package/src/components/admin/catalog/productEdit/variants/VariantModal.jsx +6 -6
  18. package/src/components/admin/catalog/productGrid/rows/ThumbnailRow.jsx +1 -1
  19. package/src/components/admin/checkout/shippingSetting/Method.jsx +6 -6
  20. package/src/components/admin/checkout/shippingSetting/MethodForm.jsx +4 -4
  21. package/src/components/admin/checkout/shippingSetting/Methods.jsx +3 -3
  22. package/src/components/admin/checkout/shippingSetting/PriceBasedPrice.jsx +2 -2
  23. package/src/components/admin/checkout/shippingSetting/WeightBasedPrice.jsx +2 -2
  24. package/src/components/admin/checkout/shippingSetting/Zone.jsx +7 -7
  25. package/src/components/admin/checkout/shippingSetting/ZoneForm.jsx +1 -1
  26. package/src/components/admin/cms/Card.jsx +3 -3
  27. package/src/components/admin/cms/PageHeading.jsx +3 -3
  28. package/src/components/admin/cms/widget/WidgetTypes.jsx +28 -0
  29. package/src/components/admin/cms/widget/grid/WidgetTypeRow.jsx +29 -0
  30. package/src/components/admin/oms/orderEdit/items/ItemVariantOptions.jsx +1 -1
  31. package/src/components/admin/oms/orderEdit/items/Name.jsx +1 -1
  32. package/src/components/admin/oms/orderGrid/headers/OrderDateColumnHeader.jsx +1 -1
  33. package/src/components/admin/promotion/couponEdit/AttributeGroupSelector.jsx +3 -3
  34. package/src/components/admin/promotion/couponEdit/BuyXGetY.jsx +2 -2
  35. package/src/components/admin/promotion/couponEdit/CategorySelector.jsx +6 -6
  36. package/src/components/admin/promotion/couponEdit/CollectionSelector.jsx +3 -3
  37. package/src/components/admin/promotion/couponEdit/ProductSkuSelector.jsx +4 -4
  38. package/src/components/admin/promotion/couponEdit/RequireProducts.jsx +2 -2
  39. package/src/components/admin/promotion/couponEdit/Setting.jsx +1 -1
  40. package/src/components/admin/promotion/couponEdit/TargetProducts.jsx +4 -4
  41. package/src/components/admin/tax/taxSetting/Rate.jsx +6 -6
  42. package/src/components/admin/tax/taxSetting/RateForm.jsx +5 -5
  43. package/src/components/admin/tax/taxSetting/Rates.jsx +6 -6
  44. package/src/components/admin/tax/taxSetting/TaxClass.jsx +3 -3
  45. package/src/components/admin/tax/taxSetting/TaxClassForm.jsx +1 -1
  46. package/src/components/admin/widgets/BasicMenuSetting.jsx +614 -0
  47. package/src/components/admin/widgets/BasicMenuSetting.scss +19 -0
  48. package/src/components/admin/widgets/CollectionProductsSetting.jsx +203 -0
  49. package/src/components/admin/widgets/TextBlockSetting.jsx +70 -0
  50. package/src/components/common/Area.jsx +31 -8
  51. package/src/components/common/Badge.jsx +1 -1
  52. package/src/components/common/Editor.jsx +193 -0
  53. package/src/components/common/Notification.scss +1 -0
  54. package/src/components/common/SimplePagination.jsx +2 -2
  55. package/src/components/common/form/Form.jsx +1 -1
  56. package/src/components/common/form/fields/Checkbox.jsx +1 -1
  57. package/src/components/common/form/fields/Ckeditor.jsx +11 -11
  58. package/src/components/common/form/fields/Editor.jsx +326 -0
  59. package/src/components/common/form/fields/Editor.scss +33 -0
  60. package/src/components/common/form/fields/Radio.jsx +1 -1
  61. package/src/components/common/form/fields/editor/FileBrowser.jsx +419 -0
  62. package/src/components/common/form/fields/editor/FileBrowser.scss +37 -0
  63. package/src/components/common/form/fields/editor/GetColumnClasses.jsx +14 -0
  64. package/src/components/common/form/fields/editor/GetRowClasses.jsx +18 -0
  65. package/src/components/common/form/fields/editor/RowTemplates.jsx +154 -0
  66. package/src/components/common/grid/Pagination.jsx +4 -4
  67. package/src/components/common/grid/headers/FromTo.jsx +1 -1
  68. package/src/components/common/grid/headers/Sortable.jsx +1 -1
  69. package/src/components/common/grid/rows/ThumbnailRow.jsx +1 -1
  70. package/src/components/common/list/Filter.jsx +1 -1
  71. package/src/components/common/modal/Alert.jsx +1 -1
  72. package/src/components/common/modal/Modal.jsx +1 -1
  73. package/src/components/frontStore/catalog/categoryView/filter/AttributeFilter.jsx +2 -2
  74. package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.jsx +3 -2
  75. package/src/components/frontStore/catalog/categoryView/filter/CategoryFilter.scss +5 -0
  76. package/src/components/frontStore/catalog/product/list/List.jsx +4 -4
  77. package/src/components/frontStore/catalog/product/list/Pagination.jsx +1 -1
  78. package/src/components/frontStore/catalog/product/list/Sorting.jsx +2 -2
  79. package/src/components/frontStore/catalog/product/list/item/Name.jsx +1 -1
  80. package/src/components/frontStore/checkout/cart/Empty.jsx +3 -3
  81. package/src/components/frontStore/checkout/cart/items/ItemOptions.jsx +1 -1
  82. package/src/components/frontStore/checkout/cart/items/ItemVariantOptions.jsx +1 -1
  83. package/src/components/frontStore/checkout/cart/items/Items.jsx +20 -21
  84. package/src/components/frontStore/checkout/cart/items/Items.scss +47 -0
  85. package/src/components/frontStore/checkout/cart/items/Quantity.jsx +154 -0
  86. package/src/components/frontStore/checkout/checkout/StepTitle.jsx +1 -1
  87. package/src/components/frontStore/checkout/checkout/payment/paymentStep/StepContent.jsx +5 -5
  88. package/src/components/frontStore/checkout/checkout/shipment/StepContent.jsx +1 -1
  89. package/src/components/frontStore/checkout/checkout/summary/Cart.jsx +10 -12
  90. package/src/components/frontStore/checkout/checkout/summary/Items.jsx +9 -9
  91. package/src/components/frontStore/checkout/checkout/summary/cart/Total.jsx +6 -6
  92. package/src/components/frontStore/checkout/success/summary/items/ItemOptions.jsx +1 -1
  93. package/src/components/frontStore/checkout/success/summary/items/Items.jsx +9 -6
  94. package/src/components/frontStore/checkout/success/summary/order/OrderSummary.jsx +9 -13
  95. package/src/components/frontStore/checkout/success/summary/order/Total.jsx +5 -5
  96. package/src/components/frontStore/customer/address/addressForm/AddressFormLoadingSkeleton.jsx +2 -2
  97. package/src/components/frontStore/customer/address/addressForm/NameAndTelephone.jsx +1 -1
  98. package/src/components/frontStore/customer/address/addressForm/ProvinceAndPostcode.jsx +1 -1
  99. package/src/components/frontStore/customer/checkout/Edit.jsx +2 -2
  100. package/src/components/frontStore/customer/detail/Order.jsx +4 -4
  101. package/src/components/frontStore/stripe/checkout/CheckoutForm.jsx +2 -2
  102. package/src/components/frontStore/stripe/checkout/TestCards.jsx +1 -1
  103. package/src/components/frontStore/widgets/BasicMenu.jsx +129 -0
  104. package/src/{modules/catalog/pages/frontStore/homepage/FeaturedProducts.jsx → components/frontStore/widgets/CollectionProducts.jsx} +40 -32
  105. package/src/components/frontStore/widgets/TextBlock.jsx +46 -0
  106. package/src/lib/componee/getComponentsByRoute.js +15 -2
  107. package/src/lib/event/event-manager.js +1 -1
  108. package/src/lib/middleware/tests/app/modules/404page/pages/frontStore/product/route.json +2 -1
  109. package/src/lib/middlewares/static.js +3 -1
  110. package/src/lib/response/render.js +5 -6
  111. package/src/lib/router/Router.js +1 -1
  112. package/src/lib/router/loadModuleRoutes.js +3 -0
  113. package/src/lib/router/registerAdminRoute.js +9 -1
  114. package/src/lib/router/registerFrontStoreRoute.js +2 -0
  115. package/src/lib/router/scanForRoutes.js +1 -0
  116. package/src/lib/router/tests/unit/unit.validateRoute.test.js +7 -1
  117. package/src/lib/util/defaultPaginationFilters.js +19 -17
  118. package/src/lib/util/getEnabledWidgets.js +34 -0
  119. package/src/lib/util/merge.js +67 -14
  120. package/src/lib/util/tests/unit/util.merge.test.js +21 -4
  121. package/src/lib/util/validateConfiguration.js +83 -0
  122. package/src/lib/webpack/createBaseConfig.js +4 -1
  123. package/src/lib/webpack/dev/createConfigClient.js +10 -2
  124. package/src/lib/webpack/loaders/AreaLoader.js +16 -6
  125. package/src/lib/webpack/util/keyGenerator.js +9 -0
  126. package/src/lib/webpack/util/parseGraphql.js +30 -16
  127. package/src/lib/webpack/util/parseGraphqlByFile.js +16 -2
  128. package/src/modules/auth/pages/admin/adminLogin/LoginForm.jsx +54 -21
  129. package/src/modules/auth/pages/admin/all/AdminUser.jsx +3 -3
  130. package/src/modules/base/bootstrap.js +79 -0
  131. package/src/modules/base/graphql/types/Route/Route.admin.graphql +15 -0
  132. package/src/modules/base/graphql/types/Route/Route.admin.resolvers.js +10 -0
  133. package/src/modules/base/pages/global/response[errorHandler].js +25 -1
  134. package/src/modules/catalog/bootstrap.js +125 -5
  135. package/src/modules/catalog/graphql/types/Category/Category.graphql +4 -3
  136. package/src/modules/catalog/graphql/types/Category/Category.resolvers.js +34 -0
  137. package/src/modules/catalog/graphql/types/Collection/Collection.graphql +2 -2
  138. package/src/modules/catalog/graphql/types/Collection/Collection.resolvers.js +34 -0
  139. package/src/modules/catalog/graphql/types/Product/Attribute/ProductAttribute.resolvers.js +1 -0
  140. package/src/modules/catalog/graphql/types/Product/Product.graphql +1 -1
  141. package/src/modules/catalog/graphql/types/Product/Product.resolvers.js +34 -0
  142. package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.graphql +11 -0
  143. package/src/modules/catalog/graphql/types/Widget/CollectionProductsWidget/CollectionProductsWidget.resolvers.js +8 -0
  144. package/src/modules/catalog/migration/Version-1.0.0.js +1 -0
  145. package/src/modules/catalog/migration/Version-1.0.7.js +10 -0
  146. package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/FormContent.jsx +4 -4
  147. package/src/modules/catalog/pages/admin/attributeEdit+attributeNew/General.jsx +5 -5
  148. package/src/modules/catalog/pages/admin/attributeGrid/Grid.jsx +2 -2
  149. package/src/modules/catalog/pages/admin/categoryEdit/Products.jsx +4 -4
  150. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/FormContent.jsx +4 -4
  151. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/General.jsx +16 -18
  152. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Image.jsx +1 -2
  153. package/src/modules/catalog/pages/admin/categoryEdit+categoryNew/Status.jsx +16 -1
  154. package/src/modules/catalog/pages/admin/categoryGrid/Grid.jsx +3 -3
  155. package/src/modules/catalog/pages/admin/collectionEdit/Products.jsx +4 -4
  156. package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/FormContent.jsx +2 -2
  157. package/src/modules/catalog/pages/admin/collectionEdit+collectionNew/General.jsx +2 -2
  158. package/src/modules/catalog/pages/admin/collectionGrid/Grid.jsx +3 -3
  159. package/src/modules/catalog/pages/admin/productEdit/Collection.jsx +7 -7
  160. package/src/modules/catalog/pages/admin/productEdit+productNew/Attributes.jsx +8 -3
  161. package/src/modules/catalog/pages/admin/productEdit+productNew/CustomOptions.jsss +4 -4
  162. package/src/modules/catalog/pages/admin/productEdit+productNew/FormContent.jsx +4 -4
  163. package/src/modules/catalog/pages/admin/productEdit+productNew/General.jsx +15 -17
  164. package/src/modules/catalog/pages/admin/productGrid/Grid.jsx +3 -3
  165. package/src/modules/catalog/pages/frontStore/catalogSearch/General.jsx +2 -2
  166. package/src/modules/catalog/pages/frontStore/catalogSearch/Products.jsx +1 -1
  167. package/src/modules/catalog/pages/frontStore/catalogSearch/route.json +2 -1
  168. package/src/modules/catalog/pages/frontStore/categoryView/CategoryView.jsx +19 -2
  169. package/src/modules/catalog/pages/frontStore/categoryView/Filter.scss +1 -0
  170. package/src/modules/catalog/pages/frontStore/categoryView/General.jsx +6 -8
  171. package/src/modules/catalog/pages/frontStore/categoryView/General.scss +0 -2
  172. package/src/modules/catalog/pages/frontStore/categoryView/Pagination.jsx +6 -0
  173. package/src/modules/catalog/pages/frontStore/categoryView/Products.jsx +8 -1
  174. package/src/modules/catalog/pages/frontStore/categoryView/route.json +2 -1
  175. package/src/modules/catalog/pages/frontStore/productView/Description.jsx +15 -4
  176. package/src/modules/catalog/pages/frontStore/productView/Form.jsx +4 -4
  177. package/src/modules/catalog/pages/frontStore/productView/Form.scss +1 -0
  178. package/src/modules/catalog/pages/frontStore/productView/GeneralInfo.jsx +1 -1
  179. package/src/modules/catalog/pages/frontStore/productView/Images.jsx +1 -1
  180. package/src/modules/catalog/pages/frontStore/productView/Layout.jsx +1 -1
  181. package/src/modules/catalog/pages/frontStore/productView/Options.jsx +7 -3
  182. package/src/modules/catalog/pages/frontStore/productView/Variants.jsx +6 -6
  183. package/src/modules/catalog/pages/frontStore/productView/route.json +2 -1
  184. package/src/modules/catalog/services/AttributeCollection.js +10 -10
  185. package/src/modules/catalog/services/AttributeGroupCollection.js +10 -10
  186. package/src/modules/catalog/services/CategoryCollection.js +10 -10
  187. package/src/modules/catalog/services/CollectionCollection.js +10 -10
  188. package/src/modules/catalog/services/registerCartItemProductUrlField.js +35 -0
  189. package/src/modules/catalog/services/registerCartItemVariantOptionsField.js +51 -0
  190. package/src/modules/catalog/services/registerDefaultCategoryCollectionFilters.js +16 -0
  191. package/src/modules/checkout/api/addShippingNote/[context]bodyParser[auth].js +5 -0
  192. package/src/modules/checkout/api/addShippingNote/payloadSchema.json +15 -0
  193. package/src/modules/checkout/api/addShippingNote/route.json +5 -0
  194. package/src/modules/checkout/api/addShippingNote/saveShippingNote.js +50 -0
  195. package/src/modules/checkout/api/createCart/createNewCart.js +28 -3
  196. package/src/modules/checkout/api/updateCartItemQty/[bodyParser]updateQty.js +49 -0
  197. package/src/modules/checkout/api/updateCartItemQty/[context]bodyParser[auth].js +5 -0
  198. package/src/modules/checkout/api/updateCartItemQty/payloadSchema.json +21 -0
  199. package/src/modules/checkout/api/updateCartItemQty/route.json +5 -0
  200. package/src/modules/checkout/api/updateMineCartItemQty/[context]bodyParser[auth].js +5 -0
  201. package/src/modules/checkout/api/updateMineCartItemQty/[detectCurrentCart]updateQty.js +51 -0
  202. package/src/modules/checkout/api/updateMineCartItemQty/[getCurrentCustomer]detectCurrentCart.js +32 -0
  203. package/src/modules/checkout/api/updateMineCartItemQty/payloadSchema.json +21 -0
  204. package/src/modules/checkout/api/updateMineCartItemQty/route.json +5 -0
  205. package/src/modules/checkout/bootstrap.js +27 -0
  206. package/src/modules/checkout/graphql/types/Cart/Cart.graphql +22 -3
  207. package/src/modules/checkout/graphql/types/Cart/Cart.resolvers.js +18 -2
  208. package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.graphql +3 -0
  209. package/src/modules/checkout/graphql/types/CheckoutSetting/CheckoutSetting.resolvers.js +7 -0
  210. package/src/modules/checkout/migration/Version-1.0.0.js +14 -0
  211. package/src/modules/checkout/migration/Version-1.0.6.js +201 -0
  212. package/src/modules/checkout/pages/admin/shippingSetting/ShippingSetting.jsx +2 -2
  213. package/src/modules/checkout/pages/frontStore/all/[context]detectCurrentCart[auth].js +5 -0
  214. package/src/modules/checkout/pages/frontStore/cart/ShoppingCart.jsx +20 -12
  215. package/src/modules/checkout/pages/frontStore/cart/Summary.jsx +34 -23
  216. package/src/modules/checkout/pages/frontStore/cart/route.json +2 -1
  217. package/src/modules/checkout/pages/frontStore/checkout/Checkout.jsx +5 -5
  218. package/src/modules/checkout/pages/frontStore/checkout/Checkout.scss +4 -0
  219. package/src/modules/checkout/pages/frontStore/checkout/ShippingMethods.jsx +2 -2
  220. package/src/modules/checkout/pages/frontStore/checkout/ShippingNote.jsx +105 -0
  221. package/src/modules/checkout/pages/frontStore/checkout/Summary.jsx +14 -14
  222. package/src/modules/checkout/pages/frontStore/checkout/SummaryMobile.jsx +12 -15
  223. package/src/modules/checkout/pages/frontStore/checkout/route.json +2 -1
  224. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.jsx +1 -1
  225. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CheckoutSuccess.scss +4 -0
  226. package/src/modules/checkout/pages/frontStore/checkoutSuccess/CustomerInfo.jsx +30 -32
  227. package/src/modules/checkout/pages/frontStore/checkoutSuccess/ShippingNote.jsx +47 -0
  228. package/src/modules/checkout/pages/frontStore/checkoutSuccess/Summary.jsx +12 -15
  229. package/src/modules/checkout/pages/frontStore/checkoutSuccess/route.json +2 -1
  230. package/src/modules/checkout/services/cart/Cart.js +31 -27
  231. package/src/modules/checkout/services/cart/registerCartBaseFields.js +133 -41
  232. package/src/modules/checkout/services/cart/registerCartItemBaseFields.js +300 -374
  233. package/src/modules/checkout/services/toPrice.js +1 -1
  234. package/src/modules/checkout/tests/basicSetup.js +85 -0
  235. package/src/modules/checkout/tests/coupons.js +82 -0
  236. package/src/modules/checkout/tests/products.js +67 -0
  237. package/src/modules/checkout/tests/taxRates.js +3 -0
  238. package/src/modules/checkout/tests/unit/discountAmount.test.js +60 -0
  239. package/src/modules/checkout/tests/unit/grandTotal.test.js +83 -0
  240. package/src/modules/checkout/tests/unit/lineTotal.test.js +92 -0
  241. package/src/modules/checkout/tests/unit/lineTotalWithDiscount.test.js +103 -0
  242. package/src/modules/checkout/tests/unit/productPrice.test.js +69 -0
  243. package/src/modules/checkout/tests/unit/subTotal.test.js +85 -0
  244. package/src/modules/checkout/tests/unit/subTotalWithDiscount.test.js +117 -0
  245. package/src/modules/checkout/tests/unit/taxAmount.test.js +68 -0
  246. package/src/modules/checkout/tests/unit/taxAmountRounding.test.js +277 -0
  247. package/src/modules/cms/api/createWidget/[context]bodyParser[auth].js +5 -0
  248. package/src/modules/cms/api/createWidget/createWidget[finish].js +17 -0
  249. package/src/modules/cms/api/createWidget/finish[apiResponse].js +27 -0
  250. package/src/modules/cms/api/createWidget/payloadSchema.json +18 -0
  251. package/src/modules/cms/api/createWidget/route.json +5 -0
  252. package/src/modules/cms/api/deleteWidget/deleteWidget.js +27 -0
  253. package/src/modules/cms/api/deleteWidget/route.json +5 -0
  254. package/src/modules/cms/api/updateWidget/[context]bodyParser[auth].js +5 -0
  255. package/src/modules/cms/api/updateWidget/finish[apiResponse].js +27 -0
  256. package/src/modules/cms/api/updateWidget/payloadSchema.json +18 -0
  257. package/src/modules/cms/api/updateWidget/route.json +5 -0
  258. package/src/modules/cms/api/updateWidget/updateWidget[finish].js +17 -0
  259. package/src/modules/cms/bootstrap.js +223 -3
  260. package/src/modules/cms/graphql/types/CmsPage/CmsPage.graphql +1 -2
  261. package/src/modules/cms/graphql/types/CmsPage/CmsPage.resolvers.js +35 -1
  262. package/src/modules/cms/graphql/types/Widget/Widget.graphql +91 -0
  263. package/src/modules/cms/graphql/types/Widget/Widget.resolvers.js +142 -0
  264. package/src/modules/cms/migration/Version-1.1.0.js +22 -0
  265. package/src/modules/cms/migration/Version-1.1.1.js +103 -0
  266. package/src/modules/cms/pages/admin/adminNotFound/NotFound.jsx +4 -4
  267. package/src/modules/cms/pages/admin/all/CmsMenuGroup.jsx +12 -4
  268. package/src/modules/cms/pages/admin/all/Notification.scss +1 -1
  269. package/src/modules/cms/pages/admin/all/search/NoResult.jsx +2 -2
  270. package/src/modules/cms/pages/admin/all/search/Results.jsx +3 -3
  271. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/FormContent.jsx +7 -9
  272. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/General.jsx +3 -3
  273. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Seo.jsx +1 -1
  274. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/Status.jsx +40 -0
  275. package/src/modules/cms/pages/admin/cmsPageGrid/Grid.jsx +3 -4
  276. package/src/modules/cms/pages/admin/dashboard/Layout.jsx +3 -3
  277. package/src/modules/cms/pages/admin/widgetEdit/WidgetForm.jsx +52 -0
  278. package/src/modules/cms/pages/admin/widgetEdit/index.js +36 -0
  279. package/src/modules/cms/pages/admin/widgetEdit/route.json +4 -0
  280. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.jsx +69 -0
  281. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/FormContent.scss +7 -0
  282. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/General.jsx +185 -0
  283. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/PageHeading.jsx +37 -0
  284. package/src/modules/cms/pages/admin/widgetEdit+widgetNew/Setting.jsx +55 -0
  285. package/src/modules/cms/pages/admin/widgetGrid/Grid.jsx +415 -0
  286. package/src/modules/cms/pages/admin/widgetGrid/Heading.jsx +11 -0
  287. package/src/modules/cms/pages/admin/widgetGrid/NewWidgetButton.jsx +52 -0
  288. package/src/modules/cms/pages/admin/widgetGrid/index.js +15 -0
  289. package/src/modules/cms/pages/admin/widgetGrid/route.json +4 -0
  290. package/src/modules/cms/pages/admin/widgetNew/WidgetNewForm.jsx +60 -0
  291. package/src/modules/cms/pages/admin/widgetNew/index.js +11 -0
  292. package/src/modules/cms/pages/admin/widgetNew/route.json +4 -0
  293. package/src/modules/cms/pages/admin/widgetNew/typeValidate.js +21 -0
  294. package/src/modules/cms/pages/frontStore/all/Breadcrumb.jsx +1 -1
  295. package/src/modules/cms/pages/frontStore/all/Footer.jsx +2 -2
  296. package/src/modules/cms/pages/frontStore/all/Layout.jsx +3 -3
  297. package/src/modules/cms/pages/frontStore/all/Layout.scss +13 -0
  298. package/src/modules/cms/pages/frontStore/all/Logo.jsx +2 -2
  299. package/src/modules/cms/pages/frontStore/all/Logo.scss +2 -4
  300. package/src/modules/cms/pages/frontStore/all/Notification.scss +1 -1
  301. package/src/modules/cms/pages/frontStore/cmsPageView/Layout.jsx +2 -2
  302. package/src/modules/cms/pages/frontStore/cmsPageView/View.jsx +5 -3
  303. package/src/modules/cms/pages/frontStore/cmsPageView/index.js +6 -12
  304. package/src/modules/cms/pages/frontStore/cmsPageView/route.json +2 -1
  305. package/src/modules/cms/pages/frontStore/homepage/route.json +2 -1
  306. package/src/modules/cms/pages/frontStore/notFound/NotFound.jsx +4 -4
  307. package/src/modules/cms/pages/frontStore/notFound/route.json +2 -1
  308. package/src/modules/cms/pages/frontStore/staticAsset/[context]staticAssets[auth].js +1 -1
  309. package/src/modules/cms/services/CMSPageCollection.js +10 -10
  310. package/src/modules/cms/services/WidgetCollection.js +62 -0
  311. package/src/modules/cms/services/getWidgetsBaseQuery.js +7 -0
  312. package/src/modules/cms/services/page/createPage.js +1 -2
  313. package/src/modules/cms/services/page/pageDataSchema.json +0 -4
  314. package/src/modules/cms/services/registerDefaultWidgetCollectionFilters.js +62 -0
  315. package/src/modules/cms/services/tailwind.admin.config.js +22 -107
  316. package/src/modules/cms/services/tailwind.frontStore.config.js +23 -108
  317. package/src/modules/cms/services/widget/createWidget.js +73 -0
  318. package/src/modules/cms/services/widget/deleteWidget.js +49 -0
  319. package/src/modules/cms/services/widget/loadWidgetInstances.js +54 -0
  320. package/src/modules/cms/services/widget/updateWidget.js +86 -0
  321. package/src/modules/cms/services/widget/widgetDataSchema.json +29 -0
  322. package/src/modules/cod/pages/admin/paymentSetting/CODSetting.jsx +2 -2
  323. package/src/modules/cod/pages/frontStore/checkout/CashOnDelivery.jsx +1 -1
  324. package/src/modules/customer/bootstrap.js +21 -4
  325. package/src/modules/customer/pages/admin/customerEdit/CustomerEditForm.jsx +3 -3
  326. package/src/modules/customer/pages/admin/customerEdit+customerNew/OrderHistory.jsx +1 -1
  327. package/src/modules/customer/pages/admin/customerGrid/Grid.jsx +3 -3
  328. package/src/modules/customer/pages/frontStore/account/AccountDetails.jsx +3 -3
  329. package/src/modules/customer/pages/frontStore/account/Layout.jsx +3 -3
  330. package/src/modules/customer/pages/frontStore/account/OrderHistory.jsx +1 -1
  331. package/src/modules/customer/pages/frontStore/account/route.json +2 -1
  332. package/src/modules/customer/pages/frontStore/login/LoginForm.jsx +2 -2
  333. package/src/modules/customer/pages/frontStore/login/route.json +2 -1
  334. package/src/modules/customer/pages/frontStore/register/RegisterForm.jsx +2 -2
  335. package/src/modules/customer/pages/frontStore/register/route.json +2 -1
  336. package/src/modules/customer/pages/frontStore/resetPasswordPage/ResetPasswordForm.jsx +2 -2
  337. package/src/modules/customer/pages/frontStore/resetPasswordPage/route.json +2 -1
  338. package/src/modules/customer/pages/frontStore/updatePasswordPage/UpdatePasswordForm.jsx +3 -3
  339. package/src/modules/customer/pages/frontStore/updatePasswordPage/route.json +2 -1
  340. package/src/modules/customer/services/CustomerCollection.js +10 -10
  341. package/src/modules/customer/services/CustomerGroupCollection.js +10 -10
  342. package/src/modules/graphql/pages/global/[bodyParser]buildQuery[graphql].js +241 -6
  343. package/src/modules/graphql/pages/global/[buildQuery]graphql[notification].js +12 -8
  344. package/src/modules/oms/bootstrap.js +87 -3
  345. package/src/modules/oms/graphql/types/Order/Order.graphql +11 -2
  346. package/src/modules/oms/graphql/types/Order/Order.resolvers.js +7 -1
  347. package/src/modules/oms/pages/admin/dashboard/Bestsellers.jsx +2 -2
  348. package/src/modules/oms/pages/admin/dashboard/Lifetimesales.jsx +5 -5
  349. package/src/modules/oms/pages/admin/orderEdit/AddTrackingButton.jsx +1 -1
  350. package/src/modules/oms/pages/admin/orderEdit/Items.jsx +7 -7
  351. package/src/modules/oms/pages/admin/orderEdit/Layout.jsx +3 -3
  352. package/src/modules/oms/pages/admin/orderEdit/Payment.jsx +6 -6
  353. package/src/modules/oms/pages/admin/orderEdit/ShipButton.jsx +1 -1
  354. package/src/modules/oms/pages/admin/orderGrid/Grid.jsx +3 -3
  355. package/src/modules/oms/services/OrderCollection.js +10 -10
  356. package/src/modules/paypal/api/paypalCreateOrder/[bodyParser]createOrder.js +55 -24
  357. package/src/modules/paypal/pages/admin/paymentSetting/PaypalSetting.jsx +6 -6
  358. package/src/modules/paypal/pages/frontStore/checkout/Paypal.jsx +3 -4
  359. package/src/modules/promotion/bootstrap.js +19 -101
  360. package/src/modules/promotion/pages/admin/couponEdit+couponNew/DiscountType.jsx +1 -1
  361. package/src/modules/promotion/pages/admin/couponEdit+couponNew/FormContent.jsx +5 -5
  362. package/src/modules/promotion/pages/admin/couponGrid/Grid.jsx +3 -3
  363. package/src/modules/promotion/pages/frontStore/cart/Coupon.jsx +2 -2
  364. package/src/modules/promotion/services/CouponCollection.js +10 -10
  365. package/src/modules/promotion/services/couponValidator.js +4 -7
  366. package/src/modules/promotion/services/discountCalculator.js +2 -7
  367. package/src/modules/promotion/services/registerCartItemPromotionFields.js +80 -0
  368. package/src/modules/promotion/services/registerCartPromotionFields.js +128 -0
  369. package/src/modules/promotion/services/registerDefaultCalculators.js +48 -20
  370. package/src/modules/promotion/services/registerDefaultValidators.js +16 -4
  371. package/src/modules/setting/pages/admin/paymentSetting/PaymentSetting.jsx +2 -2
  372. package/src/modules/setting/pages/admin/storeSetting/StoreSetting.jsx +98 -35
  373. package/src/modules/stripe/pages/admin/paymentSetting/StripePayment.jsx +5 -5
  374. package/src/modules/stripe/pages/frontStore/checkout/Stripe.jsx +1 -1
  375. package/src/modules/tax/bootstrap.js +40 -5
  376. package/src/modules/tax/graphql/types/Product/Price/ProductPrice.resolvers.js +6 -39
  377. package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.graphql +1 -2
  378. package/src/modules/tax/graphql/types/TaxSetting/TaxSetting.resolvers.js +1 -8
  379. package/src/modules/tax/pages/admin/taxSetting/TaxSetting.jsx +4 -4
  380. package/src/modules/tax/services/TaxClassCollection.js +10 -10
  381. package/src/modules/tax/services/calculateTaxAmount.js +12 -9
  382. package/src/modules/tax/services/registerCartItemTaxPercentField.js +76 -0
  383. package/src/modules/auth/services/adminSessionMiddleware.js +0 -0
  384. package/src/modules/catalog/pages/frontStore/homepage/FeaturedCategories.jsx +0 -58
  385. package/src/modules/cms/pages/admin/cmsPageEdit+cmsPageNew/StatusAndLayout.jsx +0 -61
  386. package/src/modules/cms/pages/frontStore/all/Menu.jsx +0 -46
  387. package/src/modules/cms/pages/frontStore/all/Menu.scss +0 -7
  388. package/src/modules/cms/pages/frontStore/all/MobileMenu.jsx +0 -73
  389. package/src/modules/cms/pages/frontStore/all/MobileMenu.scss +0 -35
  390. package/src/modules/cms/pages/frontStore/homepage/MainBanner.jsx +0 -31
  391. package/src/modules/cms/pages/frontStore/homepage/MainBanner.scss +0 -48
@@ -2,12 +2,13 @@
2
2
  The `Category` type represents a category object.
3
3
  """
4
4
  type Category {
5
- categoryId: ID!
5
+ categoryId: Int!
6
6
  uuid: String!
7
7
  name: String!
8
8
  status: Int!
9
9
  includeInNav: Int!
10
- description: String
10
+ showProducts: Int!
11
+ description: JSON
11
12
  urlKey: String
12
13
  metaTitle: String
13
14
  metaDescription: String
@@ -49,7 +50,7 @@ enum FilterOperation {
49
50
  input FilterInput {
50
51
  key: String!
51
52
  operation: FilterOperation!
52
- value: String
53
+ value: ID
53
54
  }
54
55
 
55
56
  """
@@ -1,3 +1,4 @@
1
+ const { v4: uuidv4 } = require('uuid');
1
2
  const { select, execute } = require('@evershop/postgres-query-builder');
2
3
  const { buildUrl } = require('@evershop/evershop/src/lib/router/buildUrl');
3
4
  const { camelCase } = require('@evershop/evershop/src/lib/util/camelCase');
@@ -145,6 +146,39 @@ module.exports = {
145
146
  );
146
147
  query.where('category.category_id', '=', category.parentId);
147
148
  return camelCase(await query.load(pool));
149
+ },
150
+ description: ({ description }) => {
151
+ try {
152
+ return JSON.parse(description);
153
+ } catch (e) {
154
+ // This is for backward compatibility. If the description is not a JSON string then it is a raw HTML block
155
+ const rowId = `r__${uuidv4()}`;
156
+ return [
157
+ {
158
+ size: 1,
159
+ id: rowId,
160
+ columns: [
161
+ {
162
+ id: 'c__c5d90067-c786-4324-8e24-8e30520ac3d7',
163
+ size: 1,
164
+ data: {
165
+ time: 1723347125344,
166
+ blocks: [
167
+ {
168
+ id: 'AU89ItzUa7',
169
+ type: 'raw',
170
+ data: {
171
+ html: description
172
+ }
173
+ }
174
+ ],
175
+ version: '2.30.2'
176
+ }
177
+ }
178
+ ]
179
+ }
180
+ ];
181
+ }
148
182
  }
149
183
  },
150
184
  Product: {
@@ -2,10 +2,10 @@
2
2
  The `Collection` type represents a product collection.
3
3
  """
4
4
  type Collection {
5
- collectionId: ID!
5
+ collectionId: Int!
6
6
  uuid: String!
7
7
  name: String!
8
- description: String
8
+ description: JSON
9
9
  code: String!
10
10
  products(filters: [FilterInput]): ProductCollection
11
11
  }
@@ -1,3 +1,4 @@
1
+ const { v4: uuidv4 } = require('uuid');
1
2
  const { select } = require('@evershop/postgres-query-builder');
2
3
  const { camelCase } = require('@evershop/evershop/src/lib/util/camelCase');
3
4
  const { ProductCollection } = require('../../../services/ProductCollection');
@@ -32,6 +33,39 @@ module.exports = {
32
33
  const root = new ProductCollection(query);
33
34
  await root.init(filters, !!user);
34
35
  return root;
36
+ },
37
+ description: ({ description }) => {
38
+ try {
39
+ return JSON.parse(description);
40
+ } catch (e) {
41
+ // This is for backward compatibility. If the description is not a JSON string then it is a raw HTML block
42
+ const rowId = `r__${uuidv4()}`;
43
+ return [
44
+ {
45
+ size: 1,
46
+ id: rowId,
47
+ columns: [
48
+ {
49
+ id: 'c__c5d90067-c786-4324-8e24-8e30520ac3d7',
50
+ size: 1,
51
+ data: {
52
+ time: 1723347125344,
53
+ blocks: [
54
+ {
55
+ id: 'AU89ItzUa7',
56
+ type: 'raw',
57
+ data: {
58
+ html: description
59
+ }
60
+ }
61
+ ],
62
+ version: '2.30.2'
63
+ }
64
+ }
65
+ ]
66
+ }
67
+ ];
68
+ }
35
69
  }
36
70
  },
37
71
  Product: {
@@ -20,6 +20,7 @@ module.exports = {
20
20
  if (!user) {
21
21
  query.andWhere('attribute.display_on_frontend', '=', true);
22
22
  }
23
+ query.orderBy('attribute.sort_order', 'ASC');
23
24
  const attributes = await query.execute(pool);
24
25
  return attributes.map((a) => camelCase(a));
25
26
  },
@@ -9,7 +9,7 @@ type Product {
9
9
  sku: String!
10
10
  weight: Weight!
11
11
  taxClass: Int
12
- description: String
12
+ description: JSON
13
13
  urlKey: String
14
14
  metaTitle: String
15
15
  metaDescription: String
@@ -1,3 +1,4 @@
1
+ const { v4: uuidv4 } = require('uuid');
1
2
  const { select } = require('@evershop/postgres-query-builder');
2
3
  const { buildUrl } = require('@evershop/evershop/src/lib/router/buildUrl');
3
4
  const { camelCase } = require('@evershop/evershop/src/lib/util/camelCase');
@@ -20,6 +21,39 @@ module.exports = {
20
21
  } else {
21
22
  return urlRewrite.request_path;
22
23
  }
24
+ },
25
+ description: ({ description }) => {
26
+ try {
27
+ return JSON.parse(description);
28
+ } catch (e) {
29
+ // This is for backward compatibility. If the description is not a JSON string then it is a raw HTML block
30
+ const rowId = `r__${uuidv4()}`;
31
+ return [
32
+ {
33
+ size: 1,
34
+ id: rowId,
35
+ columns: [
36
+ {
37
+ id: 'c__c5d90067-c786-4324-8e24-8e30520ac3d7',
38
+ size: 1,
39
+ data: {
40
+ time: 1723347125344,
41
+ blocks: [
42
+ {
43
+ id: 'AU89ItzUa7',
44
+ type: 'raw',
45
+ data: {
46
+ html: description
47
+ }
48
+ }
49
+ ],
50
+ version: '2.30.2'
51
+ }
52
+ }
53
+ ]
54
+ }
55
+ ];
56
+ }
23
57
  }
24
58
  },
25
59
  Query: {
@@ -0,0 +1,11 @@
1
+ """
2
+ Return a collection products Widget
3
+ """
4
+ type CollectionProductsWidget {
5
+ collection: String
6
+ count: Int
7
+ }
8
+
9
+ extend type Query {
10
+ collectionProductsWidget(collection: String, count: Int): CollectionProductsWidget
11
+ }
@@ -0,0 +1,8 @@
1
+ module.exports = {
2
+ Query: {
3
+ collectionProductsWidget: async (root, { collection, count }) => ({
4
+ collection,
5
+ count: count ? parseInt(count, 10) : 5
6
+ })
7
+ }
8
+ };
@@ -353,6 +353,7 @@ module.exports = exports = async (connection) => {
353
353
  "parent_id" INT DEFAULT NULL,
354
354
  "include_in_nav" boolean NOT NULL,
355
355
  "position" smallint DEFAULT NULL,
356
+ "show_products" boolean DEFAULT TRUE,
356
357
  "created_at" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
357
358
  "updated_at" TIMESTAMP WITH TIME ZONE DEFAULT CURRENT_TIMESTAMP,
358
359
  CONSTRAINT "CATEGORY_UUID_UNIQUE" UNIQUE ("uuid")
@@ -0,0 +1,10 @@
1
+ const { execute } = require('@evershop/postgres-query-builder');
2
+
3
+ // eslint-disable-next-line no-multi-assign
4
+ module.exports = exports = async (connection) => {
5
+ // rename the image column in the product_image table to origin_image
6
+ await execute(
7
+ connection,
8
+ `ALTER TABLE category ADD COLUMN IF NOT EXISTS show_products boolean DEFAULT TRUE`
9
+ );
10
+ };
@@ -9,15 +9,15 @@ export default function FormContent({ gridUrl }) {
9
9
  const { state } = useFormContext();
10
10
  return (
11
11
  <>
12
- <div className="grid grid-cols-3 gap-x-2 grid-flow-row ">
13
- <div className="col-span-2 grid grid-cols-1 gap-2 auto-rows-max">
12
+ <div className="grid grid-cols-3 gap-x-8 grid-flow-row ">
13
+ <div className="col-span-2 grid grid-cols-1 gap-8 auto-rows-max">
14
14
  <Area id="leftSide" noOuter />
15
15
  </div>
16
- <div className="col-span-1 grid grid-cols-1 gap-2 auto-rows-max">
16
+ <div className="col-span-1 grid grid-cols-1 gap-8 auto-rows-max">
17
17
  <Area id="rightSide" noOuter />
18
18
  </div>
19
19
  </div>
20
- <div className="form-submit-button flex border-t border-divider mt-15 pt-15 justify-between">
20
+ <div className="form-submit-button flex border-t border-divider mt-6 pt-6 justify-between">
21
21
  <Button
22
22
  title="Cancel"
23
23
  variant="critical"
@@ -63,8 +63,8 @@ function Groups({ groups, createGroupApi }) {
63
63
 
64
64
  return (
65
65
  <div>
66
- <div className="mb-1">Select groups the attribute belongs to</div>
67
- <div className="grid gap-2 grid-cols-2">
66
+ <div className="mb-4">Select groups the attribute belongs to</div>
67
+ <div className="grid gap-8 grid-cols-2">
68
68
  <div>
69
69
  <Select
70
70
  name="groups[]"
@@ -74,7 +74,7 @@ function Groups({ groups, createGroupApi }) {
74
74
  defaultValue={groups}
75
75
  />
76
76
  </div>
77
- <div className="grid gap-2 grid-cols-1">
77
+ <div className="grid gap-8 grid-cols-1">
78
78
  <div>
79
79
  <Input
80
80
  type="text"
@@ -151,7 +151,7 @@ function Options({ originOptions = [] }) {
151
151
  {options.map((option, index) => {
152
152
  const { uuid, optionId, optionText } = option;
153
153
  return (
154
- <div key={uuid} className="flex mb-05 space-x-2">
154
+ <div key={uuid} className="flex mb-2 space-x-8">
155
155
  <div>
156
156
  <Field
157
157
  key={uuid}
@@ -179,7 +179,7 @@ function Options({ originOptions = [] }) {
179
179
  </div>
180
180
  );
181
181
  })}
182
- <div className="mt-1">
182
+ <div className="mt-4">
183
183
  <a
184
184
  href="#"
185
185
  onClick={(e) => addOption(e)}
@@ -80,7 +80,7 @@ function Actions({ attributes = [], selectedIds = [] }) {
80
80
  {selectedIds.length > 0 && (
81
81
  <td style={{ borderTop: 0 }} colSpan="100">
82
82
  <div className="inline-flex border border-divider rounded justify-items-start">
83
- <a href="#" className="font-semibold pt-075 pb-075 pl-15 pr-15">
83
+ <a href="#" className="font-semibold pt-3 pb-3 pl-6 pr-6">
84
84
  {selectedIds.length} selected
85
85
  </a>
86
86
  {actions.map((action) => (
@@ -90,7 +90,7 @@ function Actions({ attributes = [], selectedIds = [] }) {
90
90
  e.preventDefault();
91
91
  action.onAction();
92
92
  }}
93
- className="font-semibold pt-075 pb-075 pl-15 pr-15 block border-l border-divider self-center"
93
+ className="font-semibold pt-3 pb-3 pl-6 pr-6 block border-l border-divider self-center"
94
94
  >
95
95
  <span>{action.name}</span>
96
96
  </a>
@@ -142,7 +142,7 @@ export default function Products({ category: { categoryId, addProductApi } }) {
142
142
  )}
143
143
  <Card.Session>
144
144
  <div>
145
- <div className="border rounded border-divider mb-2">
145
+ <div className="border rounded border-divider mb-8">
146
146
  <input
147
147
  type="text"
148
148
  value={keyword}
@@ -161,7 +161,7 @@ export default function Products({ category: { categoryId, addProductApi } }) {
161
161
  </div>
162
162
  <div>
163
163
  {data.category.products.total > 10 && (
164
- <div className="flex justify-between gap-1">
164
+ <div className="flex justify-between gap-4">
165
165
  {page > 1 && (
166
166
  <a
167
167
  className="text-interactive"
@@ -195,9 +195,9 @@ export default function Products({ category: { categoryId, addProductApi } }) {
195
195
  // eslint-disable-next-line react/no-array-index-key
196
196
  <div
197
197
  key={p.uuid}
198
- className="grid grid-cols-8 gap-2 py-1 border-divider items-center"
198
+ className="grid grid-cols-8 gap-8 py-4 border-divider items-center"
199
199
  >
200
- <div className="grid-thumbnail text-border border border-divider p-075 rounded flex justify-center col-span-1">
200
+ <div className="grid-thumbnail text-border border border-divider p-3 rounded flex justify-center col-span-1">
201
201
  {p.image?.url && (
202
202
  <img
203
203
  className="self-center"
@@ -9,15 +9,15 @@ export default function FormContent({ gridUrl }) {
9
9
  const { state } = useFormContext();
10
10
  return (
11
11
  <>
12
- <div className="grid grid-cols-3 gap-x-2 grid-flow-row ">
13
- <div className="col-span-2 grid grid-cols-1 gap-2 auto-rows-max">
12
+ <div className="grid grid-cols-3 gap-x-8 grid-flow-row ">
13
+ <div className="col-span-2 grid grid-cols-1 gap-8 auto-rows-max">
14
14
  <Area id="leftSide" noOuter />
15
15
  </div>
16
- <div className="col-span-1 grid grid-cols-1 gap-2 auto-rows-max">
16
+ <div className="col-span-1 grid grid-cols-1 gap-8 auto-rows-max">
17
17
  <Area id="rightSide" noOuter />
18
18
  </div>
19
19
  </div>
20
- <div className="form-submit-button flex border-t border-divider mt-15 pt-15 justify-between">
20
+ <div className="form-submit-button flex border-t border-divider mt-6 pt-6 justify-between">
21
21
  <Button
22
22
  title="Cancel"
23
23
  variant="critical"
@@ -4,25 +4,25 @@ import Area from '@components/common/Area';
4
4
  import { get } from '@evershop/evershop/src/lib/util/get';
5
5
  import { Field } from '@components/common/form/Field';
6
6
  import { Card } from '@components/admin/cms/Card';
7
- import CkeditorField from '@components/common/form/fields/Ckeditor';
8
7
  import CategoryTree from '@components/admin/catalog/productEdit/category/CategoryTree';
8
+ import Editor from '@components/common/form/fields/Editor';
9
9
 
10
10
  function ParentCategory({ currentId, parent }) {
11
11
  const [selecting, setSelecting] = React.useState(false);
12
12
  const [category, setCategory] = React.useState(parent || null);
13
13
 
14
14
  return (
15
- <div className="mt-15 relative">
16
- <div className="mb-1">Parent category</div>
15
+ <div className="mt-6 relative">
16
+ <div className="mb-4">Parent category</div>
17
17
  {category && (
18
- <div className="border rounded border-[#c9cccf] mb-1 p-1">
18
+ <div className="border rounded border-[#c9cccf] mb-4 p-4">
19
19
  {category.path.map((item, index) => (
20
20
  <span key={item.name} className="text-gray-500">
21
21
  {item.name}
22
22
  {index < category.path.length - 1 && ' > '}
23
23
  </span>
24
24
  ))}
25
- <span className="text-interactive pl-2">
25
+ <span className="text-interactive pl-8">
26
26
  <a
27
27
  href="#"
28
28
  onClick={(e) => {
@@ -48,18 +48,16 @@ function ParentCategory({ currentId, parent }) {
48
48
  </a>
49
49
  )}
50
50
  {selecting && (
51
- <div className="absolute top-5 left-0 right-0 bg-[#eff2f5] z-50 border rounded border-[#c9cccf] p-[10px]">
52
- <CategoryTree
53
- selectedCategory={category}
54
- setSelectedCategory={(c) => {
55
- if (c.categoryId === currentId) {
56
- return;
57
- }
58
- setCategory(c);
59
- setSelecting(false);
60
- }}
61
- />
62
- </div>
51
+ <CategoryTree
52
+ selectedCategory={category}
53
+ setSelectedCategory={(c) => {
54
+ if (c.categoryId === currentId) {
55
+ return;
56
+ }
57
+ setCategory(c);
58
+ setSelecting(false);
59
+ }}
60
+ />
63
61
  )}
64
62
  <input
65
63
  type="hidden"
@@ -127,7 +125,7 @@ export default function General({
127
125
  sortOrder: 20
128
126
  },
129
127
  {
130
- component: { default: CkeditorField },
128
+ component: { default: Editor },
131
129
  props: {
132
130
  id: 'description',
133
131
  name: 'description',
@@ -83,7 +83,6 @@ export default function Image({ category, imageUploadUrl }) {
83
83
  <div className="uploader-icon flex justify-center">
84
84
  <svg
85
85
  xmlns="http://www.w3.org/2000/svg"
86
- className="h-5 w-5"
87
86
  viewBox="0 0 20 20"
88
87
  fill="currentColor"
89
88
  >
@@ -101,7 +100,7 @@ export default function Image({ category, imageUploadUrl }) {
101
100
  onAction={() => ref.current.click()}
102
101
  />
103
102
  </div>
104
- <div className="flex justify-center mt-1">
103
+ <div className="flex justify-center mt-4">
105
104
  <span style={{ color: '#6d7175', fontSize: '1.2rem' }}>
106
105
  click to upload an image
107
106
  </span>
@@ -30,6 +30,19 @@ export default function Status({ category }) {
30
30
  }
31
31
  />
32
32
  </Card.Session>
33
+ <Card.Session title="Show Products?">
34
+ <Field
35
+ type="radio"
36
+ name="show_products"
37
+ options={[
38
+ { value: 0, text: 'No' },
39
+ { value: 1, text: 'Yes' }
40
+ ]}
41
+ value={
42
+ category?.showProducts === undefined ? 1 : category.showProducts
43
+ }
44
+ />
45
+ </Card.Session>
33
46
  </Card>
34
47
  );
35
48
  }
@@ -37,7 +50,8 @@ export default function Status({ category }) {
37
50
  Status.propTypes = {
38
51
  category: PropTypes.shape({
39
52
  status: PropTypes.number,
40
- includeInNav: PropTypes.number
53
+ includeInNav: PropTypes.number,
54
+ showProducts: PropTypes.number
41
55
  })
42
56
  };
43
57
 
@@ -55,6 +69,7 @@ export const query = `
55
69
  category(id: getContextValue("categoryId", null)) {
56
70
  status
57
71
  includeInNav
72
+ showProducts
58
73
  }
59
74
  }
60
75
  `;
@@ -62,7 +62,7 @@ function Actions({ categories = [], selectedIds = [] }) {
62
62
  {selectedIds.length > 0 && (
63
63
  <td style={{ borderTop: 0 }} colSpan="100">
64
64
  <div className="inline-flex border border-divider rounded justify-items-start">
65
- <a href="#" className="font-semibold pt-075 pb-075 pl-15 pr-15">
65
+ <a href="#" className="font-semibold pt-3 pb-3 pl-6 pr-6">
66
66
  {selectedIds.length} selected
67
67
  </a>
68
68
  {actions.map((action, index) => (
@@ -73,7 +73,7 @@ function Actions({ categories = [], selectedIds = [] }) {
73
73
  e.preventDefault();
74
74
  action.onAction();
75
75
  }}
76
- className="font-semibold pt-075 pb-075 pl-15 pr-15 block border-l border-divider self-center"
76
+ className="font-semibold pt-3 pb-3 pl-6 pr-6 block border-l border-divider self-center"
77
77
  >
78
78
  <span>{action.name}</span>
79
79
  </a>
@@ -145,7 +145,7 @@ export default function CategoryGrid({
145
145
  }
146
146
  }
147
147
  ]}
148
- />
148
+ />
149
149
  <table className="listing sticky">
150
150
  <thead>
151
151
  <tr>
@@ -142,7 +142,7 @@ export default function Products({ collection: { code, addProductApi } }) {
142
142
  )}
143
143
  <Card.Session>
144
144
  <div>
145
- <div className="border rounded border-divider mb-2">
145
+ <div className="border rounded border-divider mb-8">
146
146
  <input
147
147
  type="text"
148
148
  value={keyword}
@@ -161,7 +161,7 @@ export default function Products({ collection: { code, addProductApi } }) {
161
161
  </div>
162
162
  <div>
163
163
  {data.collection.products.total > 10 && (
164
- <div className="flex justify-between gap-1">
164
+ <div className="flex justify-between gap-4">
165
165
  {page > 1 && (
166
166
  <a
167
167
  className="text-interactive"
@@ -195,9 +195,9 @@ export default function Products({ collection: { code, addProductApi } }) {
195
195
  // eslint-disable-next-line react/no-array-index-key
196
196
  <div
197
197
  key={p.uuid}
198
- className="grid grid-cols-8 gap-2 py-1 border-divider items-center"
198
+ className="grid grid-cols-8 gap-8 py-4 border-divider items-center"
199
199
  >
200
- <div className="grid-thumbnail text-border border border-divider p-075 rounded flex justify-center col-span-1">
200
+ <div className="grid-thumbnail text-border border border-divider p-3 rounded flex justify-center col-span-1">
201
201
  {p.image?.url && (
202
202
  <img
203
203
  className="self-center"
@@ -9,10 +9,10 @@ export default function FormContent({ gridUrl }) {
9
9
  const { state } = useFormContext();
10
10
  return (
11
11
  <div className="w-2/3" style={{ margin: '0 auto' }}>
12
- <div className="grid gap-2">
12
+ <div className="grid gap-8">
13
13
  <Area id="collectionFormInner" noOuter />
14
14
  </div>
15
- <div className="form-submit-button flex border-t border-divider mt-15 pt-15 justify-between">
15
+ <div className="form-submit-button flex border-t border-divider mt-6 pt-6 justify-between">
16
16
  <Button
17
17
  title="Cancel"
18
18
  variant="critical"
@@ -4,7 +4,7 @@ import Area from '@components/common/Area';
4
4
  import { get } from '@evershop/evershop/src/lib/util/get';
5
5
  import { Field } from '@components/common/form/Field';
6
6
  import { Card } from '@components/admin/cms/Card';
7
- import CkeditorField from '@components/common/form/fields/Ckeditor';
7
+ import Editor from '@components/common/form/fields/Editor';
8
8
 
9
9
  export default function General({
10
10
  collection,
@@ -50,7 +50,7 @@ export default function General({
50
50
  sortOrder: 10
51
51
  },
52
52
  {
53
- component: { default: CkeditorField },
53
+ component: { default: Editor },
54
54
  props: {
55
55
  id: 'description',
56
56
  name: 'description',
@@ -62,7 +62,7 @@ function Actions({ collections = [], selectedIds = [] }) {
62
62
  {selectedIds.length > 0 && (
63
63
  <td style={{ borderTop: 0 }} colSpan="100">
64
64
  <div className="inline-flex border border-divider rounded justify-items-start">
65
- <a href="#" className="font-semibold pt-075 pb-075 pl-15 pr-15">
65
+ <a href="#" className="font-semibold pt-3 pb-3 pl-6 pr-6">
66
66
  {selectedIds.length} selected
67
67
  </a>
68
68
  {actions.map((action, index) => (
@@ -73,7 +73,7 @@ function Actions({ collections = [], selectedIds = [] }) {
73
73
  e.preventDefault();
74
74
  action.onAction();
75
75
  }}
76
- className="font-semibold pt-075 pb-075 pl-15 pr-15 block border-l border-divider self-center"
76
+ className="font-semibold pt-3 pb-3 pl-6 pr-6 block border-l border-divider self-center"
77
77
  >
78
78
  <span>{action.name}</span>
79
79
  </a>
@@ -146,7 +146,7 @@ export default function CollectionGrid({
146
146
  }
147
147
  }
148
148
  ]}
149
- />
149
+ />
150
150
  <table className="listing sticky">
151
151
  <thead>
152
152
  <tr>
@@ -8,13 +8,13 @@ export default function Collections({ product: { collections } }) {
8
8
  <Card title="Collections" subdued>
9
9
  <Card.Session>
10
10
  {collections.map((collection) => (
11
- <div className="flex justify-start gap-1 items-center align-middle">
12
- <CollectionIcon width={16} height={16} fill="#2c6ecb" />
13
- <a href={collection.editUrl} className="hover:underline">
14
- <span>{collection.name}</span>
15
- </a>
16
- </div>
17
- ))}
11
+ <div className="flex justify-start gap-4 items-center align-middle">
12
+ <CollectionIcon width={16} height={16} fill="#2c6ecb" />
13
+ <a href={collection.editUrl} className="hover:underline">
14
+ <span>{collection.name}</span>
15
+ </a>
16
+ </div>
17
+ ))}
18
18
  {collections.length === 0 && (
19
19
  <div className="text-gray-500">No collections</div>
20
20
  )}