ordering-ui-admin-external 1.23.5 → 1.24.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.a1255b2c1a2d4b87080d.js → ordering-ui-admin.0c354f3e7da49f56465b.js} +2 -2
- package/_modules/components/CartRecovery/RecoveryActionAdd/index.js +325 -0
- package/_modules/components/CartRecovery/RecoveryGeneral/index.js +41 -17
- package/_modules/components/Delivery/DriversCompaniesList/styles.js +1 -1
- package/_modules/components/Delivery/DriversCompaniesListing/index.js +20 -2
- package/_modules/components/Delivery/DriversCompaniesListing/styles.js +2 -2
- package/_modules/components/Delivery/DriversCompanyAddForm/GeneralForm/index.js +122 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/GeneralForm/styles.js +21 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/ScheduleForm/index.js +27 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/ScheduleForm/styles.js +14 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/WebhooksForm/index.js +60 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/WebhooksForm/styles.js +16 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/index.js +114 -0
- package/_modules/components/Delivery/DriversCompanyAddForm/styles.js +18 -0
- package/_modules/components/MyProducts/AdvancedSettings/index.js +66 -82
- package/_modules/components/MyProducts/AdvancedSettings/styles.js +40 -44
- package/_modules/components/MyProducts/OrderingWebsite/SelectBusiness.js +59 -0
- package/_modules/components/MyProducts/OrderingWebsite/SelectFranchise.js +59 -0
- package/_modules/components/MyProducts/OrderingWebsite/index.js +21 -29
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +1 -1
- package/_modules/components/MyProducts/UploadAudio/index.js +170 -0
- package/_modules/components/MyProducts/UploadAudio/styles.js +30 -0
- package/_modules/components/MyProducts/index.js +8 -1
- package/_modules/components/Orders/DeliveriesLocation/index.js +1 -0
- package/_modules/components/Orders/OrderBill/index.js +4 -3
- package/_modules/components/Orders/OrderContactInformation/index.js +14 -12
- package/_modules/components/Orders/OrderDetails/index.js +6 -131
- package/_modules/components/Orders/OrdersTable/index.js +2 -2
- package/_modules/components/Settings/NotificationSetting/index.js +1 -1
- package/_modules/components/Settings/SettingsList/index.js +1 -1
- package/_modules/components/Settings/SettingsList/styles.js +2 -2
- package/_modules/components/SidebarMenu/index.js +22 -22
- package/_modules/components/Stores/BusinessDetails/index.js +2 -1
- package/_modules/components/Stores/BusinessDeviceDetail/index.js +66 -16
- package/_modules/components/Stores/BusinessDeviceDetail/styles.js +7 -5
- package/_modules/components/Stores/BusinessSalesChannel/index.js +13 -4
- package/_modules/components/Stores/BusinessSalesFacebook/FacebookProfile.js +2 -2
- package/_modules/components/Stores/BusinessSalesFacebook/index.js +2 -2
- package/_modules/components/Stores/BusinessSalesGoogle/index.js +2 -2
- package/_modules/components/Stores/BusinessSalesInstagram/AdvancedInstagram.js +3 -2
- package/_modules/components/Stores/BusinessSalesInstagram/GeneralInstagram.js +2 -2
- package/_modules/components/Stores/BusinessSalesInstagram/index.js +3 -5
- package/_modules/components/Users/CustomersListing/index.js +5 -3
- package/_modules/utils/index.js +203 -2
- package/index-template.js +1 -1
- package/index.html +1 -0
- package/package.json +2 -2
- package/public/push/onesignal/OneSignalSDKUpdaterWorker.js +1 -0
- package/public/push/onesignal/OneSignalSDKWorker.js +1 -0
- package/src/components/CartRecovery/RecoveryActionAdd/index.js +355 -0
- package/src/components/CartRecovery/RecoveryGeneral/index.js +23 -4
- package/src/components/Delivery/DriversCompaniesList/styles.js +1 -1
- package/src/components/Delivery/DriversCompaniesListing/index.js +29 -12
- package/src/components/Delivery/DriversCompaniesListing/styles.js +1 -1
- package/src/components/Delivery/DriversCompanyAddForm/GeneralForm/index.js +120 -0
- package/src/components/Delivery/DriversCompanyAddForm/GeneralForm/styles.js +32 -0
- package/src/components/Delivery/DriversCompanyAddForm/ScheduleForm/index.js +29 -0
- package/src/components/Delivery/DriversCompanyAddForm/ScheduleForm/styles.js +11 -0
- package/src/components/Delivery/DriversCompanyAddForm/WebhooksForm/index.js +69 -0
- package/src/components/Delivery/DriversCompanyAddForm/WebhooksForm/styles.js +24 -0
- package/src/components/Delivery/DriversCompanyAddForm/index.js +121 -0
- package/src/components/Delivery/DriversCompanyAddForm/styles.js +39 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +35 -36
- package/src/components/MyProducts/AdvancedSettings/styles.js +3 -11
- package/src/components/MyProducts/OrderingWebsite/SelectBusiness.js +47 -0
- package/src/components/MyProducts/OrderingWebsite/SelectFranchise.js +47 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +20 -30
- package/src/components/MyProducts/OrderingWebsite/styles.js +0 -4
- package/src/components/MyProducts/UploadAudio/index.js +168 -0
- package/src/components/MyProducts/UploadAudio/styles.js +120 -0
- package/src/components/MyProducts/index.js +3 -1
- package/src/components/Orders/DeliveriesLocation/index.js +1 -0
- package/src/components/Orders/OrderBill/index.js +9 -6
- package/src/components/Orders/OrderContactInformation/index.js +5 -1
- package/src/components/Orders/OrderDetails/index.js +7 -35
- package/src/components/Orders/OrdersTable/index.js +3 -1
- package/src/components/Settings/NotificationSetting/index.js +2 -0
- package/src/components/Settings/SettingsList/index.js +53 -53
- package/src/components/Settings/SettingsList/styles.js +2 -1
- package/src/components/Settings/SettingsSelectUI/index.js +1 -1
- package/src/components/SidebarMenu/index.js +1 -0
- package/src/components/Stores/BusinessDetails/index.js +1 -0
- package/src/components/Stores/BusinessDeviceDetail/index.js +46 -7
- package/src/components/Stores/BusinessDeviceDetail/styles.js +11 -0
- package/src/components/Stores/BusinessSalesChannel/index.js +12 -6
- package/src/components/Stores/BusinessSalesFacebook/FacebookProfile.js +2 -2
- package/src/components/Stores/BusinessSalesFacebook/index.js +3 -3
- package/src/components/Stores/BusinessSalesGoogle/index.js +3 -3
- package/src/components/Stores/BusinessSalesInstagram/AdvancedInstagram.js +2 -2
- package/src/components/Stores/BusinessSalesInstagram/GeneralInstagram.js +2 -2
- package/src/components/Stores/BusinessSalesInstagram/index.js +3 -3
- package/src/components/Users/CustomersListing/index.js +2 -3
- package/src/utils/index.js +53 -0
- package/template/app.js +76 -3
- package/template/config.json +1 -0
- /package/_bundles/{ordering-ui-admin.a1255b2c1a2d4b87080d.js.LICENSE.txt → ordering-ui-admin.0c354f3e7da49f56465b.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div`
|
|
4
|
+
> h2 {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
font-size: 24px;
|
|
7
|
+
line-height: 36px;
|
|
8
|
+
text-align: center;
|
|
9
|
+
margin-top: 0;
|
|
10
|
+
margin-bottom: 8px;
|
|
11
|
+
}
|
|
12
|
+
> p {
|
|
13
|
+
width: 100%;
|
|
14
|
+
font-weight: 400;
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
line-height: 18px;
|
|
17
|
+
text-align: center;
|
|
18
|
+
margin: 0 auto;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media (min-width: 768px) {
|
|
22
|
+
> p {
|
|
23
|
+
width: 80%;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`
|
|
27
|
+
|
|
28
|
+
export const FileUploadBox = styled.div`
|
|
29
|
+
height: 210px;
|
|
30
|
+
margin-top: 35px;
|
|
31
|
+
border-radius: 8px;
|
|
32
|
+
background-color: ${props => props.theme.colors.borderColor};
|
|
33
|
+
position: relative;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
cursor: -webkit-grab;
|
|
36
|
+
cursor: grab;
|
|
37
|
+
img, div {
|
|
38
|
+
width: 100%;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
img {
|
|
43
|
+
object-fit: contain;
|
|
44
|
+
}
|
|
45
|
+
`
|
|
46
|
+
|
|
47
|
+
export const UploadIconBox = styled.div`
|
|
48
|
+
position: absolute;
|
|
49
|
+
top: 0px;
|
|
50
|
+
> div {
|
|
51
|
+
color: ${props => props.theme.colors.secundaryLight};
|
|
52
|
+
display: flex;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
align-items: center;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
svg {
|
|
57
|
+
width: 43px;
|
|
58
|
+
font-size: 40px;
|
|
59
|
+
}
|
|
60
|
+
p {
|
|
61
|
+
font-weight: 400;
|
|
62
|
+
font-size: 12px;
|
|
63
|
+
line-height: 18px;
|
|
64
|
+
margin-bottom: 0;
|
|
65
|
+
margin-top: 8px;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
`
|
|
69
|
+
|
|
70
|
+
export const Or = styled.h6`
|
|
71
|
+
text-align: center;
|
|
72
|
+
font-weight: 400;
|
|
73
|
+
font-size: 14px;
|
|
74
|
+
line-height: 24px;
|
|
75
|
+
margin: 27px 0;
|
|
76
|
+
`
|
|
77
|
+
|
|
78
|
+
export const FormControl = styled.div`
|
|
79
|
+
label {
|
|
80
|
+
font-weight: 400;
|
|
81
|
+
font-size: 14px;
|
|
82
|
+
line-height: 24px;
|
|
83
|
+
margin-bottom: 13px;
|
|
84
|
+
}
|
|
85
|
+
input {
|
|
86
|
+
width: 100%;
|
|
87
|
+
border-radius: 8px;
|
|
88
|
+
height: 44px;
|
|
89
|
+
}
|
|
90
|
+
`
|
|
91
|
+
|
|
92
|
+
export const ButtonGroup = styled.div`
|
|
93
|
+
display: flex;
|
|
94
|
+
flex-direction: column;
|
|
95
|
+
padding-top: 30px;
|
|
96
|
+
> button {
|
|
97
|
+
width: 100%;
|
|
98
|
+
margin-top: 15px;
|
|
99
|
+
height: 44px;
|
|
100
|
+
border-radius: 8px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (min-width: 576px) {
|
|
104
|
+
justify-content: space-between;
|
|
105
|
+
flex-direction: row;
|
|
106
|
+
> button {
|
|
107
|
+
width: 48%;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`
|
|
111
|
+
|
|
112
|
+
export const PdfIconBox = styled.div`
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
justify-content: center;
|
|
116
|
+
svg {
|
|
117
|
+
font-size: 150px;
|
|
118
|
+
color: ${props => props.theme.colors.danger};
|
|
119
|
+
}
|
|
120
|
+
`
|
|
@@ -7,6 +7,7 @@ import { CallCenterApp } from './CallCenterApp'
|
|
|
7
7
|
import { KioskApp } from './KioskApp'
|
|
8
8
|
import { CustomProject } from './CustomProject'
|
|
9
9
|
import { OrderingWidgets } from './OrderingWidgets'
|
|
10
|
+
import { UploadAudio } from './UploadAudio'
|
|
10
11
|
|
|
11
12
|
export {
|
|
12
13
|
OrderingWebsite,
|
|
@@ -17,5 +18,6 @@ export {
|
|
|
17
18
|
CallCenterApp,
|
|
18
19
|
KioskApp,
|
|
19
20
|
CustomProject,
|
|
20
|
-
OrderingWidgets
|
|
21
|
+
OrderingWidgets,
|
|
22
|
+
UploadAudio
|
|
21
23
|
}
|
|
@@ -18,6 +18,7 @@ export const OrderBill = (props) => {
|
|
|
18
18
|
handleOrderRefund
|
|
19
19
|
} = props
|
|
20
20
|
|
|
21
|
+
const isGiftCardOrder = order?.products?.[0]?.type === 'gift_card'
|
|
21
22
|
const [, t] = useLanguage()
|
|
22
23
|
const [{ parsePrice, parseNumber }] = useUtils()
|
|
23
24
|
const [{ configs }] = useConfig()
|
|
@@ -262,11 +263,13 @@ export const OrderBill = (props) => {
|
|
|
262
263
|
</tbody>
|
|
263
264
|
</table>
|
|
264
265
|
)}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
{!isGiftCardOrder && (
|
|
267
|
+
<RefundToWallet
|
|
268
|
+
order={order}
|
|
269
|
+
actionStatus={actionStatus}
|
|
270
|
+
handleOrderRefund={handleOrderRefund}
|
|
271
|
+
/>
|
|
272
|
+
)}
|
|
270
273
|
{order?.payment_events?.filter(item => item.event === 'refund').length > 0 && (
|
|
271
274
|
<table className='payments'>
|
|
272
275
|
<thead>
|
|
@@ -352,7 +355,7 @@ export const OrderBill = (props) => {
|
|
|
352
355
|
</table>
|
|
353
356
|
)}
|
|
354
357
|
|
|
355
|
-
{!order?.refund_data && stripePaymethods.includes(order?.paymethod?.gateway) && (
|
|
358
|
+
{!isGiftCardOrder && !order?.refund_data && stripePaymethods.includes(order?.paymethod?.gateway) && (
|
|
356
359
|
<RefundButtonWrapper>
|
|
357
360
|
<Button
|
|
358
361
|
color='primary'
|
|
@@ -130,7 +130,11 @@ export const OrderContactInformation = (props) => {
|
|
|
130
130
|
</PhotoWrapper>
|
|
131
131
|
<InfoContent>
|
|
132
132
|
<div>
|
|
133
|
-
|
|
133
|
+
{(order?.customer?.name || order?.customer?.middle_name || order?.customer?.lastname || order?.customer?.second_lastname) ? (
|
|
134
|
+
<p className='name'>{order?.customer?.name} {order?.customer?.middle_name} {order?.customer?.lastname} {order?.customer?.second_lastname}</p>
|
|
135
|
+
) : (
|
|
136
|
+
(!order?.customer?.email || !order?.customer?.phone) && <p className='name'>{t('GUEST_USER', 'Guest user')}</p>
|
|
137
|
+
)}
|
|
134
138
|
{order?.customer?.cellphone && (
|
|
135
139
|
<IconButton
|
|
136
140
|
onClick={() => window.open(`tel:${order?.customer?.country_phone_code ? '+' + order?.customer?.country_phone_code : ''}${order?.customer?.cellphone}`)}
|
|
@@ -15,6 +15,7 @@ import { NotFoundSource, Modal } from '../../Shared'
|
|
|
15
15
|
import { IconButton } from '../../../styles'
|
|
16
16
|
import { OrderToPrint } from '../OrderToPrint'
|
|
17
17
|
import { OrderToPrintTicket } from '../OrderToPrintTicket'
|
|
18
|
+
import { getOrderStatuPickUp, getOrderStatus } from '../../../utils'
|
|
18
19
|
|
|
19
20
|
import {
|
|
20
21
|
Container,
|
|
@@ -77,37 +78,6 @@ const OrderDetailsUI = (props) => {
|
|
|
77
78
|
} = props.order
|
|
78
79
|
|
|
79
80
|
const rejectResonStatuses = [6, 9, 10, 11, 12, 14]
|
|
80
|
-
const getOrderStatus = (status) => {
|
|
81
|
-
const orderStatus = [
|
|
82
|
-
{ key: 0, value: 'Pending Order', slug: 'PENDING_ORDER', percentage: 10 },
|
|
83
|
-
{ key: 1, value: 'Completed by admin', slug: 'COMPLETED_BY_ADMIN', percentage: 100 },
|
|
84
|
-
{ key: 2, value: 'Reject by admin', slug: 'REJECT_BY_ADMIN', percentage: 0 },
|
|
85
|
-
{ key: 3, value: 'Driver arrived by business', slug: 'DRIVER_IN_BUSINESS', percentage: 60 },
|
|
86
|
-
{ key: 4, value: 'Preparation Completed', slug: 'PREPARATION_COMPLETED', percentage: 20 },
|
|
87
|
-
{ key: 5, value: 'Reject by business', slug: 'REJECT_BY_BUSINESS', percentage: 0 },
|
|
88
|
-
{ key: 6, value: 'Reject by driver', slug: 'REJECT_BY_DRIVER', percentage: 0 },
|
|
89
|
-
{ key: 7, value: 'Accepted by business', slug: 'ACCEPTED_BY_BUSINESS', percentage: 15 },
|
|
90
|
-
{ key: 8, value: 'Accepted by driver', slug: 'ACCEPTED_BY_DRIVER', percentage: 40 },
|
|
91
|
-
{ key: 9, value: 'Pick up completed by driver', slug: 'PICK_UP_COMPLETED_BY_DRIVER', percentage: 70 },
|
|
92
|
-
{ key: 10, value: 'Pick up Failed by driver', slug: 'PICK_UP_FAILED_BY_DRIVER', percentage: 0 },
|
|
93
|
-
{ key: 11, value: 'Delivery completed by driver', slug: 'DELIVERY_COMPLETED_BY_DRIVER', percentage: 100 },
|
|
94
|
-
{ key: 12, value: 'Delivery Failed by driver', slug: 'DELIVERY_FAILED_BY_DRIVER', percentage: 0 },
|
|
95
|
-
{ key: 13, value: 'Preorder', slug: 'PREORDER', percentage: 0 },
|
|
96
|
-
{ key: 14, value: 'Order not ready', slug: 'ORDER_NOT_READY', percentage: 15 },
|
|
97
|
-
{ key: 15, value: 'Pickup completed by customer', slug: 'PICKUP_COMPLETED_BY_CUSTOMER', percentage: 100 },
|
|
98
|
-
{ key: 16, value: 'Canceled by customer', slug: 'CANCELED_BY_CUSTOMER', percentage: 0 },
|
|
99
|
-
{ key: 17, value: 'Not picked by customer', slug: 'NOT_PICKED_BY_CUSTOMER', percentage: 0 },
|
|
100
|
-
{ key: 18, value: 'Driver almost arrived to business', slug: 'DRIVER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 50 },
|
|
101
|
-
{ key: 19, value: 'Driver almost arrived to customer', slug: 'DRIVER_ALMOST_ARRIVED_TO_CUSTOMER', percentage: 90 },
|
|
102
|
-
{ key: 20, value: 'Customer almost arrived to business', slug: 'CUSTOMER_ALMOST_ARRIVED_TO_BUSINESS', percentage: 90 },
|
|
103
|
-
{ key: 21, value: 'Customer arrived to business', slug: 'CUSTOMER_ARRIVED_TO_BUSINESS', percentage: 90 },
|
|
104
|
-
{ key: 22, value: 'Looking for driver', slug: 'ORDER_LOOKING_FOR_DRIVER', percentage: 30 },
|
|
105
|
-
{ key: 23, value: 'Driver on way', slug: 'ORDER_DRIVER_ON_WAY', percentage: 80 }
|
|
106
|
-
]
|
|
107
|
-
|
|
108
|
-
const objectStatus = orderStatus.find((o) => o.key === status)
|
|
109
|
-
return objectStatus && objectStatus
|
|
110
|
-
}
|
|
111
81
|
|
|
112
82
|
const getLogisticTag = (status) => {
|
|
113
83
|
switch (parseInt(status)) {
|
|
@@ -302,6 +272,8 @@ const OrderDetailsUI = (props) => {
|
|
|
302
272
|
}
|
|
303
273
|
}, [loading])
|
|
304
274
|
|
|
275
|
+
const progressBarObjt = order?.delivery_type && order?.delivery_type === 2 ? getOrderStatuPickUp : getOrderStatus
|
|
276
|
+
|
|
305
277
|
return (
|
|
306
278
|
<Container
|
|
307
279
|
isSelectedOrders={isSelectedOrders}
|
|
@@ -367,10 +339,10 @@ const OrderDetailsUI = (props) => {
|
|
|
367
339
|
<p>
|
|
368
340
|
{t('SPOT', 'Spot')}: {order?.place?.name}
|
|
369
341
|
</p>
|
|
370
|
-
</PlaceSpotContainer>
|
|
342
|
+
</PlaceSpotContainer>
|
|
371
343
|
)}
|
|
372
344
|
<StatusBarContainer>
|
|
373
|
-
<StatusBar percentage={
|
|
345
|
+
<StatusBar percentage={progressBarObjt(order?.status)?.percentage} />
|
|
374
346
|
</StatusBarContainer>
|
|
375
347
|
<AdvancedLogistic>
|
|
376
348
|
<div>
|
|
@@ -542,7 +514,7 @@ const OrderDetailsUI = (props) => {
|
|
|
542
514
|
ref={printRef}
|
|
543
515
|
order={order}
|
|
544
516
|
placeSpotEnabled={placeSpotEnabled}
|
|
545
|
-
getOrderStatus={
|
|
517
|
+
getOrderStatus={progressBarObjt}
|
|
546
518
|
getLogisticTag={getLogisticTag}
|
|
547
519
|
getPriorityTag={getPriorityTag}
|
|
548
520
|
/>
|
|
@@ -551,7 +523,7 @@ const OrderDetailsUI = (props) => {
|
|
|
551
523
|
<OrderToPrintTicket
|
|
552
524
|
ref={printTicketRef}
|
|
553
525
|
order={order}
|
|
554
|
-
getOrderStatus={
|
|
526
|
+
getOrderStatus={progressBarObjt}
|
|
555
527
|
/>
|
|
556
528
|
)}
|
|
557
529
|
</Container>
|
|
@@ -734,7 +734,9 @@ export const OrdersTable = (props) => {
|
|
|
734
734
|
</OrdersCountWrapper>
|
|
735
735
|
</WrapperImage>
|
|
736
736
|
<div className='info'>
|
|
737
|
-
<p className='bold'>
|
|
737
|
+
<p className='bold'>
|
|
738
|
+
{(!order?.customer?.email && !order?.customer?.cellphone && !order?.customer?.name) ? t('GUEST_USER', 'Guest user') : order?.customer?.name}
|
|
739
|
+
</p>
|
|
738
740
|
<p>{order?.customer?.cellphone}</p>
|
|
739
741
|
</div>
|
|
740
742
|
</CustomerInfo>
|
|
@@ -190,22 +190,22 @@ export const SettingsListUI = (props) => {
|
|
|
190
190
|
<p>{config?.description}</p>
|
|
191
191
|
)}
|
|
192
192
|
{
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
193
|
+
config?.options?.length > 0 && config?.options?.map((item, j) => (
|
|
194
|
+
<FormGroupWrapper key={j}>
|
|
195
|
+
<FormGroupCheck className='checkbox'>
|
|
196
|
+
<label>
|
|
197
|
+
<input
|
|
198
|
+
type='checkbox'
|
|
199
|
+
name={item?.value}
|
|
200
|
+
data-id={config?.id}
|
|
201
|
+
defaultChecked={config?.value.split('|').includes(item?.value)}
|
|
202
|
+
onChange={(e) => handleCheckBoxChange(e, true, config?.value)}
|
|
203
|
+
/>
|
|
204
|
+
{t(item.text.toUpperCase(), item.text.replace(/_/g, ' ').toLowerCase())}
|
|
205
|
+
</label>
|
|
206
|
+
</FormGroupCheck>
|
|
207
|
+
</FormGroupWrapper>
|
|
208
|
+
))
|
|
209
209
|
}
|
|
210
210
|
{
|
|
211
211
|
!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>
|
|
@@ -236,22 +236,22 @@ export const SettingsListUI = (props) => {
|
|
|
236
236
|
<p>{config?.description}</p>
|
|
237
237
|
)}
|
|
238
238
|
{
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
239
|
+
config?.options?.length > 0 && config?.options?.map((item, j) => (
|
|
240
|
+
<FormGroupWrapper key={j}>
|
|
241
|
+
<FormGroupCheck className='checkbox'>
|
|
242
|
+
<label>
|
|
243
|
+
<input
|
|
244
|
+
type='checkbox'
|
|
245
|
+
name={item?.value}
|
|
246
|
+
data-id={config?.id}
|
|
247
|
+
defaultChecked={JSON.parse(config?.value).includes(parseInt(item?.value))}
|
|
248
|
+
onChange={(e) => handleCheckBoxChange(e, false, config?.value)}
|
|
249
|
+
/>
|
|
250
|
+
{item.text}
|
|
251
|
+
</label>
|
|
252
|
+
</FormGroupCheck>
|
|
253
|
+
</FormGroupWrapper>
|
|
254
|
+
))
|
|
255
255
|
}
|
|
256
256
|
{!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>}
|
|
257
257
|
</CheckBoxWrapper>
|
|
@@ -267,27 +267,27 @@ export const SettingsListUI = (props) => {
|
|
|
267
267
|
)
|
|
268
268
|
}
|
|
269
269
|
{/* {config.type === 6 && (
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
270
|
+
<>
|
|
271
|
+
<FormGroupText className='form-group'>
|
|
272
|
+
<label>{config?.name}</label>
|
|
273
|
+
{config?.description && <Description>{config?.description}</Description>}
|
|
274
|
+
{config?.value?.split('|')?.filter(value => valuesTypeSix.includes(value?.split(',')[0]))?.map((value, i, hash) => (
|
|
275
|
+
<React.Fragment key={`${config?.id} ${value}`}>
|
|
276
|
+
<Description typeSix>{t(value?.split(',')[0], value?.split(',')[0].replace('_', ' '))}</Description>
|
|
277
|
+
<input
|
|
278
|
+
type='text'
|
|
279
|
+
defaultValue={value?.split(',')[1]}
|
|
280
|
+
onChange={(e) => handleChangeTypeSix({
|
|
281
|
+
value: e.target.value,
|
|
282
|
+
type: value?.split(',')[0]
|
|
283
|
+
}, config)}
|
|
284
|
+
className='form-control'
|
|
285
|
+
placeholder={0}
|
|
286
|
+
/>
|
|
287
|
+
</React.Fragment>
|
|
288
|
+
))}
|
|
289
|
+
</FormGroupText>
|
|
290
|
+
</>
|
|
291
291
|
)} */}
|
|
292
292
|
</div>
|
|
293
293
|
)
|
|
@@ -61,6 +61,7 @@ export const FormGroupCheck = styled.div`
|
|
|
61
61
|
display: flex;
|
|
62
62
|
align-items: center;
|
|
63
63
|
color: ${props => props.theme.colors.headingColor};
|
|
64
|
+
text-transform: capitalize;
|
|
64
65
|
}
|
|
65
66
|
`
|
|
66
67
|
|
|
@@ -87,7 +88,7 @@ export const CheckBoxWrapper = styled.div`
|
|
|
87
88
|
|
|
88
89
|
> label {
|
|
89
90
|
font-weight: 600;
|
|
90
|
-
margin:
|
|
91
|
+
margin: 0px;
|
|
91
92
|
font-size: 14px;
|
|
92
93
|
color: ${props => props.theme.colors.headingColor};
|
|
93
94
|
}
|
|
@@ -504,6 +504,7 @@ const SidebarMenuUI = (props) => {
|
|
|
504
504
|
<MenuContent>
|
|
505
505
|
{ordersSubMenus.map(item => (
|
|
506
506
|
!(sessionState?.user?.level === 2 && item.pageName === 'drivers') &&
|
|
507
|
+
!((sessionState?.user?.level === 2 || sessionState?.user?.level === 5) && item.pageName === 'giftCards') &&
|
|
507
508
|
!(sessionState?.user?.level === 5 && item.pageName === 'appointments') && (
|
|
508
509
|
item.pageName === 'appointments' ? (
|
|
509
510
|
isEnabledAppointmentsFeature && (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage, BusinessDeviceDetail as BusinessDeviceDetailController } from 'ordering-components-admin-external'
|
|
3
|
-
import { ThreeDots, ArrowsAngleContract, ArrowsAngleExpand } from 'react-bootstrap-icons'
|
|
3
|
+
import { ThreeDots, ArrowsAngleContract, ArrowsAngleExpand, PersonFill } from 'react-bootstrap-icons'
|
|
4
4
|
import { Button, IconButton, DefaultSelect, Input } from '../../../styles'
|
|
5
5
|
import { Select } from '../../../styles/Select/FirstSelect'
|
|
6
6
|
import { useTheme } from 'styled-components'
|
|
@@ -34,7 +34,9 @@ const BusinessDeviceDetailUI = (props) => {
|
|
|
34
34
|
|
|
35
35
|
const [isExpand, setIsExpand] = useState(false)
|
|
36
36
|
const [businessOptions, setBusinessOptions] = useState(null)
|
|
37
|
-
const [
|
|
37
|
+
const [ownerOptions, setOwnerOptions] = useState(null)
|
|
38
|
+
const [businessSearchVal, setBusinessSearchVal] = useState('')
|
|
39
|
+
const [userSearchVal, setUserSearchVal] = useState('')
|
|
38
40
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
39
41
|
|
|
40
42
|
const moreOptions = [
|
|
@@ -72,13 +74,28 @@ const BusinessDeviceDetailUI = (props) => {
|
|
|
72
74
|
if (businessList?.loading) return
|
|
73
75
|
|
|
74
76
|
const options = businessList?.businesses
|
|
75
|
-
.filter(option => option?.name.toLocaleLowerCase().includes(
|
|
77
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(businessSearchVal.toLocaleLowerCase()))
|
|
76
78
|
.map(business => ({
|
|
77
79
|
value: business?.id,
|
|
78
80
|
content: <Option><Logo src={business?.logo || theme.images?.dummies?.businessLogo} />{business?.name}</Option>
|
|
79
81
|
}))
|
|
80
82
|
setBusinessOptions(options)
|
|
81
|
-
}, [
|
|
83
|
+
}, [businessSearchVal, businessList])
|
|
84
|
+
|
|
85
|
+
useEffect(() => {
|
|
86
|
+
if (!businessList?.loading && (formState?.changes?.business_id || selectedDevice?.business_id)) {
|
|
87
|
+
const owners = businessList?.businesses.find(business => business.id === (formState?.changes?.business_id || selectedDevice?.business_id))?.owners
|
|
88
|
+
if (owners?.length > 0) {
|
|
89
|
+
const options = owners
|
|
90
|
+
.filter(option => option?.name.toLocaleLowerCase().includes(userSearchVal.toLocaleLowerCase()))
|
|
91
|
+
.map(user => ({
|
|
92
|
+
value: user?.id,
|
|
93
|
+
content: <Option>{user?.photo ? <Logo src={user?.photo} /> : <PersonFill />}{user?.name} {user?.lastname}</Option>
|
|
94
|
+
}))
|
|
95
|
+
setOwnerOptions(options)
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}, [userSearchVal, selectedDevice, formState?.changes?.business_id, businessList])
|
|
82
99
|
|
|
83
100
|
useEffect(() => {
|
|
84
101
|
if (formState?.result?.error) {
|
|
@@ -137,11 +154,33 @@ const BusinessDeviceDetailUI = (props) => {
|
|
|
137
154
|
isShowSearchBar
|
|
138
155
|
searchBarIsCustomLayout
|
|
139
156
|
searchBarIsNotLazyLoad
|
|
140
|
-
searchValue={
|
|
141
|
-
handleChangeSearch={(val) =>
|
|
157
|
+
searchValue={businessSearchVal}
|
|
158
|
+
handleChangeSearch={(val) => setBusinessSearchVal(val)}
|
|
142
159
|
/>
|
|
143
160
|
)}
|
|
144
161
|
</SelectWrapper>
|
|
162
|
+
{(formState?.changes?.business_id || selectedDevice?.business_id) && (
|
|
163
|
+
<SelectWrapper>
|
|
164
|
+
<label>{t('BUSINESS_OWNER', 'Business owner')}</label>
|
|
165
|
+
{businessList?.loading ? (
|
|
166
|
+
<Skeleton height={44} />
|
|
167
|
+
) : (
|
|
168
|
+
<Select
|
|
169
|
+
options={ownerOptions}
|
|
170
|
+
className='select'
|
|
171
|
+
defaultValue={formState?.changes?.user_id ?? selectedDevice?.user_id}
|
|
172
|
+
placeholder={t('SELECT_OPTION', 'Select an option')}
|
|
173
|
+
onChange={(value) => handleChangeFormState({ user_id: value })}
|
|
174
|
+
isShowSearchBar
|
|
175
|
+
searchBarIsCustomLayout
|
|
176
|
+
searchBarIsNotLazyLoad
|
|
177
|
+
searchValue={userSearchVal}
|
|
178
|
+
handleChangeSearch={(val) => setUserSearchVal(val)}
|
|
179
|
+
/>
|
|
180
|
+
)}
|
|
181
|
+
</SelectWrapper>
|
|
182
|
+
)}
|
|
183
|
+
|
|
145
184
|
{selectedDevice && (
|
|
146
185
|
<FormControl>
|
|
147
186
|
<label>{t('DEVICE_CODE', 'Device Code')}</label>
|
|
@@ -177,7 +216,7 @@ export const BusinessDeviceDetail = (props) => {
|
|
|
177
216
|
const businessDeviceDetailProps = {
|
|
178
217
|
...props,
|
|
179
218
|
UIComponent: BusinessDeviceDetailUI,
|
|
180
|
-
propsToFetch: ['id', 'name', 'logo']
|
|
219
|
+
propsToFetch: ['id', 'name', 'logo', 'owners']
|
|
181
220
|
}
|
|
182
221
|
return <BusinessDeviceDetailController {...businessDeviceDetailProps} />
|
|
183
222
|
}
|
|
@@ -114,6 +114,7 @@ export const SelectWrapper = styled.div`
|
|
|
114
114
|
color: ${props => props.theme.colors.secundaryContrast};
|
|
115
115
|
}
|
|
116
116
|
.list {
|
|
117
|
+
width: 100%;
|
|
117
118
|
background-color: ${props => props.theme.colors.secundary};
|
|
118
119
|
border: none;
|
|
119
120
|
|
|
@@ -145,6 +146,16 @@ export const Option = styled.div`
|
|
|
145
146
|
font-size: 14px;
|
|
146
147
|
line-height: 24px;
|
|
147
148
|
color: ${props => props.theme.colors.secundaryContrast};
|
|
149
|
+
word-break: break-all;
|
|
150
|
+
svg {
|
|
151
|
+
min-width: 25px;
|
|
152
|
+
height: 25px;
|
|
153
|
+
margin-right: 15px;
|
|
154
|
+
${props => props.theme.rtl && css`
|
|
155
|
+
margin-left: 15px;
|
|
156
|
+
margin-right: 0;
|
|
157
|
+
`}
|
|
158
|
+
}
|
|
148
159
|
`
|
|
149
160
|
|
|
150
161
|
export const Logo = styled.img`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
2
|
-
import { useLanguage } from 'ordering-components-admin-external'
|
|
1
|
+
import React, { useMemo, useState } from 'react'
|
|
2
|
+
import { useLanguage, useApi } from 'ordering-components-admin-external'
|
|
3
3
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
4
4
|
import { useTheme } from 'styled-components'
|
|
5
5
|
import { Button } from '../../../styles'
|
|
@@ -17,9 +17,10 @@ import {
|
|
|
17
17
|
} from './styles'
|
|
18
18
|
|
|
19
19
|
export const BusinessSalesChannel = (props) => {
|
|
20
|
-
const { setIsExtendExtraOpen, business } = props
|
|
20
|
+
const { setIsExtendExtraOpen, business, siteState } = props
|
|
21
21
|
|
|
22
22
|
const [, t] = useLanguage()
|
|
23
|
+
const [ordering] = useApi()
|
|
23
24
|
const theme = useTheme()
|
|
24
25
|
const { width } = useWindowSize()
|
|
25
26
|
|
|
@@ -52,6 +53,10 @@ export const BusinessSalesChannel = (props) => {
|
|
|
52
53
|
setSelectedItem(null)
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
const storeUrl = useMemo(() => (siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended' && siteState?.ssl_status !== 'error'
|
|
57
|
+
? `https://${siteState?.site?.domain}/store/${business?.slug}`
|
|
58
|
+
: `https://${ordering.project}.tryordering.com/store/${business?.slug}`), [siteState, business])
|
|
59
|
+
|
|
55
60
|
return (
|
|
56
61
|
<Container>
|
|
57
62
|
<SalesContainer>
|
|
@@ -94,27 +99,28 @@ export const BusinessSalesChannel = (props) => {
|
|
|
94
99
|
<>
|
|
95
100
|
{selectedItem?.key === 'facebook' && (
|
|
96
101
|
<BusinessSalesFacebook
|
|
97
|
-
businessSlug={business.slug}
|
|
98
102
|
socialItem={selectedItem}
|
|
103
|
+
storeUrl={storeUrl}
|
|
99
104
|
onClose={handleCloseDetail}
|
|
100
105
|
/>
|
|
101
106
|
)}
|
|
102
107
|
{selectedItem?.key === 'tiktok' && (
|
|
103
108
|
<BusinessSalesTiktok
|
|
109
|
+
storeUrl={storeUrl}
|
|
104
110
|
socialItem={selectedItem}
|
|
105
111
|
onClose={handleCloseDetail}
|
|
106
112
|
/>
|
|
107
113
|
)}
|
|
108
114
|
{selectedItem?.key === 'instagram' && (
|
|
109
115
|
<BusinessSalesInstagram
|
|
110
|
-
|
|
116
|
+
storeUrl={storeUrl}
|
|
111
117
|
socialItem={selectedItem}
|
|
112
118
|
onClose={handleCloseDetail}
|
|
113
119
|
/>
|
|
114
120
|
)}
|
|
115
121
|
{selectedItem?.key === 'google_my_business' && (
|
|
116
122
|
<BusinessSalesGoogle
|
|
117
|
-
|
|
123
|
+
storeUrl={storeUrl}
|
|
118
124
|
socialItem={selectedItem}
|
|
119
125
|
onClose={handleCloseDetail}
|
|
120
126
|
/>
|