ordering-ui-admin-external 1.17.0 → 1.19.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 (87) hide show
  1. package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js → ordering-ui-admin.661a37246ac77dcc4edf.js} +2 -2
  2. package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
  3. package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
  4. package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
  5. package/_modules/components/Delivery/UsersList/index.js +47 -51
  6. package/_modules/components/Delivery/UsersList/styles.js +6 -4
  7. package/_modules/components/Home/HomePage/index.js +7 -1
  8. package/_modules/components/Login/LoginForm/index.js +7 -1
  9. package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  10. package/_modules/components/Messages/MessagesListing/index.js +1 -1
  11. package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
  12. package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
  13. package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
  14. package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
  15. package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
  16. package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
  17. package/_modules/components/MyProducts/AppResources/index.js +132 -0
  18. package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -2
  19. package/_modules/components/MyProducts/OrderingWebsite/styles.js +13 -3
  20. package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -9
  21. package/_modules/components/Orders/DeliveriesManager/index.js +1 -1
  22. package/_modules/components/Orders/Messages/index.js +25 -94
  23. package/_modules/components/Orders/OrderBill/index.js +3 -3
  24. package/_modules/components/Orders/OrderNotification/index.js +4 -2
  25. package/_modules/components/Orders/OrdersManager/index.js +3 -1
  26. package/_modules/components/SidebarMenu/index.js +34 -33
  27. package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
  28. package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
  29. package/_modules/components/Stores/BusinessDetails/index.js +27 -8
  30. package/_modules/components/Stores/BusinessLocation/index.js +8 -7
  31. package/_modules/components/Stores/BusinessPlace/index.js +127 -0
  32. package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
  33. package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
  34. package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
  35. package/_modules/components/Stores/BusinessProductList/index.js +3 -3
  36. package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
  37. package/_modules/components/Stores/BusinessSummary/index.js +12 -3
  38. package/_modules/components/Stores/ProductStep/index.js +15 -3
  39. package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
  40. package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
  41. package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
  42. package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
  43. package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
  44. package/package.json +2 -2
  45. package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
  46. package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
  47. package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
  48. package/src/components/Delivery/UsersList/index.js +79 -61
  49. package/src/components/Delivery/UsersList/styles.js +4 -12
  50. package/src/components/Home/HomePage/index.js +2 -2
  51. package/src/components/Login/LoginForm/index.js +4 -1
  52. package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
  53. package/src/components/Messages/MessagesListing/index.js +1 -1
  54. package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
  55. package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
  56. package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
  57. package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
  58. package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
  59. package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
  60. package/src/components/MyProducts/AppResources/index.js +167 -0
  61. package/src/components/MyProducts/OrderingWebsite/index.js +66 -2
  62. package/src/components/MyProducts/OrderingWebsite/styles.js +37 -0
  63. package/src/components/OrderingProducts/SiteTheme/index.js +7 -3
  64. package/src/components/Orders/DeliveriesManager/index.js +1 -1
  65. package/src/components/Orders/Messages/index.js +56 -216
  66. package/src/components/Orders/OrderBill/index.js +6 -2
  67. package/src/components/Orders/OrderNotification/index.js +6 -2
  68. package/src/components/Orders/OrdersManager/index.js +1 -1
  69. package/src/components/SidebarMenu/index.js +8 -8
  70. package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
  71. package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
  72. package/src/components/Stores/BusinessDetails/index.js +24 -1
  73. package/src/components/Stores/BusinessLocation/index.js +2 -1
  74. package/src/components/Stores/BusinessPlace/index.js +137 -0
  75. package/src/components/Stores/BusinessPlace/styles.js +132 -0
  76. package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
  77. package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
  78. package/src/components/Stores/BusinessProductList/index.js +9 -1
  79. package/src/components/Stores/BusinessProductsListing/index.js +1 -0
  80. package/src/components/Stores/BusinessSummary/index.js +16 -5
  81. package/src/components/Stores/ProductStep/index.js +19 -2
  82. package/src/components/Stores/SpoonityApiKey/index.js +87 -0
  83. package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
  84. package/src/components/Stores/UploadMenuGuide/index.js +10 -1
  85. package/src/components/Users/CustomerPointsWallet/index.js +130 -2
  86. package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
  87. /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.661a37246ac77dcc4edf.js.LICENSE.txt} +0 -0
@@ -4,6 +4,9 @@ import { useLanguage, UserWallet as UserWalletController } from 'ordering-compon
4
4
  import { useTheme } from 'styled-components'
5
5
  import Skeleton from 'react-loading-skeleton'
6
6
  import { CustomerWalletEvents } from '../CustomerWalletEvents'
7
+ import { Button, Input, TextArea } from '../../../styles'
8
+ import { Alert } from '../../Shared'
9
+
7
10
  import {
8
11
  Container,
9
12
  PointsWalletContainer,
@@ -11,20 +14,32 @@ import {
11
14
  Tabs,
12
15
  Tab,
13
16
  LoyaltyLevel,
14
- LoyaltyLevelContent
17
+ LoyaltyLevelContent,
18
+
19
+ SectionContainer,
20
+ FormController
15
21
  } from './styles'
16
22
 
17
23
  const CustomerPointsWalletUI = (props) => {
18
24
  const {
19
25
  walletState,
20
- user
26
+ user,
27
+
28
+ handleChangeInput,
29
+ actionState,
30
+ addWalletState,
31
+ reduceWalletState,
32
+ handleAddWalletMoney,
33
+ handleReduceWalletMoney
21
34
  } = props
22
35
 
23
36
  const history = useHistory()
24
37
  const query = new URLSearchParams(useLocation().search)
25
38
  const [, t] = useLanguage()
26
39
  const theme = useTheme()
40
+
27
41
  const [showOption, setShowOption] = useState('points_wallet')
42
+ const [alertState, setAlertState] = useState({ open: false, content: [] })
28
43
 
29
44
  const handleTabClick = (tab, isInitialRender) => {
30
45
  setShowOption(tab)
@@ -45,6 +60,36 @@ const CustomerPointsWalletUI = (props) => {
45
60
  }
46
61
  }, [])
47
62
 
63
+ const onAddWalletMoney = () => {
64
+ if (!addWalletState?.amount) {
65
+ setAlertState({
66
+ open: true,
67
+ content: [t('VALIDATION_ERROR_REQUIRED', 'The amount is required').replace('_attribute_', t('AMOUNT', 'Amount'))]
68
+ })
69
+ return
70
+ }
71
+ handleAddWalletMoney()
72
+ }
73
+
74
+ const onReduceWalletMoney = () => {
75
+ if (!reduceWalletState?.amount) {
76
+ setAlertState({
77
+ open: true,
78
+ content: [t('VALIDATION_ERROR_REQUIRED', 'The amount is required').replace('_attribute_', t('AMOUNT', 'Amount'))]
79
+ })
80
+ return
81
+ }
82
+ handleReduceWalletMoney()
83
+ }
84
+
85
+ useEffect(() => {
86
+ if (actionState.loading || !actionState.error) return
87
+ setAlertState({
88
+ open: true,
89
+ content: actionState.error
90
+ })
91
+ }, [actionState])
92
+
48
93
  return (
49
94
  <Container>
50
95
  <h1>{t('POINTS_WALLET', 'Points wallet')}</h1>
@@ -96,6 +141,79 @@ const CustomerPointsWalletUI = (props) => {
96
141
  </LoyaltyLevelContent>
97
142
  </LoyaltyLevel>
98
143
  )}
144
+
145
+ <SectionContainer>
146
+ <p>{t('ADD_WALLET_MONEY', 'Add wallet money')}</p>
147
+ <FormController>
148
+ <label>{t('INDICATE_THE_AMOUNT_TO_ADD', 'Indicate the amount to add')}</label>
149
+ <Input
150
+ type='number'
151
+ name='amount'
152
+ placeholder={t('POINTS', 'Points')}
153
+ onKeyPress={(e) => {
154
+ if (!/^[0-9.]$/.test(e.key)) {
155
+ e.preventDefault()
156
+ }
157
+ }}
158
+ value={addWalletState?.amount || ''}
159
+ onChange={(e) => handleChangeInput(e, true)}
160
+ />
161
+ </FormController>
162
+ <FormController>
163
+ <label>{t('COMMENT', 'Comment')}</label>
164
+ <TextArea
165
+ name='description'
166
+ rows={3}
167
+ value={addWalletState?.description || ''}
168
+ onChange={(e) => handleChangeInput(e, true)}
169
+ placeholder={t('WRITE_SHORT_COMMENT', 'Write a short comment')}
170
+ />
171
+ </FormController>
172
+ <Button
173
+ borderRadius='8px'
174
+ color='primary'
175
+ onClick={() => onAddWalletMoney()}
176
+ disabled={actionState.loading || Object.keys(addWalletState).length === 0}
177
+ >
178
+ {t('ADD', 'Add')}
179
+ </Button>
180
+ </SectionContainer>
181
+ <SectionContainer>
182
+ <p>{t('REDUCE_WALLET_MONEY', 'Reduce wallet money')}</p>
183
+ <FormController>
184
+ <label>{t('INDICATE_THE_AMOUNT_TO_REDUCE', 'Indicate the amount to reduce')}</label>
185
+ <Input
186
+ type='number'
187
+ name='amount'
188
+ placeholder={t('POINTS', 'Points')}
189
+ value={reduceWalletState?.amount || ''}
190
+ onChange={e => handleChangeInput(e, false)}
191
+ onKeyPress={(e) => {
192
+ if (!/^[0-9.]$/.test(e.key)) {
193
+ e.preventDefault()
194
+ }
195
+ }}
196
+ />
197
+ </FormController>
198
+ <FormController>
199
+ <label>{t('COMMENT', 'Comment')}</label>
200
+ <TextArea
201
+ rows={3}
202
+ name='description'
203
+ value={reduceWalletState?.description || ''}
204
+ onChange={e => handleChangeInput(e, false)}
205
+ placeholder={t('WRITE_SHORT_COMMENT', 'Write a short comment')}
206
+ />
207
+ </FormController>
208
+ <Button
209
+ borderRadius='8px'
210
+ color='black'
211
+ onClick={() => onReduceWalletMoney()}
212
+ disabled={actionState.loading || Object.keys(reduceWalletState).length === 0}
213
+ >
214
+ {t('REDUCE', 'Reduce')}
215
+ </Button>
216
+ </SectionContainer>
99
217
  </PointsWalletContainer>
100
218
  </>
101
219
  )}
@@ -104,6 +222,16 @@ const CustomerPointsWalletUI = (props) => {
104
222
  {showOption === 'history' && (
105
223
  <CustomerWalletEvents {...props} />
106
224
  )}
225
+ <Alert
226
+ width='800px'
227
+ title={t('LOGIN')}
228
+ content={alertState.content}
229
+ acceptText={t('ACCEPT')}
230
+ open={alertState.open}
231
+ onClose={() => setAlertState({ open: false, content: [] })}
232
+ onAccept={() => setAlertState({ open: false, content: [] })}
233
+ closeOnBackdrop={false}
234
+ />
107
235
  </Container>
108
236
  )
109
237
  }
@@ -14,7 +14,7 @@ export const Container = styled.div`
14
14
 
15
15
  export const PointsWalletContainer = styled.div`
16
16
  width: 100%;
17
- padding-top: 30px;
17
+ padding: 30px 0;
18
18
  `
19
19
 
20
20
  export const PointsWrapper = styled.div`
@@ -121,3 +121,42 @@ export const LoyaltyLevelContent = styled.div`
121
121
  text-align: center;
122
122
  }
123
123
  `
124
+
125
+ export const SectionContainer = styled.div`
126
+ margin-top: 54px;
127
+ margin-bottom: 30px;
128
+ > p {
129
+ font-size: 16px;
130
+ font-weight: 600;
131
+ margin-top: 0;
132
+ margin-bottom: 22px;
133
+ }
134
+ > button {
135
+ height: 44px;
136
+ }
137
+ `
138
+ export const FormController = styled.div`
139
+ display: flex;
140
+ flex-direction: column;
141
+ margin-bottom: 26px;
142
+
143
+ label {
144
+ font-size: 14px;
145
+ margin-bottom: 10px;
146
+ }
147
+
148
+ input,
149
+ textarea {
150
+ font-size: 14px;
151
+ }
152
+
153
+ input::-webkit-outer-spin-button,
154
+ input::-webkit-inner-spin-button {
155
+ -webkit-appearance: none;
156
+ margin: 0;
157
+ }
158
+
159
+ input[type=number] {
160
+ -moz-appearance: textfield;
161
+ }
162
+ `