ordering-ui-admin-external 1.6.5 → 1.7.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.
- package/_bundles/{ordering-ui-admin.0b48ec00b24a060f7133.js → ordering-ui-admin.f6cdf30b6e7d2ac03d1b.js} +2 -2
- package/_bundles/{ordering-ui-admin.0b48ec00b24a060f7133.js.LICENSE.txt → ordering-ui-admin.f6cdf30b6e7d2ac03d1b.js.LICENSE.txt} +0 -0
- package/_modules/components/Marketing/EnterprisePromotionDetails/index.js +4 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +16 -6
- package/_modules/components/OrderingProducts/SiteTheme/styles.js +8 -3
- package/_modules/components/Orders/Messages/index.js +6 -3
- package/_modules/components/Orders/OrderDetails/styles.js +1 -1
- package/_modules/components/Orders/OrdersManager/index.js +6 -2
- package/_modules/components/Settings/DoordashConnect/index.js +174 -0
- package/_modules/components/Settings/DoordashConnect/styles.js +109 -0
- package/_modules/components/Settings/IntegrationListing/index.js +15 -2
- package/_modules/components/Settings/IntegrationListing/styles.js +1 -1
- package/_modules/components/Shared/Pagination/index.js +3 -2
- package/_modules/components/Shared/SelectSites/index.js +3 -4
- package/_modules/components/Shared/SelectUsers/index.js +37 -5
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +5 -2
- package/_modules/components/Stores/BusinessDetails/index.js +42 -6
- package/package.json +2 -2
- package/src/components/Marketing/EnterprisePromotionDetails/index.js +3 -3
- package/src/components/OrderingProducts/SiteTheme/index.js +18 -2
- package/src/components/OrderingProducts/SiteTheme/styles.js +18 -0
- package/src/components/Orders/Messages/index.js +24 -2
- package/src/components/Orders/OrderDetails/styles.js +1 -0
- package/src/components/Orders/OrdersManager/index.js +5 -1
- package/src/components/Settings/DoordashConnect/index.js +222 -0
- package/src/components/Settings/DoordashConnect/styles.js +321 -0
- package/src/components/Settings/IntegrationListing/index.js +20 -0
- package/src/components/Settings/IntegrationListing/styles.js +4 -0
- package/src/components/Shared/Pagination/index.js +3 -2
- package/src/components/Shared/SelectSites/index.js +2 -3
- package/src/components/Shared/SelectUsers/index.js +50 -21
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +11 -6
- package/src/components/Stores/BusinessDetails/index.js +25 -3
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const DoordashConnectContainer = styled.div`
|
|
4
|
+
padding: 26px 20px;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
width: 100%;
|
|
7
|
+
overflow-x: hidden;
|
|
8
|
+
position: relative;
|
|
9
|
+
|
|
10
|
+
@media (min-width: 768px) {
|
|
11
|
+
padding: 26px 40px;
|
|
12
|
+
}
|
|
13
|
+
`
|
|
14
|
+
|
|
15
|
+
export const Header = styled.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
align-items: center;
|
|
19
|
+
margin-bottom: 30px;
|
|
20
|
+
|
|
21
|
+
${props => props.theme?.rtl ? css`
|
|
22
|
+
margin-left: 35px;
|
|
23
|
+
` : css`
|
|
24
|
+
margin-right: 35px;
|
|
25
|
+
`}
|
|
26
|
+
|
|
27
|
+
h1 {
|
|
28
|
+
font-size: 20px;
|
|
29
|
+
font-weight: 700;
|
|
30
|
+
margin: 0px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
button {
|
|
34
|
+
height: 42px;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
|
|
38
|
+
export const ApiKeysListTable = styled.table`
|
|
39
|
+
width: 100%;
|
|
40
|
+
margin-top: 25px;
|
|
41
|
+
|
|
42
|
+
thead {
|
|
43
|
+
border-bottom: 1px solid ${props => props.theme.colors.secundaryLight};
|
|
44
|
+
th {
|
|
45
|
+
padding: 10px 0;
|
|
46
|
+
&:last-child {
|
|
47
|
+
padding-left: 20px;
|
|
48
|
+
padding-right: 20px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
tr {
|
|
53
|
+
width: 100%;
|
|
54
|
+
th,
|
|
55
|
+
td {
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
word-break: break-all;
|
|
58
|
+
|
|
59
|
+
&:last-child {
|
|
60
|
+
width: 100px;
|
|
61
|
+
> div {
|
|
62
|
+
padding-left: 20px;
|
|
63
|
+
padding-right: 20px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
tbody {
|
|
70
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
71
|
+
td {
|
|
72
|
+
padding-top: 9px;
|
|
73
|
+
padding-bottom: 9px;
|
|
74
|
+
|
|
75
|
+
&:last-child {
|
|
76
|
+
> div {
|
|
77
|
+
display: flex;
|
|
78
|
+
justify-content: flex-end;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`
|
|
84
|
+
|
|
85
|
+
export const DropdownButtonWrapper = styled.div`
|
|
86
|
+
${props => props?.theme?.rtl ? css`
|
|
87
|
+
border-right: 1px solid ${props => props.theme.colors.borderColor};
|
|
88
|
+
` : css`
|
|
89
|
+
border-left: 1px solid ${props => props.theme.colors.borderColor};
|
|
90
|
+
`}
|
|
91
|
+
padding: 5px 20px;
|
|
92
|
+
button {
|
|
93
|
+
background: transparent !important;
|
|
94
|
+
border: none;
|
|
95
|
+
padding: 0px;
|
|
96
|
+
&:active,
|
|
97
|
+
&:focus {
|
|
98
|
+
border-color: unset !important;
|
|
99
|
+
box-shadow: none !important;
|
|
100
|
+
}
|
|
101
|
+
svg {
|
|
102
|
+
color: ${props => props.theme.colors.headingColor};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
&:after {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.show {
|
|
111
|
+
button {
|
|
112
|
+
background: ${props => props.theme.colors.secundary} !important;
|
|
113
|
+
border-color: unset !important;
|
|
114
|
+
box-shadow: none !important;
|
|
115
|
+
}
|
|
116
|
+
>div {
|
|
117
|
+
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
118
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
> div {
|
|
123
|
+
> div {
|
|
124
|
+
border-radius: 8px;
|
|
125
|
+
.dropdown-item {
|
|
126
|
+
font-size: 12px;
|
|
127
|
+
color: ${props => props.theme.colors.headingColor};
|
|
128
|
+
}
|
|
129
|
+
.dropdown-item:last-child {
|
|
130
|
+
color: #E63757;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
`
|
|
135
|
+
export const AddNewButton = styled.div`
|
|
136
|
+
cursor: pointer;
|
|
137
|
+
font-size: 12px;
|
|
138
|
+
color: ${props => props.theme.colors.lightGray};
|
|
139
|
+
margin: 20px 0;
|
|
140
|
+
width: fit-content;
|
|
141
|
+
|
|
142
|
+
&:hover {
|
|
143
|
+
color: ${props => props.theme.colors.primary};
|
|
144
|
+
}
|
|
145
|
+
`
|
|
146
|
+
|
|
147
|
+
export const AllSetting = styled.div`
|
|
148
|
+
user-select: none;
|
|
149
|
+
cursor: pointer;
|
|
150
|
+
margin-top: 36px;
|
|
151
|
+
cursor: pointer;
|
|
152
|
+
span {
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
font-size: 14px;
|
|
155
|
+
color: ${props => props.theme.colors.primary};
|
|
156
|
+
}
|
|
157
|
+
svg {
|
|
158
|
+
color: ${props => props.theme.colors.primary};
|
|
159
|
+
margin-left: 5px;
|
|
160
|
+
transition: 0.2s linear;
|
|
161
|
+
${props => props.theme.rtl && css`
|
|
162
|
+
margin-right: 5px;
|
|
163
|
+
margin-left: 0px;
|
|
164
|
+
`}
|
|
165
|
+
}
|
|
166
|
+
&:hover {
|
|
167
|
+
svg {
|
|
168
|
+
transform: translateX(3px);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
`
|
|
172
|
+
|
|
173
|
+
export const Description = styled.p`
|
|
174
|
+
margin-top: 40px;
|
|
175
|
+
font-size: 14px;
|
|
176
|
+
margin-bottom: 0px;
|
|
177
|
+
text-align: justify;
|
|
178
|
+
|
|
179
|
+
@media (min-width: 768px) {
|
|
180
|
+
text-align: initial;
|
|
181
|
+
}
|
|
182
|
+
`
|
|
183
|
+
|
|
184
|
+
export const CategoryExtraContent = styled.div`
|
|
185
|
+
position: relative;
|
|
186
|
+
padding: 26px 26px 60px 26px;
|
|
187
|
+
box-sizing: border-box;
|
|
188
|
+
width: 100%;
|
|
189
|
+
overflow: auto;
|
|
190
|
+
|
|
191
|
+
${props => props.theme?.rtl ? css`
|
|
192
|
+
border-right: 1px solid #E9ECEF;
|
|
193
|
+
` : css`
|
|
194
|
+
border-left: 1px solid #E9ECEF;
|
|
195
|
+
`}
|
|
196
|
+
|
|
197
|
+
> button {
|
|
198
|
+
z-index: 100;
|
|
199
|
+
position: absolute;
|
|
200
|
+
top: 25px;
|
|
201
|
+
${props => props.theme?.rtl ? css`
|
|
202
|
+
left: 20px;
|
|
203
|
+
` : css`
|
|
204
|
+
right: 20px;
|
|
205
|
+
`}
|
|
206
|
+
}
|
|
207
|
+
`
|
|
208
|
+
|
|
209
|
+
export const Container = styled.div`
|
|
210
|
+
display: flex;
|
|
211
|
+
width: 0;
|
|
212
|
+
position: fixed;
|
|
213
|
+
box-shadow: -4px 0px 7px #ccc;
|
|
214
|
+
|
|
215
|
+
${({ isDriverOrders }) => isDriverOrders && css`
|
|
216
|
+
position: absolute;
|
|
217
|
+
box-shadow: none;
|
|
218
|
+
|
|
219
|
+
${props => props.theme?.rtl ? css`
|
|
220
|
+
border-right: 1px solid #CCC;
|
|
221
|
+
` : css`
|
|
222
|
+
border-left: 1px solid #CCC;
|
|
223
|
+
`}
|
|
224
|
+
`}
|
|
225
|
+
background: ${props => props.theme.colors?.backgroundPage || '#FFF'};
|
|
226
|
+
height: calc(var(--vh, 1vh) * 100);
|
|
227
|
+
top: 0px;
|
|
228
|
+
z-index: 1001;
|
|
229
|
+
overflow-x: hidden;
|
|
230
|
+
transition: 0.3s;
|
|
231
|
+
|
|
232
|
+
${props => props.theme?.rtl ? css`
|
|
233
|
+
left: 0px;
|
|
234
|
+
` : css`
|
|
235
|
+
right: 0px;
|
|
236
|
+
`}
|
|
237
|
+
@media print {
|
|
238
|
+
box-shadow: none;
|
|
239
|
+
}
|
|
240
|
+
`
|
|
241
|
+
|
|
242
|
+
export const DescriptionHeader = styled.div`
|
|
243
|
+
display: flex;
|
|
244
|
+
justify-content: flex-end;
|
|
245
|
+
align-items: center;
|
|
246
|
+
`
|
|
247
|
+
|
|
248
|
+
export const HeaderIcons = styled.div`
|
|
249
|
+
display: flex;
|
|
250
|
+
position: absolute;
|
|
251
|
+
top: 25px;
|
|
252
|
+
right: 20px;
|
|
253
|
+
|
|
254
|
+
> button:first-child {
|
|
255
|
+
${props => props.theme?.rtl ? css`
|
|
256
|
+
margin-left: 8px;
|
|
257
|
+
` : css`
|
|
258
|
+
margin-right: 8px;
|
|
259
|
+
`}
|
|
260
|
+
}
|
|
261
|
+
`
|
|
262
|
+
|
|
263
|
+
export const SettingListConatiner = styled.div`
|
|
264
|
+
width: 100%;
|
|
265
|
+
margin: 20px 0;
|
|
266
|
+
border-bottom: 1px solid #E9ECEF;
|
|
267
|
+
`
|
|
268
|
+
|
|
269
|
+
export const Tab = styled.div`
|
|
270
|
+
user-select: none;
|
|
271
|
+
padding: 10px 0px;
|
|
272
|
+
cursor: pointer;
|
|
273
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
274
|
+
font-size: 14px;
|
|
275
|
+
white-space: nowrap;
|
|
276
|
+
${props => props.theme?.rtl ? css`
|
|
277
|
+
margin-left: 30px;
|
|
278
|
+
` : css`
|
|
279
|
+
margin-right: 30px;
|
|
280
|
+
`}
|
|
281
|
+
|
|
282
|
+
${({ active }) => active && css`
|
|
283
|
+
border-bottom: 2px solid;
|
|
284
|
+
font-weight: 500;
|
|
285
|
+
`}
|
|
286
|
+
|
|
287
|
+
${({ active }) => !active && css`
|
|
288
|
+
color: #909BA9;
|
|
289
|
+
`}
|
|
290
|
+
`
|
|
291
|
+
|
|
292
|
+
export const Paragraph = styled.div`
|
|
293
|
+
margin-top: 20px;
|
|
294
|
+
h2{
|
|
295
|
+
font-size: 16px;
|
|
296
|
+
}
|
|
297
|
+
p{
|
|
298
|
+
white-space: pre-line;
|
|
299
|
+
font-size: 12px;
|
|
300
|
+
margin: 0;
|
|
301
|
+
}
|
|
302
|
+
span {
|
|
303
|
+
font-size: 12px;
|
|
304
|
+
}
|
|
305
|
+
a {
|
|
306
|
+
text-decoration: underline !important;
|
|
307
|
+
cursor: pointer;
|
|
308
|
+
font-size: 12px;
|
|
309
|
+
color: ${props => props.theme.colors.primary} !important;
|
|
310
|
+
}
|
|
311
|
+
.bold {
|
|
312
|
+
font-weight: 600;
|
|
313
|
+
}
|
|
314
|
+
`
|
|
315
|
+
|
|
316
|
+
export const PurchaseWrapper = styled.div`
|
|
317
|
+
button {
|
|
318
|
+
border-radius: 5px;
|
|
319
|
+
}
|
|
320
|
+
margin-top: 15px;
|
|
321
|
+
`
|
|
@@ -8,6 +8,7 @@ import { SideBar } from '../../Shared'
|
|
|
8
8
|
import { PluginList } from '../PluginList'
|
|
9
9
|
import { WebhookList } from '../WebhookList'
|
|
10
10
|
import { ApiKeysList } from '../ApiKeysList'
|
|
11
|
+
import { DoordashConnect } from '../DoordashConnect'
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
14
|
IntegrationsContainer,
|
|
@@ -17,11 +18,13 @@ import {
|
|
|
17
18
|
IconWrapper,
|
|
18
19
|
SettingItemContent
|
|
19
20
|
} from './styles'
|
|
21
|
+
import { useTheme } from 'styled-components'
|
|
20
22
|
|
|
21
23
|
export const IntegrationListing = (props) => {
|
|
22
24
|
const [, t] = useLanguage()
|
|
23
25
|
const { search } = useLocation()
|
|
24
26
|
const [events] = useEvent()
|
|
27
|
+
const theme = useTheme()
|
|
25
28
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
26
29
|
const [showOption, setShowOption] = useState(null)
|
|
27
30
|
|
|
@@ -112,6 +115,17 @@ export const IntegrationListing = (props) => {
|
|
|
112
115
|
<p>{t('APIKEYS_DESCRIPTION', 'These keys serve to obtain a direct connection to the API without the need for authentication.')}</p>
|
|
113
116
|
</SettingItemContent>
|
|
114
117
|
</SettingItemContainer>
|
|
118
|
+
<SettingItemContainer
|
|
119
|
+
onClick={() => handleOpenSetting('doordash')}
|
|
120
|
+
>
|
|
121
|
+
<IconWrapper>
|
|
122
|
+
<img src={theme.images.general.doordash} />
|
|
123
|
+
</IconWrapper>
|
|
124
|
+
<SettingItemContent>
|
|
125
|
+
<h5>{t('CONNECT_WITH_DOORDASH', 'Connect with Doordash')}</h5>
|
|
126
|
+
<p>{t('CONNECT_DOORDASH_DESCRIPTION', 'Send orders directly to your driver in Doordash and keep customers happy with their deliveries.')}</p>
|
|
127
|
+
</SettingItemContent>
|
|
128
|
+
</SettingItemContainer>
|
|
115
129
|
</SettingListContainer>
|
|
116
130
|
</IntegrationsContainer>
|
|
117
131
|
|
|
@@ -147,6 +161,12 @@ export const IntegrationListing = (props) => {
|
|
|
147
161
|
<ApiKeysList />
|
|
148
162
|
</SideBar>
|
|
149
163
|
)}
|
|
164
|
+
|
|
165
|
+
{showOption === 'doordash' && (
|
|
166
|
+
<DoordashConnect
|
|
167
|
+
onClose={() => handleCloseSettings()}
|
|
168
|
+
/>
|
|
169
|
+
)}
|
|
150
170
|
</>
|
|
151
171
|
)
|
|
152
172
|
}
|
|
@@ -19,7 +19,8 @@ export const Pagination = (props) => {
|
|
|
19
19
|
handleChangePage,
|
|
20
20
|
defaultPageSize,
|
|
21
21
|
handleChangePageSize,
|
|
22
|
-
isHidePagecontrol
|
|
22
|
+
isHidePagecontrol,
|
|
23
|
+
paginationSize
|
|
23
24
|
} = props
|
|
24
25
|
|
|
25
26
|
const [, t] = useLanguage()
|
|
@@ -131,7 +132,7 @@ export const Pagination = (props) => {
|
|
|
131
132
|
isSecondIcon
|
|
132
133
|
notAsync
|
|
133
134
|
minWidth='70px'
|
|
134
|
-
defaultValue={defaultPageSize ||
|
|
135
|
+
defaultValue={defaultPageSize || paginationSize}
|
|
135
136
|
options={pageSizeOptions}
|
|
136
137
|
onChange={size => handleChangePageSize(size)}
|
|
137
138
|
/>
|
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
|
|
13
13
|
export const SelectSites = (props) => {
|
|
14
14
|
const {
|
|
15
|
-
isAllChecked,
|
|
16
15
|
isAddMode,
|
|
17
16
|
isDisabled,
|
|
18
17
|
selectedSitesIds,
|
|
@@ -67,8 +66,8 @@ export const SelectSites = (props) => {
|
|
|
67
66
|
key={site.id}
|
|
68
67
|
>
|
|
69
68
|
<Checkbox
|
|
70
|
-
checked={
|
|
71
|
-
onChange={(e) => handleSelectSite(
|
|
69
|
+
checked={selectedSitesIds.includes(site.id)}
|
|
70
|
+
onChange={(e) => handleSelectSite(e.target.checked, site.id)}
|
|
72
71
|
/>
|
|
73
72
|
<span>{site.name}</span>
|
|
74
73
|
</ChannelItem>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage, UsersList as UsersListController } from 'ordering-components-admin-external'
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { Pagination } from '../Pagination'
|
|
@@ -18,25 +18,41 @@ const SelectUsersUI = (props) => {
|
|
|
18
18
|
getUsers,
|
|
19
19
|
searchValue,
|
|
20
20
|
onSearch,
|
|
21
|
-
|
|
22
21
|
isAddMode,
|
|
23
22
|
isDisabled,
|
|
24
23
|
selectedUserIds,
|
|
25
24
|
handleSelectUser,
|
|
26
25
|
handleAddPromotion,
|
|
27
|
-
handleUpdateClick
|
|
26
|
+
handleUpdateClick,
|
|
27
|
+
handleSelectAllUsers
|
|
28
28
|
} = props
|
|
29
29
|
const [, t] = useLanguage()
|
|
30
|
+
const [all, setAll] = useState(false)
|
|
31
|
+
const [paginationSize, setPaginationSize] = useState(10)
|
|
30
32
|
|
|
31
33
|
const handleChangePage = (page) => {
|
|
32
|
-
getUsers(page,
|
|
34
|
+
getUsers(page, paginationSize)
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
const handleChangePageSize = (pageSize) => {
|
|
36
38
|
const expectedPage = Math.ceil(paginationProps.from / pageSize)
|
|
39
|
+
setPaginationSize(pageSize)
|
|
37
40
|
getUsers(expectedPage, pageSize)
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setAll(!!!selectedUserIds?.length)
|
|
45
|
+
}, [selectedUserIds])
|
|
46
|
+
|
|
47
|
+
const handleAllCheck = (check) => {
|
|
48
|
+
if (!check) {
|
|
49
|
+
handleSelectAllUsers()
|
|
50
|
+
setAll(true)
|
|
51
|
+
} else {
|
|
52
|
+
setAll(false)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
40
56
|
return (
|
|
41
57
|
<UsersContainer>
|
|
42
58
|
<SearchBarWrapper>
|
|
@@ -57,27 +73,40 @@ const SelectUsersUI = (props) => {
|
|
|
57
73
|
</UserItem>
|
|
58
74
|
))
|
|
59
75
|
) : (
|
|
60
|
-
|
|
61
|
-
<UserItem
|
|
76
|
+
<>
|
|
77
|
+
<UserItem>
|
|
62
78
|
<Checkbox
|
|
63
|
-
checked={
|
|
64
|
-
onChange={(
|
|
79
|
+
checked={all}
|
|
80
|
+
onChange={() => handleAllCheck(all)}
|
|
65
81
|
/>
|
|
66
|
-
<span className='name'>{
|
|
82
|
+
<span className='name'>{t('ALL', 'All')}</span>
|
|
67
83
|
</UserItem>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
84
|
+
{(!all || !!searchValue?.length) &&
|
|
85
|
+
usersList.users.map(user => (
|
|
86
|
+
<UserItem key={user.id}>
|
|
87
|
+
<Checkbox
|
|
88
|
+
checked={selectedUserIds.includes(user.id)}
|
|
89
|
+
onChange={(e) => handleSelectUser(e.target.checked, user.id)}
|
|
90
|
+
/>
|
|
91
|
+
<span className='name'>{user?.name} {user?.lastname}</span>
|
|
92
|
+
</UserItem>
|
|
93
|
+
)
|
|
94
|
+
)}
|
|
95
|
+
</>
|
|
80
96
|
)}
|
|
97
|
+
{(!all || !!searchValue?.length) &&
|
|
98
|
+
usersList?.users.length > 0 && (
|
|
99
|
+
<WrapperPagination>
|
|
100
|
+
<Pagination
|
|
101
|
+
paginationSize={paginationSize}
|
|
102
|
+
currentPage={paginationProps.currentPage}
|
|
103
|
+
totalPages={paginationProps.totalPages}
|
|
104
|
+
handleChangePage={handleChangePage}
|
|
105
|
+
handleChangePageSize={handleChangePageSize}
|
|
106
|
+
/>
|
|
107
|
+
</WrapperPagination>
|
|
108
|
+
)
|
|
109
|
+
}
|
|
81
110
|
|
|
82
111
|
<Button
|
|
83
112
|
borderRadius='8px'
|
|
@@ -156,6 +156,7 @@ export const BusinessDeliveryZoneInformation = (props) => {
|
|
|
156
156
|
<FormControl>
|
|
157
157
|
<label>{t('NAME', 'Name')}</label>
|
|
158
158
|
<Input
|
|
159
|
+
disabled={zone?.businesses[0]?.id !== zone?.pivot.business_id}
|
|
159
160
|
placeholder={t('NAME', 'Name')}
|
|
160
161
|
name='name'
|
|
161
162
|
value={formState.changes?.name ?? zone?.name ?? ''}
|
|
@@ -169,6 +170,7 @@ export const BusinessDeliveryZoneInformation = (props) => {
|
|
|
169
170
|
<label>{t('TYPE', 'Type')}</label>
|
|
170
171
|
<TypeSelectWrapper>
|
|
171
172
|
<Select
|
|
173
|
+
isDisabled={zone?.businesses[0]?.id !== zone?.pivot.business_id}
|
|
172
174
|
defaultValue={parseInt(formState.changes?.type || zoneType)}
|
|
173
175
|
options={typeOptions}
|
|
174
176
|
onChange={handleChangeType}
|
|
@@ -213,13 +215,16 @@ export const BusinessDeliveryZoneInformation = (props) => {
|
|
|
213
215
|
{zoneType !== 4 && isShowMap && (
|
|
214
216
|
configState?.configs?.google_maps_api_key?.value ? (
|
|
215
217
|
<WrapperMap>
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
218
|
+
{zone?.businesses[0]?.id === zone?.pivot.business_id &&
|
|
219
|
+
<button
|
|
220
|
+
type='button'
|
|
221
|
+
onClick={() => setClearState(true)}
|
|
222
|
+
>
|
|
223
|
+
{t('CLEAR', 'Clear')}
|
|
224
|
+
</button>
|
|
225
|
+
}
|
|
222
226
|
<BusinessZoneGoogleMaps
|
|
227
|
+
disabled={zone?.businesses[0]?.id !== zone?.pivot.business_id}
|
|
223
228
|
apiKey={configState?.configs?.google_maps_api_key?.value}
|
|
224
229
|
mapControls={googleMapsControls}
|
|
225
230
|
location={business?.location}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { BusinessDetails as BusinessDetailsController, useSession } from 'ordering-components-admin-external'
|
|
2
|
+
import { BusinessDetails as BusinessDetailsController, useSession, useLanguage } from 'ordering-components-admin-external'
|
|
3
3
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
4
4
|
import { BusinessSummary } from '../BusinessSummary'
|
|
5
5
|
import { BusinessSupport } from '../BusinessSupport'
|
|
@@ -18,7 +18,7 @@ import { BusinessOrderingChannels } from '../BusinessOrderingChannels'
|
|
|
18
18
|
import { BusinessFrontLayout } from '../BusinessFrontLayout'
|
|
19
19
|
// import { BusinessPublishing } from '../BusinessPublishing'
|
|
20
20
|
|
|
21
|
-
import { MoreSidebarLayout, Personalization } from '../../Shared'
|
|
21
|
+
import { MoreSidebarLayout, Personalization, Alert } from '../../Shared'
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
BarContainer
|
|
@@ -42,13 +42,17 @@ export const BusinessDetailsUI = (props) => {
|
|
|
42
42
|
handleSuccessDeleteBusinessItem,
|
|
43
43
|
handleUpdateBusinessState,
|
|
44
44
|
handleDuplicateBusiness,
|
|
45
|
-
handleDeleteBusiness
|
|
45
|
+
handleDeleteBusiness,
|
|
46
|
+
actionStatus
|
|
46
47
|
} = props
|
|
48
|
+
|
|
49
|
+
const [, t] = useLanguage()
|
|
47
50
|
const { width } = useWindowSize()
|
|
48
51
|
const [{ user }] = useSession()
|
|
49
52
|
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
|
50
53
|
const [extraOpen, setExtraOpen] = useState(false)
|
|
51
54
|
const [isExtendExtraOpen, setIsExtendExtraOpen] = useState(false)
|
|
55
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
52
56
|
|
|
53
57
|
const isAdmin = user?.level === 0
|
|
54
58
|
|
|
@@ -125,6 +129,14 @@ export const BusinessDetailsUI = (props) => {
|
|
|
125
129
|
return () => document.removeEventListener('keydown', onCloseSidebar)
|
|
126
130
|
}, [open])
|
|
127
131
|
|
|
132
|
+
useEffect(() => {
|
|
133
|
+
if (!actionStatus?.error) return
|
|
134
|
+
setAlertState({
|
|
135
|
+
open: true,
|
|
136
|
+
content: actionStatus?.error
|
|
137
|
+
})
|
|
138
|
+
}, [actionStatus?.error])
|
|
139
|
+
|
|
128
140
|
return (
|
|
129
141
|
<BarContainer id='business_details_bar'>
|
|
130
142
|
{(!isExtendExtraOpen || width < 1000) && (
|
|
@@ -274,6 +286,16 @@ export const BusinessDetailsUI = (props) => {
|
|
|
274
286
|
)}
|
|
275
287
|
</MoreSidebarLayout>
|
|
276
288
|
)}
|
|
289
|
+
|
|
290
|
+
<Alert
|
|
291
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
292
|
+
content={alertState.content}
|
|
293
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
294
|
+
open={alertState.open}
|
|
295
|
+
onClose={() => setAlertState({ open: false, content: [] })}
|
|
296
|
+
onAccept={() => setAlertState({ open: false, content: [] })}
|
|
297
|
+
closeOnBackdrop={false}
|
|
298
|
+
/>
|
|
277
299
|
</BarContainer>
|
|
278
300
|
)
|
|
279
301
|
}
|