ordering-ui-admin-external 1.7.4 → 1.8.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.215ac926de72666d96e4.js → ordering-ui-admin.22db20d62f2d39ead727.js} +2 -2
- package/_bundles/{ordering-ui-admin.215ac926de72666d96e4.js.LICENSE.txt → ordering-ui-admin.22db20d62f2d39ead727.js.LICENSE.txt} +0 -0
- package/_modules/components/Delivery/DriversGroupDeliveryDetails/index.js +104 -0
- package/_modules/components/Delivery/DriversGroupDeliveryDetails/styles.js +12 -0
- package/_modules/components/Delivery/DriversGroupDeliveryZoneInformation/index.js +274 -0
- package/_modules/components/Delivery/DriversGroupDeliveryZoneInformation/styles.js +40 -0
- package/_modules/components/Delivery/DriversGroupDeliveryZoneList/index.js +119 -0
- package/_modules/components/Delivery/DriversGroupDeliveryZoneList/styles.js +54 -0
- package/_modules/components/Delivery/DriversGroupDetails/index.js +37 -8
- package/_modules/components/Delivery/DriversGroupsDeliveryZoneDetails/index.js +125 -0
- package/_modules/components/Delivery/DriversGroupsDeliveryZoneDetails/styles.js +62 -0
- package/_modules/components/Delivery/DriversGroupsList/index.js +2 -1
- package/_modules/components/Delivery/DriversGroupsListing/index.js +12 -6
- package/_modules/components/Home/HomePage/index.js +2 -2
- package/_modules/components/Orders/Messages/index.js +1 -1
- package/_modules/components/SidebarMenu/index.js +4 -3
- package/_modules/components/SidebarMenu/styles.js +22 -18
- package/_modules/components/Stores/BusinessDelete/index.js +99 -0
- package/_modules/components/Stores/BusinessDelete/styles.js +19 -0
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/index.js +181 -0
- package/_modules/components/Stores/BusinessDeliveryGroupsDetails/styles.js +14 -0
- package/_modules/components/Stores/BusinessDeliveryPickupMore/index.js +5 -1
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +34 -12
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/styles.js +1 -1
- package/_modules/components/Stores/BusinessProductAddForm/index.js +4 -4
- package/_modules/components/Stores/BusinessesList/index.js +75 -10
- package/_modules/components/Stores/BusinessesList/styles.js +26 -3
- package/_modules/components/Stores/BusinessesListing/index.js +19 -4
- package/_modules/components/Stores/BusinessesListing/styles.js +10 -3
- package/_modules/components/Stores/PaymentOptionMethods/index.js +11 -12
- package/_modules/components/Stores/PaymentOptionMethods/styles.js +1 -5
- package/_modules/components/Stores/PaymentOptionPaypal/index.js +6 -7
- package/_modules/components/Stores/PaymentOptionPaypal/styles.js +1 -5
- package/_modules/components/Stores/PaymentOptionSquare/index.js +1 -1
- package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +11 -12
- package/_modules/components/Stores/PaymentOptionStripeDirect/styles.js +1 -5
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +11 -12
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/styles.js +1 -5
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +11 -12
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/styles.js +1 -5
- package/_modules/components/Stores/SingleBusiness/index.js +37 -19
- package/_modules/components/Stores/SingleBusiness/styles.js +20 -3
- package/_modules/components/Stores/index.js +7 -0
- package/package.json +2 -2
- package/src/components/Delivery/DriversGroupDeliveryDetails/index.js +84 -0
- package/src/components/Delivery/DriversGroupDeliveryDetails/styles.js +11 -0
- package/src/components/Delivery/DriversGroupDeliveryZoneInformation/index.js +278 -0
- package/src/components/Delivery/DriversGroupDeliveryZoneInformation/styles.js +93 -0
- package/src/components/Delivery/DriversGroupDeliveryZoneList/index.js +134 -0
- package/src/components/Delivery/DriversGroupDeliveryZoneList/styles.js +87 -0
- package/src/components/Delivery/DriversGroupDetails/index.js +29 -6
- package/src/components/Delivery/DriversGroupsDeliveryZoneDetails/index.js +123 -0
- package/src/components/Delivery/DriversGroupsDeliveryZoneDetails/styles.js +125 -0
- package/src/components/Delivery/DriversGroupsList/index.js +2 -2
- package/src/components/Delivery/DriversGroupsListing/index.js +4 -1
- package/src/components/Home/HomePage/index.js +3 -3
- package/src/components/Orders/Messages/index.js +1 -1
- package/src/components/SidebarMenu/index.js +25 -15
- package/src/components/SidebarMenu/styles.js +10 -2
- package/src/components/Stores/BusinessDelete/index.js +99 -0
- package/src/components/Stores/BusinessDelete/styles.js +40 -0
- package/src/components/Stores/BusinessDeliveryGroupsDetails/index.js +127 -0
- package/src/components/Stores/BusinessDeliveryGroupsDetails/styles.js +16 -0
- package/src/components/Stores/BusinessDeliveryPickupMore/index.js +6 -1
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +35 -10
- package/src/components/Stores/BusinessDeliveryZoneInformation/styles.js +1 -1
- package/src/components/Stores/BusinessProductAddForm/index.js +2 -2
- package/src/components/Stores/BusinessesList/index.js +83 -10
- package/src/components/Stores/BusinessesList/styles.js +52 -0
- package/src/components/Stores/BusinessesListing/index.js +27 -8
- package/src/components/Stores/BusinessesListing/styles.js +34 -0
- package/src/components/Stores/PaymentOptionMethods/index.js +9 -12
- package/src/components/Stores/PaymentOptionMethods/styles.js +0 -10
- package/src/components/Stores/PaymentOptionPaypal/index.js +9 -12
- package/src/components/Stores/PaymentOptionPaypal/styles.js +0 -10
- package/src/components/Stores/PaymentOptionSquare/index.js +1 -1
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +9 -12
- package/src/components/Stores/PaymentOptionStripeDirect/styles.js +0 -10
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +9 -12
- package/src/components/Stores/PaymethodOptionPaypalExpress/styles.js +0 -10
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +9 -12
- package/src/components/Stores/PaymethodOptionStripeRedirect/styles.js +0 -10
- package/src/components/Stores/SingleBusiness/index.js +38 -13
- package/src/components/Stores/SingleBusiness/styles.js +30 -0
- package/src/components/Stores/index.js +2 -0
- package/template/assets/images/myProducts/driver-app-brand.png +0 -0
- package/template/assets/images/myProducts/driver-app-free.png +0 -0
- package/template/assets/images/myProducts/multi-store-customer-app.png +0 -0
- package/template/assets/images/myProducts/my-callcenter-app-brand.png +0 -0
- package/template/assets/images/myProducts/my-callcenter-app-live.png +0 -0
- package/template/assets/images/myProducts/my-kiosk-app-brand.png +0 -0
- package/template/assets/images/myProducts/my-kiosk-app-live.png +0 -0
- package/template/assets/images/myProducts/my-pos-app-brand.png +0 -0
- package/template/assets/images/myProducts/my-pos-app-live.png +0 -0
- package/template/assets/images/myProducts/ordering-website.png +0 -0
- package/template/assets/images/myProducts/single-store-customer-app.png +0 -0
- package/template/assets/images/myProducts/store-app-brand.png +0 -0
- package/template/assets/images/myProducts/store-app-free.png +0 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
useLanguage,
|
|
4
|
+
DriverGroupDeliveryZone as DriverGroupDeliveryZoneController
|
|
5
|
+
} from 'ordering-components-admin-external'
|
|
6
|
+
import { DriverGroupDeliveryZoneInformation } from '../DriversGroupDeliveryZoneInformation'
|
|
7
|
+
import { ThreeDots } from 'react-bootstrap-icons'
|
|
8
|
+
import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
9
|
+
import { useTheme } from 'styled-components'
|
|
10
|
+
import { Confirm } from '../../Shared'
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
Container,
|
|
14
|
+
Header,
|
|
15
|
+
TabContainer,
|
|
16
|
+
Tab,
|
|
17
|
+
ActionSelectorWrapper
|
|
18
|
+
} from './styles'
|
|
19
|
+
|
|
20
|
+
const DriverGroupDeliveryZoneDetailsUI = (props) => {
|
|
21
|
+
const {
|
|
22
|
+
drivergroup,
|
|
23
|
+
driverGroupsZones,
|
|
24
|
+
zoneState,
|
|
25
|
+
formState,
|
|
26
|
+
handleChangeInput,
|
|
27
|
+
handleChangeFormState,
|
|
28
|
+
handleUpdateDriverGroupDeliveryZone,
|
|
29
|
+
handleAddDriverGroupDeliveryZone,
|
|
30
|
+
handleDeleteDriverGroupDeliveryZone,
|
|
31
|
+
handleUploadKmlFiles,
|
|
32
|
+
kmlData,
|
|
33
|
+
} = props
|
|
34
|
+
|
|
35
|
+
const theme = useTheme()
|
|
36
|
+
const [, t] = useLanguage()
|
|
37
|
+
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
38
|
+
const [selectedMenuOption, setSelectedMenuOption] = useState('information')
|
|
39
|
+
const tabs = [
|
|
40
|
+
{ key: 'information', content: t('INFORMATION', 'Information') }
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
const onClickDelete = () => {
|
|
44
|
+
setConfirm({
|
|
45
|
+
open: true,
|
|
46
|
+
content: t('QUESTION_DELETE_DELIVERYZONE', 'Are you sure that you want to delete this delivery zone?'),
|
|
47
|
+
handleOnAccept: () => {
|
|
48
|
+
setConfirm({ ...confirm, open: false })
|
|
49
|
+
handleDeleteDriverGroupDeliveryZone()
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<>
|
|
56
|
+
<Container>
|
|
57
|
+
<Header>
|
|
58
|
+
<h1>
|
|
59
|
+
{zoneState?.zone ? zoneState?.zone?.name : t('ZONE_DELIVERY_SETTINGS', 'Zone delivery settings')}
|
|
60
|
+
</h1>
|
|
61
|
+
<ActionSelectorWrapper>
|
|
62
|
+
<DropdownButton
|
|
63
|
+
menuAlign={theme?.rtl ? 'left' : 'right'}
|
|
64
|
+
title={<ThreeDots />}
|
|
65
|
+
id={theme?.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'}
|
|
66
|
+
>
|
|
67
|
+
<Dropdown.Item
|
|
68
|
+
onClick={() => onClickDelete()}
|
|
69
|
+
>
|
|
70
|
+
{t('DELETE', 'Delete')}
|
|
71
|
+
</Dropdown.Item>
|
|
72
|
+
</DropdownButton>
|
|
73
|
+
</ActionSelectorWrapper>
|
|
74
|
+
</Header>
|
|
75
|
+
<TabContainer>
|
|
76
|
+
{tabs?.map(tab => (
|
|
77
|
+
<Tab
|
|
78
|
+
key={tab?.key}
|
|
79
|
+
active={selectedMenuOption === tab?.key}
|
|
80
|
+
onClick={() => setSelectedMenuOption(tab?.key)}
|
|
81
|
+
>
|
|
82
|
+
{tab?.content}
|
|
83
|
+
</Tab>
|
|
84
|
+
))}
|
|
85
|
+
</TabContainer>
|
|
86
|
+
|
|
87
|
+
{selectedMenuOption === 'information' && (
|
|
88
|
+
<DriverGroupDeliveryZoneInformation
|
|
89
|
+
drivergroup={drivergroup}
|
|
90
|
+
zone={zoneState?.zone}
|
|
91
|
+
driverGroupsZones={driverGroupsZones?.zones}
|
|
92
|
+
formState={formState}
|
|
93
|
+
handleChangeInput={handleChangeInput}
|
|
94
|
+
handleChangeFormState={handleChangeFormState}
|
|
95
|
+
handleUpdateDriverGroupDeliveryZone={handleUpdateDriverGroupDeliveryZone}
|
|
96
|
+
handleAddDriverGroupDeliveryZone={handleAddDriverGroupDeliveryZone}
|
|
97
|
+
kmlData={kmlData}
|
|
98
|
+
handleUploadKmlFiles={handleUploadKmlFiles}
|
|
99
|
+
/>
|
|
100
|
+
)}
|
|
101
|
+
</Container>
|
|
102
|
+
<Confirm
|
|
103
|
+
width='700px'
|
|
104
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
105
|
+
content={confirm?.content}
|
|
106
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
107
|
+
open={confirm?.open}
|
|
108
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
109
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
110
|
+
onAccept={confirm.handleOnAccept}
|
|
111
|
+
closeOnBackdrop={false}
|
|
112
|
+
/>
|
|
113
|
+
</>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export const DriverGroupDeliveryZoneDetails = (props) => {
|
|
118
|
+
const driverGroupDeliveryZoneProps = {
|
|
119
|
+
...props,
|
|
120
|
+
UIComponent: DriverGroupDeliveryZoneDetailsUI
|
|
121
|
+
}
|
|
122
|
+
return <DriverGroupDeliveryZoneController {...driverGroupDeliveryZoneProps} />
|
|
123
|
+
}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
import { darken } from 'polished'
|
|
3
|
+
|
|
4
|
+
export const Container = styled.div`
|
|
5
|
+
width: 100%;
|
|
6
|
+
padding: 20px;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
|
|
9
|
+
> button {
|
|
10
|
+
margin: 20px 0;
|
|
11
|
+
}
|
|
12
|
+
`
|
|
13
|
+
|
|
14
|
+
export const Header = styled.div`
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: space-between;
|
|
18
|
+
h1 {
|
|
19
|
+
font-size: 20px;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
color: ${props => props.theme.colors.headingColor};
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
}
|
|
24
|
+
${props => props.theme?.rtl ? css`
|
|
25
|
+
margin-left: 35px;
|
|
26
|
+
` : css`
|
|
27
|
+
margin-right: 35px;
|
|
28
|
+
`}
|
|
29
|
+
`
|
|
30
|
+
|
|
31
|
+
export const TabContainer = styled.div`
|
|
32
|
+
width: 100%;
|
|
33
|
+
display: flex;
|
|
34
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
35
|
+
margin-bottom: 24px;
|
|
36
|
+
margin-top: 15px;
|
|
37
|
+
`
|
|
38
|
+
|
|
39
|
+
export const Tab = styled.div`
|
|
40
|
+
padding: 10px 0px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
position: relative;
|
|
46
|
+
${props => props.theme?.rtl ? css`
|
|
47
|
+
margin-left: 30px;
|
|
48
|
+
` : css`
|
|
49
|
+
margin-right: 30px;
|
|
50
|
+
`}
|
|
51
|
+
|
|
52
|
+
${({ active }) => active && css`
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
|
|
55
|
+
&::after {
|
|
56
|
+
content: "";
|
|
57
|
+
background: #344050;
|
|
58
|
+
height: 1px;
|
|
59
|
+
position: absolute;
|
|
60
|
+
width: 100%;
|
|
61
|
+
bottom: -1px;
|
|
62
|
+
${props => props.theme?.rtl ? css`
|
|
63
|
+
right: 0;
|
|
64
|
+
` : css`
|
|
65
|
+
left: 0;
|
|
66
|
+
`}
|
|
67
|
+
}
|
|
68
|
+
`}
|
|
69
|
+
${({ active }) => !active && css`
|
|
70
|
+
color: ${props => props.theme.colors?.lightGray};
|
|
71
|
+
`}
|
|
72
|
+
`
|
|
73
|
+
export const ActionSelectorWrapper = styled.div`
|
|
74
|
+
button {
|
|
75
|
+
background: transparent !important;
|
|
76
|
+
border: none;
|
|
77
|
+
padding: 0px 5px;
|
|
78
|
+
&:active,
|
|
79
|
+
&:focus {
|
|
80
|
+
border-color: unset !important;
|
|
81
|
+
box-shadow: none !important;
|
|
82
|
+
}
|
|
83
|
+
svg {
|
|
84
|
+
color: ${props => props.theme.colors.headingColor};
|
|
85
|
+
font-size: 20px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&:after {
|
|
89
|
+
display: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&:hover {
|
|
93
|
+
background: ${props => darken(0.04, props.theme.colors.secundary)} !important;
|
|
94
|
+
}
|
|
95
|
+
&:active {
|
|
96
|
+
background: ${props => darken(0.1, props.theme.colors.secundary)} !important;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.show {
|
|
101
|
+
button {
|
|
102
|
+
background: ${props => darken(0.04, props.theme.colors.secundary)} !important;
|
|
103
|
+
}
|
|
104
|
+
>div {
|
|
105
|
+
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
106
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
> div {
|
|
111
|
+
> div {
|
|
112
|
+
border-radius: 8px;
|
|
113
|
+
.dropdown-item {
|
|
114
|
+
font-size: 12px;
|
|
115
|
+
color: ${props => props.theme.colors.headingColor};
|
|
116
|
+
&:active {
|
|
117
|
+
background: ${props => darken(0.1, props.theme.colors.secundary)} !important;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
.dropdown-item:last-child {
|
|
121
|
+
color: #E63757;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`
|
|
@@ -32,7 +32,7 @@ export const DriversGroupsList = (props) => {
|
|
|
32
32
|
handleOpenDetails,
|
|
33
33
|
handleUpdateDriversGroup,
|
|
34
34
|
selectedGroupList,
|
|
35
|
-
|
|
35
|
+
isFromStore,
|
|
36
36
|
handleSelectGroup,
|
|
37
37
|
handleAllSelectGroup
|
|
38
38
|
} = props
|
|
@@ -79,7 +79,7 @@ export const DriversGroupsList = (props) => {
|
|
|
79
79
|
const handleClickDriverGroup = (e, group) => {
|
|
80
80
|
const isInvalid = e.target.closest('.group-checkbox') || e.target.closest('.group-enabled')
|
|
81
81
|
if (isInvalid) return
|
|
82
|
-
handleOpenDetails(group)
|
|
82
|
+
!isFromStore && handleOpenDetails(group)
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
const getTypeTag = (type) => {
|
|
@@ -45,6 +45,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
45
45
|
const [moveDistance, setMoveDistance] = useState(0)
|
|
46
46
|
const [openDetails, setOpenDetails] = useState(false)
|
|
47
47
|
const [curDriversGroup, setCurDriversGroup] = useState(null)
|
|
48
|
+
const [isExtendExtraOpen, setIsExtendExtraOpen] = useState(false)
|
|
48
49
|
|
|
49
50
|
const [isTourOpen, setIsTourOpen] = useState(false)
|
|
50
51
|
const [currentTourStep, setCurrentTourStep] = useState(4)
|
|
@@ -186,7 +187,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
186
187
|
{openDetails && (
|
|
187
188
|
<SideBar
|
|
188
189
|
sidebarId='driver_group_details'
|
|
189
|
-
defaultSideBarWidth={
|
|
190
|
+
defaultSideBarWidth={!isExtendExtraOpen ? 540 + moveDistance : 1040}
|
|
190
191
|
open={openDetails}
|
|
191
192
|
moveDistance={moveDistance}
|
|
192
193
|
noAnimation={isTourOpen}
|
|
@@ -207,6 +208,8 @@ const DriversGroupsListingUI = (props) => {
|
|
|
207
208
|
companies={driversCompanyList?.companies}
|
|
208
209
|
handleUpdateDriversGroup={handleUpdateDriversGroup}
|
|
209
210
|
handleParentSidebarMove={val => setMoveDistance(val)}
|
|
211
|
+
setIsExtendExtraOpen={setIsExtendExtraOpen}
|
|
212
|
+
isExtendExtraOpen={isExtendExtraOpen}
|
|
210
213
|
onClose={() => {
|
|
211
214
|
setOpenDetails(false)
|
|
212
215
|
if (isTourOpen) {
|
|
@@ -219,15 +219,15 @@ const HomeUI = (props) => {
|
|
|
219
219
|
<h1>{t('HOME', 'Home')}</h1>
|
|
220
220
|
</Breadcrumb>
|
|
221
221
|
|
|
222
|
-
{projectStatus
|
|
222
|
+
{projectStatus?.loading && (
|
|
223
223
|
<HeaderContainer>
|
|
224
224
|
<Skeleton height={150} />
|
|
225
225
|
</HeaderContainer>
|
|
226
226
|
)}
|
|
227
227
|
|
|
228
|
-
{!projectStatus
|
|
228
|
+
{!projectStatus?.loading && (
|
|
229
229
|
<>
|
|
230
|
-
{!projectStatus
|
|
230
|
+
{!projectStatus?.project?.current_status ? (
|
|
231
231
|
<HeaderContainer>
|
|
232
232
|
<WelcomeMsg>{t('WELCOME_TO_ORDERING', 'Welcome to Ordering')}!</WelcomeMsg>
|
|
233
233
|
<GuideMsg>{t('ORDERING_GUIDE_MSG', 'Our guide helps you to configure your Ordering products.')}</GuideMsg>
|
|
@@ -485,7 +485,7 @@ export const MessagesUI = (props) => {
|
|
|
485
485
|
<BubbleConsole>
|
|
486
486
|
{t('ORDER_PLACED_FOR', 'Order placed for')} {' '}
|
|
487
487
|
<strong>{parseDate(order.created_at)}</strong> {' '}
|
|
488
|
-
{t('VIA', 'via')} <strong>{order.app_id}</strong>{' '}
|
|
488
|
+
{t('VIA', 'via')} <strong>{order.app_id ? t(order.app_id.toUpperCase(), `${order.app_id}`) : ''}</strong>{' '}
|
|
489
489
|
<OverlayTrigger
|
|
490
490
|
placement='top'
|
|
491
491
|
overlay={
|
|
@@ -39,7 +39,9 @@ import {
|
|
|
39
39
|
MenuContainer,
|
|
40
40
|
MenuContent,
|
|
41
41
|
SubMenu,
|
|
42
|
-
LanguageSelectorContainer
|
|
42
|
+
LanguageSelectorContainer,
|
|
43
|
+
LogoWrapper,
|
|
44
|
+
PoweredWrapper
|
|
43
45
|
} from './styles'
|
|
44
46
|
|
|
45
47
|
const SidebarMenuUI = (props) => {
|
|
@@ -54,6 +56,7 @@ const SidebarMenuUI = (props) => {
|
|
|
54
56
|
const [ordering] = useApi()
|
|
55
57
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
56
58
|
const windowSize = useWindowSize()
|
|
59
|
+
const isPoweredByOrderingModule = configs?.powered_by_ordering_module?.value
|
|
57
60
|
|
|
58
61
|
const ordersSubMenus = [
|
|
59
62
|
{
|
|
@@ -366,20 +369,27 @@ const SidebarMenuUI = (props) => {
|
|
|
366
369
|
className='d-flex flex-column'
|
|
367
370
|
>
|
|
368
371
|
<SidebarHeader>
|
|
369
|
-
<
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
<
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
372
|
+
<LogoWrapper>
|
|
373
|
+
<Image
|
|
374
|
+
src={configs?.dashboard_logo?.value || theme?.images?.logos?.logotype}
|
|
375
|
+
onClick={() => handleGoToPage({ page: 'home' })}
|
|
376
|
+
/>
|
|
377
|
+
<BurgerButton
|
|
378
|
+
onClick={() => handleMenuCollapse(true)}
|
|
379
|
+
>
|
|
380
|
+
<svg viewBox='0 0 50 32'>
|
|
381
|
+
<path d='M49,4H19c-0.6,0-1-0.4-1-1s0.4-1,1-1h30c0.6,0,1,0.4,1,1S49.6,4,49,4z' />
|
|
382
|
+
<path d='M49,16H19c-0.6,0-1-0.4-1-1s0.4-1,1-1h30c0.6,0,1,0.4,1,1S49.6,16,49,16z' />
|
|
383
|
+
<path d='M49,28H19c-0.6,0-1-0.4-1-1s0.4-1,1-1h30c0.6,0,1,0.4,1,1S49.6,28,49,28z' />
|
|
384
|
+
<path d='M8.1,22.8c-0.3,0-0.5-0.1-0.7-0.3L0.7,15l6.7-7.8c0.4-0.4,1-0.5,1.4-0.1c0.4,0.4,0.5,1,0.1,1.4L3.3,15l5.5,6.2 c0.4,0.4,0.3,1-0.1,1.4C8.6,22.7,8.4,22.8,8.1,22.8z' />
|
|
385
|
+
</svg>
|
|
386
|
+
</BurgerButton>
|
|
387
|
+
</LogoWrapper>
|
|
388
|
+
{isPoweredByOrderingModule && (
|
|
389
|
+
<PoweredWrapper>
|
|
390
|
+
{t('POWERED_BY_ORDERING', 'Powered by Ordering.co')}
|
|
391
|
+
</PoweredWrapper>
|
|
392
|
+
)}
|
|
383
393
|
</SidebarHeader>
|
|
384
394
|
<SidebarMainContent>
|
|
385
395
|
<SidebarContent className='d-flex flex-column justify-content-between p-1 pt-0'>
|
|
@@ -72,10 +72,14 @@ export const SidebarInnerContainer = styled.div`
|
|
|
72
72
|
`
|
|
73
73
|
|
|
74
74
|
export const SidebarHeader = styled.div`
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
padding: 12px;
|
|
78
|
+
`
|
|
79
|
+
export const LogoWrapper = styled.div`
|
|
75
80
|
display: flex;
|
|
76
81
|
justify-content: space-between;
|
|
77
82
|
align-items: center;
|
|
78
|
-
padding: 12px;
|
|
79
83
|
|
|
80
84
|
> img {
|
|
81
85
|
max-width: 150px;
|
|
@@ -83,7 +87,6 @@ export const SidebarHeader = styled.div`
|
|
|
83
87
|
object-fit: contain;
|
|
84
88
|
}
|
|
85
89
|
`
|
|
86
|
-
|
|
87
90
|
export const BurgerButton = styled.button`
|
|
88
91
|
background-color: transparent;
|
|
89
92
|
border: none;
|
|
@@ -232,3 +235,8 @@ export const LanguageSelectorContainer = styled.div`
|
|
|
232
235
|
}
|
|
233
236
|
}
|
|
234
237
|
`
|
|
238
|
+
export const PoweredWrapper = styled.div`
|
|
239
|
+
text-align: center;
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
font-weight: 600;
|
|
242
|
+
`
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useLanguage, CheckPassword as CheckPasswordController } from 'ordering-components-admin-external'
|
|
3
|
+
import FaTrash from '@meronex/icons/fa/FaTrash'
|
|
4
|
+
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
5
|
+
import { Button } from '../../../styles/Buttons'
|
|
6
|
+
import { Modal } from '../../Shared'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
WrapperCheckPassword,
|
|
10
|
+
ErrorText
|
|
11
|
+
} from './styles'
|
|
12
|
+
|
|
13
|
+
const BusinessDeleteUI = (props) => {
|
|
14
|
+
const {
|
|
15
|
+
checkPasswordStatus,
|
|
16
|
+
handleChangePassword,
|
|
17
|
+
getCheckPassword,
|
|
18
|
+
handleDeleteMultiBusinesses
|
|
19
|
+
} = props
|
|
20
|
+
const { width } = useWindowSize()
|
|
21
|
+
const [, t] = useLanguage()
|
|
22
|
+
|
|
23
|
+
const [checkPasswordModalOpen, setCheckPasswordModalOpen] = useState(false)
|
|
24
|
+
const [password, setPassword] = useState('')
|
|
25
|
+
const handlePassword = (e) => {
|
|
26
|
+
setPassword(e.target.value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const handleModalOpen = () => {
|
|
30
|
+
setPassword('')
|
|
31
|
+
setCheckPasswordModalOpen(true)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
handleChangePassword(password)
|
|
36
|
+
}, [password])
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (checkPasswordStatus.loading || checkPasswordStatus.error !== null) return
|
|
40
|
+
if (checkPasswordStatus.result === 'OK') {
|
|
41
|
+
setCheckPasswordModalOpen(false)
|
|
42
|
+
setPassword('')
|
|
43
|
+
handleDeleteMultiBusinesses()
|
|
44
|
+
}
|
|
45
|
+
}, [checkPasswordStatus])
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<>
|
|
49
|
+
<Button
|
|
50
|
+
borderRadius='8px'
|
|
51
|
+
color='secundary'
|
|
52
|
+
onClick={() => handleModalOpen()}
|
|
53
|
+
>
|
|
54
|
+
{width > 600 && t('DELETE', 'Delete')}
|
|
55
|
+
<FaTrash />
|
|
56
|
+
</Button>
|
|
57
|
+
|
|
58
|
+
<Modal
|
|
59
|
+
open={checkPasswordModalOpen}
|
|
60
|
+
width='600px'
|
|
61
|
+
onClose={() => setCheckPasswordModalOpen(false)}
|
|
62
|
+
>
|
|
63
|
+
<WrapperCheckPassword>
|
|
64
|
+
<h3>{t('CONFIRM_PASSWORD', 'Confirm password')}</h3>
|
|
65
|
+
<p>{t('TYPE_YOUR_PASSWORD_TO_CONFIRM_DELETE', 'Type your password to confirm delete.')}</p>
|
|
66
|
+
<input
|
|
67
|
+
autoComplete='new-password'
|
|
68
|
+
type='password'
|
|
69
|
+
value={password}
|
|
70
|
+
placeholder={t('PASSWORD', 'password')}
|
|
71
|
+
onChange={(e) => handlePassword(e)}
|
|
72
|
+
/>
|
|
73
|
+
{checkPasswordStatus?.error && (
|
|
74
|
+
<ErrorText
|
|
75
|
+
className='text-danger'
|
|
76
|
+
>
|
|
77
|
+
{checkPasswordStatus.error}
|
|
78
|
+
</ErrorText>
|
|
79
|
+
)}
|
|
80
|
+
<Button
|
|
81
|
+
color='primary'
|
|
82
|
+
borderRadius='7.6px'
|
|
83
|
+
onClick={() => getCheckPassword()}
|
|
84
|
+
>
|
|
85
|
+
{t('CONFIRM', 'Confirm')}
|
|
86
|
+
</Button>
|
|
87
|
+
</WrapperCheckPassword>
|
|
88
|
+
</Modal>
|
|
89
|
+
</>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export const BusinessDelete = (props) => {
|
|
94
|
+
const checkPasswordControlProps = {
|
|
95
|
+
...props,
|
|
96
|
+
UIComponent: BusinessDeleteUI
|
|
97
|
+
}
|
|
98
|
+
return <CheckPasswordController {...checkPasswordControlProps} />
|
|
99
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const WrapperCheckPassword = styled.div`
|
|
4
|
+
padding: 10px;
|
|
5
|
+
color: ${props => props.theme.colors?.headingColor};
|
|
6
|
+
|
|
7
|
+
h3 {
|
|
8
|
+
font-size: 24px;
|
|
9
|
+
margin: 0px;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
p {
|
|
14
|
+
margin-top: 25px;
|
|
15
|
+
margin-bottom: 10px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
input {
|
|
19
|
+
outline: none;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
font-size: 16px;
|
|
22
|
+
border: 1px solid rgba(20, 20, 20, 0.2);
|
|
23
|
+
width: 100%;
|
|
24
|
+
padding: 10px 15px;
|
|
25
|
+
&:focus {
|
|
26
|
+
border: 1px solid ${props => props.theme.colors.primary};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
button {
|
|
31
|
+
margin-top: 40px;
|
|
32
|
+
width: 150px;
|
|
33
|
+
padding-top: 5px;
|
|
34
|
+
padding-bottom: 5px;
|
|
35
|
+
}
|
|
36
|
+
`
|
|
37
|
+
export const ErrorText = styled.div`
|
|
38
|
+
text-align: center;
|
|
39
|
+
margin: 10px 0;
|
|
40
|
+
`
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory } from 'react-router-dom'
|
|
3
|
+
import { useLanguage, DriversGroupsList as DriversGroupsListController } from 'ordering-components-admin-external'
|
|
4
|
+
import { getStorageItem, removeStorageItem } from '../../../utils'
|
|
5
|
+
import { Alert, Confirm, SearchBar } from '../../Shared'
|
|
6
|
+
import { WizardDelivery } from '../../Delivery/WizardDelivery'
|
|
7
|
+
import { DriversGroupsList } from '../../Delivery/DriversGroupsList'
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
DriversGroupsListingContainer,
|
|
11
|
+
SearchContainer
|
|
12
|
+
} from './styles'
|
|
13
|
+
|
|
14
|
+
const DriversGroupsListingDetailsUI = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
driversGroupsState,
|
|
17
|
+
selectedGroupList,
|
|
18
|
+
handleSelectGroup,
|
|
19
|
+
handleAllSelectGroup,
|
|
20
|
+
actionState,
|
|
21
|
+
handleUpdateDriversGroup,
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const history = useHistory()
|
|
25
|
+
const [, t] = useLanguage()
|
|
26
|
+
const [searchValue, setSearchValue] = useState(null)
|
|
27
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
28
|
+
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
29
|
+
|
|
30
|
+
const [isTourOpen, setIsTourOpen] = useState(false)
|
|
31
|
+
const [currentTourStep, setCurrentTourStep] = useState(4)
|
|
32
|
+
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!actionState?.error) return
|
|
35
|
+
setAlertState({
|
|
36
|
+
open: true,
|
|
37
|
+
content: actionState?.error
|
|
38
|
+
})
|
|
39
|
+
}, [actionState?.error])
|
|
40
|
+
|
|
41
|
+
const handleOpenTour = () => {
|
|
42
|
+
setOpenDetails(false)
|
|
43
|
+
setCurrentTourStep(4)
|
|
44
|
+
setIsTourOpen(true)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (history.location?.state?.isFromTourDriversGroup) {
|
|
49
|
+
handleOpenTour()
|
|
50
|
+
}
|
|
51
|
+
}, [history.location?.state?.isFromTourDriversGroup])
|
|
52
|
+
|
|
53
|
+
const getDataFromStorage = async () => {
|
|
54
|
+
const value = await getStorageItem('isFromDeliveryDriversGroup', true)
|
|
55
|
+
if (value) {
|
|
56
|
+
removeStorageItem('isFromDeliveryDriversGroup')
|
|
57
|
+
handleOpenTour()
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
useEffect(() => {
|
|
61
|
+
getDataFromStorage()
|
|
62
|
+
}, [])
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<SearchContainer>
|
|
67
|
+
<SearchBar
|
|
68
|
+
lazyLoad
|
|
69
|
+
isCustomLayout
|
|
70
|
+
onSearch={val => setSearchValue(val)}
|
|
71
|
+
search={searchValue}
|
|
72
|
+
placeholder={t('SEARCH', 'Search')}
|
|
73
|
+
customClass='searchBar'
|
|
74
|
+
/>
|
|
75
|
+
</SearchContainer>
|
|
76
|
+
<DriversGroupsListingContainer>
|
|
77
|
+
<DriversGroupsList
|
|
78
|
+
isFromStore
|
|
79
|
+
driversGroupsState={driversGroupsState}
|
|
80
|
+
searchValue={searchValue}
|
|
81
|
+
handleUpdateDriversGroup={handleUpdateDriversGroup}
|
|
82
|
+
selectedGroupList={selectedGroupList}
|
|
83
|
+
handleSelectGroup={handleSelectGroup}
|
|
84
|
+
handleAllSelectGroup={handleAllSelectGroup}
|
|
85
|
+
/>
|
|
86
|
+
</DriversGroupsListingContainer>
|
|
87
|
+
<Alert
|
|
88
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
89
|
+
content={alertState.content}
|
|
90
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
91
|
+
open={alertState.open}
|
|
92
|
+
onClose={() => setAlertState({ open: false, content: [] })}
|
|
93
|
+
onAccept={() => setAlertState({ open: false, content: [] })}
|
|
94
|
+
closeOnBackdrop={false}
|
|
95
|
+
/>
|
|
96
|
+
<Confirm
|
|
97
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
98
|
+
content={confirm.content}
|
|
99
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
100
|
+
open={confirm.open}
|
|
101
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
102
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
103
|
+
onAccept={confirm.handleOnAccept}
|
|
104
|
+
closeOnBackdrop={false}
|
|
105
|
+
/>
|
|
106
|
+
|
|
107
|
+
{isTourOpen && (
|
|
108
|
+
<WizardDelivery
|
|
109
|
+
isTourOpen={isTourOpen}
|
|
110
|
+
setIsTourOpen={setIsTourOpen}
|
|
111
|
+
currentStep={currentTourStep}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
114
|
+
</>
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export const DriversGroupsListingDetails = (props) => {
|
|
119
|
+
const driversGroupsListProps = {
|
|
120
|
+
...props,
|
|
121
|
+
isDriversMangersRequired: true,
|
|
122
|
+
UIComponent: DriversGroupsListingDetailsUI
|
|
123
|
+
}
|
|
124
|
+
return (
|
|
125
|
+
<DriversGroupsListController {...driversGroupsListProps} />
|
|
126
|
+
)
|
|
127
|
+
}
|