ordering-ui-admin-external 1.33.1 → 1.35.0

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 (293) hide show
  1. package/_bundles/{ordering-ui-admin.462f5c3aad7a320965e9.js → ordering-ui-admin.78f6259366a43cc634db.js} +2 -2
  2. package/_modules/components/BusinessIntelligence/AnalyticsCalendar/index.js +1 -0
  3. package/_modules/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +40 -133
  4. package/_modules/components/BusinessIntelligence/BusinessReviewList/index.js +14 -6
  5. package/_modules/components/BusinessIntelligence/InvoiceBusinessManager/index.js +4 -3
  6. package/_modules/components/BusinessIntelligence/InvoiceDriverManager/index.js +4 -3
  7. package/_modules/components/BusinessIntelligence/InvoiceManager/index.js +5 -3
  8. package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +173 -0
  9. package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +93 -0
  10. package/_modules/components/BusinessIntelligence/Reports/index.js +12 -4
  11. package/_modules/components/BusinessIntelligence/ReviewProductsListing/index.js +21 -10
  12. package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +52 -12
  13. package/_modules/components/BusinessIntelligence/UsersReviewList/index.js +14 -6
  14. package/_modules/components/CartRecovery/OpenCartList/index.js +12 -3
  15. package/_modules/components/CartRecovery/OpenCartListing/index.js +16 -4
  16. package/_modules/components/CartRecovery/OpenCartsDetail/index.js +52 -2
  17. package/_modules/components/CartRecovery/OpenCartsDetail/styles.js +20 -3
  18. package/_modules/components/CartRecovery/RecoveryActionDetail/index.js +4 -3
  19. package/_modules/components/CartRecovery/RecoveryActionList/index.js +10 -1
  20. package/_modules/components/CartRecovery/RecoveryActionListing/index.js +15 -5
  21. package/_modules/components/Delivery/DeliveryUsersListing/index.js +19 -6
  22. package/_modules/components/Delivery/DriversCompaniesList/index.js +16 -3
  23. package/_modules/components/Delivery/DriversCompaniesListing/index.js +9 -5
  24. package/_modules/components/Delivery/DriversCompanyDetailsForm/index.js +4 -3
  25. package/_modules/components/Delivery/DriversGroupDetails/index.js +4 -3
  26. package/_modules/components/Delivery/DriversGroupLogistics/index.js +4 -4
  27. package/_modules/components/Delivery/DriversGroupsList/index.js +16 -3
  28. package/_modules/components/Delivery/DriversGroupsListing/index.js +9 -5
  29. package/_modules/components/Delivery/UserDetails/index.js +4 -8
  30. package/_modules/components/Delivery/UserFormDetails/index.js +9 -1
  31. package/_modules/components/Delivery/UsersList/index.js +10 -1
  32. package/_modules/components/Marketing/AdBannersListing/index.js +6 -3
  33. package/_modules/components/Marketing/CampaignDetail/index.js +4 -3
  34. package/_modules/components/Marketing/CampaignList/index.js +10 -1
  35. package/_modules/components/Marketing/CampaignListing/index.js +14 -4
  36. package/_modules/components/Marketing/EnterprisePromotionList/index.js +10 -1
  37. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +14 -4
  38. package/_modules/components/Marketing/PageBanner/index.js +5 -5
  39. package/_modules/components/Messages/MessagesListing/index.js +15 -5
  40. package/_modules/components/MyProducts/AdvancedSettings/index.js +12 -0
  41. package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +4 -2
  42. package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +23 -5
  43. package/_modules/components/Orders/AllInOne/DriversManager/styles.js +1 -1
  44. package/_modules/components/Orders/AllInOne/index.js +7 -3
  45. package/_modules/components/Orders/AllInOne/styles.js +2 -2
  46. package/_modules/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +2 -16
  47. package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/index.js +26 -3
  48. package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +7 -2
  49. package/_modules/components/Orders/DeliveriesManager/index.js +4 -2
  50. package/_modules/components/Orders/DeliveryDashboard/index.js +4 -1
  51. package/_modules/components/Orders/DriverSelector/index.js +17 -5
  52. package/_modules/components/Orders/DriversDashboard/index.js +4 -2
  53. package/_modules/components/Orders/DriversLocation/index.js +70 -9
  54. package/_modules/components/Orders/DriversManager/index.js +5 -7
  55. package/_modules/components/Orders/DriversManager/styles.js +1 -1
  56. package/_modules/components/Orders/GiftCardsListing/index.js +46 -5
  57. package/_modules/components/Orders/Messages/index.js +4 -4
  58. package/_modules/components/Orders/OrderContactInformation/index.js +28 -20
  59. package/_modules/components/Orders/OrderDashboardSLASetting/index.js +1 -1
  60. package/_modules/components/Orders/OrderDetails/index.js +24 -13
  61. package/_modules/components/Orders/OrderStatusFilterBar/index.js +28 -5
  62. package/_modules/components/Orders/OrdersCards/index.js +10 -1
  63. package/_modules/components/Orders/OrdersDashboardControls/index.js +6 -2
  64. package/_modules/components/Orders/OrdersDashboardList/index.js +34 -4
  65. package/_modules/components/Orders/OrdersFilterGroup/styles.js +1 -1
  66. package/_modules/components/Orders/OrdersListing/index.js +6 -3
  67. package/_modules/components/Orders/OrdersManager/index.js +7 -2
  68. package/_modules/components/Orders/OrdersManager/styles.js +3 -3
  69. package/_modules/components/Orders/OrdersTable/index.js +9 -1
  70. package/_modules/components/Orders/OrdersTable/styles.js +1 -1
  71. package/_modules/components/Settings/Cms/index.js +14 -3
  72. package/_modules/components/Settings/LanguageManager/index.js +3 -1
  73. package/_modules/components/Settings/LanguageTransTable/index.js +14 -3
  74. package/_modules/components/Settings/SettingsList/index.js +1 -2
  75. package/_modules/components/Settings/WebhookDelaySelector/index.js +3 -0
  76. package/_modules/components/Settings/WebhookList/styles.js +1 -1
  77. package/_modules/components/Settings/WebhookListSelector/index.js +3 -0
  78. package/_modules/components/Shared/Pagination/index.js +1 -1
  79. package/_modules/components/Stores/BusinessActiveStateFilter/index.js +28 -5
  80. package/_modules/components/Stores/BusinessAdd/BusinessDetails/index.js +3 -2
  81. package/_modules/components/Stores/BusinessAdd/OrderTypePriceLevel/index.js +10 -5
  82. package/_modules/components/Stores/BusinessAdd/PaymentMethods/index.js +2 -1
  83. package/_modules/components/Stores/BusinessBrandListing/index.js +8 -5
  84. package/_modules/components/Stores/BusinessDeliveryPickupMore/index.js +4 -4
  85. package/_modules/components/Stores/BusinessDeliveryZoneDetails/index.js +4 -6
  86. package/_modules/components/Stores/BusinessDeliveryZoneList/index.js +5 -9
  87. package/_modules/components/Stores/BusinessDetail/index.js +4 -4
  88. package/_modules/components/Stores/BusinessDetails/index.js +5 -5
  89. package/_modules/components/Stores/BusinessDeviceListing/index.js +5 -4
  90. package/_modules/components/Stores/BusinessInformation/index.js +10 -6
  91. package/_modules/components/Stores/BusinessInformation/styles.js +1 -1
  92. package/_modules/components/Stores/BusinessMenu/index.js +8 -12
  93. package/_modules/components/Stores/BusinessMenuBasicOptions/index.js +8 -0
  94. package/_modules/components/Stores/BusinessMenuOptions/index.js +4 -6
  95. package/_modules/components/Stores/BusinessOrderingChannels/index.js +4 -4
  96. package/_modules/components/Stores/BusinessPaymentMethods/index.js +11 -7
  97. package/_modules/components/Stores/BusinessPlaceGroupList/index.js +5 -7
  98. package/_modules/components/Stores/BusinessPreorderDetails/index.js +13 -1
  99. package/_modules/components/Stores/BusinessProductList/index.js +1 -1
  100. package/_modules/components/Stores/BusinessProductsCategoyDetails/index.js +4 -3
  101. package/_modules/components/Stores/BusinessProductsListing/index.js +10 -6
  102. package/_modules/components/Stores/BusinessSharedMenuProducts/index.js +5 -11
  103. package/_modules/components/Stores/BusinessSync/index.js +4 -3
  104. package/_modules/components/Stores/BusinessTypes/index.js +5 -9
  105. package/_modules/components/Stores/BusinessWalletsList/index.js +5 -7
  106. package/_modules/components/Stores/BusinessWebhooks/index.js +12 -6
  107. package/_modules/components/Stores/BusinessesList/index.js +10 -1
  108. package/_modules/components/Stores/BusinessesListing/index.js +21 -6
  109. package/_modules/components/Stores/ImportersButton/index.js +5 -3
  110. package/_modules/components/Stores/PaymentOption/index.js +4 -5
  111. package/_modules/components/Stores/PaymentOptionMethods/index.js +4 -5
  112. package/_modules/components/Stores/PaymentOptionPaypal/index.js +4 -5
  113. package/_modules/components/Stores/PaymentOptionSquare/index.js +4 -5
  114. package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +4 -5
  115. package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +4 -5
  116. package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +4 -5
  117. package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +4 -5
  118. package/_modules/components/Stores/ProductDetails/index.js +5 -7
  119. package/_modules/components/Stores/ProductExtras/index.js +95 -23
  120. package/_modules/components/Stores/ProductExtras/styles.js +14 -8
  121. package/_modules/components/Stores/ProductIngredient/index.js +5 -9
  122. package/_modules/components/Stores/ProductMainDetails/index.js +4 -5
  123. package/_modules/components/Stores/ProductTagsList/index.js +5 -11
  124. package/_modules/components/Users/CustomerCashWallet/index.js +4 -5
  125. package/_modules/components/Users/CustomerDetails/index.js +21 -17
  126. package/_modules/components/Users/CustomerPointsWallet/index.js +4 -5
  127. package/_modules/components/Users/CustomersListing/index.js +17 -8
  128. package/_modules/components/Users/ProfessionalDetail/index.js +4 -9
  129. package/_modules/components/Users/ProfessionalList/index.js +10 -1
  130. package/_modules/components/Users/ProfessionalListing/index.js +17 -8
  131. package/_modules/components/Users/UserActiveStateFilter/index.js +7 -3
  132. package/_modules/components/Users/UserDetails/index.js +4 -9
  133. package/_modules/components/Users/UsersList/index.js +10 -1
  134. package/_modules/components/Users/UsersListing/index.js +17 -8
  135. package/_modules/index.js +12 -0
  136. package/_modules/utils/index.js +39 -2
  137. package/index-template.js +1 -1
  138. package/package.json +2 -2
  139. package/src/components/BusinessIntelligence/AnalyticsCalendar/index.js +4 -0
  140. package/src/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +33 -123
  141. package/src/components/BusinessIntelligence/BusinessReviewList/index.js +13 -7
  142. package/src/components/BusinessIntelligence/InvoiceBusinessManager/index.js +3 -4
  143. package/src/components/BusinessIntelligence/InvoiceDriverManager/index.js +3 -4
  144. package/src/components/BusinessIntelligence/InvoiceManager/index.js +4 -4
  145. package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +200 -0
  146. package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +239 -0
  147. package/src/components/BusinessIntelligence/Reports/index.js +10 -6
  148. package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +23 -11
  149. package/src/components/BusinessIntelligence/ReviewsListing/index.js +54 -10
  150. package/src/components/BusinessIntelligence/UsersReviewList/index.js +14 -7
  151. package/src/components/CartRecovery/OpenCartList/index.js +15 -5
  152. package/src/components/CartRecovery/OpenCartListing/index.js +14 -3
  153. package/src/components/CartRecovery/OpenCartsDetail/index.js +44 -4
  154. package/src/components/CartRecovery/OpenCartsDetail/styles.js +54 -0
  155. package/src/components/CartRecovery/RecoveryActionDetail/index.js +3 -4
  156. package/src/components/CartRecovery/RecoveryActionList/index.js +12 -2
  157. package/src/components/CartRecovery/RecoveryActionListing/index.js +14 -6
  158. package/src/components/Delivery/DeliveryUsersListing/index.js +19 -8
  159. package/src/components/Delivery/DriversCompaniesList/index.js +17 -3
  160. package/src/components/Delivery/DriversCompaniesListing/index.js +7 -5
  161. package/src/components/Delivery/DriversCompanyDetailsForm/index.js +3 -4
  162. package/src/components/Delivery/DriversGroupDetails/index.js +3 -4
  163. package/src/components/Delivery/DriversGroupLogistics/index.js +3 -5
  164. package/src/components/Delivery/DriversGroupsList/index.js +17 -3
  165. package/src/components/Delivery/DriversGroupsListing/index.js +7 -5
  166. package/src/components/Delivery/UserDetails/index.js +4 -9
  167. package/src/components/Delivery/UserFormDetails/index.js +9 -0
  168. package/src/components/Delivery/UsersList/index.js +11 -1
  169. package/src/components/Marketing/AdBannersListing/index.js +5 -4
  170. package/src/components/Marketing/CampaignDetail/index.js +3 -4
  171. package/src/components/Marketing/CampaignList/index.js +12 -2
  172. package/src/components/Marketing/CampaignListing/index.js +14 -5
  173. package/src/components/Marketing/EnterprisePromotionList/index.js +11 -1
  174. package/src/components/Marketing/EnterprisePromotionListing/index.js +13 -5
  175. package/src/components/Marketing/PageBanner/index.js +5 -6
  176. package/src/components/Messages/MessagesListing/index.js +14 -5
  177. package/src/components/MyProducts/AdvancedSettings/index.js +4 -1
  178. package/src/components/OrderingProducts/OrderingProductDetails/index.js +4 -3
  179. package/src/components/OrderingProducts/OrderingProductsListing/index.js +23 -6
  180. package/src/components/Orders/AllInOne/DriversManager/styles.js +1 -1
  181. package/src/components/Orders/AllInOne/index.js +5 -1
  182. package/src/components/Orders/AllInOne/styles.js +6 -2
  183. package/src/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +4 -17
  184. package/src/components/Orders/CreateCustomOrder/SelectCustomer/index.js +23 -2
  185. package/src/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +22 -0
  186. package/src/components/Orders/DeliveriesManager/index.js +3 -1
  187. package/src/components/Orders/DeliveryDashboard/index.js +4 -1
  188. package/src/components/Orders/DriverSelector/index.js +8 -2
  189. package/src/components/Orders/DriversDashboard/index.js +3 -1
  190. package/src/components/Orders/DriversLocation/index.js +117 -43
  191. package/src/components/Orders/DriversManager/index.js +3 -2
  192. package/src/components/Orders/DriversManager/styles.js +1 -1
  193. package/src/components/Orders/GiftCardsListing/index.js +44 -5
  194. package/src/components/Orders/Messages/index.js +5 -5
  195. package/src/components/Orders/OrderContactInformation/index.js +13 -7
  196. package/src/components/Orders/OrderDashboardSLASetting/index.js +1 -1
  197. package/src/components/Orders/OrderDetails/index.js +16 -16
  198. package/src/components/Orders/OrderStatusFilterBar/index.js +19 -2
  199. package/src/components/Orders/OrdersCards/index.js +11 -1
  200. package/src/components/Orders/OrdersDashboardControls/index.js +8 -2
  201. package/src/components/Orders/OrdersDashboardList/index.js +34 -2
  202. package/src/components/Orders/OrdersFilterGroup/styles.js +1 -1
  203. package/src/components/Orders/OrdersListing/index.js +4 -1
  204. package/src/components/Orders/OrdersManager/index.js +6 -1
  205. package/src/components/Orders/OrdersManager/styles.js +4 -2
  206. package/src/components/Orders/OrdersTable/index.js +11 -2
  207. package/src/components/Orders/OrdersTable/styles.js +0 -6
  208. package/src/components/Settings/Cms/index.js +15 -2
  209. package/src/components/Settings/LanguageManager/index.js +5 -1
  210. package/src/components/Settings/LanguageTransTable/index.js +15 -2
  211. package/src/components/Settings/SettingsList/index.js +90 -94
  212. package/src/components/Settings/WebhookDelaySelector/index.js +3 -2
  213. package/src/components/Settings/WebhookList/styles.js +3 -0
  214. package/src/components/Settings/WebhookListSelector/index.js +1 -0
  215. package/src/components/Shared/Pagination/index.js +1 -1
  216. package/src/components/Stores/BusinessActiveStateFilter/index.js +24 -4
  217. package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +1 -1
  218. package/src/components/Stores/BusinessAdd/OrderTypePriceLevel/index.js +9 -6
  219. package/src/components/Stores/BusinessAdd/PaymentMethods/index.js +1 -1
  220. package/src/components/Stores/BusinessBrandListing/index.js +6 -6
  221. package/src/components/Stores/BusinessDeliveryPickupMore/index.js +3 -5
  222. package/src/components/Stores/BusinessDeliveryZoneDetails/index.js +3 -7
  223. package/src/components/Stores/BusinessDeliveryZoneList/index.js +4 -11
  224. package/src/components/Stores/BusinessDetail/index.js +4 -5
  225. package/src/components/Stores/BusinessDetails/index.js +4 -6
  226. package/src/components/Stores/BusinessDeviceListing/index.js +4 -4
  227. package/src/components/Stores/BusinessInformation/index.js +8 -6
  228. package/src/components/Stores/BusinessInformation/styles.js +1 -0
  229. package/src/components/Stores/BusinessMenu/index.js +5 -13
  230. package/src/components/Stores/BusinessMenuBasicOptions/index.js +3 -2
  231. package/src/components/Stores/BusinessMenuOptions/index.js +3 -7
  232. package/src/components/Stores/BusinessOrderingChannels/index.js +3 -5
  233. package/src/components/Stores/BusinessPaymentMethods/index.js +7 -9
  234. package/src/components/Stores/BusinessPlaceGroupList/index.js +4 -8
  235. package/src/components/Stores/BusinessPreorderDetails/index.js +2 -2
  236. package/src/components/Stores/BusinessProductList/index.js +1 -1
  237. package/src/components/Stores/BusinessProductsCategoyDetails/index.js +3 -5
  238. package/src/components/Stores/BusinessProductsListing/index.js +9 -7
  239. package/src/components/Stores/BusinessSharedMenuProducts/index.js +4 -12
  240. package/src/components/Stores/BusinessSync/index.js +3 -4
  241. package/src/components/Stores/BusinessTypes/index.js +4 -11
  242. package/src/components/Stores/BusinessWalletsList/index.js +4 -8
  243. package/src/components/Stores/BusinessWebhooks/index.js +6 -4
  244. package/src/components/Stores/BusinessesList/index.js +11 -1
  245. package/src/components/Stores/BusinessesListing/index.js +21 -7
  246. package/src/components/Stores/ImportersButton/index.js +4 -5
  247. package/src/components/Stores/PaymentOption/index.js +3 -6
  248. package/src/components/Stores/PaymentOptionMethods/index.js +3 -6
  249. package/src/components/Stores/PaymentOptionPaypal/index.js +3 -6
  250. package/src/components/Stores/PaymentOptionSquare/index.js +3 -6
  251. package/src/components/Stores/PaymentOptionStripeDirect/index.js +3 -6
  252. package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +3 -6
  253. package/src/components/Stores/PaymethodOptionStripeConnect/index.js +3 -6
  254. package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +3 -6
  255. package/src/components/Stores/ProductDetails/index.js +5 -8
  256. package/src/components/Stores/ProductExtras/index.js +65 -14
  257. package/src/components/Stores/ProductExtras/styles.js +41 -1
  258. package/src/components/Stores/ProductIngredient/index.js +4 -10
  259. package/src/components/Stores/ProductMainDetails/index.js +4 -6
  260. package/src/components/Stores/ProductTagsList/index.js +4 -12
  261. package/src/components/Users/CustomerCashWallet/index.js +3 -6
  262. package/src/components/Users/CustomerDetails/index.js +13 -11
  263. package/src/components/Users/CustomerPointsWallet/index.js +3 -6
  264. package/src/components/Users/CustomersListing/index.js +15 -8
  265. package/src/components/Users/ProfessionalDetail/index.js +3 -10
  266. package/src/components/Users/ProfessionalList/index.js +11 -1
  267. package/src/components/Users/ProfessionalListing/index.js +15 -8
  268. package/src/components/Users/UserActiveStateFilter/index.js +5 -4
  269. package/src/components/Users/UserDetails/index.js +3 -10
  270. package/src/components/Users/UsersList/index.js +11 -1
  271. package/src/components/Users/UsersListing/index.js +15 -8
  272. package/src/index.js +3 -1
  273. package/src/utils/index.js +27 -0
  274. package/template/pages/AllInOne/index.js +4 -4
  275. package/template/pages/BusinessesList/index.js +4 -4
  276. package/template/pages/CampaignListing/index.js +5 -1
  277. package/template/pages/CustomersList/index.js +5 -4
  278. package/template/pages/DeliveriesManager/index.js +5 -4
  279. package/template/pages/DeliveryDriversList/index.js +5 -4
  280. package/template/pages/DriversCompaniesList/index.js +5 -1
  281. package/template/pages/DriversGroupsList/index.js +5 -1
  282. package/template/pages/DriversManagersList/index.js +5 -4
  283. package/template/pages/EnterprisePromotionList/index.js +1 -0
  284. package/template/pages/GiftCardsList/index.js +5 -1
  285. package/template/pages/ManagersList/index.js +5 -4
  286. package/template/pages/MessagesList/index.js +5 -1
  287. package/template/pages/OpenCarts/index.js +4 -5
  288. package/template/pages/OrderingProducts/index.js +2 -1
  289. package/template/pages/OrdersList/index.js +4 -4
  290. package/template/pages/Professionals/index.js +5 -4
  291. package/template/pages/RecoveryActionListing/index.js +5 -1
  292. package/template/pages/ReviewsList/index.js +5 -1
  293. /package/_bundles/{ordering-ui-admin.462f5c3aad7a320965e9.js.LICENSE.txt → ordering-ui-admin.78f6259366a43cc634db.js.LICENSE.txt} +0 -0
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage, BusinessPlaceGroupList as BusinessPlaceGroupListController } from 'ordering-components-admin-external'
4
4
  import Skeleton from 'react-loading-skeleton'
5
5
  import { Button, LinkButton } from '../../../styles'
@@ -7,6 +7,7 @@ import { ChevronRight, CheckSquareFill, Square } from 'react-bootstrap-icons'
7
7
  import { useWindowSize } from '../../../hooks/useWindowSize'
8
8
  import { BusinessPlaceGroup } from '../BusinessPlaceGroup'
9
9
  import { Modal } from '../../Shared'
10
+ import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
10
11
 
11
12
  import {
12
13
  Container,
@@ -32,7 +33,6 @@ export const BusinessPlaceGroupListUI = (props) => {
32
33
  getMultiCheckStatus
33
34
  } = props
34
35
 
35
- const history = useHistory()
36
36
  const query = new URLSearchParams(useLocation().search)
37
37
  const [, t] = useLanguage()
38
38
  const { width } = useWindowSize()
@@ -49,9 +49,7 @@ export const BusinessPlaceGroupListUI = (props) => {
49
49
  setOpenDetail(false)
50
50
  setSelectedPlace(null)
51
51
  setIsExtendExtraOpen(false)
52
- const businessId = query.get('id')
53
- const section = query.get('section')
54
- history.replace(`${location.pathname}?id=${businessId}&section=${section}`)
52
+ removeQueryToUrl(['place_group'])
55
53
  }
56
54
 
57
55
  const handleUpdateSelectedPlaceGroup = (placeGroup) => {
@@ -62,9 +60,7 @@ export const BusinessPlaceGroupListUI = (props) => {
62
60
  if (e?.target?.closest('.check-box')) return
63
61
  handleOpenDetail(placeGroup)
64
62
  if (!isInitialRender) {
65
- const businessId = query.get('id')
66
- const section = query.get('section')
67
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&place_group=${placeGroup.id}`)
63
+ addQueryToUrl({ place_group: placeGroup.id })
68
64
  }
69
65
  }
70
66
 
@@ -120,7 +120,7 @@ export const BusinessPreorderDetails = (props) => {
120
120
  {t('SAVE', 'Save')}
121
121
  </Button>
122
122
  </PreorderTimeWrapper>
123
- {/* <Divider />
123
+ <Divider />
124
124
  <BusinessCateringDelivery
125
125
  minutes={minutes}
126
126
  type='catering_delivery'
@@ -135,7 +135,7 @@ export const BusinessPreorderDetails = (props) => {
135
135
  changePreorderConfigs={changePreorderConfigs}
136
136
  disabled={actionStatus?.loading}
137
137
  />
138
- <Margin /> */}
138
+ <Margin />
139
139
  </BusinessPreorderContainer>
140
140
  )
141
141
  }
@@ -177,7 +177,7 @@ export const BusinessProductList = (props) => {
177
177
  (isLazyLoadProducts ? categoryState.products : currentProducts).sort((a, b) => a.rank - b.rank).map((product, i) => (
178
178
  <SingleBusinessProduct
179
179
  {...props}
180
- key={i}
180
+ key={`${product?.id}_${i}`}
181
181
  productDetailsId={productDetailsId}
182
182
  product={product}
183
183
  allowColumns={allowColumns}
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { useLanguage, BusinessProductsCategoyDetails as BusinessProductsCategoyDetailsController } from 'ordering-components-admin-external'
5
5
  import { ArrowsAngleContract, ArrowsAngleExpand, ThreeDots } from 'react-bootstrap-icons'
@@ -9,7 +9,7 @@ import { Alert, Confirm } from '../../Shared'
9
9
  import { IconButton, Switch } from '../../../styles'
10
10
  import { SeoOptions } from '../SeoOptions'
11
11
  import { useWindowSize } from '../../../hooks/useWindowSize'
12
-
12
+ import { addQueryToUrl } from '../../../utils'
13
13
  import { BusinessCategoryInfoSettingList } from '../BusinessCategoryInfoSettingList'
14
14
  import { BusinessProductsCategoyInfo } from '../BusinessProductsCategoyInfo'
15
15
 
@@ -44,7 +44,6 @@ const BusinessProductsCategoyDetailsUI = (props) => {
44
44
  handleTutorialSkip
45
45
  } = props
46
46
 
47
- const history = useHistory()
48
47
  const query = new URLSearchParams(useLocation().search)
49
48
  const theme = useTheme()
50
49
  const [, t] = useLanguage()
@@ -94,8 +93,7 @@ const BusinessProductsCategoyDetailsUI = (props) => {
94
93
  const handleTabClick = (tab, isInitialRender) => {
95
94
  setSelctedInfoItem(tab)
96
95
  if (!isInitialRender) {
97
- const category = query.get('category')
98
- history.replace(`${location.pathname}?category=${category}&tab=${tab}`)
96
+ addQueryToUrl({ tab: tab })
99
97
  }
100
98
  }
101
99
 
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect, useState, useRef } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import BisDownArrow from '@meronex/icons/bi/BisDownArrow'
5
5
  import { useWindowSize } from '../../../hooks/useWindowSize'
@@ -29,6 +29,7 @@ import { ImportersButton } from '../ImportersButton'
29
29
  import { AddBusinessForm } from '../AddBusinessForm'
30
30
  import { ProductStep } from '../ProductStep'
31
31
  import { BusinessAddStore } from '../BusinessAddStore'
32
+ import { addQueryToUrl, removeQueryToUrl, checkSiteUrl } from '../../../utils'
32
33
 
33
34
  import {
34
35
  CategoryProductsContainer,
@@ -47,7 +48,6 @@ import {
47
48
  ColumnsAllowWrapper,
48
49
  ButtonWrapper
49
50
  } from './styles'
50
- import { checkSiteUrl } from '../../../utils'
51
51
 
52
52
  const BusinessProductsListingUI = (props) => {
53
53
  const {
@@ -82,7 +82,6 @@ const BusinessProductsListingUI = (props) => {
82
82
  siteState
83
83
  } = props
84
84
 
85
- const history = useHistory()
86
85
  const query = new URLSearchParams(useLocation().search)
87
86
  const [, t] = useLanguage()
88
87
  const { width } = useWindowSize()
@@ -139,7 +138,7 @@ const BusinessProductsListingUI = (props) => {
139
138
  setCategorySelected(category)
140
139
  setOpenSidebar('category_details')
141
140
  if (!isInitialRender) {
142
- history.replace(`${location.pathname}?category=${category.id}`)
141
+ addQueryToUrl({ category: category.id })
143
142
  }
144
143
  } else {
145
144
  setCurrentCategory(null)
@@ -155,7 +154,7 @@ const BusinessProductsListingUI = (props) => {
155
154
  })
156
155
  setCurrentCategory(null)
157
156
  setOpenSidebar(null)
158
- history.replace(`${location.pathname}`)
157
+ removeQueryToUrl(['category'])
159
158
  }
160
159
 
161
160
  const handleOpenProductDetails = (product, isInitialRender) => {
@@ -320,7 +319,7 @@ const BusinessProductsListingUI = (props) => {
320
319
  <span
321
320
  className='business'
322
321
  onClick={() => {
323
- history.replace(`${location.pathname}?id=${businessState?.business?.id}`)
322
+ addQueryToUrl({ id: businessState?.business?.id })
324
323
  setOpenSidebar('business_details')
325
324
  }}
326
325
  >
@@ -522,7 +521,10 @@ const BusinessProductsListingUI = (props) => {
522
521
  businessId={selectedBusiness?.id || businessState?.business?.id}
523
522
  handleSucessRemoveBusiness={() => handleStoresRedirect()}
524
523
  // handleSucessUpdateBusiness={handleSucessUpdateBusiness}
525
- onClose={() => setOpenSidebar(null)}
524
+ onClose={() => {
525
+ setOpenSidebar(null)
526
+ removeQueryToUrl(['id'])
527
+ }}
526
528
  businessTypes={businessTypes}
527
529
  setBusinessTypes={setBusinessTypes}
528
530
  />
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import {
4
4
  useLanguage,
5
5
  BusinessSharedMenuProducts as BusinessSharedMenuProductsController
@@ -9,6 +9,7 @@ import { Modal, SearchBar, SideBar } from '../../Shared'
9
9
  import { BusinessSharedMenuProductDetails } from '../BusinessSharedMenuProductDetails'
10
10
  import { useWindowSize } from '../../../hooks/useWindowSize'
11
11
  import { ChevronRight } from 'react-bootstrap-icons'
12
+ import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
12
13
 
13
14
  import {
14
15
  MenuProductsContainer,
@@ -26,7 +27,6 @@ const BusinessSharedMenuProductsUI = (props) => {
26
27
  handleChangeInput
27
28
  } = props
28
29
 
29
- const history = useHistory()
30
30
  const query = new URLSearchParams(useLocation().search)
31
31
  const [, t] = useLanguage()
32
32
  const { width } = useWindowSize()
@@ -42,11 +42,7 @@ const BusinessSharedMenuProductsUI = (props) => {
42
42
  setIsOpenDetails(true)
43
43
 
44
44
  if (!isInitialRender) {
45
- const businessId = query.get('id')
46
- const section = query.get('section')
47
- const tab = query.get('tab')
48
- const menu = query.get('menu')
49
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&tab=${tab}&menu=${menu}&product=${product.id}`)
45
+ addQueryToUrl({ product: product.id })
50
46
  }
51
47
  }
52
48
 
@@ -54,11 +50,7 @@ const BusinessSharedMenuProductsUI = (props) => {
54
50
  setIsOpenDetails(false)
55
51
  setCurrentProduct(null)
56
52
  setIsOpenSharedProduct(false)
57
- const businessId = query.get('id')
58
- const section = query.get('section')
59
- const tab = query.get('tab')
60
- const menu = query.get('menu')
61
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&tab=${tab}&menu=${menu}`)
53
+ removeQueryToUrl(['product'])
62
54
  }
63
55
 
64
56
  useEffect(() => {
@@ -1,9 +1,10 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import { BusinessSyncBasic } from '../BusinessSyncBasic'
5
5
  import { BusinessSyncItsaCheckmate } from '../BusinessSyncItsaCheckmate'
6
6
  import { BusinessSyncStore } from '../BusinessSyncStore'
7
+ import { addQueryToUrl } from '../../../utils'
7
8
 
8
9
  import {
9
10
  Container,
@@ -15,7 +16,6 @@ import {
15
16
  export const BusinessSync = (props) => {
16
17
  const { handleParentSidebarMove } = props
17
18
 
18
- const history = useHistory()
19
19
  const query = new URLSearchParams(useLocation().search)
20
20
  const [, t] = useLanguage()
21
21
  const [selectedOption, setSelectedOption] = useState('deliverect')
@@ -29,8 +29,7 @@ export const BusinessSync = (props) => {
29
29
  handleParentSidebarMove(0)
30
30
  setSelectedOption(key)
31
31
  if (!isInitialRender) {
32
- const header = query.get('header')
33
- history.replace(`${location.pathname}?header=${header}&tab=${key}`)
32
+ addQueryToUrl({ tab: key })
34
33
  }
35
34
  }
36
35
 
@@ -1,10 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage } from 'ordering-components-admin-external'
3
- import { useHistory, useLocation } from 'react-router-dom'
3
+ import { useLocation } from 'react-router-dom'
4
4
  import { Alert, SearchBar, Modal, SideBar } from '../../Shared'
5
5
  import { ChevronRight, Square, CheckSquareFill } from 'react-bootstrap-icons'
6
6
  import { useWindowSize } from '../../../hooks/useWindowSize'
7
7
  import BsCardImage from '@meronex/icons/bs/BsCardImage'
8
+ import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
8
9
 
9
10
  import {
10
11
  Container,
@@ -32,7 +33,6 @@ export const BusinessTypes = (props) => {
32
33
  setIsExtendExtraOpen
33
34
  } = props
34
35
 
35
- const history = useHistory()
36
36
  const query = new URLSearchParams(useLocation().search)
37
37
  const [, t] = useLanguage()
38
38
  const { width } = useWindowSize()
@@ -51,21 +51,14 @@ export const BusinessTypes = (props) => {
51
51
  setSelectedBusinessType(category)
52
52
  setIsExtendExtraOpen(true)
53
53
  setIsOpenTypeDetail(true)
54
-
55
- const businessId = query.get('id')
56
- const section = query.get('section')
57
- const tab = query.get('tab')
58
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&tab=${tab}&business_type=${category?.id}`)
54
+ addQueryToUrl({ business_type: category?.id })
59
55
  }
60
56
 
61
57
  const handleCloseDetail = () => {
62
58
  setIsOpenTypeDetail(false)
63
59
  setIsExtendExtraOpen(false)
64
60
  setSelectedBusinessType(null)
65
- const businessId = query.get('id')
66
- const section = query.get('section')
67
- const tab = query.get('tab')
68
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&tab=${tab}`)
61
+ removeQueryToUrl(['business_type'])
69
62
  }
70
63
 
71
64
  const handleSelectBusinessTypes = (typeId) => {
@@ -1,10 +1,11 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage, useConfig, BusinessWalletsList as BusinessWalletsListController } from 'ordering-components-admin-external'
4
4
  import Skeleton from 'react-loading-skeleton'
5
5
  import { ChevronRight } from 'react-bootstrap-icons'
6
6
  import { SideBar } from '../../Shared'
7
7
  import { Select } from '../../../styles/Select/FirstSelect'
8
+ import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
8
9
 
9
10
  import {
10
11
  WalletsListContainer,
@@ -25,7 +26,6 @@ const BusinessWalletsListUI = (props) => {
25
26
  handleUpdateWallet
26
27
  } = props
27
28
 
28
- const history = useHistory()
29
29
  const query = new URLSearchParams(useLocation().search)
30
30
  const [, t] = useLanguage()
31
31
  const [{ configs }] = useConfig()
@@ -52,9 +52,7 @@ const BusinessWalletsListUI = (props) => {
52
52
  setIsExtendExtraOpen(true)
53
53
  setIsOpenDetails(true)
54
54
  if (!isInitialRender) {
55
- const businessId = query.get('id')
56
- const section = query.get('section')
57
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&wallet=${config.id}`)
55
+ addQueryToUrl({ wallet: config.id })
58
56
  }
59
57
  }
60
58
  const handleCloseWallet = () => {
@@ -62,9 +60,7 @@ const BusinessWalletsListUI = (props) => {
62
60
  setIsOpenDetails(false)
63
61
  setIsExtendExtraOpen(false)
64
62
  setCurrentConfig(null)
65
- const businessId = query.get('id')
66
- const section = query.get('section')
67
- history.replace(`${location.pathname}?id=${businessId}&section=${section}`)
63
+ removeQueryToUrl(['wallet'])
68
64
  }
69
65
 
70
66
  useEffect(() => {
@@ -48,18 +48,20 @@ const BusinessWebhooksUI = (props) => {
48
48
  { value: 'orders_pickup_failed_driver', content: t('ORDERS_PICKUP_FAILED_DRIVER') },
49
49
  { value: 'orders_delivery_completed_driver', content: t('ORDERS_DELIVERY_COMPLETED_DRIVER') },
50
50
  { value: 'orders_delivery_failed_driver', content: t('ORDERS_DELIVERY_FAILED_DRIVER') },
51
+ { value: 'orders_unassigned_driver', content: t('ORDERS_UNASSIGNED_DRIVER', 'Order unassigned driver') },
51
52
  { value: 'preorder_updated', content: t('PREORDER_UPDATED', 'Preorder updated') },
52
- { value: 'drivers_changes', content: t('DRIVERS_CHANGES', 'Driver changes') },
53
+ { value: 'drivers_changes', content: t('DRIVERS_CHANGES', 'Driver changes') }
53
54
  ]
54
55
 
55
56
  const timeList = [
56
57
  { value: '', content: t('SELECT_DELAY', 'Select a delay') },
57
58
  { value: '0', content: t('IMMEDIATELY', 'Immediately') },
58
- { value: 'delivery_time', content: t('DELIVERY_TIME', 'Delivery time') },
59
- { value: 'pickup_time', content: t('PICKUP_TIME', 'Pickup time') },
60
59
  { value: '300', content: `5 ${t('MINUTES', 'Minutes')}` },
61
60
  { value: '600', content: `10 ${t('MINUTES', 'Minutes')}` },
62
- { value: '900', content: `15 ${t('MINUTES', 'Minutes')}` }
61
+ { value: '900', content: `15 ${t('MINUTES', 'Minutes')}` },
62
+ { value: 'delivery_time', content: t('DELIVERY_TIME', 'Delivery time') },
63
+ { value: 'pickup_time', content: t('PICKUP_TIME', 'Pickup time') },
64
+ { value: 'preparation_time', content: t('PREPARATION_TIME', 'Preparation time') }
63
65
  ]
64
66
 
65
67
  const closeAlert = () => {
@@ -5,6 +5,7 @@ import { Button, Switch, LinkButton } from '../../../styles'
5
5
  import { useTheme } from 'styled-components'
6
6
  import { SingleBusiness } from '../SingleBusiness'
7
7
  import { CheckSquareFill, Square } from 'react-bootstrap-icons'
8
+ import { addQueryToUrl } from '../../../utils'
8
9
 
9
10
  import {
10
11
  BusinessListContainer,
@@ -39,7 +40,8 @@ export const BusinessesList = (props) => {
39
40
  selectedBusinessActiveState,
40
41
  setBusinessIds,
41
42
  handleGotToAdd,
42
- citiesList
43
+ citiesList,
44
+ isUseQuery
43
45
  } = props
44
46
 
45
47
  const theme = useTheme()
@@ -124,6 +126,14 @@ export const BusinessesList = (props) => {
124
126
  setIsAllChecked(_isAllChecked)
125
127
  }, [JSON.stringify(businessList.businesses), businessIds])
126
128
 
129
+ useEffect(() => {
130
+ if (!isUseQuery || !pagination?.currentPage || !pagination?.pageSize || !pagination?.total) return
131
+ addQueryToUrl({
132
+ page: pagination.currentPage,
133
+ pageSize: pagination.pageSize
134
+ })
135
+ }, [pagination?.currentPage, pagination?.pageSize, pagination?.total])
136
+
127
137
  return (
128
138
  <>
129
139
  {viewMethod === 'list' && (
@@ -1,9 +1,9 @@
1
1
  import React, { useState, useEffect, useMemo } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage, useEvent, DashboardBusinessList as BusinessListController } from 'ordering-components-admin-external'
4
4
  import BsGrid from '@meronex/icons/bs/BsGrid'
5
5
  import BsViewList from '@meronex/icons/bs/BsViewList'
6
- import { getStorageItem, setStorageItem } from '../../../utils'
6
+ import { getStorageItem, setStorageItem, removeQueryToUrl, addQueryToUrl } from '../../../utils'
7
7
  import { Modal, SideBar } from '../../Shared'
8
8
  import { useTheme } from 'styled-components'
9
9
 
@@ -53,10 +53,10 @@ const BusinessesListingUI = (props) => {
53
53
  filterValues,
54
54
  businessTypeSelected,
55
55
  inActiveBusinesses,
56
- citiesList
56
+ citiesList,
57
+ isUseQuery
57
58
  } = props
58
59
 
59
- const history = useHistory()
60
60
  const query = new URLSearchParams(useLocation().search)
61
61
  const theme = useTheme()
62
62
  const [, t] = useLanguage()
@@ -158,18 +158,19 @@ const BusinessesListingUI = (props) => {
158
158
  }
159
159
  if (method === 'card') {
160
160
  getPageBusinesses(50, 1)
161
+ removeQueryToUrl(['page', 'pageSize'])
161
162
  }
162
163
  }
163
164
 
164
165
  const handleOpenSync = () => {
165
166
  setOpenSync(true)
166
- history.replace(`${location.pathname}?header=sync`)
167
+ addQueryToUrl({ header: 'sync' })
167
168
  }
168
169
 
169
170
  const handleCloseSync = () => {
170
171
  setMoveDistance(0)
171
172
  setOpenSync(false)
172
- history.replace(`${location.pathname}`)
173
+ removeQueryToUrl(['header', 'tab'])
173
174
  }
174
175
 
175
176
  useEffect(() => {
@@ -203,6 +204,7 @@ const BusinessesListingUI = (props) => {
203
204
  {!noBusinesses && (
204
205
  <ViewContainer>
205
206
  <BusinessActiveStateFilter
207
+ isUseQuery={isUseQuery}
206
208
  selectedBusinessActiveState={selectedBusinessActiveState}
207
209
  handleChangeBusinessActiveState={handleChangeBusinessActiveState}
208
210
  />
@@ -269,6 +271,7 @@ const BusinessesListingUI = (props) => {
269
271
  selectedBusinessActiveState={selectedBusinessActiveState}
270
272
  handleGotToAdd={handleGotToAdd}
271
273
  citiesList={citiesList}
274
+ isUseQuery={isUseQuery && viewMethod === 'list'}
272
275
  />
273
276
  )}
274
277
  </BusinessListingContainer>
@@ -332,13 +335,24 @@ const BusinessesListingUI = (props) => {
332
335
  }
333
336
 
334
337
  export const BusinessesListing = (props) => {
338
+ const query = new URLSearchParams(useLocation().search)
339
+ const defaultPage = query.get('page') || 1
340
+ const defaultPageSize = query.get('pageSize') || 10
341
+ const defaultActive = query.get('active')
342
+
335
343
  const businessListingProps = {
336
344
  ...props,
337
345
  UIComponent: BusinessesListingUI,
338
346
  asDashboard: true,
339
347
  isSearchByBusinessName: true,
340
348
  isSearchByBusinessEmail: true,
341
- isSearchByBusinessPhone: true
349
+ isSearchByBusinessPhone: true,
350
+ paginationSettings: {
351
+ initialPage: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPage) : 1,
352
+ pageSize: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
353
+ controlType: 'pages'
354
+ },
355
+ defaultActive: defaultActive ? defaultActive === 'true' : true
342
356
  }
343
357
  return (
344
358
  <BusinessListController {...businessListingProps} />
@@ -1,15 +1,15 @@
1
1
  import React, { useEffect, useState } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import { Upload } from 'react-bootstrap-icons'
5
5
  import { Button } from '../../../styles'
6
6
  import { ImportersListing } from '../ImportersListing'
7
7
  import { SideBar } from '../../Shared'
8
8
  import { CsvImportButtonWrapper } from './styles'
9
+ import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
9
10
 
10
11
  export const ImportersButton = (props) => {
11
12
  const { setOpenSidebar } = props
12
- const history = useHistory()
13
13
  const query = new URLSearchParams(useLocation().search)
14
14
  const [, t] = useLanguage()
15
15
  const [openImporters, setOpenImporters] = useState(false)
@@ -18,13 +18,12 @@ export const ImportersButton = (props) => {
18
18
  const handleOpenImporters = () => {
19
19
  setOpenSidebar && setOpenSidebar('importer')
20
20
  setOpenImporters(true)
21
-
22
- history.replace(`${location.pathname}?header=importers`)
21
+ addQueryToUrl({ header: 'importers' })
23
22
  }
24
23
 
25
24
  const handleCloseImporters = () => {
26
25
  setOpenImporters(false)
27
- history.replace(`${location.pathname}`)
26
+ removeQueryToUrl(['header'])
28
27
  }
29
28
 
30
29
  useEffect(() => {
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
5
5
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
@@ -10,6 +10,7 @@ import { useTheme } from 'styled-components'
10
10
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
11
11
  import { Dropdown, DropdownButton } from 'react-bootstrap'
12
12
  import { Confirm } from '../../Shared'
13
+ import { addQueryToUrl } from '../../../utils'
13
14
 
14
15
  import {
15
16
  Container,
@@ -35,7 +36,6 @@ export const PaymentOption = (props) => {
35
36
  handleDeletePaymethod
36
37
  } = props
37
38
 
38
- const history = useHistory()
39
39
  const query = new URLSearchParams(useLocation().search)
40
40
  const theme = useTheme()
41
41
  const [, t] = useLanguage()
@@ -125,10 +125,7 @@ export const PaymentOption = (props) => {
125
125
  const handleTabClick = (tab, isInitialRender) => {
126
126
  setPaymentTabs(tab)
127
127
  if (!isInitialRender) {
128
- const businessId = query.get('id')
129
- const section = query.get('section')
130
- const paymethod = query.get('paymethod')
131
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&paymethod=${paymethod}&payemthod_tab=${tab}`)
128
+ addQueryToUrl({ payemthod_tab: tab })
132
129
  }
133
130
  }
134
131
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
5
5
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
@@ -9,6 +9,7 @@ import { useTheme } from 'styled-components'
9
9
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
10
10
  import { Dropdown, DropdownButton } from 'react-bootstrap'
11
11
  import { Confirm } from '../../Shared'
12
+ import { addQueryToUrl } from '../../../utils'
12
13
 
13
14
  import {
14
15
  Container,
@@ -41,7 +42,6 @@ export const PaymentOptionMethods = (props) => {
41
42
  title
42
43
  } = props
43
44
 
44
- const history = useHistory()
45
45
  const query = new URLSearchParams(useLocation().search)
46
46
  const theme = useTheme()
47
47
  const [, t] = useLanguage()
@@ -133,10 +133,7 @@ export const PaymentOptionMethods = (props) => {
133
133
  const handleTabClick = (tab, isInitialRender) => {
134
134
  setPaymentTabs(tab)
135
135
  if (!isInitialRender) {
136
- const businessId = query.get('id')
137
- const section = query.get('section')
138
- const paymethod = query.get('paymethod')
139
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&paymethod=${paymethod}&payemthod_tab=${tab}`)
136
+ addQueryToUrl({ payemthod_tab: tab })
140
137
  }
141
138
  }
142
139
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
5
5
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
@@ -9,6 +9,7 @@ import { useTheme } from 'styled-components'
9
9
  import { ThreeDots, XLg } from 'react-bootstrap-icons'
10
10
  import { Dropdown, DropdownButton } from 'react-bootstrap'
11
11
  import { Confirm } from '../../Shared'
12
+ import { addQueryToUrl } from '../../../utils'
12
13
 
13
14
  import {
14
15
  Container,
@@ -39,7 +40,6 @@ export const PaymentOptionPaypal = (props) => {
39
40
  handleDeletePaymethod
40
41
  } = props
41
42
 
42
- const history = useHistory()
43
43
  const query = new URLSearchParams(useLocation().search)
44
44
  const theme = useTheme()
45
45
  const [, t] = useLanguage()
@@ -133,10 +133,7 @@ export const PaymentOptionPaypal = (props) => {
133
133
  const handleTabClick = (tab, isInitialRender) => {
134
134
  setPaymentTabs(tab)
135
135
  if (!isInitialRender) {
136
- const businessId = query.get('id')
137
- const section = query.get('section')
138
- const paymethod = query.get('paymethod')
139
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&paymethod=${paymethod}&payemthod_tab=${tab}`)
136
+ addQueryToUrl({ payemthod_tab: tab })
140
137
  }
141
138
  }
142
139
 
@@ -1,5 +1,5 @@
1
1
  import React, { useState, useEffect } from 'react'
2
- import { useHistory, useLocation } from 'react-router-dom'
2
+ import { useLocation } from 'react-router-dom'
3
3
  import { useLanguage, PaymentOptionSquare as PaymentOptionSquareController } from 'ordering-components-admin-external'
4
4
  import { Button, IconButton, Input, Checkbox } from '../../../styles'
5
5
  import { useWindowSize } from '../../../hooks/useWindowSize'
@@ -12,6 +12,7 @@ import { TabOption, TabOptionName } from '../PaymentOptionStripeDirect/styles'
12
12
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
13
13
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
14
14
  import SiSquare from '@meronex/icons/si/SiSquare'
15
+ import { addQueryToUrl } from '../../../utils'
15
16
 
16
17
  import {
17
18
  Container,
@@ -44,7 +45,6 @@ const PaymentOptionSquareUI = (props) => {
44
45
  handleChangeSandbox
45
46
  } = props
46
47
 
47
- const history = useHistory()
48
48
  const query = new URLSearchParams(useLocation().search)
49
49
  const theme = useTheme()
50
50
  const [, t] = useLanguage()
@@ -115,10 +115,7 @@ const PaymentOptionSquareUI = (props) => {
115
115
  const handleTabClick = (tab, isInitialRender) => {
116
116
  setPaymentTabs(tab)
117
117
  if (!isInitialRender) {
118
- const businessId = query.get('id')
119
- const section = query.get('section')
120
- const paymethod = query.get('paymethod')
121
- history.replace(`${location.pathname}?id=${businessId}&section=${section}&paymethod=${paymethod}&payemthod_tab=${tab}`)
118
+ addQueryToUrl({ payemthod_tab: tab })
122
119
  }
123
120
  }
124
121