ordering-ui-admin-external 1.25.0 → 1.26.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/main.css +1829 -1829
- package/_bundles/{ordering-ui-admin.f2522b983a000252b407.js → ordering-ui-admin.efcc125026af46873802.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsCalendar/index.js +8 -1
- package/_modules/components/Delivery/DriversCompanyAddForm/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/index.js +68 -0
- package/_modules/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/styles.js +42 -0
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +89 -0
- package/_modules/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +47 -0
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +106 -0
- package/_modules/components/Delivery/DriversGroupAddForm/GeneralForm/styles.js +16 -0
- package/_modules/components/Delivery/DriversGroupAddForm/PaymethodsForm/index.js +87 -0
- package/_modules/components/Delivery/DriversGroupAddForm/PaymethodsForm/styles.js +33 -0
- package/_modules/components/Delivery/DriversGroupAddForm/index.js +132 -0
- package/_modules/components/Delivery/DriversGroupAddForm/styles.js +18 -0
- package/_modules/components/Delivery/DriversGroupCompanies/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupDrivers/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupOrders/index.js +5 -5
- package/_modules/components/Delivery/DriversGroupsList/styles.js +1 -1
- package/_modules/components/Delivery/DriversGroupsListing/index.js +28 -7
- package/_modules/components/Delivery/DriversGroupsListing/styles.js +2 -2
- package/_modules/components/Delivery/UserAddForm/index.js +39 -6
- package/_modules/components/Delivery/UserAddForm/styles.js +28 -21
- package/_modules/components/Delivery/UserDetails/index.js +2 -2
- package/_modules/components/Home/HomePage/index.js +71 -3
- package/_modules/components/Home/HomePage/styles.js +27 -5
- package/_modules/components/Login/LoginForm/index.js +0 -5
- package/_modules/components/MyProducts/AdvancedLayouts/LayoutStyleGroup.js +46 -0
- package/_modules/components/MyProducts/AdvancedLayouts/index.js +213 -0
- package/_modules/components/MyProducts/AdvancedLayouts/styles.js +146 -0
- package/_modules/components/MyProducts/AdvancedSettings/index.js +12 -0
- package/_modules/components/MyProducts/CustomDomain/index.js +6 -4
- package/_modules/components/MyProducts/CustomDomain/styles.js +27 -9
- package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -6
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +20 -11
- package/_modules/components/Orders/AllInOne/DriversManager/index.js +128 -0
- package/_modules/components/Orders/AllInOne/DriversManager/styles.js +27 -0
- package/_modules/components/Orders/AllInOne/index.js +337 -0
- package/_modules/components/Orders/AllInOne/styles.js +67 -0
- package/_modules/components/Orders/CompanySelector/index.js +259 -0
- package/_modules/components/Orders/CompanySelector/styles.js +86 -0
- package/_modules/components/Orders/DriversBusyStatusFilter/styles.js +6 -3
- package/_modules/components/Orders/DriversList/index.js +3 -2
- package/_modules/components/Orders/DriversList/styles.js +2 -2
- package/_modules/components/Orders/DriversManager/index.js +2 -1
- package/_modules/components/Orders/DriversOnlineOfflineFilter/styles.js +5 -2
- package/_modules/components/Orders/OrderBill/RefundToWallet.js +1 -1
- package/_modules/components/Orders/OrderBill/index.js +17 -18
- package/_modules/components/Orders/OrderContactInformation/index.js +14 -3
- package/_modules/components/Orders/OrderDetails/index.js +1 -1
- package/_modules/components/Orders/OrderStatusSubFilter/styles.js +1 -1
- package/_modules/components/Orders/OrderToPrint/index.js +2 -1
- package/_modules/components/Orders/OrderToPrintTicket/index.js +4 -2
- package/_modules/components/Orders/OrdersContentHeader/index.js +2 -1
- package/_modules/components/Orders/OrdersListing/index.js +3 -1
- package/_modules/components/Orders/OrdersManager/index.js +5 -1
- package/_modules/components/Orders/OrdersTable/index.js +11 -10
- package/_modules/components/Orders/ProductItemAccordion/index.js +5 -9
- package/_modules/components/Orders/WebsocketStatus/index.js +119 -0
- package/_modules/components/Orders/WebsocketStatus/styles.js +65 -0
- package/_modules/components/Orders/index.js +7 -0
- package/_modules/components/Settings/IntegrationListing/Analytics.js +130 -0
- package/_modules/components/Settings/IntegrationListing/PaymentGateway.js +130 -0
- package/_modules/components/Settings/IntegrationListing/index.js +174 -31
- package/_modules/components/Settings/IntegrationListing/styles.js +42 -11
- package/_modules/components/Settings/NotificationSetting/index.js +25 -4
- package/_modules/components/Settings/NotificationSetting/styles.js +5 -3
- package/_modules/components/Settings/SettingsSelectUI/index.js +3 -2
- package/_modules/components/Shared/RangeCalendar/index.js +9 -1
- package/_modules/components/Shared/SearchBar/index.js +11 -6
- package/_modules/components/Shared/SearchBar/styles.js +9 -15
- package/_modules/components/SidebarMenu/index.js +19 -10
- package/_modules/components/Stores/ImporterHelpContent/index.js +1 -1
- package/_modules/components/Stores/ImportersButton/index.js +2 -2
- package/_modules/components/Users/UserDetails/index.js +2 -2
- package/_modules/config/currency.js +1017 -0
- package/_modules/index.js +6 -0
- package/_modules/utils/index.js +26 -3
- package/index-template.js +10 -0
- package/package.json +3 -2
- package/src/components/BusinessIntelligence/AnalyticsCalendar/index.js +7 -1
- package/src/components/Delivery/DriversCompanyAddForm/styles.js +0 -1
- package/src/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/index.js +113 -0
- package/src/components/Delivery/DriversGroupAddForm/AdvancedLogisticsForm/styles.js +72 -0
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/index.js +87 -0
- package/src/components/Delivery/DriversGroupAddForm/BusinessesForm/styles.js +87 -0
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/index.js +104 -0
- package/src/components/Delivery/DriversGroupAddForm/GeneralForm/styles.js +31 -0
- package/src/components/Delivery/DriversGroupAddForm/PaymethodsForm/index.js +82 -0
- package/src/components/Delivery/DriversGroupAddForm/PaymethodsForm/styles.js +46 -0
- package/src/components/Delivery/DriversGroupAddForm/index.js +130 -0
- package/src/components/Delivery/DriversGroupAddForm/styles.js +38 -0
- package/src/components/Delivery/DriversGroupCompanies/styles.js +1 -0
- package/src/components/Delivery/DriversGroupDrivers/styles.js +1 -0
- package/src/components/Delivery/DriversGroupOrders/index.js +2 -2
- package/src/components/Delivery/DriversGroupsList/styles.js +1 -1
- package/src/components/Delivery/DriversGroupsListing/index.js +35 -13
- package/src/components/Delivery/DriversGroupsListing/styles.js +1 -1
- package/src/components/Delivery/UserAddForm/index.js +34 -2
- package/src/components/Delivery/UserAddForm/styles.js +25 -0
- package/src/components/Delivery/UserDetails/index.js +1 -1
- package/src/components/Home/HomePage/index.js +215 -142
- package/src/components/Home/HomePage/styles.js +105 -1
- package/src/components/Login/LoginForm/index.js +0 -7
- package/src/components/MyProducts/AdvancedLayouts/LayoutStyleGroup.js +37 -0
- package/src/components/MyProducts/AdvancedLayouts/index.js +240 -0
- package/src/components/MyProducts/AdvancedLayouts/styles.js +388 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +5 -2
- package/src/components/MyProducts/CustomDomain/index.js +35 -16
- package/src/components/MyProducts/CustomDomain/styles.js +73 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +97 -37
- package/src/components/MyProducts/OrderingWebsite/styles.js +38 -0
- package/src/components/Orders/AllInOne/DriversManager/index.js +137 -0
- package/src/components/Orders/AllInOne/DriversManager/styles.js +51 -0
- package/src/components/Orders/AllInOne/index.js +339 -0
- package/src/components/Orders/AllInOne/styles.js +144 -0
- package/src/components/Orders/CompanySelector/index.js +250 -0
- package/src/components/Orders/CompanySelector/styles.js +142 -0
- package/src/components/Orders/DriversBusyStatusFilter/styles.js +7 -1
- package/src/components/Orders/DriversList/index.js +7 -4
- package/src/components/Orders/DriversList/styles.js +2 -1
- package/src/components/Orders/DriversManager/index.js +2 -0
- package/src/components/Orders/DriversOnlineOfflineFilter/styles.js +8 -1
- package/src/components/Orders/OrderBill/RefundToWallet.js +12 -10
- package/src/components/Orders/OrderBill/index.js +18 -18
- package/src/components/Orders/OrderContactInformation/index.js +20 -1
- package/src/components/Orders/OrderDetails/index.js +8 -8
- package/src/components/Orders/OrderStatusSubFilter/styles.js +1 -1
- package/src/components/Orders/OrderToPrint/index.js +2 -1
- package/src/components/Orders/OrderToPrintTicket/index.js +160 -173
- package/src/components/Orders/OrdersContentHeader/index.js +2 -0
- package/src/components/Orders/OrdersListing/index.js +2 -0
- package/src/components/Orders/OrdersManager/index.js +2 -2
- package/src/components/Orders/OrdersTable/index.js +39 -25
- package/src/components/Orders/ProductItemAccordion/index.js +3 -3
- package/src/components/Orders/WebsocketStatus/index.js +138 -0
- package/src/components/Orders/WebsocketStatus/styles.js +171 -0
- package/src/components/Orders/index.js +2 -0
- package/src/components/Settings/IntegrationListing/Analytics.js +127 -0
- package/src/components/Settings/IntegrationListing/PaymentGateway.js +126 -0
- package/src/components/Settings/IntegrationListing/index.js +189 -96
- package/src/components/Settings/IntegrationListing/styles.js +90 -1
- package/src/components/Settings/NotificationSetting/index.js +73 -10
- package/src/components/Settings/NotificationSetting/styles.js +19 -0
- package/src/components/Settings/SettingsSelectUI/index.js +12 -9
- package/src/components/Shared/RangeCalendar/index.js +7 -1
- package/src/components/Shared/SearchBar/index.js +14 -5
- package/src/components/Shared/SearchBar/styles.js +19 -32
- package/src/components/SidebarMenu/index.js +15 -8
- package/src/components/Stores/ImporterHelpContent/index.js +17 -17
- package/src/components/Stores/ImportersButton/index.js +2 -2
- package/src/components/Users/UserDetails/index.js +1 -1
- package/src/config/currency.js +1010 -0
- package/src/index.js +2 -0
- package/src/utils/index.js +21 -0
- package/template/app.js +4 -0
- package/template/assets/images/preview/franchise.png +0 -0
- package/template/assets/images/preview/marketplace.png +0 -0
- package/template/assets/images/preview/single-store.png +0 -0
- package/template/components/AutologinParams/index.js +1 -3
- package/template/components/ListenPageChanges/index.js +1 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/AllInOne/index.js +23 -0
- /package/_bundles/{ordering-ui-admin.f2522b983a000252b407.js.LICENSE.txt → ordering-ui-admin.efcc125026af46873802.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div``
|
|
4
|
+
export const InputWrapper = styled.div`
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
margin-bottom: 35px;
|
|
8
|
+
|
|
9
|
+
label {
|
|
10
|
+
font-size: 14px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
div {
|
|
14
|
+
font-size: 14px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.select {
|
|
18
|
+
padding: 11px 0;
|
|
19
|
+
border: none;
|
|
20
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
21
|
+
}
|
|
22
|
+
.list {
|
|
23
|
+
.options {
|
|
24
|
+
> div {
|
|
25
|
+
> div {
|
|
26
|
+
padding: 7px 10px;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { SearchBar } from '../../../Shared'
|
|
4
|
+
import { Button, Checkbox } from '../../../../styles'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
Container,
|
|
8
|
+
SearchBarWrapper,
|
|
9
|
+
ButtonGroup,
|
|
10
|
+
GroupsContainer,
|
|
11
|
+
GroupWrapper
|
|
12
|
+
} from './styles'
|
|
13
|
+
|
|
14
|
+
export const PaymethodsForm = (props) => {
|
|
15
|
+
const {
|
|
16
|
+
paymethods,
|
|
17
|
+
actionState,
|
|
18
|
+
selectedPaymethodIds,
|
|
19
|
+
handleSelectPaymethod,
|
|
20
|
+
handleSelectAllPaymethod
|
|
21
|
+
} = props
|
|
22
|
+
const [, t] = useLanguage()
|
|
23
|
+
const [searchValue, setSearchValue] = useState(null)
|
|
24
|
+
const [filteredPaymethods, setFilteredPaymethods] = useState([])
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
let _filteredPaymethods = []
|
|
28
|
+
if (searchValue) {
|
|
29
|
+
_filteredPaymethods = paymethods.filter(paymethod => paymethod?.name?.toLowerCase().includes(searchValue?.toLowerCase()))
|
|
30
|
+
} else {
|
|
31
|
+
_filteredPaymethods = [...paymethods]
|
|
32
|
+
}
|
|
33
|
+
setFilteredPaymethods(_filteredPaymethods)
|
|
34
|
+
}, [searchValue])
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<>
|
|
38
|
+
<Container>
|
|
39
|
+
<h2>{t('PAYMENT_METHODS', 'Payment methods')}</h2>
|
|
40
|
+
<SearchBarWrapper>
|
|
41
|
+
<SearchBar
|
|
42
|
+
placeholder={t('SEARCH', 'Search')}
|
|
43
|
+
isCustomLayout
|
|
44
|
+
lazyLoad
|
|
45
|
+
search={searchValue}
|
|
46
|
+
onSearch={val => setSearchValue(val)}
|
|
47
|
+
/>
|
|
48
|
+
</SearchBarWrapper>
|
|
49
|
+
<ButtonGroup>
|
|
50
|
+
<Button
|
|
51
|
+
type='button'
|
|
52
|
+
color='secundaryDark'
|
|
53
|
+
onClick={() => handleSelectAllPaymethod(true)}
|
|
54
|
+
>
|
|
55
|
+
{t('SELECT_ALL', 'Select all')}
|
|
56
|
+
</Button>
|
|
57
|
+
<Button
|
|
58
|
+
type='button'
|
|
59
|
+
color='secundaryDark'
|
|
60
|
+
onClick={() => handleSelectAllPaymethod(false)}
|
|
61
|
+
>
|
|
62
|
+
{t('SELECT_NONE', 'Select none')}
|
|
63
|
+
</Button>
|
|
64
|
+
</ButtonGroup>
|
|
65
|
+
<GroupsContainer>
|
|
66
|
+
{filteredPaymethods.map(paymethod => (
|
|
67
|
+
<GroupWrapper
|
|
68
|
+
key={paymethod.id}
|
|
69
|
+
isDisabed={actionState.loading}
|
|
70
|
+
>
|
|
71
|
+
<Checkbox
|
|
72
|
+
checked={selectedPaymethodIds.includes(paymethod.id)}
|
|
73
|
+
onChange={e => handleSelectPaymethod(paymethod.id, e.target.checked)}
|
|
74
|
+
/>
|
|
75
|
+
<p>{t(paymethod?.gateway?.toUpperCase(), paymethod?.name)}</p>
|
|
76
|
+
</GroupWrapper>
|
|
77
|
+
))}
|
|
78
|
+
</GroupsContainer>
|
|
79
|
+
</Container>
|
|
80
|
+
</>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.div``
|
|
4
|
+
|
|
5
|
+
export const SearchBarWrapper = styled.div`
|
|
6
|
+
margin-bottom: 10px;
|
|
7
|
+
`
|
|
8
|
+
|
|
9
|
+
export const ButtonGroup = styled.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
margin-bottom: 20px;
|
|
13
|
+
button:first-child {
|
|
14
|
+
${props => props.theme?.rtl ? css`
|
|
15
|
+
margin-left: 7px;
|
|
16
|
+
` : css`
|
|
17
|
+
margin-right: 7px;
|
|
18
|
+
`}
|
|
19
|
+
}
|
|
20
|
+
`
|
|
21
|
+
|
|
22
|
+
export const GroupsContainer = styled.div`
|
|
23
|
+
overflow: auto;
|
|
24
|
+
max-height: 460px;
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
export const GroupWrapper = styled.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
padding: 12px 0;
|
|
31
|
+
border-bottom: 1px solid ${props => props.theme.colors.borderColor};
|
|
32
|
+
|
|
33
|
+
p {
|
|
34
|
+
margin: 0px;
|
|
35
|
+
font-size: 14px;
|
|
36
|
+
${props => props.theme?.rtl ? css`
|
|
37
|
+
padding-right: 15px;
|
|
38
|
+
` : css`
|
|
39
|
+
padding-left: 15px;
|
|
40
|
+
`}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
${({ isDisabed }) => isDisabed && css`
|
|
44
|
+
pointer-events: none;
|
|
45
|
+
`}
|
|
46
|
+
`
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
useLanguage,
|
|
4
|
+
useConfig,
|
|
5
|
+
DriversGroupDetails as DriversGroupDetailsController
|
|
6
|
+
} from 'ordering-components-admin-external'
|
|
7
|
+
import { useForm, FormProvider } from 'react-hook-form'
|
|
8
|
+
import { Alert } from '../../Shared'
|
|
9
|
+
import { Button } from '../../../styles'
|
|
10
|
+
import { GeneralForm } from './GeneralForm'
|
|
11
|
+
import { BusinessesForm } from './BusinessesForm'
|
|
12
|
+
import { PaymethodsForm } from './PaymethodsForm'
|
|
13
|
+
import { AdvancedLogisticsForm } from './AdvancedLogisticsForm'
|
|
14
|
+
|
|
15
|
+
import {
|
|
16
|
+
Container,
|
|
17
|
+
SectionContainer,
|
|
18
|
+
ButtonsContainer
|
|
19
|
+
} from './styles'
|
|
20
|
+
|
|
21
|
+
const DriversGroupAddFormUI = (props) => {
|
|
22
|
+
const {
|
|
23
|
+
actionState,
|
|
24
|
+
changesState,
|
|
25
|
+
handleAddDriversGroup
|
|
26
|
+
} = props
|
|
27
|
+
|
|
28
|
+
const [, t] = useLanguage()
|
|
29
|
+
const [configState] = useConfig()
|
|
30
|
+
const formMethods = useForm()
|
|
31
|
+
const autoAssignType = configState?.configs?.autoassign_type?.value
|
|
32
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
33
|
+
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
if (!actionState?.error) return
|
|
36
|
+
setAlertState({
|
|
37
|
+
open: true,
|
|
38
|
+
content: actionState?.error
|
|
39
|
+
})
|
|
40
|
+
}, [actionState?.error])
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (Object.keys(formMethods.errors).length > 0) {
|
|
44
|
+
setAlertState({
|
|
45
|
+
open: true,
|
|
46
|
+
content: Object.values(formMethods.errors).map((error) => error.message)
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
}, [formMethods.errors])
|
|
50
|
+
|
|
51
|
+
const onSubmit = () => {
|
|
52
|
+
if (changesState?.type === 0 && !changesState?.drivers) {
|
|
53
|
+
setAlertState({
|
|
54
|
+
open: true,
|
|
55
|
+
content: [t('VALIDATION_ERROR_REQUIRED', 'The drivers is required.').replace('_attribute_', t('DRIVERS', 'Drivers'))]
|
|
56
|
+
})
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
if (changesState?.type === 1 && !changesState?.driver_companies) {
|
|
60
|
+
setAlertState({
|
|
61
|
+
open: true,
|
|
62
|
+
content: [t('VALIDATION_ERROR_REQUIRED', 'The Driver company is required.').replace('_attribute_', t('DRIVER_COMPANY', 'Driver company'))]
|
|
63
|
+
})
|
|
64
|
+
return
|
|
65
|
+
}
|
|
66
|
+
if (!changesState?.business) {
|
|
67
|
+
setAlertState({
|
|
68
|
+
open: true,
|
|
69
|
+
content: [t('VALIDATION_ERROR_REQUIRED', 'The drivers is required.').replace('_attribute_', t('BUSINESSES', 'Businesses'))]
|
|
70
|
+
})
|
|
71
|
+
return
|
|
72
|
+
}
|
|
73
|
+
handleAddDriversGroup()
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<FormProvider {...formMethods}>
|
|
78
|
+
<Container onSubmit={formMethods.handleSubmit(onSubmit)} data-tour='tour_fill_group'>
|
|
79
|
+
<SectionContainer>
|
|
80
|
+
<GeneralForm {...props} />
|
|
81
|
+
</SectionContainer>
|
|
82
|
+
<SectionContainer>
|
|
83
|
+
<BusinessesForm {...props} />
|
|
84
|
+
</SectionContainer>
|
|
85
|
+
<SectionContainer>
|
|
86
|
+
<PaymethodsForm {...props} />
|
|
87
|
+
</SectionContainer>
|
|
88
|
+
{autoAssignType !== 'basic' && (
|
|
89
|
+
<SectionContainer>
|
|
90
|
+
<AdvancedLogisticsForm {...props} />
|
|
91
|
+
</SectionContainer>
|
|
92
|
+
)}
|
|
93
|
+
<ButtonsContainer>
|
|
94
|
+
<Button
|
|
95
|
+
borderRadius='8px'
|
|
96
|
+
color='primary'
|
|
97
|
+
type='submit'
|
|
98
|
+
disabled={Object.keys(changesState).length === 0}
|
|
99
|
+
>
|
|
100
|
+
{t('SAVE', 'Save')}
|
|
101
|
+
</Button>
|
|
102
|
+
<Button
|
|
103
|
+
color='secundary'
|
|
104
|
+
onClick={() => props.onClose()}
|
|
105
|
+
type='button'
|
|
106
|
+
>
|
|
107
|
+
{t('CANCEL', 'Cancel')}
|
|
108
|
+
</Button>
|
|
109
|
+
</ButtonsContainer>
|
|
110
|
+
</Container>
|
|
111
|
+
<Alert
|
|
112
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
113
|
+
content={alertState.content}
|
|
114
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
115
|
+
open={alertState.open}
|
|
116
|
+
onClose={() => setAlertState({ open: false, content: [] })}
|
|
117
|
+
onAccept={() => setAlertState({ open: false, content: [] })}
|
|
118
|
+
closeOnBackdrop={false}
|
|
119
|
+
/>
|
|
120
|
+
</FormProvider>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export const DriversGroupAddForm = (props) => {
|
|
125
|
+
const driversGroupAddFormProps = {
|
|
126
|
+
...props,
|
|
127
|
+
UIComponent: DriversGroupAddFormUI
|
|
128
|
+
}
|
|
129
|
+
return <DriversGroupDetailsController {...driversGroupAddFormProps} />
|
|
130
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const Container = styled.form`
|
|
4
|
+
h2 {
|
|
5
|
+
font-weight: 600;
|
|
6
|
+
font-size: 16px;
|
|
7
|
+
line-height: 24px;
|
|
8
|
+
margin: 0 0 29px 0;
|
|
9
|
+
}
|
|
10
|
+
`
|
|
11
|
+
|
|
12
|
+
export const SectionContainer = styled.div`
|
|
13
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
14
|
+
border-radius: 7.6px;
|
|
15
|
+
padding: 25px 38px;
|
|
16
|
+
margin: 25px 20px 34px 20px;
|
|
17
|
+
|
|
18
|
+
> div {
|
|
19
|
+
max-width: 1024px;
|
|
20
|
+
}
|
|
21
|
+
`
|
|
22
|
+
export const ButtonsContainer = styled.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
padding: 20px;
|
|
26
|
+
position: sticky;
|
|
27
|
+
z-index: 100;
|
|
28
|
+
bottom: 0;
|
|
29
|
+
background-color: ${props => props.theme.colors.backgroundPage};
|
|
30
|
+
|
|
31
|
+
> button {
|
|
32
|
+
border-radius: 8px;
|
|
33
|
+
height: 44px;
|
|
34
|
+
&:last-child {
|
|
35
|
+
margin: 0 10px;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`
|
|
@@ -37,7 +37,7 @@ const DriversGroupOrdersUI = (props) => {
|
|
|
37
37
|
<FieldWrapper>
|
|
38
38
|
<label>{t('MAX_NUMBER_ORDERS', 'Maxiumum number of orders')}</label>
|
|
39
39
|
<Input
|
|
40
|
-
value={changesState?.orders_group_max_orders ?? curDriversGroup?.orders_group_max_orders}
|
|
40
|
+
value={changesState?.orders_group_max_orders ?? curDriversGroup?.orders_group_max_orders ?? 0}
|
|
41
41
|
onChange={e => onChangeNumberInput('orders_group_max_orders', e.target.value)}
|
|
42
42
|
/>
|
|
43
43
|
</FieldWrapper>
|
|
@@ -89,7 +89,7 @@ const DriversGroupOrdersUI = (props) => {
|
|
|
89
89
|
<FieldWrapper>
|
|
90
90
|
<UseMapsApiCheckboxContainer>
|
|
91
91
|
<Checkbox
|
|
92
|
-
checked={changesState?.orders_group_use_maps_api ?? curDriversGroup?.orders_group_use_maps_api}
|
|
92
|
+
checked={changesState?.orders_group_use_maps_api ?? curDriversGroup?.orders_group_use_maps_api ?? false}
|
|
93
93
|
onChange={e => handleChangesState({ orders_group_use_maps_api: e.target.checked })}
|
|
94
94
|
/>
|
|
95
95
|
<MapsApiDescriptionContainer>
|
|
@@ -10,6 +10,7 @@ import { Alert, Confirm, SearchBar, SideBar } from '../../Shared'
|
|
|
10
10
|
import { WizardDelivery } from '../WizardDelivery'
|
|
11
11
|
import { DriversGroupsList } from '../DriversGroupsList'
|
|
12
12
|
import { DriversGroupDetails } from '../DriversGroupDetails'
|
|
13
|
+
import { DriversGroupAddForm } from '../DriversGroupAddForm'
|
|
13
14
|
|
|
14
15
|
import {
|
|
15
16
|
DriversGroupsListingContainer,
|
|
@@ -49,6 +50,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
49
50
|
const [curDriversGroup, setCurDriversGroup] = useState(null)
|
|
50
51
|
const [curDriversGroupId, setCurDriversGroupId] = useState(null)
|
|
51
52
|
const [isExtendExtraOpen, setIsExtendExtraOpen] = useState(false)
|
|
53
|
+
const [isAddMode, setIsAddMode] = useState(false)
|
|
52
54
|
|
|
53
55
|
const [isTourOpen, setIsTourOpen] = useState(false)
|
|
54
56
|
const [currentTourStep, setCurrentTourStep] = useState(4)
|
|
@@ -60,6 +62,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
60
62
|
setOpenDetails(true)
|
|
61
63
|
|
|
62
64
|
if (!driverGroup) {
|
|
65
|
+
setIsAddMode(true)
|
|
63
66
|
setTimeout(() => {
|
|
64
67
|
setCurrentTourStep(5)
|
|
65
68
|
}, 50)
|
|
@@ -193,20 +196,39 @@ const DriversGroupsListingUI = (props) => {
|
|
|
193
196
|
/>
|
|
194
197
|
</HeaderRightContainer>
|
|
195
198
|
</HeaderContainer>
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
199
|
+
{!isAddMode ? (
|
|
200
|
+
<DriversGroupsList
|
|
201
|
+
curDriversGroup={curDriversGroup}
|
|
202
|
+
driversGroupsState={driversGroupsState}
|
|
203
|
+
searchValue={searchValue}
|
|
204
|
+
handleOpenDetails={handleOpenDetails}
|
|
205
|
+
handleUpdateDriversGroup={handleUpdateDriversGroup}
|
|
206
|
+
handleDeleteDriversGroup={handleDeleteDriversGroup}
|
|
207
|
+
selectedGroupList={selectedGroupList}
|
|
208
|
+
handleSelectGroup={handleSelectGroup}
|
|
209
|
+
handleAllSelectGroup={handleAllSelectGroup}
|
|
210
|
+
actionDisabled={actionDisabled}
|
|
211
|
+
/>
|
|
212
|
+
) : (
|
|
213
|
+
<DriversGroupAddForm
|
|
214
|
+
driversGroupsState={driversGroupsState}
|
|
215
|
+
setDriversGroupsState={setDriversGroupsState}
|
|
216
|
+
curDriversGroup={curDriversGroup}
|
|
217
|
+
driversGroupId={curDriversGroupId}
|
|
218
|
+
driversManagers={driversManagersList?.managers}
|
|
219
|
+
businesses={businessesList?.businesses}
|
|
220
|
+
paymethods={paymethodsList?.paymethods}
|
|
221
|
+
drivers={driversList?.drivers}
|
|
222
|
+
companies={driversCompanyList?.companies}
|
|
223
|
+
onClose={() => {
|
|
224
|
+
setOpenDetails(false)
|
|
225
|
+
setIsAddMode(false)
|
|
226
|
+
}}
|
|
227
|
+
actionDisabled={actionDisabled}
|
|
228
|
+
/>
|
|
229
|
+
)}
|
|
208
230
|
</DriversGroupsListingContainer>
|
|
209
|
-
{openDetails && (
|
|
231
|
+
{openDetails && !isAddMode && (
|
|
210
232
|
<SideBar
|
|
211
233
|
sidebarId='driver_group_details'
|
|
212
234
|
defaultSideBarWidth={!isExtendExtraOpen ? 540 + moveDistance : 1040}
|
|
@@ -2,7 +2,6 @@ import styled, { css } from 'styled-components'
|
|
|
2
2
|
|
|
3
3
|
export const DriversGroupsListingContainer = styled.div`
|
|
4
4
|
flex: 1;
|
|
5
|
-
padding: 20px;
|
|
6
5
|
box-sizing: border-box;
|
|
7
6
|
transition: all 0.5s;
|
|
8
7
|
max-height: 100vh;
|
|
@@ -11,6 +10,7 @@ export const DriversGroupsListingContainer = styled.div`
|
|
|
11
10
|
export const HeaderContainer = styled.div`
|
|
12
11
|
display: flex;
|
|
13
12
|
flex-direction: column;
|
|
13
|
+
padding: 20px 20px 0 20px;
|
|
14
14
|
|
|
15
15
|
@media (min-width: 768px) {
|
|
16
16
|
flex-direction: row;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
ExamineClick,
|
|
9
9
|
UserFormDetails as UserFormDetailsController
|
|
10
10
|
} from 'ordering-components-admin-external'
|
|
11
|
-
import { Button, Input } from '../../../styles'
|
|
11
|
+
import { Button, Input, DefaultSelect } from '../../../styles'
|
|
12
12
|
import { Alert, InputPhoneNumber, Modal, ImageCrop } from '../../Shared'
|
|
13
13
|
import { sortInputFields, bytesConverter, setStorageItem } from '../../../utils'
|
|
14
14
|
import parsePhoneNumber from 'libphonenumber-js'
|
|
@@ -17,6 +17,7 @@ import BiImage from '@meronex/icons/bi/BiImage'
|
|
|
17
17
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
18
18
|
import MdCheckBoxOutlineBlank from '@meronex/icons/md/MdCheckBoxOutlineBlank'
|
|
19
19
|
import MdCheckBox from '@meronex/icons/md/MdCheckBox'
|
|
20
|
+
import { timezones } from '../../../config/constants'
|
|
20
21
|
|
|
21
22
|
import {
|
|
22
23
|
FormContainer,
|
|
@@ -31,7 +32,8 @@ import {
|
|
|
31
32
|
MainInformationContainer,
|
|
32
33
|
DriverGroupListContainer,
|
|
33
34
|
DriverGroupItem,
|
|
34
|
-
CheckboxWrapper
|
|
35
|
+
CheckboxWrapper,
|
|
36
|
+
InputWrapper
|
|
35
37
|
} from './styles'
|
|
36
38
|
|
|
37
39
|
const UserAddFormUI = (props) => {
|
|
@@ -63,6 +65,8 @@ const UserAddFormUI = (props) => {
|
|
|
63
65
|
const [userPhoneNumber, setUserPhoneNumber] = useState(null)
|
|
64
66
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
65
67
|
const [isSuccessSubmitted, setIsSuccessSubmitted] = useState(false)
|
|
68
|
+
const [timezonesOptions, setTimezonesOptions] = useState([])
|
|
69
|
+
const [timezoneSearchValue, setTimezoneSearchValue] = useState('')
|
|
66
70
|
const [cropState, setCropState] = useState({ name: null, data: null, open: false })
|
|
67
71
|
const emailInput = useRef(null)
|
|
68
72
|
const inputRef = useRef(null)
|
|
@@ -75,6 +79,18 @@ const UserAddFormUI = (props) => {
|
|
|
75
79
|
cleanFormState && cleanFormState({ result: { error: false } })
|
|
76
80
|
}
|
|
77
81
|
|
|
82
|
+
useEffect(() => {
|
|
83
|
+
const _timezonesOptions = timezones
|
|
84
|
+
.filter(timezone => timezone.toLocaleLowerCase().includes(timezoneSearchValue.toLocaleLowerCase()))
|
|
85
|
+
.map(timezone => {
|
|
86
|
+
return {
|
|
87
|
+
value: timezone,
|
|
88
|
+
content: timezone
|
|
89
|
+
}
|
|
90
|
+
})
|
|
91
|
+
setTimezonesOptions(_timezonesOptions)
|
|
92
|
+
}, [timezoneSearchValue])
|
|
93
|
+
|
|
78
94
|
const showInputPhoneNumber = validationFields?.fields?.checkout?.cellphone?.enabled ?? false
|
|
79
95
|
|
|
80
96
|
const onSubmit = () => {
|
|
@@ -323,6 +339,22 @@ const UserAddFormUI = (props) => {
|
|
|
323
339
|
</React.Fragment>
|
|
324
340
|
)
|
|
325
341
|
)}
|
|
342
|
+
{isDriversPage && (
|
|
343
|
+
<InputWrapper>
|
|
344
|
+
<DefaultSelect
|
|
345
|
+
placeholder={t('SELECT_TIMEZONE', 'Select a timezone')}
|
|
346
|
+
defaultValue={formState?.changes?.timezone}
|
|
347
|
+
options={timezonesOptions}
|
|
348
|
+
onChange={val => handleChangeSwtich('timezone', val)}
|
|
349
|
+
optionInnerMaxHeight='300px'
|
|
350
|
+
isShowSearchBar
|
|
351
|
+
searchBarIsCustomLayout
|
|
352
|
+
searchBarIsNotLazyLoad
|
|
353
|
+
searchValue={timezoneSearchValue}
|
|
354
|
+
handleChangeSearch={setTimezoneSearchValue}
|
|
355
|
+
/>
|
|
356
|
+
</InputWrapper>
|
|
357
|
+
)}
|
|
326
358
|
{!!showInputPhoneNumber && (
|
|
327
359
|
<InputPhoneNumber
|
|
328
360
|
value={userPhoneNumber}
|
|
@@ -25,6 +25,31 @@ export const UserImage = styled.div`
|
|
|
25
25
|
}
|
|
26
26
|
`
|
|
27
27
|
|
|
28
|
+
export const InputWrapper = styled.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
margin-bottom: 20px;
|
|
32
|
+
|
|
33
|
+
.select {
|
|
34
|
+
padding-top: 4px;
|
|
35
|
+
padding-bottom: 4px;
|
|
36
|
+
border: none;
|
|
37
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
|
|
40
|
+
${({ isTimezone }) => isTimezone && css`
|
|
41
|
+
> div:first-child {
|
|
42
|
+
> div {
|
|
43
|
+
overflow: hidden;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.list-wrapper {
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
}
|
|
49
|
+
`}
|
|
50
|
+
}
|
|
51
|
+
`
|
|
52
|
+
|
|
28
53
|
export const Image = styled.div`
|
|
29
54
|
position: relative;
|
|
30
55
|
width: 90px;
|
|
@@ -4,7 +4,7 @@ import Skeleton from 'react-loading-skeleton'
|
|
|
4
4
|
import { useTheme } from 'styled-components'
|
|
5
5
|
import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
6
6
|
import { useLanguage, UserDetails as UserDetailsController } from 'ordering-components-admin-external'
|
|
7
|
-
import { OrdersManager } from '../../Orders'
|
|
7
|
+
import { OrdersManager } from '../../Orders/OrdersManager'
|
|
8
8
|
import { AddressList } from '../AddressList'
|
|
9
9
|
import { Personalization, Modal, Schedule } from '../../Shared'
|
|
10
10
|
import { UserDetailsMenu } from '../UserDetailsMenu'
|