ordering-ui-admin-external 1.24.2 → 1.25.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 (228) hide show
  1. package/_bundles/main.css +12158 -12158
  2. package/_bundles/{ordering-ui-admin.0c354f3e7da49f56465b.js → ordering-ui-admin.f2522b983a000252b407.js} +2 -2
  3. package/_modules/components/CartRecovery/RecoveryActionAdd/index.js +16 -3
  4. package/_modules/components/CartRecovery/RecoveryActionAdd/styles.js +65 -0
  5. package/_modules/components/CartRecovery/RecoveryActionList/index.js +1 -1
  6. package/_modules/components/CartRecovery/RecoveryActionList/styles.js +3 -7
  7. package/_modules/components/CartRecovery/RecoveryActionListing/index.js +21 -2
  8. package/_modules/components/CartRecovery/RecoveryActionListing/styles.js +1 -1
  9. package/_modules/components/CartRecovery/RecoveryNotificationList/index.js +6 -2
  10. package/_modules/components/CartRecovery/RecoveryNotificationList/styles.js +3 -7
  11. package/_modules/components/CartRecovery/SingleRecoveryNotification/index.js +67 -21
  12. package/_modules/components/CartRecovery/SingleRecoveryNotification/styles.js +1 -1
  13. package/_modules/components/CartRecovery/index.js +8 -1
  14. package/_modules/components/Delivery/DriversCompaniesList/index.js +1 -1
  15. package/_modules/components/Delivery/DriversCompaniesList/styles.js +3 -7
  16. package/_modules/components/Delivery/DriversGroupsList/index.js +1 -1
  17. package/_modules/components/Delivery/DriversGroupsList/styles.js +3 -10
  18. package/_modules/components/Delivery/UsersList/index.js +1 -1
  19. package/_modules/components/Delivery/UsersList/styles.js +8 -15
  20. package/_modules/components/Marketing/CampaignList/index.js +1 -1
  21. package/_modules/components/Marketing/CampaignList/styles.js +3 -7
  22. package/_modules/components/Marketing/EnterprisePromotionDetails/index.js +1 -0
  23. package/_modules/components/Marketing/EnterprisePromotionList/index.js +1 -1
  24. package/_modules/components/Marketing/EnterprisePromotionList/styles.js +4 -8
  25. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +9 -1
  26. package/_modules/components/Marketing/EnterprisePromotionRules/index.js +7 -2
  27. package/_modules/components/Messages/MessagesListing/index.js +8 -2
  28. package/_modules/components/MyProducts/ContentForm/index.js +0 -1
  29. package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +1 -1
  30. package/_modules/components/OrderingProducts/OrderingProductsListing/styles.js +7 -11
  31. package/_modules/components/Orders/DeliveriesManager/index.js +1 -0
  32. package/_modules/components/Orders/DriversList/index.js +10 -9
  33. package/_modules/components/Orders/DriversList/styles.js +9 -16
  34. package/_modules/components/Orders/Logistics/index.js +15 -7
  35. package/_modules/components/Orders/Logistics/styles.js +1 -1
  36. package/_modules/components/Orders/OrderDetails/index.js +15 -13
  37. package/_modules/components/Orders/OrderDetailsHeader/index.js +7 -12
  38. package/_modules/components/Orders/OrderNotification/index.js +33 -1
  39. package/_modules/components/Orders/OrdersCards/index.js +11 -10
  40. package/_modules/components/Orders/OrdersCards/styles.js +1 -1
  41. package/_modules/components/Orders/OrdersTable/index.js +10 -9
  42. package/_modules/components/Settings/Cms/index.js +1 -1
  43. package/_modules/components/Settings/Cms/styles.js +3 -7
  44. package/_modules/components/Settings/CountriesList/index.js +1 -1
  45. package/_modules/components/Settings/CountriesList/styles.js +3 -7
  46. package/_modules/components/Settings/DropdownOptionList/index.js +1 -1
  47. package/_modules/components/Settings/DropdownOptionList/styles.js +3 -7
  48. package/_modules/components/Settings/LanguageTransTable/index.js +7 -6
  49. package/_modules/components/Settings/LanguageTransTable/styles.js +3 -7
  50. package/_modules/components/Settings/PlaceListing/index.js +1 -1
  51. package/_modules/components/Settings/PlaceListing/styles.js +3 -7
  52. package/_modules/components/Settings/SettingsList/index.js +1 -1
  53. package/_modules/components/Shared/HtmlEditor/InsertImage/index.js +202 -0
  54. package/_modules/components/Shared/HtmlEditor/InsertImage/styles.js +36 -0
  55. package/_modules/components/Shared/HtmlEditor/InsertLink/index.js +75 -0
  56. package/_modules/components/Shared/HtmlEditor/InsertLink/styles.js +16 -0
  57. package/_modules/components/Shared/HtmlEditor/InsertVideo/index.js +56 -0
  58. package/_modules/components/Shared/HtmlEditor/InsertVideo/styles.js +14 -0
  59. package/_modules/components/Shared/HtmlEditor/index.js +181 -0
  60. package/_modules/components/Shared/HtmlEditor/styles.js +18 -0
  61. package/_modules/components/Shared/index.js +7 -0
  62. package/_modules/components/Stores/BusinessBrandListing/index.js +1 -1
  63. package/_modules/components/Stores/BusinessBrandListing/styles.js +3 -6
  64. package/_modules/components/Stores/BusinessDeliveryPickupMore/styles.js +1 -1
  65. package/_modules/components/Stores/BusinessDeliveryZoneList/index.js +2 -2
  66. package/_modules/components/Stores/BusinessDeliveryZoneList/styles.js +4 -8
  67. package/_modules/components/Stores/BusinessDetail/styles.js +2 -2
  68. package/_modules/components/Stores/BusinessDetails/index.js +24 -25
  69. package/_modules/components/Stores/BusinessDeviceListing/index.js +1 -1
  70. package/_modules/components/Stores/BusinessDeviceListing/styles.js +1 -4
  71. package/_modules/components/Stores/BusinessMenu/index.js +2 -2
  72. package/_modules/components/Stores/BusinessMenu/styles.js +3 -5
  73. package/_modules/components/Stores/BusinessPlaceGroup/index.js +2 -2
  74. package/_modules/components/Stores/BusinessPlaceGroup/styles.js +3 -7
  75. package/_modules/components/Stores/BusinessPlaceGroupList/index.js +2 -2
  76. package/_modules/components/Stores/BusinessPlaceGroupList/styles.js +3 -7
  77. package/_modules/components/Stores/BusinessProductList/index.js +7 -6
  78. package/_modules/components/Stores/BusinessProductList/styles.js +3 -5
  79. package/_modules/components/Stores/BusinessProductsCategories/index.js +6 -5
  80. package/_modules/components/Stores/BusinessProductsCategories/styles.js +3 -6
  81. package/_modules/components/Stores/BusinessProductsListing/index.js +9 -6
  82. package/_modules/components/Stores/BusinessPromotionList/index.js +2 -2
  83. package/_modules/components/Stores/BusinessPromotionList/styles.js +3 -5
  84. package/_modules/components/Stores/BusinessSummary/index.js +7 -12
  85. package/_modules/components/Stores/BusinessesList/index.js +7 -4
  86. package/_modules/components/Stores/BusinessesList/styles.js +12 -16
  87. package/_modules/components/Stores/BusinessesListing/index.js +4 -2
  88. package/_modules/components/Stores/ImportersButton/index.js +2 -0
  89. package/_modules/components/Stores/ImportersList/index.js +1 -1
  90. package/_modules/components/Stores/ImportersList/styles.js +4 -9
  91. package/_modules/components/Stores/ProductDetails/index.js +19 -20
  92. package/_modules/components/Stores/ProductExtraOptionDetails/index.js +1 -1
  93. package/_modules/components/Stores/ProductExtraOptionDetails/styles.js +1 -5
  94. package/_modules/components/Stores/ProductExtras/index.js +2 -2
  95. package/_modules/components/Stores/ProductExtras/styles.js +3 -7
  96. package/_modules/components/Stores/ProductIngredient/index.js +2 -2
  97. package/_modules/components/Stores/ProductIngredient/styles.js +3 -7
  98. package/_modules/components/Stores/ProductStep/index.js +13 -7
  99. package/_modules/components/Stores/ProductSummary/index.js +2 -8
  100. package/_modules/components/Stores/ProductTagsList/index.js +2 -2
  101. package/_modules/components/Stores/ProductTagsList/styles.js +1 -5
  102. package/_modules/components/Stores/RestaurantSelectGuide/index.js +18 -9
  103. package/_modules/components/Stores/SeoOptions/index.js +25 -10
  104. package/_modules/components/Stores/SingleBusiness/index.js +18 -11
  105. package/_modules/components/Users/CustomerDetails/index.js +6 -7
  106. package/_modules/components/Users/CustomersListing/index.js +10 -4
  107. package/_modules/components/Users/ProfessionalList/index.js +1 -1
  108. package/_modules/components/Users/ProfessionalList/styles.js +8 -12
  109. package/_modules/components/Users/UsersList/index.js +1 -1
  110. package/_modules/components/Users/UsersList/styles.js +11 -15
  111. package/_modules/index.js +6 -0
  112. package/_modules/styles/Buttons/index.js +11 -4
  113. package/_modules/styles/index.js +6 -0
  114. package/index-template.js +1 -1
  115. package/package.json +2 -2
  116. package/src/components/CartRecovery/RecoveryActionAdd/index.js +13 -3
  117. package/src/components/CartRecovery/RecoveryActionAdd/styles.js +179 -0
  118. package/src/components/CartRecovery/RecoveryActionList/index.js +4 -5
  119. package/src/components/CartRecovery/RecoveryActionList/styles.js +0 -6
  120. package/src/components/CartRecovery/RecoveryActionListing/index.js +25 -6
  121. package/src/components/CartRecovery/RecoveryActionListing/styles.js +2 -1
  122. package/src/components/CartRecovery/RecoveryNotificationList/index.js +7 -3
  123. package/src/components/CartRecovery/RecoveryNotificationList/styles.js +5 -13
  124. package/src/components/CartRecovery/SingleRecoveryNotification/index.js +91 -42
  125. package/src/components/CartRecovery/SingleRecoveryNotification/styles.js +2 -2
  126. package/src/components/CartRecovery/index.js +3 -1
  127. package/src/components/Delivery/DriversCompaniesList/index.js +3 -4
  128. package/src/components/Delivery/DriversCompaniesList/styles.js +0 -6
  129. package/src/components/Delivery/DriversGroupsList/index.js +3 -4
  130. package/src/components/Delivery/DriversGroupsList/styles.js +0 -12
  131. package/src/components/Delivery/UsersList/index.js +3 -4
  132. package/src/components/Delivery/UsersList/styles.js +0 -12
  133. package/src/components/Marketing/CampaignList/index.js +3 -4
  134. package/src/components/Marketing/CampaignList/styles.js +0 -6
  135. package/src/components/Marketing/EnterprisePromotionDetails/index.js +1 -0
  136. package/src/components/Marketing/EnterprisePromotionList/index.js +3 -4
  137. package/src/components/Marketing/EnterprisePromotionList/styles.js +0 -7
  138. package/src/components/Marketing/EnterprisePromotionListing/index.js +6 -1
  139. package/src/components/Marketing/EnterprisePromotionRules/index.js +7 -2
  140. package/src/components/Messages/MessagesListing/index.js +3 -0
  141. package/src/components/MyProducts/ContentForm/index.js +0 -1
  142. package/src/components/OrderingProducts/OrderingProductsListing/index.js +3 -4
  143. package/src/components/OrderingProducts/OrderingProductsListing/styles.js +0 -7
  144. package/src/components/Orders/DeliveriesManager/index.js +1 -0
  145. package/src/components/Orders/DriversList/index.js +4 -4
  146. package/src/components/Orders/DriversList/styles.js +0 -10
  147. package/src/components/Orders/Logistics/index.js +10 -1
  148. package/src/components/Orders/Logistics/styles.js +6 -0
  149. package/src/components/Orders/OrderDetails/index.js +11 -13
  150. package/src/components/Orders/OrderDetailsHeader/index.js +40 -43
  151. package/src/components/Orders/OrderNotification/index.js +19 -1
  152. package/src/components/Orders/OrdersCards/index.js +7 -7
  153. package/src/components/Orders/OrdersCards/styles.js +3 -1
  154. package/src/components/Orders/OrdersTable/index.js +8 -8
  155. package/src/components/Settings/Cms/index.js +4 -5
  156. package/src/components/Settings/Cms/styles.js +0 -6
  157. package/src/components/Settings/CountriesList/index.js +4 -5
  158. package/src/components/Settings/CountriesList/styles.js +0 -6
  159. package/src/components/Settings/DropdownOptionList/index.js +4 -5
  160. package/src/components/Settings/DropdownOptionList/styles.js +0 -6
  161. package/src/components/Settings/LanguageTransTable/index.js +4 -4
  162. package/src/components/Settings/LanguageTransTable/styles.js +0 -6
  163. package/src/components/Settings/PlaceListing/index.js +4 -5
  164. package/src/components/Settings/PlaceListing/styles.js +0 -6
  165. package/src/components/Settings/SettingsList/index.js +88 -88
  166. package/src/components/Shared/HtmlEditor/InsertImage/index.js +172 -0
  167. package/src/components/Shared/HtmlEditor/InsertImage/styles.js +136 -0
  168. package/src/components/Shared/HtmlEditor/InsertLink/index.js +73 -0
  169. package/src/components/Shared/HtmlEditor/InsertLink/styles.js +34 -0
  170. package/src/components/Shared/HtmlEditor/InsertVideo/index.js +51 -0
  171. package/src/components/Shared/HtmlEditor/InsertVideo/styles.js +23 -0
  172. package/src/components/Shared/HtmlEditor/index.js +172 -0
  173. package/src/components/Shared/HtmlEditor/styles.js +30 -0
  174. package/src/components/Shared/index.js +3 -1
  175. package/src/components/Stores/BusinessBrandListing/index.js +2 -2
  176. package/src/components/Stores/BusinessBrandListing/styles.js +0 -7
  177. package/src/components/Stores/BusinessDeliveryPickupMore/styles.js +0 -4
  178. package/src/components/Stores/BusinessDeliveryZoneList/index.js +9 -7
  179. package/src/components/Stores/BusinessDeliveryZoneList/styles.js +1 -11
  180. package/src/components/Stores/BusinessDetail/styles.js +1 -4
  181. package/src/components/Stores/BusinessDetails/index.js +12 -17
  182. package/src/components/Stores/BusinessDeviceListing/index.js +2 -2
  183. package/src/components/Stores/BusinessDeviceListing/styles.js +0 -7
  184. package/src/components/Stores/BusinessMenu/index.js +9 -7
  185. package/src/components/Stores/BusinessMenu/styles.js +1 -6
  186. package/src/components/Stores/BusinessPlaceGroup/index.js +7 -3
  187. package/src/components/Stores/BusinessPlaceGroup/styles.js +1 -12
  188. package/src/components/Stores/BusinessPlaceGroupList/index.js +5 -3
  189. package/src/components/Stores/BusinessPlaceGroupList/styles.js +1 -12
  190. package/src/components/Stores/BusinessProductList/index.js +9 -6
  191. package/src/components/Stores/BusinessProductList/styles.js +1 -6
  192. package/src/components/Stores/BusinessProductsCategories/index.js +10 -7
  193. package/src/components/Stores/BusinessProductsCategories/styles.js +1 -6
  194. package/src/components/Stores/BusinessProductsListing/index.js +5 -2
  195. package/src/components/Stores/BusinessPromotionList/index.js +7 -5
  196. package/src/components/Stores/BusinessPromotionList/styles.js +1 -5
  197. package/src/components/Stores/BusinessSummary/index.js +4 -7
  198. package/src/components/Stores/BusinessesList/index.js +7 -5
  199. package/src/components/Stores/BusinessesList/styles.js +0 -8
  200. package/src/components/Stores/BusinessesListing/index.js +3 -1
  201. package/src/components/Stores/ImportersButton/index.js +2 -0
  202. package/src/components/Stores/ImportersList/index.js +3 -4
  203. package/src/components/Stores/ImportersList/styles.js +1 -13
  204. package/src/components/Stores/ProductDetails/index.js +12 -16
  205. package/src/components/Stores/ProductExtraOptionDetails/index.js +3 -3
  206. package/src/components/Stores/ProductExtraOptionDetails/styles.js +0 -9
  207. package/src/components/Stores/ProductExtras/index.js +9 -7
  208. package/src/components/Stores/ProductExtras/styles.js +1 -8
  209. package/src/components/Stores/ProductIngredient/index.js +9 -7
  210. package/src/components/Stores/ProductIngredient/styles.js +1 -8
  211. package/src/components/Stores/ProductStep/index.js +25 -4
  212. package/src/components/Stores/ProductSummary/index.js +3 -7
  213. package/src/components/Stores/ProductTagsList/index.js +7 -5
  214. package/src/components/Stores/ProductTagsList/styles.js +0 -7
  215. package/src/components/Stores/RestaurantSelectGuide/index.js +54 -24
  216. package/src/components/Stores/SeoOptions/index.js +15 -1
  217. package/src/components/Stores/SingleBusiness/index.js +9 -3
  218. package/src/components/Users/CustomerDetails/index.js +6 -8
  219. package/src/components/Users/CustomersListing/index.js +4 -1
  220. package/src/components/Users/ProfessionalList/index.js +3 -4
  221. package/src/components/Users/ProfessionalList/styles.js +0 -7
  222. package/src/components/Users/UsersList/index.js +3 -4
  223. package/src/components/Users/UsersList/styles.js +0 -7
  224. package/src/index.js +2 -1
  225. package/src/styles/Buttons/index.js +15 -1
  226. package/src/styles/index.js +2 -1
  227. package/template/pages/Login/index.js +2 -4
  228. /package/_bundles/{ordering-ui-admin.0c354f3e7da49f56465b.js.LICENSE.txt → ordering-ui-admin.f2522b983a000252b407.js.LICENSE.txt} +0 -0
@@ -45,6 +45,7 @@ const ProductDetailsUI = (props) => {
45
45
  const [isMenuOpen, setIsMenuOpen] = useState(false)
46
46
  const [extraOpen, setExtraOpen] = useState(false)
47
47
  const [isExtendExtraOpen, setIsExtendExtraOpen] = useState(false)
48
+ const [isExpand, setIsExpand] = useState(false)
48
49
  const [showOption, setShowOption] = useState(null)
49
50
 
50
51
  const handleShowOption = (option, isInitialRender) => {
@@ -80,20 +81,18 @@ const ProductDetailsUI = (props) => {
80
81
  if (width <= 500) {
81
82
  document.getElementById('product_details').style.width = '100vw'
82
83
  } else {
83
- if (extraOpen && width >= 1000) {
84
- document.getElementById('product_details').style.width = '1000px'
84
+ if (isExpand) {
85
+ document.getElementById('product_details').style.width = '100vw'
85
86
  } else {
86
- document.getElementById('product_details').style.width = '500px'
87
+ if (extraOpen && width >= 1000) {
88
+ document.getElementById('product_details').style.width = '1000px'
89
+ } else {
90
+ document.getElementById('product_details').style.width = '500px'
91
+ }
87
92
  }
88
93
  }
89
94
  }
90
95
  }
91
- useEffect(() => {
92
- // if (width > 1000) {
93
- // setIsExtendExtraOpen(false)
94
- // }
95
- toggleMainContent()
96
- }, [width])
97
96
 
98
97
  useEffect(() => {
99
98
  if (!open) return
@@ -101,13 +100,8 @@ const ProductDetailsUI = (props) => {
101
100
  }, [open])
102
101
 
103
102
  useEffect(() => {
104
- if (width < 1000) return
105
- if (extraOpen) {
106
- document.getElementById('product_details').style.width = '1000px'
107
- } else {
108
- toggleMainContent()
109
- }
110
- }, [extraOpen])
103
+ toggleMainContent()
104
+ }, [extraOpen, isExpand, width])
111
105
 
112
106
  useEffect(() => {
113
107
  setExtraOpen(false)
@@ -142,6 +136,8 @@ const ProductDetailsUI = (props) => {
142
136
  showOption={showOption}
143
137
  handleShowOption={handleShowOption}
144
138
  extraOpen={extraOpen}
139
+ isExpand={isExpand}
140
+ setIsExpand={setIsExpand}
145
141
  />
146
142
  )}
147
143
  {extraOpen && (
@@ -6,7 +6,7 @@ import {
6
6
  ProductExtraOptionDetails as ProductExtraOptionDetailsController
7
7
  } from 'ordering-components-admin-external'
8
8
  import BiImage from '@meronex/icons/bi/BiImage'
9
- import { IconButton, Input } from '../../../styles'
9
+ import { IconButton, Input, LinkButton } from '../../../styles'
10
10
  import { DropdownButton, Dropdown } from 'react-bootstrap'
11
11
  import { useTheme } from 'styled-components'
12
12
  import { bytesConverter } from '../../../utils'
@@ -400,12 +400,12 @@ const ProductExtraOptionDetailsUI = (props) => {
400
400
  )}
401
401
  {!isAddForm && (
402
402
  <AddNewOptionButton>
403
- <span
403
+ <LinkButton
404
404
  className='add-option-btn'
405
405
  onClick={() => setIsAddForm(true)}
406
406
  >
407
407
  {t('ADD_SUBOPTION', 'Add suboption')}
408
- </span>
408
+ </LinkButton>
409
409
  </AddNewOptionButton>
410
410
  )}
411
411
  </ModifierOptionsContainer>
@@ -287,13 +287,4 @@ export const AdddSubOptionForm = styled.form`
287
287
 
288
288
  export const AddNewOptionButton = styled.div`
289
289
  margin-top: 15px;
290
- font-size: 14px;
291
- color: ${props => props.theme.colors.lightGray};
292
- span {
293
- cursor: pointer;
294
- }
295
-
296
- &:hover {
297
- color: ${props => props.theme.colors.primary};
298
- }
299
290
  `
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useHistory, useLocation } from 'react-router-dom'
3
3
  import { useLanguage, ProductExtras as ProductExtrasController } from 'ordering-components-admin-external'
4
4
  import { useWindowSize } from '../../../hooks/useWindowSize'
5
- import { Button, Checkbox } from '../../../styles'
5
+ import { Button, Checkbox, LinkButton } from '../../../styles'
6
6
  import { Alert, Confirm, Modal } from '../../Shared'
7
7
  import { ProductExtraOptions } from '../ProductExtraOptions'
8
8
  import { ChevronRight } from 'react-bootstrap-icons'
@@ -17,7 +17,7 @@ import {
17
17
  MoreContainer,
18
18
  Details,
19
19
  ExtraAddForm,
20
- AddButton,
20
+ AddButtonWrapper,
21
21
  DragImageWrapper
22
22
  } from './styles'
23
23
 
@@ -201,11 +201,13 @@ const ProductExtrasUI = (props) => {
201
201
  />
202
202
  </ExtraAddForm>
203
203
  )}
204
- <AddButton
205
- onClick={() => handleOpenAddForm()}
206
- >
207
- {t('ADD_PRODUCT_OPTION', 'Add product option')}
208
- </AddButton>
204
+ <AddButtonWrapper>
205
+ <LinkButton
206
+ onClick={() => handleOpenAddForm()}
207
+ >
208
+ {t('ADD_PRODUCT_OPTION', 'Add product option')}
209
+ </LinkButton>
210
+ </AddButtonWrapper>
209
211
  </ProductExtrasContainer>
210
212
  {width >= 1000 ? (
211
213
  <>
@@ -99,15 +99,8 @@ export const Details = styled.div`
99
99
  }
100
100
  `
101
101
 
102
- export const AddButton = styled.div`
103
- cursor: pointer;
104
- font-size: 14px;
102
+ export const AddButtonWrapper = styled.div`
105
103
  padding: 12px 0;
106
- color: ${props => props.theme.colors.lightGray};
107
-
108
- &:hover {
109
- color: ${props => props.theme.colors.primary};
110
- }
111
104
  `
112
105
 
113
106
  export const ExtraAddForm = styled.form`
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react'
2
2
  import { useHistory, useLocation } from 'react-router-dom'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import { useWindowSize } from '../../../hooks/useWindowSize'
5
- import { Button } from '../../../styles'
5
+ import { Button, LinkButton } from '../../../styles'
6
6
  import { ProductIngredientDetails } from '../ProductIngredientDetails'
7
7
  import { Modal } from '../../Shared'
8
8
  import { ChevronRight } from 'react-bootstrap-icons'
@@ -12,7 +12,7 @@ import {
12
12
  IngredientContainer,
13
13
  Header,
14
14
  IngredientOption,
15
- AddIngredientButton
15
+ AddIngredientButtonWrapper
16
16
  } from './styles'
17
17
 
18
18
  export const ProductIngredient = (props) => {
@@ -81,11 +81,13 @@ export const ProductIngredient = (props) => {
81
81
  <ChevronRight />
82
82
  </IngredientOption>
83
83
  ))}
84
- <AddIngredientButton
85
- onClick={() => handleOpenIngredient(null)}
86
- >
87
- {t('ADD_INGREDIENT', 'Add ingredient')}
88
- </AddIngredientButton>
84
+ <AddIngredientButtonWrapper>
85
+ <LinkButton
86
+ onClick={() => handleOpenIngredient(null)}
87
+ >
88
+ {t('ADD_INGREDIENT', 'Add ingredient')}
89
+ </LinkButton>
90
+ </AddIngredientButtonWrapper>
89
91
  </IngredientContainer>
90
92
 
91
93
  {width >= 1000 ? (
@@ -64,13 +64,6 @@ export const IngredientOption = styled.div`
64
64
  border-bottom: 1px solid ${props => props.theme.colors.primary};
65
65
  `}
66
66
  `
67
- export const AddIngredientButton = styled.div`
68
- cursor: pointer;
69
- font-size: 14px;
67
+ export const AddIngredientButtonWrapper = styled.div`
70
68
  padding: 12px 0;
71
- color: ${props => props.theme.colors.lightGray};
72
-
73
- &:hover {
74
- color: ${props => props.theme.colors.primary};
75
- }
76
69
  `
@@ -16,13 +16,12 @@ import { SelectPosGuide } from '../SelectPosGuide'
16
16
  const ProductStepUI = (props) => {
17
17
  const {
18
18
  onClose,
19
- businessList,
19
+ businessListState,
20
20
  setBusiness,
21
21
  actionState,
22
22
  handleImport,
23
23
  handleChangeAddress,
24
24
  business,
25
- isLoading,
26
25
  orderingBusiness,
27
26
  countriesState,
28
27
  handleOpenCategoryDetails
@@ -53,12 +52,11 @@ const ProductStepUI = (props) => {
53
52
  setBusiness={setBusiness}
54
53
  setStep={setStep}
55
54
  onClose={onClose}
56
- businessList={businessList}
55
+ businessListState={businessListState}
57
56
  handleImport={handleImport}
58
57
  handleChangeAddress={handleChangeAddress}
59
58
  orderingBusiness={orderingBusiness}
60
59
  business={business}
61
- isLoading={isLoading}
62
60
  />
63
61
  )}
64
62
  {step === 3 && option === 2 && actionState?.loading && (
@@ -91,6 +89,29 @@ const ProductStepUI = (props) => {
91
89
  </ButtonWrapper>
92
90
  </ImportMenuContainer>
93
91
  )}
92
+ {step === 3 && option === 2 && !actionState?.loading && actionState?.error && (
93
+ <ImportMenuContainer>
94
+ <h2>{t('ERROR', 'Error')}</h2>
95
+ {actionState.error && typeof actionState.error === 'string' && actionState.error}
96
+ {actionState.error && typeof actionState.error === 'object' && Array.isArray(actionState.error) && (
97
+ <ul>
98
+ {actionState.error.map((item, i) => (
99
+ <React.Fragment key={i}>
100
+ {Array.isArray(item) ? (
101
+ item.map((err, index) => (
102
+ typeof err === 'string' && (
103
+ <li key={index}>{t(err.toUpperCase(), err)}</li>
104
+ )
105
+ ))
106
+ ) : (
107
+ typeof item === 'string' && <li>{t(item.toUpperCase(), item)}</li>
108
+ )}
109
+ </React.Fragment>
110
+ ))}
111
+ </ul>
112
+ )}
113
+ </ImportMenuContainer>
114
+ )}
94
115
  {step === 2 && option === 3 && (
95
116
  <UploadMenuGuide
96
117
  handleBack={() => setStep(1)}
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
1
+ import React, { useState } from 'react'
2
2
  import { useLanguage, useUtils } from 'ordering-components-admin-external'
3
3
  import BsChevronRight from '@meronex/icons/bs/BsChevronRight'
4
4
  import BiImage from '@meronex/icons/bi/BiImage'
@@ -43,7 +43,8 @@ export const ProductSummary = (props) => {
43
43
  productCart,
44
44
  handleDeleteProduct,
45
45
  showProductOption,
46
- extraOpen
46
+ isExpand,
47
+ setIsExpand
47
48
  } = props
48
49
 
49
50
  const [, t] = useLanguage()
@@ -54,7 +55,6 @@ export const ProductSummary = (props) => {
54
55
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
55
56
  const [isProductPreview, setIsProductPreview] = useState(false)
56
57
  const [selectedView, setSelectedView] = useState('desktop')
57
- const [isExpand, setIsExpand] = useState(false)
58
58
 
59
59
  const productConfigOptions = [
60
60
  {
@@ -138,10 +138,6 @@ export const ProductSummary = (props) => {
138
138
  setIsExpand(prev => !prev)
139
139
  }
140
140
 
141
- useEffect(() => {
142
- if (extraOpen) setIsExpand(false)
143
- }, [extraOpen])
144
-
145
141
  return (
146
142
  <>
147
143
  <ProductDetailsContainer disabled={productState.loading}>
@@ -3,7 +3,7 @@ import { useHistory, useLocation } from 'react-router-dom'
3
3
  import { useLanguage, ProductTagsList as ProductTagsController } from 'ordering-components-admin-external'
4
4
  import Skeleton from 'react-loading-skeleton'
5
5
  import { SearchBar, SideBar } from '../../Shared'
6
- import { Button, Checkbox } from '../../../styles'
6
+ import { Button, Checkbox, LinkButton } from '../../../styles'
7
7
  import { ChevronRight, Image as ImageIcon } from 'react-bootstrap-icons'
8
8
  import { ProductTagDetails } from '../ProductTagDetails'
9
9
 
@@ -147,10 +147,12 @@ const ProductTagsListUI = (props) => {
147
147
  )}
148
148
 
149
149
  {!tagsState.loading && (
150
- <AddNewLabel
151
- onClick={e => handleOpenProductTagDetail(e, null)}
152
- >
153
- {t('ADD_NEW_LABEL', 'Add new label')}
150
+ <AddNewLabel>
151
+ <LinkButton
152
+ onClick={e => handleOpenProductTagDetail(e, null)}
153
+ >
154
+ {t('ADD_NEW_LABEL', 'Add new label')}
155
+ </LinkButton>
154
156
  </AddNewLabel>
155
157
  )}
156
158
  </TagsListContainer>
@@ -74,12 +74,5 @@ export const TagImageWrapper = styled.div`
74
74
  }
75
75
  `
76
76
  export const AddNewLabel = styled.div`
77
- width: fit-content;
78
- cursor: pointer;
79
- font-size: 14px;
80
- color: ${props => props.theme.colors.lightGray};
81
77
  margin: 15px 0;
82
- &:hover {
83
- color: ${props => props.theme.colors.primary};
84
- }
85
78
  `
@@ -16,13 +16,12 @@ import {
16
16
  export const RestaurantSelectGuide = (props) => {
17
17
  const {
18
18
  setBusiness,
19
- businessList,
19
+ businessListState,
20
20
  setStep,
21
21
  onClose,
22
22
  handleImport,
23
23
  handleChangeAddress,
24
24
  orderingBusiness,
25
- isLoading,
26
25
  business
27
26
  } = props
28
27
 
@@ -38,12 +37,12 @@ export const RestaurantSelectGuide = (props) => {
38
37
  }
39
38
 
40
39
  const handleSelectBusiness = (id) => {
41
- const _business = businessList.find(item => item._id === id)
40
+ const _business = businessListState.businesses?.find(item => item._id === id)
42
41
  setBusiness(_business)
43
42
  }
44
43
 
45
44
  useEffect(() => {
46
- const _options = businessList?.map(item => {
45
+ const _options = businessListState.businesses?.map(item => {
47
46
  return {
48
47
  value: item._id,
49
48
  content: (
@@ -56,7 +55,7 @@ export const RestaurantSelectGuide = (props) => {
56
55
  }
57
56
  })
58
57
  setOptions(_options)
59
- }, [businessList])
58
+ }, [businessListState?.businesses])
60
59
 
61
60
  return (
62
61
  <Container>
@@ -76,7 +75,7 @@ export const RestaurantSelectGuide = (props) => {
76
75
  countryCode={configs?.country_autocomplete?.value || '*'}
77
76
  />
78
77
  </SearchWrapper>
79
- {isLoading && (
78
+ {businessListState.loading && (
80
79
  <SelectWrapper>
81
80
  <label>
82
81
  <Skeleton height={15} width={100} />
@@ -84,24 +83,55 @@ export const RestaurantSelectGuide = (props) => {
84
83
  <Skeleton height={44} />
85
84
  </SelectWrapper>
86
85
  )}
87
- {!isLoading && options?.length > 0 && (
88
- <SelectWrapper>
89
- <label>{t('SELECT_YOUR_RESTAURANT', 'Select your restaurant')}</label>
90
- <Select
91
- options={options}
92
- className='select'
93
- defaultValue={business?._id || ''}
94
- placeholder={t('SELECT_BUSINESS', 'Select a Business')}
95
- onChange={(value) => handleSelectBusiness(value)}
96
- searchBarIsCustomLayout
97
- searchBarIsNotLazyLoad
98
- />
99
- </SelectWrapper>
100
- )}
101
- {!isLoading && options.length === 0 && (
102
- <EmptyData>
103
- {t('NO_RESULT', 'There are no results')}
104
- </EmptyData>
86
+ {!businessListState.loading && (
87
+ <>
88
+ {!businessListState.error ? (
89
+ <>
90
+ {options?.length > 0 && (
91
+ <SelectWrapper>
92
+ <label>{t('SELECT_YOUR_RESTAURANT', 'Select your restaurant')}</label>
93
+ <Select
94
+ options={options}
95
+ className='select'
96
+ defaultValue={business?._id || ''}
97
+ placeholder={t('SELECT_BUSINESS', 'Select a Business')}
98
+ onChange={(value) => handleSelectBusiness(value)}
99
+ searchBarIsCustomLayout
100
+ searchBarIsNotLazyLoad
101
+ />
102
+ </SelectWrapper>
103
+ )}
104
+ {options.length === 0 && (
105
+ <EmptyData>
106
+ {t('NO_RESULT', 'There are no results')}
107
+ </EmptyData>
108
+ )}
109
+ </>
110
+ ) : (
111
+ <>
112
+ <EmptyData>
113
+ {businessListState.error && typeof businessListState.error === 'string' && businessListState.error}
114
+ {businessListState.error && typeof businessListState.error === 'object' && Array.isArray(businessListState.error) && (
115
+ <ul>
116
+ {businessListState.error.map((item, i) => (
117
+ <React.Fragment key={i}>
118
+ {Array.isArray(item) ? (
119
+ item.map((err, index) => (
120
+ typeof err === 'string' && (
121
+ <li key={index}>{t(err.toUpperCase(), err)}</li>
122
+ )
123
+ ))
124
+ ) : (
125
+ typeof item === 'string' && <li>{t(item.toUpperCase(), item)}</li>
126
+ )}
127
+ </React.Fragment>
128
+ ))}
129
+ </ul>
130
+ )}
131
+ </EmptyData>
132
+ </>
133
+ )}
134
+ </>
105
135
  )}
106
136
  <ButtonWrapper>
107
137
  <span onClick={() => onClose()}>{t('SKIP', 'Skip')}</span>
@@ -138,6 +138,20 @@ export const SeoOptions = (props) => {
138
138
  descriptionRef.current.value = data?.description
139
139
  }
140
140
 
141
+ const onUpdateClick = () => {
142
+ if (formState?.changes?.slug) {
143
+ const format = /[ `!@#$%^&*()+\-=[\]{};':"\\|,.<>/?~]/
144
+ if (format.test(formState?.changes?.slug)) {
145
+ setAlertState({
146
+ open: true,
147
+ content: [t('SLUG_NOT_ALLOWED_SPECIAL_CHARACTERS', 'The slug is not allowed special characters.')]
148
+ })
149
+ return
150
+ }
151
+ }
152
+ handleUpdateClick()
153
+ }
154
+
141
155
  useEffect(() => {
142
156
  titleRef.current.value = data?.seo_title ?? ''
143
157
  descriptionRef.current.value = data?.seo_description ?? ''
@@ -268,7 +282,7 @@ export const SeoOptions = (props) => {
268
282
  color='primary'
269
283
  borderRadius='5px'
270
284
  disabled={formState.loading || Object.keys(formState?.changes).length === 0}
271
- onClick={() => handleUpdateClick()}
285
+ onClick={() => onUpdateClick()}
272
286
  >
273
287
  {formState.loading ? t('UPDATING', 'Updating') : t('SAVE', 'Save')}
274
288
  </Button>
@@ -33,7 +33,8 @@ const SingleBusinessUI = (props) => {
33
33
  handleOpenBusinessDetails,
34
34
  detailsBusinessId,
35
35
  businessIds,
36
- handleChangeBusinessIds
36
+ handleChangeBusinessIds,
37
+ citiesList
37
38
  } = props
38
39
 
39
40
  const [, t] = useLanguage()
@@ -49,6 +50,11 @@ const SingleBusinessUI = (props) => {
49
50
  handleOpenBusinessDetails(businessState?.business)
50
51
  }
51
52
 
53
+ const getCityName = (id) => {
54
+ const found = citiesList?.find(city => city.id === id)
55
+ return found?.name || ''
56
+ }
57
+
52
58
  return (
53
59
  <>
54
60
  {viewMethod === 'list' && (
@@ -125,7 +131,7 @@ const SingleBusinessUI = (props) => {
125
131
  </WrapperImage>
126
132
  <InfoBlock>
127
133
  <p className='bold'>{businessState?.business?.name}</p>
128
- <p>{businessState?.business?.city?.name}</p>
134
+ <p>{getCityName(businessState?.business?.city_id)}</p>
129
135
  </InfoBlock>
130
136
  </BusinessGeneralInfo>
131
137
  </td>
@@ -201,7 +207,7 @@ const SingleBusinessUI = (props) => {
201
207
  </BusinessHeader>
202
208
  <BusinessContent>
203
209
  <h1>{businessState?.business?.name}</h1>
204
- <p>{businessState?.business?.city?.name}</p>
210
+ <p>{getCityName(businessState?.business?.city_id)}</p>
205
211
  <BusinessActionContainer>
206
212
  <span>{t('ID', 'ID')} {businessState?.business?.id}</span>
207
213
  <BusinessEnableWrapper className='business_enable_control'>
@@ -35,7 +35,8 @@ const CustomerDetailsUI = (props) => {
35
35
  userState,
36
36
  handleDeleteUser,
37
37
  handleParentSidebarMove,
38
- handleChangeActiveUser
38
+ handleChangeActiveUser,
39
+ setSideBarWidth
39
40
  } = props
40
41
 
41
42
  const history = useHistory()
@@ -72,7 +73,8 @@ const CustomerDetailsUI = (props) => {
72
73
 
73
74
  const handleClickMenu = (key, isInitialRender) => {
74
75
  setShowOption(key)
75
- handleParentSidebarMove(500)
76
+ setSideBarWidth(isExpand ? width : 1000)
77
+ handleParentSidebarMove(isExpand ? width / 2 : 500)
76
78
  setIsOpenMenu(true)
77
79
  if (!isInitialRender) {
78
80
  const enabled = query.get('enabled')
@@ -82,6 +84,7 @@ const CustomerDetailsUI = (props) => {
82
84
  }
83
85
 
84
86
  const handleCloseMenu = () => {
87
+ setSideBarWidth(isExpand ? width : 500)
85
88
  handleParentSidebarMove(0)
86
89
  setShowOption(null)
87
90
  setIsOpenMenu(false)
@@ -104,10 +107,6 @@ const CustomerDetailsUI = (props) => {
104
107
  setShowOption(null)
105
108
  }, [userState?.user?.id])
106
109
 
107
- useEffect(() => {
108
- if (isOpenMenu) setIsExpand(false)
109
- }, [isOpenMenu])
110
-
111
110
  useEffect(() => {
112
111
  if (userState.loading) return
113
112
  const section = query.get('section')
@@ -216,11 +215,10 @@ const CustomerDetailsUI = (props) => {
216
215
 
217
216
  {isOpenMenu && (
218
217
  <SideBar
219
- sidebarId='customer_details_menu'
220
218
  open={isOpenMenu}
221
219
  onClose={() => handleCloseMenu()}
222
220
  isBorderShow
223
- defaultSideBarWidth={500 + menuMoveDistance}
221
+ defaultSideBarWidth={isExpand ? width / 2 : 500 + menuMoveDistance}
224
222
  moveDistance={menuMoveDistance}
225
223
  >
226
224
  {showOption === 'user_details' && (
@@ -61,6 +61,7 @@ const CustomersListingUI = (props) => {
61
61
  const [isOpenUserDetails, setIsOpenUserDetails] = useState(false)
62
62
  const [openUser, setOpenUser] = useState(null)
63
63
  const [openUserAddForm, setOpenUserAddForm] = useState(false)
64
+ const [sideBarWidth, setSideBarWidth] = useState(500)
64
65
  const [moveDistance, setMoveDistance] = useState(0)
65
66
 
66
67
  const orderList = [
@@ -73,6 +74,7 @@ const CustomersListingUI = (props) => {
73
74
  setIsOpenUserDetails(false)
74
75
  setOpenUser(null)
75
76
  setQueryId(null)
77
+ setSideBarWidth(500)
76
78
  moveDistance && setMoveDistance(0)
77
79
  const enabled = selectedUserActiveState ? 'active' : 'inactive'
78
80
  history.replace(`${location.pathname}?enabled=${enabled}`)
@@ -187,7 +189,7 @@ const CustomersListingUI = (props) => {
187
189
  sidebarId='customer_details'
188
190
  open={isOpenUserDetails}
189
191
  onClose={() => handleBackRedirect()}
190
- defaultSideBarWidth={500 + moveDistance}
192
+ defaultSideBarWidth={sideBarWidth}
191
193
  moveDistance={moveDistance}
192
194
  >
193
195
  <CustomerDetails
@@ -197,6 +199,7 @@ const CustomersListingUI = (props) => {
197
199
  handleSuccessDeleteUser={handleSuccessDeleteUser}
198
200
  onClose={() => handleBackRedirect()}
199
201
  handleParentSidebarMove={val => setMoveDistance(val)}
202
+ setSideBarWidth={setSideBarWidth}
200
203
  handleChangeActiveUser={handleChangeActiveUser}
201
204
  />
202
205
  </SideBar>
@@ -4,7 +4,7 @@ import { useLanguage, useUtils } from 'ordering-components-admin-external'
4
4
  import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
5
5
 
6
6
  import { Envelope, Phone, CheckSquareFill, Square } from 'react-bootstrap-icons'
7
- import { Switch } from '../../../styles'
7
+ import { Switch, LinkButton } from '../../../styles'
8
8
  import { ConfirmAdmin, Pagination, ColumnAllowSettingPopover } from '../../Shared'
9
9
 
10
10
  import {
@@ -19,7 +19,6 @@ import {
19
19
  UserTypeWrapper,
20
20
  UserEnableWrapper,
21
21
  WrapperPagination,
22
- AddNewUserButton,
23
22
  UsersBottomContainer,
24
23
  VerifiedItemsContainer,
25
24
  VerifiedItem,
@@ -311,9 +310,9 @@ export const ProfessionalList = (props) => {
311
310
  </UsersTable>
312
311
  </UserTableWrapper>
313
312
  <UsersBottomContainer>
314
- <AddNewUserButton onClick={() => handleOpenUserAddForm()}>
313
+ <LinkButton onClick={() => handleOpenUserAddForm()}>
315
314
  {t('ADD_NEW_USER', 'Add new user')}
316
- </AddNewUserButton>
315
+ </LinkButton>
317
316
  {usersList?.users.length > 0 && (
318
317
  <WrapperPagination>
319
318
  <Pagination
@@ -189,13 +189,6 @@ export const WrapperPagination = styled.div`
189
189
  align-items: center;
190
190
  `
191
191
 
192
- export const AddNewUserButton = styled.div`
193
- cursor: pointer;
194
- color: ${props => props.theme.colors.primary};
195
- width: fit-content;
196
- font-size: 14px;
197
- `
198
-
199
192
  export const UsersBottomContainer = styled.div`
200
193
  display: flex;
201
194
  flex-wrap: wrap;