ordering-ui-admin-external 1.23.4 → 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.152c2c4d99f05215f0c3.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/CustomDomain/index.js +150 -0
- package/_modules/components/MyProducts/CustomDomain/styles.js +38 -0
- 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 +65 -36
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +70 -35
- 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/Shared/InputPhoneNumber/index.js +3 -2
- package/_modules/components/SidebarMenu/index.js +22 -22
- package/_modules/components/Stores/BusinessDetails/index.js +6 -3
- package/_modules/components/Stores/BusinessDeviceDetail/index.js +66 -16
- package/_modules/components/Stores/BusinessDeviceDetail/styles.js +7 -5
- package/_modules/components/Stores/BusinessProductsListing/index.js +18 -16
- 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/Stores/BusinessSummary/index.js +11 -9
- package/_modules/components/Users/CustomersListing/index.js +5 -3
- package/_modules/utils/index.js +211 -3
- 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/CustomDomain/index.js +137 -0
- package/src/components/MyProducts/CustomDomain/styles.js +103 -0
- 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 +99 -42
- package/src/components/MyProducts/OrderingWebsite/styles.js +126 -7
- 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/Shared/InputPhoneNumber/index.js +2 -2
- package/src/components/SidebarMenu/index.js +1 -0
- package/src/components/Stores/BusinessDetails/index.js +4 -1
- package/src/components/Stores/BusinessDeviceDetail/index.js +46 -7
- package/src/components/Stores/BusinessDeviceDetail/styles.js +11 -0
- package/src/components/Stores/BusinessProductsListing/index.js +6 -2
- 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/Stores/BusinessSummary/index.js +6 -2
- package/src/components/Users/CustomersListing/index.js +2 -3
- package/src/utils/index.js +59 -1
- package/template/app.js +76 -3
- package/template/config.json +1 -0
- /package/_bundles/{ordering-ui-admin.152c2c4d99f05215f0c3.js.LICENSE.txt → ordering-ui-admin.0c354f3e7da49f56465b.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Schedule } from '../../../Shared'
|
|
3
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
ScheduleContainer,
|
|
7
|
+
ScheduleInnerContainer
|
|
8
|
+
} from './styles'
|
|
9
|
+
|
|
10
|
+
export const ScheduleForm = (props) => {
|
|
11
|
+
const {
|
|
12
|
+
handleChangeScheduleState
|
|
13
|
+
} = props
|
|
14
|
+
|
|
15
|
+
const [, t] = useLanguage()
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<>
|
|
19
|
+
<ScheduleContainer>
|
|
20
|
+
<h2>{t('SCHEDULE', 'Schedule')}</h2>
|
|
21
|
+
<ScheduleInnerContainer>
|
|
22
|
+
<Schedule
|
|
23
|
+
handleChangeScheduleState={handleChangeScheduleState}
|
|
24
|
+
/>
|
|
25
|
+
</ScheduleInnerContainer>
|
|
26
|
+
</ScheduleContainer>
|
|
27
|
+
</>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { Input } from '../../../../styles'
|
|
4
|
+
import { useFormContext } from 'react-hook-form'
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
FormContainer,
|
|
8
|
+
InputWrapper
|
|
9
|
+
} from './styles'
|
|
10
|
+
|
|
11
|
+
export const WebhooksForm = (props) => {
|
|
12
|
+
const {
|
|
13
|
+
changesState,
|
|
14
|
+
handleChangesState
|
|
15
|
+
} = props
|
|
16
|
+
|
|
17
|
+
const [, t] = useLanguage()
|
|
18
|
+
const { register } = useFormContext()
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<FormContainer>
|
|
23
|
+
<h2>{t('WEBHOOKS', 'Webhooks')}</h2>
|
|
24
|
+
<InputWrapper>
|
|
25
|
+
<label>{t('WEBHOOK_NEW_ORDER', 'Webhook new order')}</label>
|
|
26
|
+
<Input
|
|
27
|
+
name='webhook_new_order'
|
|
28
|
+
defaultValue={changesState?.webhook_new_order ?? ''}
|
|
29
|
+
onChange={e => handleChangesState('webhook_new_order', e.target.value)}
|
|
30
|
+
placeholder={t('WEBHOOK_NEW_ORDER', 'Webhook new order')}
|
|
31
|
+
ref={register({
|
|
32
|
+
required: t(
|
|
33
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
34
|
+
'Name is required'
|
|
35
|
+
).replace('_attribute_', t('WEBHOOK_NEW_ORDER', 'Webhook new order'))
|
|
36
|
+
})}
|
|
37
|
+
autoComplete='off'
|
|
38
|
+
/>
|
|
39
|
+
</InputWrapper>
|
|
40
|
+
<InputWrapper>
|
|
41
|
+
<label>{t('WEBHOOK_CANCEL_REQUEST', 'Webhook cancel request')}</label>
|
|
42
|
+
<Input
|
|
43
|
+
name='webhook_cancel_request'
|
|
44
|
+
defaultValue={changesState?.webhook_cancel_request ?? ''}
|
|
45
|
+
onChange={e => handleChangesState('webhook_cancel_request', e.target.value)}
|
|
46
|
+
placeholder={t('WEBHOOK_CANCEL_REQUEST', 'Webhook cancel request')}
|
|
47
|
+
ref={register({
|
|
48
|
+
required: t(
|
|
49
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
50
|
+
'Name is required'
|
|
51
|
+
).replace('_attribute_', t('WEBHOOK_CANCEL_REQUEST', 'Webhook cancel request'))
|
|
52
|
+
})}
|
|
53
|
+
autoComplete='off'
|
|
54
|
+
/>
|
|
55
|
+
</InputWrapper>
|
|
56
|
+
<InputWrapper>
|
|
57
|
+
<label>{t('WEBHOOK_ORDER_STATUS_CHANGED', 'Webhook order status changed')}</label>
|
|
58
|
+
<Input
|
|
59
|
+
name='webhook_order_status_changed'
|
|
60
|
+
defaultValue={changesState?.webhook_order_status_changed ?? ''}
|
|
61
|
+
onChange={e => handleChangesState('webhook_order_status_changed', e.target.value)}
|
|
62
|
+
placeholder={t('WEBHOOK_ORDER_STATUS_CHANGED', 'Webhook order status changed')}
|
|
63
|
+
autoComplete='off'
|
|
64
|
+
/>
|
|
65
|
+
</InputWrapper>
|
|
66
|
+
</FormContainer>
|
|
67
|
+
</>
|
|
68
|
+
)
|
|
69
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import styled from 'styled-components'
|
|
2
|
+
|
|
3
|
+
export const FormContainer = styled.div``
|
|
4
|
+
|
|
5
|
+
export const InputWrapper = styled.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
margin-bottom: 35px;
|
|
9
|
+
|
|
10
|
+
label {
|
|
11
|
+
font-size: 14px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
div {
|
|
15
|
+
font-size: 14px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.select {
|
|
19
|
+
padding-top: 4px;
|
|
20
|
+
padding-bottom: 4px;
|
|
21
|
+
border: none;
|
|
22
|
+
background-color: ${props => props.theme.colors.secundary};
|
|
23
|
+
}
|
|
24
|
+
`
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
useLanguage,
|
|
4
|
+
DriversCompanyDetails as DriversCompanyDetailsController
|
|
5
|
+
} from 'ordering-components-admin-external'
|
|
6
|
+
import { useForm, FormProvider } from 'react-hook-form'
|
|
7
|
+
import { Alert } from '../../Shared'
|
|
8
|
+
import { Button } from '../../../styles'
|
|
9
|
+
import { GeneralForm } from './GeneralForm'
|
|
10
|
+
import { ScheduleForm } from './ScheduleForm'
|
|
11
|
+
import { WebhooksForm } from './WebhooksForm'
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
Container,
|
|
15
|
+
SectionContainer,
|
|
16
|
+
ButtonsContainer
|
|
17
|
+
} from './styles'
|
|
18
|
+
|
|
19
|
+
const DriversCompanyAddFormUI = (props) => {
|
|
20
|
+
const {
|
|
21
|
+
changesState,
|
|
22
|
+
actionState,
|
|
23
|
+
cleanActionState,
|
|
24
|
+
handleAddDriversCompany
|
|
25
|
+
} = props
|
|
26
|
+
|
|
27
|
+
const [, t] = useLanguage()
|
|
28
|
+
const formMethods = useForm()
|
|
29
|
+
|
|
30
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
31
|
+
|
|
32
|
+
const closeAlert = () => {
|
|
33
|
+
cleanActionState()
|
|
34
|
+
setAlertState({
|
|
35
|
+
open: false,
|
|
36
|
+
content: []
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (!actionState.loading && actionState.error) {
|
|
42
|
+
setAlertState({
|
|
43
|
+
open: true,
|
|
44
|
+
content: actionState.error || [t('ERROR')]
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
}, [actionState])
|
|
48
|
+
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
if (Object.keys(formMethods.errors).length > 0) {
|
|
51
|
+
setAlertState({
|
|
52
|
+
open: true,
|
|
53
|
+
content: Object.values(formMethods.errors).map((error) => error.message)
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
}, [formMethods.errors])
|
|
57
|
+
|
|
58
|
+
const onSubmit = () => {
|
|
59
|
+
if (!(changesState?.timezone)) {
|
|
60
|
+
setAlertState({
|
|
61
|
+
open: true,
|
|
62
|
+
content: t(
|
|
63
|
+
'VALIDATION_ERROR_REQUIRED',
|
|
64
|
+
'Name is required'
|
|
65
|
+
).replace('_attribute_', t('TIMEZONE', 'Timezone'))
|
|
66
|
+
})
|
|
67
|
+
return
|
|
68
|
+
}
|
|
69
|
+
handleAddDriversCompany()
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<FormProvider {...formMethods}>
|
|
74
|
+
<Container onSubmit={formMethods.handleSubmit(onSubmit)}>
|
|
75
|
+
<SectionContainer>
|
|
76
|
+
<GeneralForm {...props} />
|
|
77
|
+
</SectionContainer>
|
|
78
|
+
<SectionContainer>
|
|
79
|
+
<ScheduleForm {...props} />
|
|
80
|
+
</SectionContainer>
|
|
81
|
+
<SectionContainer>
|
|
82
|
+
<WebhooksForm {...props} />
|
|
83
|
+
</SectionContainer>
|
|
84
|
+
<ButtonsContainer>
|
|
85
|
+
<Button
|
|
86
|
+
color='secundary'
|
|
87
|
+
onClick={() => props.onClose()}
|
|
88
|
+
type='button'
|
|
89
|
+
>
|
|
90
|
+
{t('CANCEL', 'Cancel')}
|
|
91
|
+
</Button>
|
|
92
|
+
<Button
|
|
93
|
+
borderRadius='8px'
|
|
94
|
+
color='primary'
|
|
95
|
+
type='submit'
|
|
96
|
+
disabled={Object.keys(changesState).length === 0}
|
|
97
|
+
>
|
|
98
|
+
{t('SAVE', 'Save')}
|
|
99
|
+
</Button>
|
|
100
|
+
</ButtonsContainer>
|
|
101
|
+
</Container>
|
|
102
|
+
<Alert
|
|
103
|
+
title={t('ERROR')}
|
|
104
|
+
content={alertState.content}
|
|
105
|
+
acceptText={t('ACCEPT')}
|
|
106
|
+
open={alertState.open}
|
|
107
|
+
onClose={() => closeAlert()}
|
|
108
|
+
onAccept={() => closeAlert()}
|
|
109
|
+
closeOnBackdrop={false}
|
|
110
|
+
/>
|
|
111
|
+
</FormProvider>
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export const DriversCompanyAddForm = (props) => {
|
|
116
|
+
const driversCompanyDetailsProps = {
|
|
117
|
+
...props,
|
|
118
|
+
UIComponent: DriversCompanyAddFormUI
|
|
119
|
+
}
|
|
120
|
+
return <DriversCompanyDetailsController {...driversCompanyDetailsProps} />
|
|
121
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
justify-content: flex-end;
|
|
26
|
+
padding: 20px;
|
|
27
|
+
position: sticky;
|
|
28
|
+
z-index: 100;
|
|
29
|
+
bottom: 0;
|
|
30
|
+
background-color: ${props => props.theme.colors.backgroundPage};
|
|
31
|
+
|
|
32
|
+
> button {
|
|
33
|
+
border-radius: 8px;
|
|
34
|
+
height: 44px;
|
|
35
|
+
&:first-child {
|
|
36
|
+
margin: 0 10px;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
`
|
|
@@ -3,21 +3,19 @@ import { useLanguage } from 'ordering-components-admin-external'
|
|
|
3
3
|
import { SettingComponent } from './SettingComponent'
|
|
4
4
|
import { Button, Input } from '../../../styles'
|
|
5
5
|
import { ImageBox } from './ImageBox'
|
|
6
|
-
import { Alert } from '../../Shared'
|
|
6
|
+
import { Alert, Modal } from '../../Shared'
|
|
7
7
|
import { OrderType } from './OrderType'
|
|
8
8
|
import { FontStyleGroup } from './FontStyleGroup'
|
|
9
9
|
|
|
10
10
|
import {
|
|
11
11
|
Container,
|
|
12
12
|
BoxLayout,
|
|
13
|
-
HomePageWrapper,
|
|
14
|
-
ShadowWrapper,
|
|
15
13
|
HeadingWrapper,
|
|
16
14
|
ImageGroup,
|
|
17
15
|
FormControl,
|
|
18
16
|
ButtonWrapper
|
|
19
17
|
} from './styles'
|
|
20
|
-
import {
|
|
18
|
+
import { UploadAudio } from '../UploadAudio'
|
|
21
19
|
|
|
22
20
|
export const AdvancedSettings = (props) => {
|
|
23
21
|
const {
|
|
@@ -33,9 +31,7 @@ export const AdvancedSettings = (props) => {
|
|
|
33
31
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
34
32
|
const themeValuesRef = useRef({})
|
|
35
33
|
|
|
36
|
-
const
|
|
37
|
-
{ key: 'homepage_header', name: t('HOMEPAGE_HEADER', 'Homepage Header'), type: 'hidden', path: 'homepage_view.components.homepage_header.hidden' }
|
|
38
|
-
]
|
|
34
|
+
const [isOpenSound, setIsOpenSound] = useState(false)
|
|
39
35
|
|
|
40
36
|
const headerList = [
|
|
41
37
|
{ name: t('BACKGROUND_COLOR', 'Background color'), type: 'color', path: 'header.components.style.backgroundColor' },
|
|
@@ -46,12 +42,9 @@ export const AdvancedSettings = (props) => {
|
|
|
46
42
|
const businessListing = [
|
|
47
43
|
{ name: '', type: 'hidden', path: 'business_listing_view.hidden' },
|
|
48
44
|
{ name: t('BUSINESS_LISTING_IMAGE', 'Business listing image'), type: 'image', path: 'business_listing_view.components.business_hero.components.image' },
|
|
49
|
-
{ name: t('PREVIOUS_ORDERS_BLOCK', 'Previous orders block'), type: 'hidden', path: 'business_listing_view.components.previous_orders_block.hidden' },
|
|
50
45
|
{ name: t('HIGHEST_RATED_BUSINESS_BLOCK', 'Highest rated business block'), type: 'hidden', path: 'business_listing_view.components.highest_rated_business_block.hidden' },
|
|
51
46
|
{ name: t('CATEGORIES_BLOCK', 'Categories block'), type: 'hidden', path: 'business_listing_view.components.categories.hidden' },
|
|
52
47
|
{ name: t('AMOUNT_OF_BUSINESSES_TO_DISPLAY_PER_ROW', 'Amount of businesses to display per row:'), type: 'position', path: 'business_listing_view.components.layout.rows' },
|
|
53
|
-
{ name: t('SEARCH_BOX', 'Search box'), type: 'hidden', path: 'business_listing_view.components.search.hidden' },
|
|
54
|
-
{ name: t('FILTER_ICON', 'Filter icon'), type: 'hidden', path: 'business_listing_view.components.filter.hidden' },
|
|
55
48
|
{ name: t('CITIES_DROPDOWN', 'Cities dropdown'), type: 'hidden', path: 'business_listing_view.components.cities.hidden' }
|
|
56
49
|
]
|
|
57
50
|
|
|
@@ -65,20 +58,17 @@ export const AdvancedSettings = (props) => {
|
|
|
65
58
|
{ name: t('FAVORITE_BUTTON', 'Favorite button'), type: 'hidden', path: 'business_listing_view.components.business.components.favorite.hidden' },
|
|
66
59
|
{ name: t('OFFER_BADGE', 'Offer badge'), type: 'hidden', path: 'business_listing_view.components.business.components.offer.hidden' },
|
|
67
60
|
{ name: t('OFFER_BADGE_POSITION', 'Offer badge position'), type: 'position', path: 'business_listing_view.components.business.components.offer.position' },
|
|
68
|
-
{ name: t('CATEGORIES', 'Categories'), type: 'hidden', path: 'business_listing_view.components.business.components.categories.hidden' },
|
|
69
61
|
{ name: t('FEATURED_BADGE', 'Featured badge'), type: 'hidden', path: 'business_listing_view.components.business.components.featured_badge.hidden' }
|
|
70
62
|
]
|
|
71
63
|
|
|
72
64
|
const businessPageList = [
|
|
73
65
|
{ name: t('DEFAULT_BACKGROUND_COLOR', 'Default Background color'), type: 'color', path: 'business_view.components.style.backgroundColor' },
|
|
74
66
|
{ name: t('PRODUCTS_FROM_PREVIOUS_ORDERS_BLOCK', 'Products from previous orders block'), type: 'hidden', path: 'business_view.components.products_ordered.hidden' },
|
|
75
|
-
{ name: t('NEAR_BUSINESS_BLOCK', 'Near business block'), type: 'hidden', path: 'business_view.components.near_business.hidden' }
|
|
76
|
-
{ name: t('ORDER_VIEW_BUTTON', 'Order view button'), type: 'hidden', path: 'business_view.components.order_view_button.hidden' }
|
|
67
|
+
{ name: t('NEAR_BUSINESS_BLOCK', 'Near business block'), type: 'hidden', path: 'business_view.components.near_business.hidden' }
|
|
77
68
|
]
|
|
78
69
|
|
|
79
70
|
const businessInfoList = [
|
|
80
71
|
{ name: t('DESCRIPTION', 'Description'), type: 'hidden', path: 'business_view.components.information.components.description.hidden' },
|
|
81
|
-
{ name: t('ABOUT', 'About'), type: 'hidden', path: 'business_view.components.information.components.about.hidden' },
|
|
82
72
|
{ name: t('VIDEOS', 'Videos'), type: 'hidden', path: 'business_view.components.information.components.videos.hidden' },
|
|
83
73
|
{ name: t('MENU_LIST_DELIVERY_TIME', 'Delivery time'), type: 'hidden', path: 'business_view.components.information.components.delivery_time.hidden' },
|
|
84
74
|
{ name: t('PICKUP_TIME', 'Pickup time'), type: 'hidden', path: 'business_view.components.information.components.pickup_time.hidden' },
|
|
@@ -206,7 +196,7 @@ export const AdvancedSettings = (props) => {
|
|
|
206
196
|
return (
|
|
207
197
|
<>
|
|
208
198
|
<Container>
|
|
209
|
-
{isApp
|
|
199
|
+
{isApp && (
|
|
210
200
|
<BoxLayout>
|
|
211
201
|
<h1>{t('CUSTOMER_APP_ADVANCED_SETTINGS', 'Customer App Advanced Settings')}</h1>
|
|
212
202
|
<h2>{t('HOMEPAGE', 'Homepage')}</h2>
|
|
@@ -219,21 +209,11 @@ export const AdvancedSettings = (props) => {
|
|
|
219
209
|
handleChangePhoto={handleUpdateThemeValue}
|
|
220
210
|
/>
|
|
221
211
|
</BoxLayout>
|
|
222
|
-
) : (
|
|
223
|
-
<BoxLayout>
|
|
224
|
-
<h1>{t('WEBSITE_ADVANCED_SETTINGS', 'Website Advanced Settings')}</h1>
|
|
225
|
-
<HomePageWrapper>
|
|
226
|
-
<h2>{t('HOMEPAGE', 'Homepage')}</h2>
|
|
227
|
-
<SettingComponent
|
|
228
|
-
settingList={homepageViewList}
|
|
229
|
-
handleUpdateThemeValue={handleUpdateThemeValue}
|
|
230
|
-
advancedValues={themeValuesRef?.current}
|
|
231
|
-
themeId={themesList?.themes?.[0]?.id}
|
|
232
|
-
/>
|
|
233
|
-
</HomePageWrapper>
|
|
234
|
-
</BoxLayout>
|
|
235
212
|
)}
|
|
236
213
|
<BoxLayout>
|
|
214
|
+
{!isApp && (
|
|
215
|
+
<h1>{t('WEBSITE_ADVANCED_SETTINGS', 'Website Advanced Settings')}</h1>
|
|
216
|
+
)}
|
|
237
217
|
<h2>{t('BUTTONS', 'Buttons')}</h2>
|
|
238
218
|
<SettingComponent
|
|
239
219
|
settingList={buttonList}
|
|
@@ -242,14 +222,15 @@ export const AdvancedSettings = (props) => {
|
|
|
242
222
|
themeStructure={themeStructure}
|
|
243
223
|
themeId={themesList?.themes?.[0]?.id}
|
|
244
224
|
/>
|
|
245
|
-
<
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
225
|
+
<Button
|
|
226
|
+
color='primary'
|
|
227
|
+
outline
|
|
228
|
+
borderRadius='8px'
|
|
229
|
+
onClick={() => setIsOpenSound(true)}
|
|
230
|
+
className='custom'
|
|
231
|
+
>
|
|
232
|
+
{t('CUSTOM_SOUNDS', 'Custom sounds')}
|
|
233
|
+
</Button>
|
|
253
234
|
</BoxLayout>
|
|
254
235
|
<BoxLayout>
|
|
255
236
|
<h2>{t('TIPOGRAPHY', 'Tipography')}</h2>
|
|
@@ -399,6 +380,8 @@ export const AdvancedSettings = (props) => {
|
|
|
399
380
|
themeStructure={themeStructure}
|
|
400
381
|
themeId={themesList?.themes?.[0]?.id}
|
|
401
382
|
/>
|
|
383
|
+
</BoxLayout>
|
|
384
|
+
<BoxLayout>
|
|
402
385
|
<h3>{t('CONFIRMATION_PAGE', 'Confirmation page')}</h3>
|
|
403
386
|
<h3>{t('ORDER_BLOCK', 'Order block')}</h3>
|
|
404
387
|
<SettingComponent
|
|
@@ -408,6 +391,8 @@ export const AdvancedSettings = (props) => {
|
|
|
408
391
|
themeStructure={themeStructure}
|
|
409
392
|
themeId={themesList?.themes?.[0]?.id}
|
|
410
393
|
/>
|
|
394
|
+
</BoxLayout>
|
|
395
|
+
<BoxLayout>
|
|
411
396
|
<h3>{t('POPUP_ADDRESS', 'Popup: Address')}</h3>
|
|
412
397
|
<SettingComponent
|
|
413
398
|
settingList={popupAddressList}
|
|
@@ -416,6 +401,8 @@ export const AdvancedSettings = (props) => {
|
|
|
416
401
|
themeStructure={themeStructure}
|
|
417
402
|
themeId={themesList?.themes?.[0]?.id}
|
|
418
403
|
/>
|
|
404
|
+
</BoxLayout>
|
|
405
|
+
<BoxLayout>
|
|
419
406
|
<h3>{t('MY_ACCOUNT_PAGE', 'My account page')}</h3>
|
|
420
407
|
<SettingComponent
|
|
421
408
|
settingList={myAccountList}
|
|
@@ -424,6 +411,8 @@ export const AdvancedSettings = (props) => {
|
|
|
424
411
|
themeStructure={themeStructure}
|
|
425
412
|
themeId={themesList?.themes?.[0]?.id}
|
|
426
413
|
/>
|
|
414
|
+
</BoxLayout>
|
|
415
|
+
<BoxLayout>
|
|
427
416
|
<h3>{t('MY_ORDERS', 'My orders')}</h3>
|
|
428
417
|
<h3>{t('ACTIVE_ORDERS_BLOCK', 'Active Orders Block')}</h3>
|
|
429
418
|
<SettingComponent
|
|
@@ -519,6 +508,16 @@ export const AdvancedSettings = (props) => {
|
|
|
519
508
|
</Button>
|
|
520
509
|
</ButtonWrapper>
|
|
521
510
|
</Container>
|
|
511
|
+
<Modal
|
|
512
|
+
width='769px'
|
|
513
|
+
padding='25px'
|
|
514
|
+
open={isOpenSound}
|
|
515
|
+
onClose={() => setIsOpenSound(false)}
|
|
516
|
+
>
|
|
517
|
+
<UploadAudio
|
|
518
|
+
onClose={() => setIsOpenSound(false)}
|
|
519
|
+
/>
|
|
520
|
+
</Modal>
|
|
522
521
|
<Alert
|
|
523
522
|
title={t('ORDERING', 'Ordering')}
|
|
524
523
|
content={alertState.content}
|
|
@@ -27,10 +27,11 @@ export const BoxLayout = styled.div`
|
|
|
27
27
|
margin-top: 0px;
|
|
28
28
|
margin-bottom: 20px;
|
|
29
29
|
}
|
|
30
|
+
button.custom {
|
|
31
|
+
height: 44px;
|
|
32
|
+
}
|
|
30
33
|
`
|
|
31
34
|
|
|
32
|
-
export const HomePageWrapper = styled.div``
|
|
33
|
-
|
|
34
35
|
export const FormControlWithCheck = styled.div`
|
|
35
36
|
> p {
|
|
36
37
|
font-weight: 400;
|
|
@@ -69,15 +70,6 @@ export const HideCheckWrapper = styled.div`
|
|
|
69
70
|
`}
|
|
70
71
|
`
|
|
71
72
|
|
|
72
|
-
export const ShadowWrapper = styled.div`
|
|
73
|
-
display: flex;
|
|
74
|
-
flex-direction: column;
|
|
75
|
-
|
|
76
|
-
@media (min-width: 576px) {
|
|
77
|
-
flex-direction: row;
|
|
78
|
-
}
|
|
79
|
-
`
|
|
80
|
-
|
|
81
73
|
export const InnerShadowWrapper = styled.div``
|
|
82
74
|
|
|
83
75
|
export const DropShadowWrapper = styled.div`
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useLanguage, useConfig, CustomDomain as CustomDomainController } from 'ordering-components-admin-external'
|
|
3
|
+
import { Select } from '../../../styles/Select/FirstSelect'
|
|
4
|
+
import { CheckSquareFill as CheckedIcon, Square as UnCheckedIcon } from 'react-bootstrap-icons'
|
|
5
|
+
import { Button, Input } from '../../../styles'
|
|
6
|
+
import { Alert } from '../../Shared'
|
|
7
|
+
import {
|
|
8
|
+
Container,
|
|
9
|
+
FormControl,
|
|
10
|
+
SelectWrapper,
|
|
11
|
+
Option,
|
|
12
|
+
ButtonGroup,
|
|
13
|
+
CheckBoxWrapper
|
|
14
|
+
} from './styles'
|
|
15
|
+
|
|
16
|
+
const CustomDomainUI = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
handleChangeFormState,
|
|
19
|
+
formState,
|
|
20
|
+
onClose,
|
|
21
|
+
handleChangeCustomDomain
|
|
22
|
+
} = props
|
|
23
|
+
|
|
24
|
+
const [, t] = useLanguage()
|
|
25
|
+
const [{ configs }] = useConfig()
|
|
26
|
+
|
|
27
|
+
const [showMapInput, setShowMapInput] = useState(false)
|
|
28
|
+
const [googleMapKey, setGoogleMapKey] = useState('')
|
|
29
|
+
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
30
|
+
|
|
31
|
+
const sslTypeList = [
|
|
32
|
+
// { value: 'none', content: <Option>{t('NONE', 'None')}</Option> },
|
|
33
|
+
{ value: 'automatic', content: <Option>{t('AUTOMATIC', 'automatic')}</Option> },
|
|
34
|
+
{ value: 'proxy', content: <Option>{t('PROXY', 'Proxy')} (Cloudflare)</Option> }
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
const handleSubmit = () => {
|
|
38
|
+
const errors = []
|
|
39
|
+
if (!configs?.google_maps_api_key?.value && !(showMapInput && googleMapKey)) {
|
|
40
|
+
errors.push(t('VALIDATION_ERROR_REQUIRED', 'Name is required').replace('_attribute_', t('GOOGLE_MAP_API_KEY', 'Google map api key')))
|
|
41
|
+
}
|
|
42
|
+
if (!formState?.changes?.domain) errors.push(t('VALIDATION_ERROR_REQUIRED', 'Name is required').replace('_attribute_', t('DOMAIN', 'Domain')))
|
|
43
|
+
if (formState?.changes?.domain &&
|
|
44
|
+
!formState?.changes?.domain.match(/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i)) {
|
|
45
|
+
errors.push(t('VALIDATION_ERROR_DOMAIN', 'The domain is not valid'))
|
|
46
|
+
}
|
|
47
|
+
if (!formState?.changes?.ssl_setup_type) errors.push(t('VALIDATION_ERROR_REQUIRED', 'Name is required').replace('_attribute_', t('SSL_SETUP_TYPE', 'SSL setup type')))
|
|
48
|
+
|
|
49
|
+
if (errors.length === 0) {
|
|
50
|
+
const googleMapApiKey = showMapInput && googleMapKey
|
|
51
|
+
handleChangeCustomDomain(googleMapApiKey)
|
|
52
|
+
} else {
|
|
53
|
+
setAlertState({ open: true, content: errors })
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const closeAlert = () => {
|
|
58
|
+
setAlertState({
|
|
59
|
+
open: false,
|
|
60
|
+
content: []
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<>
|
|
66
|
+
<Container>
|
|
67
|
+
<h1>{t('CUSTOM_DOMAIN', 'Custom domain')}</h1>
|
|
68
|
+
<FormControl>
|
|
69
|
+
<label>{t('DOMAIN', 'Domain')}</label>
|
|
70
|
+
<Input
|
|
71
|
+
placeholder='www.yourdomain.com'
|
|
72
|
+
value={formState?.changes?.domain || ''}
|
|
73
|
+
onChange={(e) => handleChangeFormState({ domain: e.target.value })}
|
|
74
|
+
/>
|
|
75
|
+
</FormControl>
|
|
76
|
+
<FormControl>
|
|
77
|
+
<label>{t('SLL_SETUP_TYPE', 'SSL setup type')}</label>
|
|
78
|
+
<SelectWrapper>
|
|
79
|
+
<Select
|
|
80
|
+
options={sslTypeList}
|
|
81
|
+
className='select'
|
|
82
|
+
defaultValue={formState?.changes?.ssl_setup_type}
|
|
83
|
+
placeholder={t('SELECT_OPTION', 'Select an option')}
|
|
84
|
+
onChange={(value) => handleChangeFormState({ ssl_setup_type: value })}
|
|
85
|
+
/>
|
|
86
|
+
</SelectWrapper>
|
|
87
|
+
</FormControl>
|
|
88
|
+
<CheckBoxWrapper onClick={() => setShowMapInput(prev => !prev)}>
|
|
89
|
+
{showMapInput ? <CheckedIcon className='active' /> : <UnCheckedIcon />}
|
|
90
|
+
<span>{t('I_HAVE_GOOGLE_MAPS_KEY_WANT_SHARE_IT', 'I have my Google Maps API Key, I want to share it')}</span>
|
|
91
|
+
</CheckBoxWrapper>
|
|
92
|
+
{showMapInput && (
|
|
93
|
+
<FormControl>
|
|
94
|
+
<label>{t('GOOGLE_MAP_API_KEY', 'Google map api key')}</label>
|
|
95
|
+
<Input
|
|
96
|
+
value={googleMapKey}
|
|
97
|
+
onChange={(e) => setGoogleMapKey(e.target.value)}
|
|
98
|
+
/>
|
|
99
|
+
</FormControl>
|
|
100
|
+
)}
|
|
101
|
+
<ButtonGroup>
|
|
102
|
+
<Button
|
|
103
|
+
color='primary'
|
|
104
|
+
outline
|
|
105
|
+
onClick={onClose}
|
|
106
|
+
>
|
|
107
|
+
{t('Cancel', 'Cancel')}
|
|
108
|
+
</Button>
|
|
109
|
+
<Button
|
|
110
|
+
color='primary'
|
|
111
|
+
onClick={handleSubmit}
|
|
112
|
+
disabled={formState?.loading}
|
|
113
|
+
>
|
|
114
|
+
{t('SAVE', 'Save')}
|
|
115
|
+
</Button>
|
|
116
|
+
</ButtonGroup>
|
|
117
|
+
</Container>
|
|
118
|
+
<Alert
|
|
119
|
+
title={t('ORDERING', 'Ordering')}
|
|
120
|
+
content={alertState.content}
|
|
121
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
122
|
+
open={alertState.open}
|
|
123
|
+
onClose={() => closeAlert()}
|
|
124
|
+
onAccept={() => closeAlert()}
|
|
125
|
+
closeOnBackdrop={false}
|
|
126
|
+
/>
|
|
127
|
+
</>
|
|
128
|
+
)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export const CustomDomain = (props) => {
|
|
132
|
+
const customDomainProps = {
|
|
133
|
+
...props,
|
|
134
|
+
UIComponent: CustomDomainUI
|
|
135
|
+
}
|
|
136
|
+
return <CustomDomainController {...customDomainProps} />
|
|
137
|
+
}
|