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.
- package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js → ordering-ui-admin.661a37246ac77dcc4edf.js} +2 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
- package/_modules/components/Delivery/UsersList/index.js +47 -51
- package/_modules/components/Delivery/UsersList/styles.js +6 -4
- package/_modules/components/Home/HomePage/index.js +7 -1
- package/_modules/components/Login/LoginForm/index.js +7 -1
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/_modules/components/Messages/MessagesListing/index.js +1 -1
- package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
- package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
- package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
- package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
- package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
- package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
- package/_modules/components/MyProducts/AppResources/index.js +132 -0
- package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -2
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +13 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -9
- package/_modules/components/Orders/DeliveriesManager/index.js +1 -1
- package/_modules/components/Orders/Messages/index.js +25 -94
- package/_modules/components/Orders/OrderBill/index.js +3 -3
- package/_modules/components/Orders/OrderNotification/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +3 -1
- package/_modules/components/SidebarMenu/index.js +34 -33
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/_modules/components/Stores/BusinessDetails/index.js +27 -8
- package/_modules/components/Stores/BusinessLocation/index.js +8 -7
- package/_modules/components/Stores/BusinessPlace/index.js +127 -0
- package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
- package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
- package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
- package/_modules/components/Stores/BusinessProductList/index.js +3 -3
- package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
- package/_modules/components/Stores/BusinessSummary/index.js +12 -3
- package/_modules/components/Stores/ProductStep/index.js +15 -3
- package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
- package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
- package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
- package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
- package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
- package/package.json +2 -2
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
- package/src/components/Delivery/UsersList/index.js +79 -61
- package/src/components/Delivery/UsersList/styles.js +4 -12
- package/src/components/Home/HomePage/index.js +2 -2
- package/src/components/Login/LoginForm/index.js +4 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/src/components/Messages/MessagesListing/index.js +1 -1
- package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
- package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
- package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
- package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
- package/src/components/MyProducts/AppResources/index.js +167 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +66 -2
- package/src/components/MyProducts/OrderingWebsite/styles.js +37 -0
- package/src/components/OrderingProducts/SiteTheme/index.js +7 -3
- package/src/components/Orders/DeliveriesManager/index.js +1 -1
- package/src/components/Orders/Messages/index.js +56 -216
- package/src/components/Orders/OrderBill/index.js +6 -2
- package/src/components/Orders/OrderNotification/index.js +6 -2
- package/src/components/Orders/OrdersManager/index.js +1 -1
- package/src/components/SidebarMenu/index.js +8 -8
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/src/components/Stores/BusinessDetails/index.js +24 -1
- package/src/components/Stores/BusinessLocation/index.js +2 -1
- package/src/components/Stores/BusinessPlace/index.js +137 -0
- package/src/components/Stores/BusinessPlace/styles.js +132 -0
- package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
- package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
- package/src/components/Stores/BusinessProductList/index.js +9 -1
- package/src/components/Stores/BusinessProductsListing/index.js +1 -0
- package/src/components/Stores/BusinessSummary/index.js +16 -5
- package/src/components/Stores/ProductStep/index.js +19 -2
- package/src/components/Stores/SpoonityApiKey/index.js +87 -0
- package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
- package/src/components/Stores/UploadMenuGuide/index.js +10 -1
- package/src/components/Users/CustomerPointsWallet/index.js +130 -2
- package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
- /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.661a37246ac77dcc4edf.js.LICENSE.txt} +0 -0
|
@@ -8,8 +8,11 @@ import {
|
|
|
8
8
|
Image as DumyPhoto,
|
|
9
9
|
CheckSquareFill as CheckedIcon,
|
|
10
10
|
Square as UnCheckedIcon,
|
|
11
|
-
InfoCircle
|
|
11
|
+
InfoCircle,
|
|
12
|
+
RecordCircleFill,
|
|
13
|
+
Circle
|
|
12
14
|
} from 'react-bootstrap-icons'
|
|
15
|
+
|
|
13
16
|
import { useTheme } from 'styled-components'
|
|
14
17
|
import { Alert, Modal, ImageCrop, ColorPicker } from '../../Shared'
|
|
15
18
|
import { ContentForm } from '../ContentForm'
|
|
@@ -39,7 +42,9 @@ import {
|
|
|
39
42
|
Tabs,
|
|
40
43
|
Tab,
|
|
41
44
|
HeaderInfoWrapper,
|
|
42
|
-
InfoContent
|
|
45
|
+
InfoContent,
|
|
46
|
+
RadioItem,
|
|
47
|
+
SlugWrapper
|
|
43
48
|
} from './styles'
|
|
44
49
|
import Skeleton from 'react-loading-skeleton'
|
|
45
50
|
import { AdvancedSettings } from '../AdvancedSettings'
|
|
@@ -302,6 +307,65 @@ const OrderingWebsiteUI = (props) => {
|
|
|
302
307
|
</FormGroup>
|
|
303
308
|
</InnerBlock>
|
|
304
309
|
</InputFormWrapper>
|
|
310
|
+
<InputFormWrapper>
|
|
311
|
+
<InnerBlock>
|
|
312
|
+
<h4>{t('WEBSITE_THEME', 'Website Theme')}</h4>
|
|
313
|
+
{orderingTheme?.loading ? (
|
|
314
|
+
<Skeleton height={20} width={150} />
|
|
315
|
+
) : (
|
|
316
|
+
<>
|
|
317
|
+
<RadioItem
|
|
318
|
+
onClick={() => handleChangeValue('marketplace', 'website_theme', 'type')}
|
|
319
|
+
>
|
|
320
|
+
{themeValues?.website_theme?.components?.type === 'marketplace' ? <RecordCircleFill className='active' /> : <Circle />}
|
|
321
|
+
<span>{t('MARKETPLACE', 'Marketplace')}</span>
|
|
322
|
+
</RadioItem>
|
|
323
|
+
|
|
324
|
+
<RadioItem
|
|
325
|
+
onClick={() => handleChangeValue('franchise', 'website_theme', 'type')}
|
|
326
|
+
>
|
|
327
|
+
{themeValues?.website_theme?.components?.type === 'franchise' ? <RecordCircleFill className='active' /> : <Circle />}
|
|
328
|
+
<span>{t('REPORT_HEADER_FRANCHISES', 'Franchise')}</span>
|
|
329
|
+
</RadioItem>
|
|
330
|
+
{themeValues?.website_theme?.components?.type === 'franchise' && (
|
|
331
|
+
<SlugWrapper>
|
|
332
|
+
<label>{t('FRANCHISE_SLUG', 'Franchise slug')}</label>
|
|
333
|
+
<Input
|
|
334
|
+
name='name'
|
|
335
|
+
placeholder={t('SLUG', 'Slug')}
|
|
336
|
+
value={themeValues?.website_theme?.components?.franchise_slug || ''}
|
|
337
|
+
onChange={e => handleChangeValue(e.target.value, 'website_theme', 'franchise_slug')}
|
|
338
|
+
onKeyPress={e => {
|
|
339
|
+
if (e.which === 32) { e.preventDefault() }
|
|
340
|
+
}}
|
|
341
|
+
/>
|
|
342
|
+
</SlugWrapper>
|
|
343
|
+
)}
|
|
344
|
+
|
|
345
|
+
<RadioItem
|
|
346
|
+
onClick={() => handleChangeValue('single_store', 'website_theme', 'type')}
|
|
347
|
+
>
|
|
348
|
+
{themeValues?.website_theme?.components?.type === 'single_store' ? <RecordCircleFill className='active' /> : <Circle />}
|
|
349
|
+
<span>{t('SINGLE_STORE', 'Single Store')}</span>
|
|
350
|
+
</RadioItem>
|
|
351
|
+
{themeValues?.website_theme?.components?.type === 'single_store' && (
|
|
352
|
+
<SlugWrapper>
|
|
353
|
+
<label>{t('BUSINESS_SLUG', 'Business slug')}</label>
|
|
354
|
+
<Input
|
|
355
|
+
name='name'
|
|
356
|
+
placeholder={t('SLUG', 'Slug')}
|
|
357
|
+
value={themeValues?.website_theme?.components?.business_slug || ''}
|
|
358
|
+
onChange={e => handleChangeValue(e.target.value, 'website_theme', 'business_slug')}
|
|
359
|
+
onKeyPress={e => {
|
|
360
|
+
if (e.which === 32) { e.preventDefault() }
|
|
361
|
+
}}
|
|
362
|
+
/>
|
|
363
|
+
</SlugWrapper>
|
|
364
|
+
)}
|
|
365
|
+
</>
|
|
366
|
+
)}
|
|
367
|
+
</InnerBlock>
|
|
368
|
+
</InputFormWrapper>
|
|
305
369
|
<InputFormWrapper>
|
|
306
370
|
<h4>{t('IMAGES', 'Images')}</h4>
|
|
307
371
|
<InnerBlock>
|
|
@@ -448,3 +448,40 @@ export const InfoContent = styled.div`
|
|
|
448
448
|
min-width: 535px;
|
|
449
449
|
}
|
|
450
450
|
`
|
|
451
|
+
export const RadioItem = styled.div`
|
|
452
|
+
display: flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
padding: 12px 0;
|
|
455
|
+
cursor: pointer;
|
|
456
|
+
|
|
457
|
+
svg {
|
|
458
|
+
font-size: 16px;
|
|
459
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
460
|
+
&.active {
|
|
461
|
+
color: ${props => props.theme.colors.primary};
|
|
462
|
+
}
|
|
463
|
+
margin-right: 20px;
|
|
464
|
+
${props => props.theme.rtl && css`
|
|
465
|
+
margin-left: 20px;
|
|
466
|
+
margin-right: 0px;
|
|
467
|
+
`}
|
|
468
|
+
}
|
|
469
|
+
span {
|
|
470
|
+
font-weight: 400;
|
|
471
|
+
font-size: 14px;
|
|
472
|
+
line-height: 24px;
|
|
473
|
+
}
|
|
474
|
+
`
|
|
475
|
+
export const SlugWrapper = styled.div`
|
|
476
|
+
margin-bottom: 20px;
|
|
477
|
+
label {
|
|
478
|
+
display: block;
|
|
479
|
+
margin-bottom: 12px;
|
|
480
|
+
font-weight: 400;
|
|
481
|
+
font-size: 14px;
|
|
482
|
+
line-height: 24px;
|
|
483
|
+
}
|
|
484
|
+
> input, textarea {
|
|
485
|
+
width: 100%;
|
|
486
|
+
}
|
|
487
|
+
`
|
|
@@ -84,12 +84,16 @@ const SiteThemeUI = (props) => {
|
|
|
84
84
|
}, [themesList])
|
|
85
85
|
|
|
86
86
|
const recursiveAssign = (a, b) => {
|
|
87
|
-
if (
|
|
88
|
-
|
|
87
|
+
if (b) {
|
|
88
|
+
if (Object(b) !== b) return b
|
|
89
|
+
if (Object(a) !== a) a = {}
|
|
89
90
|
for (const key in b) {
|
|
90
91
|
a[key] = recursiveAssign(a[key], b[key])
|
|
91
92
|
}
|
|
92
93
|
return a
|
|
94
|
+
} else {
|
|
95
|
+
return a
|
|
96
|
+
}
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
useEffect(() => {
|
|
@@ -164,7 +168,7 @@ const SiteThemeUI = (props) => {
|
|
|
164
168
|
const optionObject = components[block][option]
|
|
165
169
|
return (
|
|
166
170
|
<React.Fragment key={option}>
|
|
167
|
-
{typeof themeValues[selectedPage]
|
|
171
|
+
{typeof themeValues[selectedPage]?.components?.[block]?.[option] !== 'undefined' && (
|
|
168
172
|
<ThemeOption
|
|
169
173
|
name={option}
|
|
170
174
|
optionObject={optionObject}
|
|
@@ -60,8 +60,6 @@ import BisBusiness from '@meronex/icons/bi/BisBusiness'
|
|
|
60
60
|
import { Logistics } from '../Logistics'
|
|
61
61
|
import { OrderLogisticInformation } from '../OrderLogisticInformation'
|
|
62
62
|
|
|
63
|
-
const filterSpecialStatus = ['prepared_in', 'delivered_in', 'delivery_datetime']
|
|
64
|
-
|
|
65
63
|
export const MessagesUI = (props) => {
|
|
66
64
|
const {
|
|
67
65
|
isChat,
|
|
@@ -81,7 +79,8 @@ export const MessagesUI = (props) => {
|
|
|
81
79
|
handleReadMessages,
|
|
82
80
|
isTourOpen,
|
|
83
81
|
setCurrentTourStep,
|
|
84
|
-
orderDetailClose
|
|
82
|
+
orderDetailClose,
|
|
83
|
+
getHistoryComment
|
|
85
84
|
} = props
|
|
86
85
|
|
|
87
86
|
const routerHistory = useHistory()
|
|
@@ -122,16 +121,14 @@ export const MessagesUI = (props) => {
|
|
|
122
121
|
const quickMsg = message ? `${message} ${msg}` : msg
|
|
123
122
|
setValue('message', quickMsg)
|
|
124
123
|
setMessage(quickMsg)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
useEffect(() => {
|
|
128
124
|
const msgElement = messageInputRef?.current
|
|
129
125
|
if (msgElement) {
|
|
126
|
+
msgElement.value = quickMsg
|
|
130
127
|
msgElement.focus()
|
|
131
128
|
msgElement.selectionStart = msgElement.selectionEnd = msgElement.value.length
|
|
132
129
|
msgElement.scrollLeft = msgElement.scrollWidth
|
|
133
130
|
}
|
|
134
|
-
}
|
|
131
|
+
}
|
|
135
132
|
|
|
136
133
|
useEffect(() => {
|
|
137
134
|
if (user.level === 0) setMessageList(adminMessageList)
|
|
@@ -213,78 +210,6 @@ export const MessagesUI = (props) => {
|
|
|
213
210
|
}
|
|
214
211
|
}
|
|
215
212
|
|
|
216
|
-
const getStatus = (status) => {
|
|
217
|
-
switch (status) {
|
|
218
|
-
case 0:
|
|
219
|
-
return t('PENDING', 'Pending')
|
|
220
|
-
case 1:
|
|
221
|
-
return t('COMPLETED_BY_ADMIN', 'Completed by admin')
|
|
222
|
-
case 2:
|
|
223
|
-
return t('REJECTED_BY_ADMIN', 'Rejected by admin')
|
|
224
|
-
case 3:
|
|
225
|
-
return t('ORDER_STATUS_IN_BUSINESS', 'Driver arrived to business')
|
|
226
|
-
case 4:
|
|
227
|
-
return t('PREPARATION_COMPLETED', 'Preparation Completed')
|
|
228
|
-
case 5:
|
|
229
|
-
return t('REJECTED_BY_BUSINESS', 'Rejected by business')
|
|
230
|
-
case 6:
|
|
231
|
-
return t('REJECTED_BY_DRIVER', 'Rejected by driver')
|
|
232
|
-
case 7:
|
|
233
|
-
return t('ACCEPTED_BY_BUSINESS', 'Accepted by Business')
|
|
234
|
-
case 8:
|
|
235
|
-
return t('ACCEPTED_BY_DRIVER', 'Accepted by Driver')
|
|
236
|
-
case 9:
|
|
237
|
-
return t('PICK_UP_COMPLETED_BY_DRIVER', 'Pick up completed by driver')
|
|
238
|
-
case 10:
|
|
239
|
-
return t('PICK_UP_FAILED_BY_DRIVER', 'Pick up failed by driver')
|
|
240
|
-
case 11:
|
|
241
|
-
return t('DELIVERY_COMPLETED_BY_DRIVER', 'Delivery completed by driver')
|
|
242
|
-
case 12:
|
|
243
|
-
return t('DELIVERY_FAILED_BY_DRIVER', 'Delivery failed by driver')
|
|
244
|
-
case 13:
|
|
245
|
-
return t('PREORDER', 'Preorder')
|
|
246
|
-
case 14:
|
|
247
|
-
return t('ORDER_NOT_READY', 'Order not ready')
|
|
248
|
-
case 15:
|
|
249
|
-
return t('ORDER_PICKEDUP_COMPLETED_BY_CUSTOMER', 'Pickup completed by customer')
|
|
250
|
-
case 16:
|
|
251
|
-
return t('ORDER_STATUS_CANCELLED_BY_CUSTOMER', 'Cancelled by customer')
|
|
252
|
-
case 17:
|
|
253
|
-
return t('ORDER_NOT_PICKEDUP_BY_CUSTOMER', 'Not picked by customer')
|
|
254
|
-
case 18:
|
|
255
|
-
return t('ORDER_DRIVER_ALMOST_ARRIVED_BUSINESS', 'Driver almost arrived to business')
|
|
256
|
-
case 19:
|
|
257
|
-
return t('ORDER_DRIVER_ALMOST_ARRIVED_CUSTOMER', 'Driver almost arrived to customer')
|
|
258
|
-
case 20:
|
|
259
|
-
return t('ORDER_CUSTOMER_ALMOST_ARRIVED_BUSINESS', 'Customer almost arrived to business')
|
|
260
|
-
case 21:
|
|
261
|
-
return t('ORDER_CUSTOMER_ARRIVED_BUSINESS', 'Customer arrived to business')
|
|
262
|
-
case 22:
|
|
263
|
-
return t('ORDER_LOOKING_FOR_DRIVER', 'Looking for driver')
|
|
264
|
-
case 23:
|
|
265
|
-
return t('ORDER_DRIVER_ON_WAY', 'Driver on way')
|
|
266
|
-
default:
|
|
267
|
-
return status
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
const getLogisticTagStatus = (status) => {
|
|
272
|
-
switch (status) {
|
|
273
|
-
case 0:
|
|
274
|
-
return t('PENDING', 'Pending')
|
|
275
|
-
case 1:
|
|
276
|
-
return t('IN_PROGRESS', 'In Progress')
|
|
277
|
-
case 2:
|
|
278
|
-
return t('IN_QUEUE', 'In Queue')
|
|
279
|
-
case 3:
|
|
280
|
-
return t('EXPIRED', 'Logistic expired')
|
|
281
|
-
case 4:
|
|
282
|
-
return t('RESOLVED', 'Resolved')
|
|
283
|
-
default:
|
|
284
|
-
return status
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
213
|
const getLevel = (level) => {
|
|
289
214
|
switch (level) {
|
|
290
215
|
case 0:
|
|
@@ -302,10 +227,6 @@ export const MessagesUI = (props) => {
|
|
|
302
227
|
}
|
|
303
228
|
}
|
|
304
229
|
|
|
305
|
-
const getVehicleSmmary = (vehicle) => {
|
|
306
|
-
return vehicle?.type + ' ' + vehicle?.model + ' ' + vehicle?.car_registration + ' ' + vehicle?.color
|
|
307
|
-
}
|
|
308
|
-
|
|
309
230
|
const clearInputs = () => {
|
|
310
231
|
const input = messageInputRef?.current
|
|
311
232
|
if (input) {
|
|
@@ -548,59 +469,36 @@ export const MessagesUI = (props) => {
|
|
|
548
469
|
<React.Fragment key={message.id}>
|
|
549
470
|
{history && tabActive === 'order_history' && (
|
|
550
471
|
<>
|
|
472
|
+
{message.type === 0 && (
|
|
473
|
+
<MessageConsole key={message.id}>
|
|
474
|
+
<BubbleConsole>
|
|
475
|
+
<p
|
|
476
|
+
dangerouslySetInnerHTML={{
|
|
477
|
+
__html: t('ORDER_PLACED_FOR_VIA', 'Order placed for _for_ via _via_.')
|
|
478
|
+
.replace('_for_', '<b>' + parseDate(order.delivery_datetime) + '</b>')
|
|
479
|
+
.replace('_via_', '<b>' + t(order.app_id ? order.app_id.toUpperCase() : 'OTHER') + '</b>')
|
|
480
|
+
}}
|
|
481
|
+
/>
|
|
482
|
+
<div><strong>{t('APP_ID', 'App ID')}: </strong>{message?.app_id}</div>
|
|
483
|
+
<div><strong>{t('AUTHOR', 'Author')}: </strong>{message?.author?.name} {message?.author?.lastname}</div>
|
|
484
|
+
<div><strong>{t('USER_AGENT', 'User agent')}: </strong>{message?.user_agent}</div>
|
|
485
|
+
<div><strong>{t('IP', 'IP')}: </strong>{message?.ip}</div>
|
|
486
|
+
<TimeofSent>{getTimeAgo(message?.created_at)}</TimeofSent>
|
|
487
|
+
</BubbleConsole>
|
|
488
|
+
</MessageConsole>
|
|
489
|
+
)}
|
|
551
490
|
{message.type === 1 && (
|
|
552
491
|
<MessageConsole key={message.id} style={{ display: `${tabActive === 'order_history' ? 'inline-flex' : 'none'}` }}>
|
|
553
|
-
{message
|
|
492
|
+
{getHistoryComment(message) && (
|
|
554
493
|
<BubbleConsole>
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
<strong>{message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.old, 10)) : getStatus(parseInt(message.change.old, 10))}</strong> {' '}
|
|
561
|
-
</>
|
|
562
|
-
)}
|
|
563
|
-
<>
|
|
564
|
-
{t('TO', 'to')} {' '}
|
|
565
|
-
<strong>{message.change.old === null && message.change.attribute === 'delivery_in' ? 'null' : message.change?.attribute === 'logistic_status' ? getLogisticTagStatus(parseInt(message.change.new, 10)) : getStatus(parseInt(message.change.new, 10))}</strong>
|
|
566
|
-
{message?.change?.comment ? `\n'${message?.change?.comment}'` : ''}
|
|
567
|
-
{(message?.author?.name || message?.author?.lastname) && (
|
|
568
|
-
<p><strong>Author: </strong>{(message?.author?.name ?? '') + ' ' + (message?.author?.lastname ?? '')}</p>
|
|
569
|
-
)}
|
|
570
|
-
</>
|
|
494
|
+
<div
|
|
495
|
+
dangerouslySetInnerHTML={{
|
|
496
|
+
__html: getHistoryComment(message)
|
|
497
|
+
}}
|
|
498
|
+
/>
|
|
571
499
|
<OverlayTrigger
|
|
572
500
|
placement='top'
|
|
573
|
-
overlay={
|
|
574
|
-
<Tooltip>
|
|
575
|
-
{parseDate(message.created_at)}
|
|
576
|
-
</Tooltip>
|
|
577
|
-
}
|
|
578
|
-
>
|
|
579
|
-
<TimeofSent>{getTimeAgo(message.created_at)}</TimeofSent>
|
|
580
|
-
</OverlayTrigger>
|
|
581
|
-
</BubbleConsole>
|
|
582
|
-
) : (
|
|
583
|
-
<BubbleConsole>
|
|
584
|
-
<>
|
|
585
|
-
{message.change.new !== null ? (
|
|
586
|
-
<>
|
|
587
|
-
<strong>{message.driver?.name} {' '} {message.driver?.lastname && message.driver.lastname}</strong>
|
|
588
|
-
{t('WAS_ASSIGNED_AS_DRIVER', 'was assigned as driver')}
|
|
589
|
-
{message.comment && (<><br /> {message.comment.length}</>)}
|
|
590
|
-
</>
|
|
591
|
-
) : (
|
|
592
|
-
<>
|
|
593
|
-
{t('DRIVER_UNASSIGNED', 'The driver was unnasigned')}
|
|
594
|
-
</>
|
|
595
|
-
)}
|
|
596
|
-
</>
|
|
597
|
-
<OverlayTrigger
|
|
598
|
-
placement='top'
|
|
599
|
-
overlay={
|
|
600
|
-
<Tooltip>
|
|
601
|
-
{parseDate(message.created_at)}
|
|
602
|
-
</Tooltip>
|
|
603
|
-
}
|
|
501
|
+
overlay={<Tooltip>{parseDate(message.created_at)}</Tooltip>}
|
|
604
502
|
>
|
|
605
503
|
<TimeofSent>{getTimeAgo(message.created_at)}</TimeofSent>
|
|
606
504
|
</OverlayTrigger>
|
|
@@ -612,95 +510,37 @@ export const MessagesUI = (props) => {
|
|
|
612
510
|
)}
|
|
613
511
|
{isChat && (
|
|
614
512
|
<>
|
|
615
|
-
{message.type ===
|
|
513
|
+
{message.type === 0 && (
|
|
616
514
|
<MessageConsole key={message.id}>
|
|
617
|
-
|
|
618
|
-
<
|
|
619
|
-
{t('
|
|
620
|
-
<strong>{
|
|
621
|
-
{t('
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
{message.change.old !== null && (
|
|
638
|
-
<>
|
|
639
|
-
<strong>
|
|
640
|
-
{
|
|
641
|
-
message.change?.attribute === 'logistic_status'
|
|
642
|
-
? getLogisticTagStatus(parseInt(message.change.old, 10))
|
|
643
|
-
: message.change?.attribute === 'vehicle'
|
|
644
|
-
? getVehicleSmmary(message.change.old)
|
|
645
|
-
: getStatus(parseInt(message.change.old, 10))
|
|
646
|
-
}
|
|
647
|
-
</strong>{' '}
|
|
648
|
-
</>
|
|
649
|
-
)}
|
|
650
|
-
<div style={{ whiteSpace: 'pre' }}>
|
|
651
|
-
{t('TO', 'to')} {' '}
|
|
652
|
-
<strong>
|
|
653
|
-
{
|
|
654
|
-
message.change.old === null && message.change.attribute === 'delivery_in'
|
|
655
|
-
? 'null'
|
|
656
|
-
: message.change?.attribute === 'logistic_status'
|
|
657
|
-
? getLogisticTagStatus(parseInt(message.change.new, 10))
|
|
658
|
-
: message.change?.attribute === 'vehicle'
|
|
659
|
-
? getVehicleSmmary(message.change.new)
|
|
660
|
-
: getStatus(parseInt(message.change.new, 10))
|
|
661
|
-
}
|
|
662
|
-
</strong>
|
|
663
|
-
<strong>{message?.change?.comment ? (`\n${t('COMMENT', 'Comment:')}`) : ''}</strong>
|
|
664
|
-
{message?.change?.comment ? ` ${message?.change?.comment}` : ''}
|
|
665
|
-
{(message?.author?.name || message?.author?.lastname) && (
|
|
666
|
-
<p><strong>Author: </strong>{(message?.author?.name ?? '') + ' ' + (message?.author?.lastname ?? '')}</p>
|
|
667
|
-
)}
|
|
668
|
-
</div>
|
|
669
|
-
</>
|
|
670
|
-
)}
|
|
671
|
-
<OverlayTrigger
|
|
672
|
-
placement='top'
|
|
673
|
-
overlay={
|
|
674
|
-
<Tooltip>
|
|
675
|
-
{parseDate(message.created_at)}
|
|
676
|
-
</Tooltip>
|
|
677
|
-
}
|
|
678
|
-
>
|
|
679
|
-
<TimeofSent>{getTimeAgo(message.created_at)}</TimeofSent>
|
|
680
|
-
</OverlayTrigger>
|
|
681
|
-
</BubbleConsole>
|
|
682
|
-
) : (
|
|
515
|
+
<BubbleConsole>
|
|
516
|
+
<p>
|
|
517
|
+
{t('ORDER_PLACED_FOR', 'Order placed for')} {' '}
|
|
518
|
+
<strong>{parseDate(order.created_at)}</strong> {' '}
|
|
519
|
+
{t('VIA', 'Via')}{' '}
|
|
520
|
+
<strong>
|
|
521
|
+
{order.app_id ? t(order.app_id.toUpperCase(), order.app_id) : t('OTHER', 'Other')}
|
|
522
|
+
</strong>{' '}
|
|
523
|
+
</p>
|
|
524
|
+
<div><strong>{t('APP_ID', 'App ID')}: </strong>{message?.app_id}</div>
|
|
525
|
+
<div><strong>{t('AUTHOR', 'Author')}: </strong>{message?.author?.name} {message?.author?.lastname}</div>
|
|
526
|
+
<div><strong>{t('USER_AGENT', 'User agent')}: </strong>{message?.user_agent}</div>
|
|
527
|
+
<div><strong>{t('IP', 'IP')}: </strong>{message?.ip}</div>
|
|
528
|
+
<TimeofSent>{getTimeAgo(message?.created_at)}</TimeofSent>
|
|
529
|
+
</BubbleConsole>
|
|
530
|
+
</MessageConsole>
|
|
531
|
+
)}
|
|
532
|
+
{message.type === 1 && (
|
|
533
|
+
<MessageConsole key={message.id} style={{ display: `${tabActive === 'order_history' ? 'inline-flex' : 'none'}` }}>
|
|
534
|
+
{getHistoryComment(message) && (
|
|
683
535
|
<BubbleConsole>
|
|
684
|
-
|
|
685
|
-
{
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
{message.comment && (<><br /> {message.comment.length}</>)}
|
|
690
|
-
</>
|
|
691
|
-
) : (
|
|
692
|
-
<>
|
|
693
|
-
{t('DRIVER_UNASSIGNED', 'The driver was unnasigned')}
|
|
694
|
-
</>
|
|
695
|
-
)}
|
|
696
|
-
</>
|
|
536
|
+
<div
|
|
537
|
+
dangerouslySetInnerHTML={{
|
|
538
|
+
__html: getHistoryComment(message)
|
|
539
|
+
}}
|
|
540
|
+
/>
|
|
697
541
|
<OverlayTrigger
|
|
698
542
|
placement='top'
|
|
699
|
-
overlay={
|
|
700
|
-
<Tooltip>
|
|
701
|
-
{parseDate(message.created_at)}
|
|
702
|
-
</Tooltip>
|
|
703
|
-
}
|
|
543
|
+
overlay={<Tooltip>{parseDate(message.created_at)}</Tooltip>}
|
|
704
544
|
>
|
|
705
545
|
<TimeofSent>{getTimeAgo(message.created_at)}</TimeofSent>
|
|
706
546
|
</OverlayTrigger>
|
|
@@ -186,7 +186,7 @@ export const OrderBill = (props) => {
|
|
|
186
186
|
</tr>
|
|
187
187
|
))
|
|
188
188
|
}
|
|
189
|
-
{order?.summary?.delivery_price
|
|
189
|
+
{typeof order?.summary?.delivery_price === 'number' && (
|
|
190
190
|
<tr>
|
|
191
191
|
<td>{t('DELIVERY_FEE', 'Delivery Fee')}</td>
|
|
192
192
|
<td>{parsePrice(order?.summary?.delivery_price, { currency: order?.currency })}</td>
|
|
@@ -244,7 +244,11 @@ export const OrderBill = (props) => {
|
|
|
244
244
|
<td>
|
|
245
245
|
{event?.wallet_event
|
|
246
246
|
? walletName[event?.wallet_event?.wallet?.type]?.name
|
|
247
|
-
:
|
|
247
|
+
: event?.paymethod
|
|
248
|
+
? t(event?.paymethod?.name?.toUpperCase()?.replaceAll(' ', '_'), event?.paymethod?.name)
|
|
249
|
+
: event?.data?.gateway
|
|
250
|
+
? t(event?.data?.gateway?.toUpperCase(), event?.data?.gateway?.replaceAll('_', ' '))
|
|
251
|
+
: walletName[event?.data?.wallet_currency]?.name}
|
|
248
252
|
</td>
|
|
249
253
|
<td>
|
|
250
254
|
{event?.paymethod?.gateway === 'cash' && order?.cash
|
|
@@ -18,7 +18,10 @@ import {
|
|
|
18
18
|
toast.configure()
|
|
19
19
|
|
|
20
20
|
const OrderNotificationUI = (props) => {
|
|
21
|
-
const {
|
|
21
|
+
const {
|
|
22
|
+
isOnlyDelivery,
|
|
23
|
+
customerId
|
|
24
|
+
} = props
|
|
22
25
|
|
|
23
26
|
const [configState] = useConfig()
|
|
24
27
|
const [, t] = useLanguage()
|
|
@@ -29,6 +32,7 @@ const OrderNotificationUI = (props) => {
|
|
|
29
32
|
const [registerOrderIds, setRegisterOrderIds] = useState([])
|
|
30
33
|
|
|
31
34
|
const handleNotification = (order) => {
|
|
35
|
+
if (customerId && order?.customer_id !== customerId) return
|
|
32
36
|
if (isOnlyDelivery && order?.delivery_type !== 1) return
|
|
33
37
|
const _registerOrderIds = [...registerOrderIds]
|
|
34
38
|
if (!_registerOrderIds.includes(order.id)) {
|
|
@@ -101,7 +105,7 @@ const OrderNotificationUI = (props) => {
|
|
|
101
105
|
return () => {
|
|
102
106
|
events.off('order_added', handleNotification)
|
|
103
107
|
}
|
|
104
|
-
}, [configState, registerOrderIds])
|
|
108
|
+
}, [configState, registerOrderIds, customerId])
|
|
105
109
|
|
|
106
110
|
return (
|
|
107
111
|
<>
|
|
@@ -371,13 +371,13 @@ const SidebarMenuUI = (props) => {
|
|
|
371
371
|
events.emit('go_to_page', data)
|
|
372
372
|
}
|
|
373
373
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
374
|
+
const handleGoToLink = (link) => {
|
|
375
|
+
window.open(link, '_blank')
|
|
376
|
+
}
|
|
377
377
|
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
const handleOpenSite = () => {
|
|
379
|
+
handleGoToLink(`https://${ordering.project}.tryordering.com`)
|
|
380
|
+
}
|
|
381
381
|
|
|
382
382
|
useEffect(() => {
|
|
383
383
|
if (windowSize.width < 1024) {
|
|
@@ -441,7 +441,7 @@ const SidebarMenuUI = (props) => {
|
|
|
441
441
|
<SidebarMainContent>
|
|
442
442
|
<SidebarContent className='d-flex flex-column justify-content-between p-1 pt-0'>
|
|
443
443
|
<div className='d-flex flex-column'>
|
|
444
|
-
{
|
|
444
|
+
{sessionState?.user?.level === 0 && (
|
|
445
445
|
<Button
|
|
446
446
|
className='d-flex align-items-center'
|
|
447
447
|
variant={false}
|
|
@@ -450,7 +450,7 @@ const SidebarMenuUI = (props) => {
|
|
|
450
450
|
<BoxArrowUpRight />
|
|
451
451
|
<span>{t('MY_WEBSITE', 'My Website')}</span>
|
|
452
452
|
</Button>
|
|
453
|
-
)}
|
|
453
|
+
)}
|
|
454
454
|
<Accordion>
|
|
455
455
|
{/* {sessionState?.user?.level === 0 && (
|
|
456
456
|
<Button
|
|
@@ -182,7 +182,7 @@ export const DeliveryZone = (props) => {
|
|
|
182
182
|
maxLength={2}
|
|
183
183
|
value={zoneState?.data?.distance ?? ''}
|
|
184
184
|
onInput={(e) => {
|
|
185
|
-
e.target.value = e.target.value.match('
|
|
185
|
+
e.target.value = e.target.value.match(`^[${e.target.value === '0' ? '1' : '0'}-9]{1,2}$`)
|
|
186
186
|
}}
|
|
187
187
|
onChange={e => handleChangeZoneState(e, false, configState?.configs?.distance_unit?.value)}
|
|
188
188
|
/>
|
|
@@ -217,7 +217,7 @@ export const BusinessDeliveryZoneInformation = (props) => {
|
|
|
217
217
|
maxLength={2}
|
|
218
218
|
value={formState.changes?.data?.distance ?? zone?.data?.distance ?? ''}
|
|
219
219
|
onInput={(e) => {
|
|
220
|
-
e.target.value = e.target.value.match('
|
|
220
|
+
e.target.value = e.target.value.match(`^[${e.target.value === '0' ? '1' : '0'}-9]{1,2}$`)
|
|
221
221
|
}}
|
|
222
222
|
onChange={e => handleChangeInput(e, configState?.configs?.distance_unit?.value)}
|
|
223
223
|
ref={register({
|