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
@@ -157,11 +157,11 @@ export const OrdersTable = (props) => {
157
157
  return finalTaget
158
158
  }
159
159
 
160
- const getStatusClassName = (minutes) => {
161
- if (isNaN(Number(minutes))) return 'in_time'
162
- const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
163
- return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
164
- }
160
+ // const getStatusClassName = (minutes) => {
161
+ // if (isNaN(Number(minutes))) return 'in_time'
162
+ // const delayTime = configState?.configs?.order_deadlines_delayed_time?.value
163
+ // return minutes > 0 ? 'in_time' : Math.abs(minutes) <= delayTime ? 'at_risk' : 'delayed'
164
+ // }
165
165
 
166
166
  useEffect(() => {
167
167
  const interval = setInterval(() => {
@@ -611,7 +611,7 @@ export const OrdersTable = (props) => {
611
611
  className={parseInt(orderDetailId) === order.id ? 'active' : ''}
612
612
  onClick={(e) => handleClickOrder(order, e)}
613
613
  data-tour={i === 0 ? 'tour_start' : ''}
614
- data-status={isEnabledRowInColor && getStatusClassName(getDelayMinutes(order))}
614
+ data-status={isEnabledRowInColor && order?.time_status}
615
615
  >
616
616
  <tr>
617
617
  {Object.keys(allowColumns).filter(col => allowColumns[col]?.visable)
@@ -621,7 +621,7 @@ export const OrdersTable = (props) => {
621
621
  return (
622
622
  <td key={`slaBar${i}-${index}`}>
623
623
  <Timestatus
624
- timeState={getStatusClassName(getDelayMinutes(order))}
624
+ timeState={order?.time_status}
625
625
  />
626
626
  </td>
627
627
  )
@@ -807,7 +807,7 @@ export const OrdersTable = (props) => {
807
807
  <td className='timer' key={`timer${i}-${index}`}>
808
808
  <Timer>
809
809
  <p className='bold'>{t('TIMER', 'Timer')}</p>
810
- <p className={getStatusClassName(getDelayMinutes(order))}>{displayDelayedTime(order)}</p>
810
+ <p className={order?.time_status}>{displayDelayedTime(order)}</p>
811
811
  </Timer>
812
812
  </td>
813
813
  )
@@ -1,7 +1,7 @@
1
1
  import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage, PagesList as PagesListController } from 'ordering-components-admin-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
- import { Button, IconButton, Switch } from '../../../styles'
4
+ import { Button, IconButton, Switch, LinkButton } from '../../../styles'
5
5
  import { Modal, Pagination, SearchBar } from '../../Shared'
6
6
  import { Dropdown, DropdownButton } from 'react-bootstrap'
7
7
  import FiMoreVertical from '@meronex/icons/fi/FiMoreVertical'
@@ -20,8 +20,7 @@ import {
20
20
  ActionsContainer,
21
21
  EnableWrapper,
22
22
  ActionSelectorWrapper,
23
- PagesBottomContainer,
24
- AddNewPageButton
23
+ PagesBottomContainer
25
24
  } from './styles'
26
25
 
27
26
  const CmsUI = (props) => {
@@ -187,9 +186,9 @@ const CmsUI = (props) => {
187
186
  </PageListTable>
188
187
  {!pagesListState.loading && (
189
188
  <PagesBottomContainer>
190
- <AddNewPageButton onClick={() => handleEditPage(null)}>
189
+ <LinkButton onClick={() => handleEditPage(null)}>
191
190
  {t('ADD_NEW_STATIC_PAGE', 'Add new static page')}
192
- </AddNewPageButton>
191
+ </LinkButton>
193
192
  {currentPages?.length > 0 && (
194
193
  <Pagination
195
194
  currentPage={currentPage}
@@ -208,9 +208,3 @@ export const PagesBottomContainer = styled.div`
208
208
  row-gap: 10px;
209
209
  margin: 15px 0 38px 0;
210
210
  `
211
-
212
- export const AddNewPageButton = styled.div`
213
- cursor: pointer;
214
- font-size: 12px;
215
- color: ${props => props.theme.colors.primary};
216
- `
@@ -6,7 +6,7 @@ import { Pagination, SideBar, Confirm } from '../../Shared'
6
6
  import { Dropdown, DropdownButton } from 'react-bootstrap'
7
7
  import { useTheme } from 'styled-components'
8
8
  import FiMoreVertical from '@meronex/icons/fi/FiMoreVertical'
9
- import { Switch } from '../../../styles'
9
+ import { Switch, LinkButton } from '../../../styles'
10
10
  import { CountryDetails } from '../CountryDetails'
11
11
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
12
12
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
@@ -19,8 +19,7 @@ import {
19
19
  CountryWrapper,
20
20
  CheckboxWrapper,
21
21
  CountryName,
22
- PagesBottomContainer,
23
- AddNewPageButton
22
+ PagesBottomContainer
24
23
  } from './styles'
25
24
 
26
25
  export const CountriesList = (props) => {
@@ -223,14 +222,14 @@ export const CountriesList = (props) => {
223
222
 
224
223
  {!countriesState.loading && (
225
224
  <PagesBottomContainer>
226
- <AddNewPageButton
225
+ <LinkButton
227
226
  onClick={() => {
228
227
  setSelectedCountry(null)
229
228
  setOpenDetails(true)
230
229
  }}
231
230
  >
232
231
  {t('ADD_NEW_COUNTRY ', 'Add new country')}
233
- </AddNewPageButton>
232
+ </LinkButton>
234
233
  {currentCountries?.length > 0 && (
235
234
  <Pagination
236
235
  currentPage={currentPage}
@@ -159,9 +159,3 @@ export const PagesBottomContainer = styled.div`
159
159
  row-gap: 10px;
160
160
  margin: 15px 0 38px 0;
161
161
  `
162
-
163
- export const AddNewPageButton = styled.div`
164
- cursor: pointer;
165
- font-size: 14px;
166
- color: ${props => props.theme.colors.primary};
167
- `
@@ -7,7 +7,7 @@ import { useTheme } from 'styled-components'
7
7
  import FiMoreVertical from '@meronex/icons/fi/FiMoreVertical'
8
8
  import RiCheckboxBlankLine from '@meronex/icons/ri/RiCheckboxBlankLine'
9
9
  import RiCheckboxFill from '@meronex/icons/ri/RiCheckboxFill'
10
- import { Switch } from '../../../styles'
10
+ import { Switch, LinkButton } from '../../../styles'
11
11
  import { CitySelector, Confirm, Pagination, SideBar } from '../../Shared'
12
12
  import { CountrySelector } from '../CountrySelector'
13
13
  import { ZoneDropdownDetails } from '../ZoneDropdownDetails'
@@ -22,8 +22,7 @@ import {
22
22
  CityName,
23
23
  CountryName,
24
24
  CheckboxWrapper,
25
- PagesBottomContainer,
26
- AddNewPageButton
25
+ PagesBottomContainer
27
26
  } from './styles'
28
27
 
29
28
  export const DropdownOptionList = (props) => {
@@ -237,11 +236,11 @@ export const DropdownOptionList = (props) => {
237
236
 
238
237
  {!dropdownOptionsState.loading && (
239
238
  <PagesBottomContainer>
240
- <AddNewPageButton
239
+ <LinkButton
241
240
  onClick={() => handleOpenZoneDropdownDetails(null)}
242
241
  >
243
242
  {t('ADD_NEW_ZONE_DROPDOWN ', 'Add new zone dropdown')}
244
- </AddNewPageButton>
243
+ </LinkButton>
245
244
  {currentDropdownOptions?.length > 0 && (
246
245
  <Pagination
247
246
  currentPage={currentPage}
@@ -222,9 +222,3 @@ export const PagesBottomContainer = styled.div`
222
222
  row-gap: 10px;
223
223
  margin: 15px 0;
224
224
  `
225
-
226
- export const AddNewPageButton = styled.div`
227
- cursor: pointer;
228
- font-size: 14px;
229
- color: ${props => props.theme.colors.primary};
230
- `
@@ -2,14 +2,14 @@ import React, { useState, useEffect, useRef } from 'react'
2
2
  import { useLanguage, LanguageTransTable as LanguageTransTableController } from 'ordering-components-admin-external'
3
3
  import Skeleton from 'react-loading-skeleton'
4
4
  import { Alert, Pagination } from '../../Shared'
5
+ import { LinkButton } from '../../../styles'
5
6
 
6
7
  import {
7
8
  TranslationTableContainer,
8
9
  TranslationTable,
9
10
  TableHeader,
10
11
  TableBody,
11
- TransBottomContainer,
12
- AddNewTransButton
12
+ TransBottomContainer
13
13
  } from './styles'
14
14
 
15
15
  const LanguageTransTableUI = (props) => {
@@ -183,9 +183,9 @@ const LanguageTransTableUI = (props) => {
183
183
  </TranslationTable>
184
184
  {!translationList.loading && (
185
185
  <TransBottomContainer>
186
- <AddNewTransButton onClick={() => setIsShowCreation(true)}>
186
+ <LinkButton onClick={() => setIsShowCreation(true)}>
187
187
  {t('ADD_NEW_KEY', 'Add new key')}
188
- </AddNewTransButton>
188
+ </LinkButton>
189
189
  {currentPages?.length > 0 && (
190
190
  <Pagination
191
191
  currentPage={currentPage}
@@ -77,9 +77,3 @@ export const TransBottomContainer = styled.div`
77
77
  row-gap: 10px;
78
78
  margin: 15px 0 38px 0;
79
79
  `
80
-
81
- export const AddNewTransButton = styled.div`
82
- cursor: pointer;
83
- font-size: 12px;
84
- color: ${props => props.theme.colors.primary};
85
- `
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useHistory, useLocation } from 'react-router-dom'
3
3
  import { useLanguage, PlaceList as PlaceListController } from 'ordering-components-admin-external'
4
4
  import { useInfoShare } from '../../../contexts/InfoShareContext'
5
- import { Button, IconButton, Switch } from '../../../styles'
5
+ import { Button, IconButton, Switch, LinkButton } from '../../../styles'
6
6
  import { List as MenuIcon } from 'react-bootstrap-icons'
7
7
  import Skeleton from 'react-loading-skeleton'
8
8
  import { Dropdown, DropdownButton } from 'react-bootstrap'
@@ -32,8 +32,7 @@ import {
32
32
  CityAdministrator,
33
33
  CountryName,
34
34
  CheckboxWrapper,
35
- PagesBottomContainer,
36
- AddNewPageButton
35
+ PagesBottomContainer
37
36
  } from './styles'
38
37
 
39
38
  const PlaceListingUI = (props) => {
@@ -401,11 +400,11 @@ const PlaceListingUI = (props) => {
401
400
 
402
401
  {!countriesState.loading && (
403
402
  <PagesBottomContainer>
404
- <AddNewPageButton
403
+ <LinkButton
405
404
  onClick={() => handleOpenCityDetails(null)}
406
405
  >
407
406
  {t('ADD_NEW_CITY', 'Add new city')}
408
- </AddNewPageButton>
407
+ </LinkButton>
409
408
  {currentCities?.length > 0 && (
410
409
  <Pagination
411
410
  currentPage={currentPage}
@@ -327,9 +327,3 @@ export const PagesBottomContainer = styled.div`
327
327
  row-gap: 10px;
328
328
  margin: 15px 0;
329
329
  `
330
-
331
- export const AddNewPageButton = styled.div`
332
- cursor: pointer;
333
- font-size: 14px;
334
- color: ${props => props.theme.colors.primary};
335
- `
@@ -33,7 +33,7 @@ export const SettingsListUI = (props) => {
33
33
  saveConfig
34
34
  } = props
35
35
 
36
- const settingsNotAllowed = ['guest_checkout_enabled', 'allowed_order_types_guest_checkout']
36
+ const settingsNotAllowed = ['']
37
37
 
38
38
  const [, t] = useLanguage()
39
39
  const [alertState, setAlertState] = useState({ open: false, content: [] })
@@ -145,51 +145,51 @@ export const SettingsListUI = (props) => {
145
145
  {
146
146
  configs.length > 0 && configs.map((config, i) => (
147
147
  !settingsNotAllowed.includes(config.key) && (
148
- <div key={i}>
149
- {
150
- config.type === 1 && (
151
- <FormGroupText className='form-group'>
152
- <label>{config?.name}</label>
153
- {config?.description && <Description>{config?.description}</Description>}
154
- <input
155
- type='text'
156
- value={config?.value}
157
- onChange={(e) => handleInputChange(e.target.value, config?.id)}
158
- onKeyPress={(e) => handleKeyPress(e, config?.key)}
159
- className='form-control'
160
- placeholder={config?.name}
161
- />
162
- </FormGroupText>
163
- )
164
- }
165
- {
166
- config.type === 2 && (
167
- config.key === 'country_autocomplete' ? (
168
- <SettingsCountryFilter
169
- defaultValue={config?.value}
170
- handleSelectChange={(value) => handleInputChange(value, config?.id)}
171
- label={config?.name}
172
- description={config?.description}
173
- />
174
- ) : (
175
- <SettingsSelectUI
176
- config={config}
177
- defaultValue={config?.value}
178
- handleSelectChange={(value) => handleInputChange(value, config?.id)}
179
- />
180
- )
148
+ <div key={i}>
149
+ {
150
+ config.type === 1 && (
151
+ <FormGroupText className='form-group'>
152
+ <label>{config?.name}</label>
153
+ {config?.description && <Description>{config?.description}</Description>}
154
+ <input
155
+ type='text'
156
+ value={config?.value}
157
+ onChange={(e) => handleInputChange(e.target.value, config?.id)}
158
+ onKeyPress={(e) => handleKeyPress(e, config?.key)}
159
+ className='form-control'
160
+ placeholder={config?.name}
161
+ />
162
+ </FormGroupText>
163
+ )
164
+ }
165
+ {
166
+ config.type === 2 && (
167
+ config.key === 'country_autocomplete' ? (
168
+ <SettingsCountryFilter
169
+ defaultValue={config?.value}
170
+ handleSelectChange={(value) => handleInputChange(value, config?.id)}
171
+ label={config?.name}
172
+ description={config?.description}
173
+ />
174
+ ) : (
175
+ <SettingsSelectUI
176
+ config={config}
177
+ defaultValue={config?.value}
178
+ handleSelectChange={(value) => handleInputChange(value, config?.id)}
179
+ />
181
180
  )
182
- }
183
- {
184
- config.type === 3 && (
185
- <CheckBoxWrapper>
186
- {config?.name && (
187
- <label>{config?.name}</label>
188
- )}
189
- {config?.description && (
190
- <p>{config?.description}</p>
191
- )}
192
- {
181
+ )
182
+ }
183
+ {
184
+ config.type === 3 && (
185
+ <CheckBoxWrapper>
186
+ {config?.name && (
187
+ <label>{config?.name}</label>
188
+ )}
189
+ {config?.description && (
190
+ <p>{config?.description}</p>
191
+ )}
192
+ {
193
193
  config?.options?.length > 0 && config?.options?.map((item, j) => (
194
194
  <FormGroupWrapper key={j}>
195
195
  <FormGroupCheck className='checkbox'>
@@ -206,36 +206,36 @@ export const SettingsListUI = (props) => {
206
206
  </FormGroupCheck>
207
207
  </FormGroupWrapper>
208
208
  ))
209
- }
210
- {
211
- !config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>
212
- }
213
- </CheckBoxWrapper>
214
- )
215
- }
216
- {
217
- config.type === 4 && (
218
- config.key === 'driver_tip_options' ? (
219
- <FormGroupText className='form-group'>
209
+ }
210
+ {
211
+ !config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>
212
+ }
213
+ </CheckBoxWrapper>
214
+ )
215
+ }
216
+ {
217
+ config.type === 4 && (
218
+ config.key === 'driver_tip_options' ? (
219
+ <FormGroupText className='form-group'>
220
+ <label>{config?.name}</label>
221
+ {config?.description && <Description>{config?.description}</Description>}
222
+ <input
223
+ type='text'
224
+ defaultValue={formatArray(config?.value)}
225
+ onChange={(e) => handleInputChange(e.target.value, config?.id)}
226
+ className='form-control'
227
+ placeholder='placeholder'
228
+ />
229
+ </FormGroupText>
230
+ ) : (
231
+ <CheckBoxWrapper>
232
+ {config?.name && (
220
233
  <label>{config?.name}</label>
221
- {config?.description && <Description>{config?.description}</Description>}
222
- <input
223
- type='text'
224
- defaultValue={formatArray(config?.value)}
225
- onChange={(e) => handleInputChange(e.target.value, config?.id)}
226
- className='form-control'
227
- placeholder='placeholder'
228
- />
229
- </FormGroupText>
230
- ) : (
231
- <CheckBoxWrapper>
232
- {config?.name && (
233
- <label>{config?.name}</label>
234
- )}
235
- {config?.description && (
236
- <p>{config?.description}</p>
237
- )}
238
- {
234
+ )}
235
+ {config?.description && (
236
+ <p>{config?.description}</p>
237
+ )}
238
+ {
239
239
  config?.options?.length > 0 && config?.options?.map((item, j) => (
240
240
  <FormGroupWrapper key={j}>
241
241
  <FormGroupCheck className='checkbox'>
@@ -252,20 +252,20 @@ export const SettingsListUI = (props) => {
252
252
  </FormGroupCheck>
253
253
  </FormGroupWrapper>
254
254
  ))
255
- }
256
- {!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>}
257
- </CheckBoxWrapper>
258
- )
259
- )
260
- }
261
- {
262
- config.type === 5 && (
263
- <SettingsImage
264
- config={config}
265
- saveConfig={saveConfig}
266
- />
255
+ }
256
+ {!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>}
257
+ </CheckBoxWrapper>
267
258
  )
268
- }
259
+ )
260
+ }
261
+ {
262
+ config.type === 5 && (
263
+ <SettingsImage
264
+ config={config}
265
+ saveConfig={saveConfig}
266
+ />
267
+ )
268
+ }
269
269
  {/* {config.type === 6 && (
270
270
  <>
271
271
  <FormGroupText className='form-group'>
@@ -289,7 +289,7 @@ export const SettingsListUI = (props) => {
289
289
  </FormGroupText>
290
290
  </>
291
291
  )} */}
292
- </div>
292
+ </div>
293
293
  )
294
294
  ))
295
295
  }
@@ -0,0 +1,172 @@
1
+ import React, { useState, useRef, useEffect } from 'react'
2
+ import Skeleton from 'react-loading-skeleton'
3
+ import {
4
+ useLanguage,
5
+ DragAndDrop,
6
+ ExamineClick
7
+ } from 'ordering-components-admin-external'
8
+ import { Button, Input } from '../../../../styles'
9
+ import { XLg } from 'react-bootstrap-icons'
10
+ import BiImage from '@meronex/icons/bi/BiImage'
11
+ import { bytesConverter } from '../../../../utils'
12
+ import { Alert, Confirm } from '../../../Shared'
13
+
14
+ import {
15
+ InsertImageContainer,
16
+ ImageListContainer,
17
+ WrapperImage,
18
+ WrapperInput,
19
+ NewImage,
20
+ Image,
21
+ SkeletonWrapper,
22
+ UploadImageIconContainer,
23
+ UploadImageIcon,
24
+ CloseButton
25
+ } from './styles'
26
+
27
+ export const InsertImage = (props) => {
28
+ const {
29
+ imageListState,
30
+ editorContext,
31
+ onClose,
32
+ handleRestoreEditor,
33
+ insertImageState,
34
+ handleInsertImage,
35
+ handleDeleteImage,
36
+ selectedImageUrl,
37
+ setSelectedImageUrl
38
+ } = props
39
+ const [, t] = useLanguage()
40
+ const [imageUrl, setImageUrl] = useState(null)
41
+ const imageInputRef = useRef(null)
42
+ const [alertState, setAlertState] = useState({ open: false, content: [] })
43
+ const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
44
+
45
+ const handleInsertClick = () => {
46
+ handleRestoreEditor()
47
+ editorContext.invoke('editor.insertImage', imageUrl)
48
+ onClose()
49
+ }
50
+
51
+ const handleClickImage = (type) => {
52
+ imageInputRef.current.click()
53
+ }
54
+
55
+ const handleFiles = (files) => {
56
+ if (files.length === 1) {
57
+ const type = files[0].type.split('/')[0]
58
+ if (type !== 'image') {
59
+ setAlertState({
60
+ open: true,
61
+ content: [t('ERROR_ONLY_IMAGES', 'Only images can be accepted')]
62
+ })
63
+ return
64
+ }
65
+
66
+ if (bytesConverter(files[0]?.size) > 2048) {
67
+ setAlertState({
68
+ open: true,
69
+ content: [t('IMAGE_MAXIMUM_SIZE', 'The maximum image size is 2 megabytes')]
70
+ })
71
+ return
72
+ }
73
+
74
+ setConfirm({
75
+ open: true,
76
+ content: t('QUESTION_ADD_GALLERY_IMAGE', 'Are you sure that you want to add this gallery image?'),
77
+ handleOnAccept: () => {
78
+ setConfirm({ ...confirm, open: false })
79
+ handleInsertImage(files[0])
80
+ }
81
+ })
82
+ }
83
+ }
84
+
85
+ const onDeleteClick = (imageId) => {
86
+ setConfirm({
87
+ open: true,
88
+ content: t('QUESTION_DELETE_GALLERY_ITEM', 'Are you sure that you want to delete this image?'),
89
+ handleOnAccept: () => {
90
+ setConfirm({ ...confirm, open: false })
91
+ handleDeleteImage(imageId)
92
+ }
93
+ })
94
+ }
95
+
96
+ useEffect(() => {
97
+ setImageUrl(selectedImageUrl)
98
+ }, [selectedImageUrl])
99
+
100
+ return (
101
+ <InsertImageContainer>
102
+ <h1>{t('INSERT_IMAGE', 'Insert image')}</h1>
103
+ <WrapperInput>
104
+ <label>{t('IMAGE_URL', 'Image URL')}</label>
105
+ <Input
106
+ value={imageUrl || ''}
107
+ onChange={e => setImageUrl(e.target.value)}
108
+ />
109
+ </WrapperInput>
110
+ <Button
111
+ borderRadius='8px'
112
+ color='primary'
113
+ onClick={() => handleInsertClick()}
114
+ >
115
+ {t('INSERT', 'Insert')}
116
+ </Button>
117
+ <NewImage>
118
+ <Image onClick={() => handleClickImage()} isImage={insertImageState?.change?.soucre}>
119
+ <ExamineClick onFiles={handleFiles} childRef={(e) => { imageInputRef.current = e }} accept='image/png, image/jpeg, image/jpg' disabled={insertImageState.loading}>
120
+ <DragAndDrop onDrop={dataTransfer => handleFiles(dataTransfer.files)} accept='image/png, image/jpeg, image/jpg' disabled={insertImageState.loading}>
121
+ {
122
+ insertImageState.loading
123
+ ? (<SkeletonWrapper><Skeleton /></SkeletonWrapper>)
124
+ : insertImageState?.change?.soucre && <img src={insertImageState?.change?.soucre} alt='image' loading='lazy' />
125
+ }
126
+ <UploadImageIconContainer>
127
+ <UploadImageIcon>
128
+ <BiImage />
129
+ <span>{t('DRAG_DROP_IMAGE_HERE', 'Put your image here')}</span>
130
+ </UploadImageIcon>
131
+ </UploadImageIconContainer>
132
+ </DragAndDrop>
133
+ </ExamineClick>
134
+ </Image>
135
+ </NewImage>
136
+ <ImageListContainer>
137
+ {imageListState.images.map(image => (
138
+ <WrapperImage
139
+ key={image.id}
140
+ onClick={() => setSelectedImageUrl(image?.source)}
141
+ >
142
+ <CloseButton
143
+ onClick={() => onDeleteClick(image.id)}
144
+ >
145
+ <XLg />
146
+ </CloseButton>
147
+ <img src={image?.source} alt='' />
148
+ </WrapperImage>
149
+ ))}
150
+ </ImageListContainer>
151
+ <Alert
152
+ title={t('WEB_APPNAME', 'ORDERING')}
153
+ content={alertState.content}
154
+ acceptText={t('ACCEPT', 'Accept')}
155
+ open={alertState.open}
156
+ onClose={() => setAlertState({ open: false, content: [] })}
157
+ onAccept={() => setAlertState({ open: false, content: [] })}
158
+ closeOnBackdrop={false}
159
+ />
160
+ <Confirm
161
+ title={t('WEB_APPNAME', 'Ordering')}
162
+ content={confirm.content}
163
+ acceptText={t('ACCEPT', 'Accept')}
164
+ open={confirm.open}
165
+ onClose={() => setConfirm({ ...confirm, open: false })}
166
+ onCancel={() => setConfirm({ ...confirm, open: false })}
167
+ onAccept={confirm.handleOnAccept}
168
+ closeOnBackdrop={false}
169
+ />
170
+ </InsertImageContainer>
171
+ )
172
+ }