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
@@ -0,0 +1,179 @@
1
+ import styled, { css } from 'styled-components'
2
+
3
+ export const RecoveryActionAddContainer = styled.form`
4
+ `
5
+ export const CardContainer = styled.div`
6
+ box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
7
+ border-radius: 7.6px;
8
+ padding: 25px 38px;
9
+ margin-bottom: 29px;
10
+
11
+ h2 {
12
+ font-size: 16px;
13
+ font-weight: 600;
14
+ margin: 0 0 29px 0;
15
+ }
16
+ `
17
+ export const ButtonsContainer = styled.div`
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: flex-end;
21
+ margin: 60px 0;
22
+
23
+ button {
24
+ border-radius: 8px;
25
+ height: 44px;
26
+ &:first-child {
27
+ margin: 0 10px;
28
+ }
29
+ }
30
+ `
31
+
32
+ export const InputWrapper = styled.div`
33
+ margin-bottom: 25px;
34
+
35
+ label {
36
+ font-size: 14px;
37
+ line-height: 24px;
38
+ margin-bottom: 10px;
39
+ }
40
+
41
+ input, textarea {
42
+ width: 100%;
43
+ }
44
+
45
+ .select {
46
+ border: 1px solid ${props => props.theme.colors.borderColor};
47
+ padding: 9px 0;
48
+ }
49
+ `
50
+
51
+ export const LastTimeWrapper = styled.div`
52
+ margin-top: 40px;
53
+
54
+ > h3 {
55
+ font-weight: 600;
56
+ font-size: 16px;
57
+ line-height: 24px;
58
+ margin-top: 0px;
59
+ margin-bottom: 23px;
60
+ }
61
+ `
62
+
63
+ export const TypeWrapper = styled.div`
64
+ margin-bottom: 15px;
65
+ `
66
+
67
+ export const ParentCheckBoxWrapper = styled.div`
68
+ > div {
69
+ display: flex;
70
+ align-items: center;
71
+ cursor: pointer;
72
+ width: fit-content;
73
+
74
+ svg {
75
+ font-size: 16px;
76
+ color: ${props => props.theme.colors.secundaryLight};
77
+ &.checked-icon {
78
+ color: ${props => props.theme.colors.primary};
79
+ }
80
+ }
81
+
82
+ > span {
83
+ font-size: 14px;
84
+ line-height: 24px;
85
+ margin-left: 13px;
86
+ ${props => props.theme.rtl && css`
87
+ margin-right: 13px;
88
+ margin-left: 0px;
89
+ `}
90
+ }
91
+ }
92
+ `
93
+
94
+ export const TimeContent = styled.div`
95
+ padding: 15px 0px 10px 0px;
96
+ `
97
+ export const TimeBlock = styled.div`
98
+ display: flex;
99
+ border: 1px solid ${props => props.theme.colors.gray};
100
+ box-sizing: border-box;
101
+ border-radius: 7.6px;
102
+ width: fit-content;
103
+ align-items: center;
104
+ overflow: hidden;
105
+
106
+ > span {
107
+ color: ${props => props.theme?.colors.secundaryLight};
108
+ }
109
+
110
+ > select {
111
+ height: 40px;
112
+ padding: 0px 10px;
113
+ border: none;
114
+ outline: none;
115
+ font-size: 14px;
116
+ color: ${props => props.theme?.colors.secundaryLight};
117
+ appearance: none;
118
+ }
119
+ `
120
+
121
+ export const DaysContent = styled.div`
122
+ padding: 15px 0px 10px 0px;
123
+
124
+ input {
125
+ width: 100%;
126
+ height: 44px;
127
+ border-radius: 8px !important;
128
+ padding: 0px 15px !important;
129
+ outline: none !important;
130
+ border: 1px solid ${props => props.theme.colors.gray} !important;
131
+ padding-right: 25px;
132
+ ${props => props.theme?.rtl && css`
133
+ padding-left: 25px;
134
+ padding-right: 15px;
135
+ `}
136
+ &::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */
137
+ color: ${props => props.theme.colors.secundaryLight};
138
+ opacity: 1; /* Firefox */
139
+ }
140
+
141
+ &:-ms-input-placeholder { /* Internet Explorer 10-11 */
142
+ color: ${props => props.theme.colors.secundaryLight};
143
+ }
144
+
145
+ &::-ms-input-placeholder { /* Microsoft Edge */
146
+ color: ${props => props.theme.colors.secundaryLight};
147
+ }
148
+ }
149
+
150
+ b {
151
+ border: none !important;
152
+ background: transparent !important;
153
+ box-shadow: none !important;
154
+ &:nth-child(2) {
155
+ i {
156
+ border: none !important;
157
+ box-shadow: -1px 1px 0 ${props => props.theme.colors.secundaryLight};
158
+ transform: rotate(135deg);
159
+ width: 7px !important;
160
+ height: 7px !important;
161
+ margin: 0ex 0px 0px -0.56ex !important;
162
+ }
163
+ }
164
+ &:last-child {
165
+ i {
166
+ border: none !important;
167
+ box-shadow: -1px 1px 0 ${props => props.theme.colors.secundaryLight};
168
+ transform: rotate(-45deg);
169
+ width: 7px !important;
170
+ height: 7px !important;
171
+ margin: -0.9ex 0px 0px -0.56ex !important;
172
+ }
173
+ }
174
+ }
175
+ `
176
+ export const Option = styled.div`
177
+ font-size: 14px;
178
+ line-height: 24px;
179
+ `
@@ -2,7 +2,7 @@ import React, { useState } from 'react'
2
2
  import Skeleton from 'react-loading-skeleton'
3
3
  import { useLanguage } from 'ordering-components-admin-external'
4
4
  import { ColumnAllowSettingPopover, Pagination } from '../../Shared'
5
- import { Switch } from '../../../styles'
5
+ import { Switch, LinkButton } from '../../../styles'
6
6
  import { useTheme } from 'styled-components'
7
7
 
8
8
  import {
@@ -11,8 +11,7 @@ import {
11
11
  Tbody,
12
12
  SwitchWrapper,
13
13
  DragImageWrapper,
14
- PagesBottomContainer,
15
- AddNewPageButton
14
+ PagesBottomContainer
16
15
  } from './styles'
17
16
 
18
17
  export const RecoveryActionList = (props) => {
@@ -174,11 +173,11 @@ export const RecoveryActionList = (props) => {
174
173
  </Container>
175
174
  {!recoveryActionList.loading && (
176
175
  <PagesBottomContainer>
177
- <AddNewPageButton
176
+ <LinkButton
178
177
  onClick={() => handleOpenDetail({})}
179
178
  >
180
179
  {t('ADD_NEW_RECOVERY_ACTION', 'Add new recovery action')}
181
- </AddNewPageButton>
180
+ </LinkButton>
182
181
  {recoveryActionList?.actions?.length > 0 && (
183
182
  <Pagination
184
183
  currentPage={paginationProps?.currentPage}
@@ -192,9 +192,3 @@ export const PagesBottomContainer = styled.div`
192
192
  row-gap: 10px;
193
193
  margin: 15px 0;
194
194
  `
195
-
196
- export const AddNewPageButton = styled.div`
197
- cursor: pointer;
198
- font-size: 14px;
199
- color: ${props => props.theme.colors.primary};
200
- `
@@ -5,6 +5,7 @@ import { RecoveryActionHeader } from '../RecoveryActionHeader'
5
5
  import { RecoveryActionList } from '../RecoveryActionList'
6
6
  import { SideBar } from '../../Shared'
7
7
  import { RecoveryActionDetail } from '../RecoveryActionDetail'
8
+ import { RecoveryActionAdd } from '../RecoveryActionAdd'
8
9
 
9
10
  import {
10
11
  RecoveryActionsContainer
@@ -16,10 +17,12 @@ const RecoveryActionListingUI = (props) => {
16
17
  const [isOpenDetail, setIsOpenDetail] = useState(false)
17
18
  const [selectedAction, setSelectedAction] = useState(null)
18
19
  const [selectedActionId, setSelectedActionId] = useState(null)
20
+ const [isAddMode, setIsAddMode] = useState(false)
19
21
 
20
22
  const handleCloseDetail = () => {
21
23
  setIsOpenDetail(false)
22
24
  setSelectedAction(null)
25
+ setIsAddMode(false)
23
26
  history.replace(`${location.pathname}`)
24
27
  }
25
28
 
@@ -27,6 +30,13 @@ const RecoveryActionListingUI = (props) => {
27
30
  setSelectedAction(action)
28
31
  setSelectedActionId(action?.id)
29
32
  setIsOpenDetail(true)
33
+ if (!Object.keys(action || {}).length) {
34
+ setIsAddMode(true)
35
+ history.replace(`${location.pathname}`)
36
+ return
37
+ } else {
38
+ setIsAddMode(false)
39
+ }
30
40
  if (action && !isInitialRender) {
31
41
  history.replace(`${location.pathname}?id=${action.id}`)
32
42
  }
@@ -48,13 +58,22 @@ const RecoveryActionListingUI = (props) => {
48
58
  {...props}
49
59
  handleOpenDetail={handleOpenDetail}
50
60
  />
51
- <RecoveryActionList
52
- {...props}
53
- handleOpenDetail={handleOpenDetail}
54
- selectedAction={selectedAction}
55
- />
61
+ {!isAddMode ? (
62
+ <RecoveryActionList
63
+ {...props}
64
+ handleOpenDetail={handleOpenDetail}
65
+ selectedAction={selectedAction}
66
+ />
67
+ ) : (
68
+ <RecoveryActionAdd
69
+ {...props}
70
+ action={selectedAction}
71
+ actionId={selectedActionId}
72
+ onClose={() => handleCloseDetail()}
73
+ />
74
+ )}
56
75
  </RecoveryActionsContainer>
57
- {isOpenDetail && (
76
+ {isOpenDetail && !isAddMode && (
58
77
  <SideBar
59
78
  open={isOpenDetail}
60
79
  onClose={() => handleCloseDetail()}
@@ -5,5 +5,6 @@ export const RecoveryActionsContainer = styled.div`
5
5
  padding: 20px;
6
6
  box-sizing: border-box;
7
7
  transition: all 0.5s;
8
- overflow: hidden;
8
+ max-height: 100vh;
9
+ overflow: auto;
9
10
  `
@@ -3,7 +3,7 @@ import { useLanguage, RecoveryNotificationList as RecoveryNotificationListContro
3
3
  import { useTheme } from 'styled-components'
4
4
  import Skeleton from 'react-loading-skeleton'
5
5
  import { Modal, Alert } from '../../Shared'
6
- import { Switch, Button } from '../../../styles'
6
+ import { Switch, Button, LinkButton } from '../../../styles'
7
7
  import { SingleRecoveryNotification } from '../SingleRecoveryNotification'
8
8
 
9
9
  import {
@@ -122,7 +122,11 @@ const RecoveryNotificationListUI = (props) => {
122
122
  </EmailPreviewHeader>
123
123
  <EmailPreviewContent>
124
124
  <h2>{notification?.title}</h2>
125
- <p>{notification.body}</p>
125
+ <div
126
+ dangerouslySetInnerHTML={{
127
+ __html: (notification.body)
128
+ }}
129
+ />
126
130
  </EmailPreviewContent>
127
131
  </EmailPreviewWrapper>
128
132
  )}
@@ -154,7 +158,7 @@ const RecoveryNotificationListUI = (props) => {
154
158
  </NotificationBlock>
155
159
  ))}
156
160
  <AddNewNotificationButton>
157
- <span onClick={() => setIsAddModal(true)}>{t('ADD_NEW_NOTIFICATION', 'Add new notification')}</span>
161
+ <LinkButton onClick={() => setIsAddModal(true)}>{t('ADD_NEW_NOTIFICATION', 'Add new notification')}</LinkButton>
158
162
  </AddNewNotificationButton>
159
163
  </>
160
164
  )}
@@ -48,7 +48,7 @@ export const PreivewEditWrapper = styled.div`
48
48
  export const PreviewContent = styled.div``
49
49
 
50
50
  export const EmailPreviewWrapper = styled.div`
51
- max-width: 317px;
51
+ max-width: 400px;
52
52
  margin-left: auto;
53
53
  margin-right: auto;
54
54
  border: 1px solid ${props => props.theme.colors.borderColor};
@@ -91,9 +91,10 @@ export const EmailPreviewContent = styled.div`
91
91
  text-align: center;
92
92
  font-size: 10px;
93
93
  }
94
- p {
95
- margin: 0px;
96
- font-size: 7px;
94
+
95
+ > div {
96
+ zoom: 0.4;
97
+ overflow: auto;
97
98
  }
98
99
  `
99
100
 
@@ -198,14 +199,5 @@ export const NotificationMessageContent = styled(SmsPreviewContent)`
198
199
  `
199
200
 
200
201
  export const AddNewNotificationButton = styled.div`
201
- font-size: 14px;
202
- color: ${props => props.theme.colors.lightGray};
203
202
  padding-bottom: 15px;
204
- span {
205
- cursor: pointer;
206
- }
207
-
208
- &:hover {
209
- color: ${props => props.theme.colors.primary};
210
- }
211
203
  `
@@ -2,7 +2,8 @@ import React, { useState, useEffect } from 'react'
2
2
  import { useLanguage, SingleRecoveryNotification as SingleRecoveryNotificationController } from 'ordering-components-admin-external'
3
3
  import { Input, TextArea, Button } from '../../../styles'
4
4
  import { Select } from '../../../styles/Select'
5
- import { Alert, Confirm } from '../../Shared'
5
+ import { Alert, Confirm, HtmlEditor } from '../../Shared'
6
+ import { useForm } from 'react-hook-form'
6
7
 
7
8
  import {
8
9
  Container,
@@ -20,10 +21,12 @@ const SingleRecoveryNotificationUI = (props) => {
20
21
  handleUpdateClick,
21
22
  handleDeleteClick,
22
23
  isAdd,
23
- handleClickAddBtn
24
+ handleClickAddBtn,
25
+ handleChangeItems
24
26
  } = props
25
27
 
26
28
  const [, t] = useLanguage()
29
+ const { register, handleSubmit, errors, setValue } = useForm()
27
30
 
28
31
  const [alertState, setAlertState] = useState({ open: false, content: [] })
29
32
  const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
@@ -70,9 +73,33 @@ const SingleRecoveryNotificationUI = (props) => {
70
73
  })
71
74
  }, [formState?.error])
72
75
 
76
+ useEffect(() => {
77
+ if (Object.keys(errors).length > 0) {
78
+ setAlertState({
79
+ open: true,
80
+ content: Object.values(errors).map(error => error.message)
81
+ })
82
+ }
83
+ }, [errors])
84
+
85
+ const onSubmit = () => {
86
+ if (!formState.changes?.channel && !notification?.channel) {
87
+ setAlertState({
88
+ open: true,
89
+ content: [t('VALIDATION_ERROR_REQUIRED').replace('_attribute_', t('CHANNEL', 'Channel'))]
90
+ })
91
+ return
92
+ }
93
+ if (isAdd) {
94
+ handleClickAddBtn()
95
+ } else {
96
+ handleClickUpdateBtn(notification?.id)
97
+ }
98
+ }
99
+
73
100
  return (
74
101
  <>
75
- <Container>
102
+ <Container onSubmit={handleSubmit(onSubmit)}>
76
103
  <InputWrapper>
77
104
  <label>{t('TITLE', 'Title')}</label>
78
105
  <Input
@@ -83,19 +110,10 @@ const SingleRecoveryNotificationUI = (props) => {
83
110
  ? formState?.changes?.title
84
111
  : notification?.title ?? ''
85
112
  }
86
- onChange={handleChangeInput}
87
- />
88
- </InputWrapper>
89
- <InputWrapper>
90
- <label>{t('MESSAGE', 'Message')}</label>
91
- <TextArea
92
- name='body'
93
- placeholder={t('WRITE_MESSAGE', 'Write a message')}
94
- defaultValue={
95
- formState?.changes?.body
96
- ? formState?.changes?.body
97
- : notification?.body ?? ''
98
- }
113
+ ref={register({
114
+ required: t(
115
+ 'VALIDATION_ERROR_REQUIRED').replace('_attribute_', t('TITLE', 'Title'))
116
+ })}
99
117
  onChange={handleChangeInput}
100
118
  />
101
119
  </InputWrapper>
@@ -110,41 +128,72 @@ const SingleRecoveryNotificationUI = (props) => {
110
128
  : notification?.channel ?? ''
111
129
  }
112
130
  options={channelList}
113
- onChange={val => handleChangeSelect('channel', val)}
131
+ onChange={val => {
132
+ setValue('body', '')
133
+ handleChangeItems({ channel: val, body: '' })
134
+ }}
114
135
  />
115
136
  </InputWrapper>
116
137
  )}
117
- </Container>
118
- <ButtonGroup>
119
- {isAdd ? (
120
- <Button
121
- color='primary'
122
- borderRadius='8px'
123
- disabled={Object.keys(formState?.changes).length === 0 || formState?.loading}
124
- onClick={() => handleClickAddBtn()}
125
- >
126
- {t('ADD', 'Add')}
127
- </Button>
128
- ) : (
129
- <>
138
+ <InputWrapper>
139
+ <label>{t('MESSAGE', 'Message')}</label>
140
+ {(formState?.changes?.channel === 'email' || notification?.channel === 'email') ? (
141
+ <HtmlEditor
142
+ body={
143
+ formState?.changes?.body
144
+ ? formState?.changes?.body
145
+ : notification?.body ?? ''
146
+ }
147
+ handleChangeBody={val => handleChangeSelect('body', val)}
148
+ />
149
+ ) : (
150
+ <TextArea
151
+ name='body'
152
+ placeholder={t('WRITE_MESSAGE', 'Write a message')}
153
+ defaultValue={
154
+ formState?.changes?.body
155
+ ? formState?.changes?.body
156
+ : notification?.body ?? ''
157
+ }
158
+ onChange={handleChangeInput}
159
+ ref={register({
160
+ required: t('VALIDATION_ERROR_REQUIRED').replace('_attribute_', t('MESSAGE', 'Message'))
161
+ })}
162
+ />
163
+ )}
164
+ </InputWrapper>
165
+ <ButtonGroup>
166
+ {isAdd ? (
130
167
  <Button
131
168
  color='primary'
169
+ type='submit'
132
170
  borderRadius='8px'
133
171
  disabled={Object.keys(formState?.changes).length === 0 || formState?.loading}
134
- onClick={() => handleClickUpdateBtn(notification?.id)}
135
172
  >
136
- {t('ACCEPT', 'Accept')}
173
+ {t('ADD', 'Add')}
137
174
  </Button>
138
- <Button
139
- color='secundary'
140
- borderRadius='8px'
141
- onClick={() => onClickDeleteNotification(notification?.id)}
142
- >
143
- {t('DELETE', 'Delete')}
144
- </Button>
145
- </>
146
- )}
147
- </ButtonGroup>
175
+ ) : (
176
+ <>
177
+ <Button
178
+ color='primary'
179
+ type='submit'
180
+ borderRadius='8px'
181
+ disabled={Object.keys(formState?.changes).length === 0 || formState?.loading}
182
+ >
183
+ {t('ACCEPT', 'Accept')}
184
+ </Button>
185
+ <Button
186
+ type='button'
187
+ color='secundary'
188
+ borderRadius='8px'
189
+ onClick={() => onClickDeleteNotification(notification?.id)}
190
+ >
191
+ {t('DELETE', 'Delete')}
192
+ </Button>
193
+ </>
194
+ )}
195
+ </ButtonGroup>
196
+ </Container>
148
197
  <Alert
149
198
  title={t('RECOVERY_ACTIONS', 'Recovery actions')}
150
199
  content={alertState.content}
@@ -1,7 +1,7 @@
1
1
  import styled, { css } from 'styled-components'
2
2
 
3
- export const Container = styled.div`
4
-
3
+ export const Container = styled.form`
4
+ min-height: calc(100% - 70px);
5
5
  `
6
6
 
7
7
  export const InputWrapper = styled.div`
@@ -1,7 +1,9 @@
1
1
  import { OpenCartListing } from './OpenCartListing'
2
2
  import { RecoveryActionListing } from './RecoveryActionListing'
3
+ import { RecoveryActionAdd } from './RecoveryActionAdd'
3
4
 
4
5
  export {
5
6
  OpenCartListing,
6
- RecoveryActionListing
7
+ RecoveryActionListing,
8
+ RecoveryActionAdd
7
9
  }
@@ -4,14 +4,13 @@ import Skeleton from 'react-loading-skeleton'
4
4
  import { Pagination } from '../../Shared'
5
5
  import MdCheckBoxOutlineBlank from '@meronex/icons/md/MdCheckBoxOutlineBlank'
6
6
  import MdCheckBox from '@meronex/icons/md/MdCheckBox'
7
- import { Switch } from '../../../styles'
7
+ import { Switch, LinkButton } from '../../../styles'
8
8
 
9
9
  import {
10
10
  DriversCompaniesContainer,
11
11
  TableWrapper,
12
12
  CompaniesTable,
13
13
  PagesBottomContainer,
14
- AddNewCompanyButton,
15
14
  CompanyNameContainer,
16
15
  CheckBoxWrapper,
17
16
  EnableWrapper,
@@ -223,11 +222,11 @@ export const DriversCompaniesList = (props) => {
223
222
  </TableWrapper>
224
223
  {!driversCompaniesState.loading && (
225
224
  <PagesBottomContainer>
226
- <AddNewCompanyButton
225
+ <LinkButton
227
226
  onClick={() => handleOpenDetails(null)}
228
227
  >
229
228
  {t('ADD_NEW_DRIVER_COMPANY', 'Add new driver company')}
230
- </AddNewCompanyButton>
229
+ </LinkButton>
231
230
  {currentCompanies?.length > 0 && (
232
231
  <Pagination
233
232
  currentPage={currentPage}
@@ -128,9 +128,3 @@ export const PagesBottomContainer = styled.div`
128
128
  row-gap: 10px;
129
129
  margin: 15px 0 38px 0;
130
130
  `
131
-
132
- export const AddNewCompanyButton = styled.div`
133
- cursor: pointer;
134
- font-size: 12px;
135
- color: ${props => props.theme.colors.primary};
136
- `
@@ -4,7 +4,7 @@ import Skeleton from 'react-loading-skeleton'
4
4
  import MdCheckBoxOutlineBlank from '@meronex/icons/md/MdCheckBoxOutlineBlank'
5
5
  import MdCheckBox from '@meronex/icons/md/MdCheckBox'
6
6
  import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
7
- import { Switch } from '../../../styles'
7
+ import { Switch, LinkButton } from '../../../styles'
8
8
  import { Pagination } from '../../Shared'
9
9
 
10
10
  import {
@@ -21,7 +21,6 @@ import {
21
21
  ActionsContainer,
22
22
  EnableWrapper,
23
23
  PagesBottomContainer,
24
- AddNewGroupButton,
25
24
  GroupIdWrapper
26
25
  } from './styles'
27
26
 
@@ -252,12 +251,12 @@ export const DriversGroupsList = (props) => {
252
251
  {!driversGroupsState.loading && (
253
252
  <PagesBottomContainer>
254
253
  {!isFromStore && (
255
- <AddNewGroupButton
254
+ <LinkButton
256
255
  onClick={() => handleOpenDetails(null)}
257
256
  disabled={actionDisabled}
258
257
  >
259
258
  {t('ADD_NEW_DRIVER_GROUP', 'Add new driver group')}
260
- </AddNewGroupButton>
259
+ </LinkButton>
261
260
  )}
262
261
  {currentGroups?.length > 0 && (
263
262
  <Pagination
@@ -204,18 +204,6 @@ export const PagesBottomContainer = styled.div`
204
204
  margin: 15px 0 38px 0;
205
205
  `
206
206
 
207
- export const AddNewGroupButton = styled.div`
208
- cursor: pointer;
209
- font-size: 12px;
210
- color: ${props => props.theme.colors.primary};
211
-
212
- ${({ disabled }) => disabled && css`
213
- opacity: 0.5;
214
- cursor: not-allowed;
215
- pointer-events: none;
216
- `}
217
- `
218
-
219
207
  export const GroupIdWrapper = styled.div`
220
208
  display: flex;
221
209
  align-items: center;