ordering-ui-admin-external 1.29.3 → 1.30.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.e0348521ef103574aa53.js → ordering-ui-admin.046d3a07ef07287d2ee0.js} +2 -2
- package/_modules/components/Delivery/DriversMarkAsBusy/index.js +24 -4
- package/_modules/components/Delivery/DriversMarkAsBusy/styles.js +1 -1
- package/_modules/components/Home/HomePage/index.js +4 -1
- package/_modules/components/Marketing/BannerDetails/AddBanner.js +15 -1
- package/_modules/components/Marketing/BannerDetails/Businesses/index.js +118 -0
- package/_modules/components/Marketing/BannerDetails/Businesses/styles.js +47 -0
- package/_modules/components/Marketing/BannerDetails/index.js +47 -14
- package/_modules/components/Marketing/BannerDetails/styles.js +5 -3
- package/_modules/components/MyProducts/OrderingWebsite/index.js +1 -1
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/index.js +4 -0
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/index.js +68 -64
- package/_modules/components/Orders/CreateCustomOrder/SelectProducts/styles.js +22 -29
- package/_modules/components/Shared/Schedule/index.js +2 -2
- package/_modules/components/SidebarMenu/index.js +6 -2
- package/_modules/components/Stores/BusinessProductsListing/index.js +17 -17
- package/_modules/components/Stores/BusinessQRCodeOption/index.js +2 -2
- package/_modules/components/Stores/BusinessSummary/index.js +8 -8
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/Delivery/DriversMarkAsBusy/index.js +22 -1
- package/src/components/Delivery/DriversMarkAsBusy/styles.js +2 -0
- package/src/components/Home/HomePage/index.js +4 -2
- package/src/components/Marketing/BannerDetails/AddBanner.js +23 -2
- package/src/components/Marketing/BannerDetails/Businesses/index.js +117 -0
- package/src/components/Marketing/BannerDetails/Businesses/styles.js +96 -0
- package/src/components/Marketing/BannerDetails/index.js +42 -6
- package/src/components/Marketing/BannerDetails/styles.js +7 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +2 -1
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/index.js +6 -1
- package/src/components/Orders/CreateCustomOrder/SelectProducts/index.js +54 -73
- package/src/components/Orders/CreateCustomOrder/SelectProducts/styles.js +54 -53
- package/src/components/Settings/SettingsList/index.js +89 -89
- package/src/components/Shared/Schedule/index.js +1 -1
- package/src/components/SidebarMenu/index.js +8 -2
- package/src/components/Stores/BusinessProductsListing/index.js +5 -3
- package/src/components/Stores/BusinessQRCodeOption/index.js +5 -3
- package/src/components/Stores/BusinessSummary/index.js +5 -3
- /package/_bundles/{ordering-ui-admin.e0348521ef103574aa53.js.LICENSE.txt → ordering-ui-admin.046d3a07ef07287d2ee0.js.LICENSE.txt} +0 -0
|
@@ -3,59 +3,6 @@ import styled, { css } from 'styled-components'
|
|
|
3
3
|
export const Container = styled.div`
|
|
4
4
|
margin-top: 50px;
|
|
5
5
|
`
|
|
6
|
-
export const SearchProductsWrapper = styled.div`
|
|
7
|
-
position: relative;
|
|
8
|
-
margin-top: 11px;
|
|
9
|
-
|
|
10
|
-
> input {
|
|
11
|
-
width: 100%;
|
|
12
|
-
height: 44px;
|
|
13
|
-
${props => props.theme?.rtl ? css`
|
|
14
|
-
padding-left: 40px;
|
|
15
|
-
` : css`
|
|
16
|
-
padding-right: 40px;
|
|
17
|
-
`}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
span.loading {
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: 10px;
|
|
23
|
-
${props => props.theme?.rtl ? css`
|
|
24
|
-
left: 10px;
|
|
25
|
-
` : css`
|
|
26
|
-
right: 10px;
|
|
27
|
-
`}
|
|
28
|
-
|
|
29
|
-
@keyframes spinner-content {
|
|
30
|
-
0% { transform: rotate(0) }
|
|
31
|
-
100% { transform: rotate(360deg) }
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
svg {
|
|
35
|
-
animation: spinner-content 1.85s linear infinite;
|
|
36
|
-
color: ${props => props.theme.colors.headingColor};
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`
|
|
40
|
-
|
|
41
|
-
export const OptionsToSelectContainer = styled.div`
|
|
42
|
-
z-index: 100;
|
|
43
|
-
position: absolute;
|
|
44
|
-
top: 50px;
|
|
45
|
-
left: 0;
|
|
46
|
-
width: 100%;
|
|
47
|
-
max-height: 300px;
|
|
48
|
-
overflow-x: hidden;
|
|
49
|
-
border-radius: 8px;
|
|
50
|
-
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
51
|
-
background-color: ${props => props.theme.colors.backgroundPage};
|
|
52
|
-
padding: 9px 0;
|
|
53
|
-
|
|
54
|
-
> p {
|
|
55
|
-
font-size: 12px;
|
|
56
|
-
margin: 0 16px;
|
|
57
|
-
}
|
|
58
|
-
`
|
|
59
6
|
export const SelectOption = styled.div`
|
|
60
7
|
cursor: pointer;
|
|
61
8
|
width: 100%;
|
|
@@ -159,3 +106,57 @@ export const ProductEditDeleteActions = styled.div`
|
|
|
159
106
|
}
|
|
160
107
|
}
|
|
161
108
|
`
|
|
109
|
+
|
|
110
|
+
export const SelectWrapper = styled.div`
|
|
111
|
+
margin-top: 11px;
|
|
112
|
+
|
|
113
|
+
.select {
|
|
114
|
+
width: 100%;
|
|
115
|
+
background: ${props => props.theme.colors.secundary};
|
|
116
|
+
border: none;
|
|
117
|
+
font-size: 14px;
|
|
118
|
+
|
|
119
|
+
> div:first-child {
|
|
120
|
+
padding-top: 4px;
|
|
121
|
+
padding-bottom: 4px;
|
|
122
|
+
}
|
|
123
|
+
.list {
|
|
124
|
+
max-width: 100%;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`
|
|
128
|
+
export const Option = styled.div`
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
cursor: pointer;
|
|
132
|
+
padding: 5px;
|
|
133
|
+
border-radius: 7.6px;
|
|
134
|
+
img {
|
|
135
|
+
min-height: 38px;
|
|
136
|
+
min-width: 38px;
|
|
137
|
+
height: 38px;
|
|
138
|
+
width: 38px;
|
|
139
|
+
border-radius: 8px;
|
|
140
|
+
object-fit: cover;
|
|
141
|
+
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
|
|
142
|
+
${props => props.theme?.rtl ? css`
|
|
143
|
+
margin-left: 8px;
|
|
144
|
+
` : css`
|
|
145
|
+
margin-right: 8px;
|
|
146
|
+
`}
|
|
147
|
+
}
|
|
148
|
+
> span {
|
|
149
|
+
max-width: 200px;
|
|
150
|
+
font-size: 14px;
|
|
151
|
+
font-weight: 700;
|
|
152
|
+
text-overflow: ellipsis;
|
|
153
|
+
white-space: nowrap;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
@media (min-width: 768px) {
|
|
158
|
+
> span {
|
|
159
|
+
max-width: 560px;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
`
|
|
@@ -145,89 +145,43 @@ export const SettingsListUI = (props) => {
|
|
|
145
145
|
{
|
|
146
146
|
configs.length > 0 && configs.map((config, i) => (
|
|
147
147
|
!settingsNotAllowed.includes(config.key) && (
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<FormGroupText className='form-group'>
|
|
152
|
-
<label>{config?.name}</label>
|
|
153
|
-
{config?.description && <Description>{config?.description}</Description>}
|
|
154
|
-
<input
|
|
155
|
-
type='text'
|
|
156
|
-
value={config?.value}
|
|
157
|
-
onChange={(e) => handleInputChange(e.target.value, config?.id)}
|
|
158
|
-
onKeyPress={(e) => handleKeyPress(e, config?.key)}
|
|
159
|
-
className='form-control'
|
|
160
|
-
placeholder={config?.name}
|
|
161
|
-
/>
|
|
162
|
-
</FormGroupText>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
{
|
|
166
|
-
config.type === 2 && (
|
|
167
|
-
config.key === 'country_autocomplete' ? (
|
|
168
|
-
<SettingsCountryFilter
|
|
169
|
-
defaultValue={config?.value}
|
|
170
|
-
handleSelectChange={(value) => handleInputChange(value, config?.id)}
|
|
171
|
-
label={config?.name}
|
|
172
|
-
description={config?.description}
|
|
173
|
-
/>
|
|
174
|
-
) : (
|
|
175
|
-
<SettingsSelectUI
|
|
176
|
-
config={config}
|
|
177
|
-
defaultValue={config?.value}
|
|
178
|
-
handleSelectChange={(value) => handleInputChange(value, config?.id)}
|
|
179
|
-
/>
|
|
180
|
-
)
|
|
181
|
-
)
|
|
182
|
-
}
|
|
183
|
-
{
|
|
184
|
-
config.type === 3 && (
|
|
185
|
-
<CheckBoxWrapper>
|
|
186
|
-
{config?.name && (
|
|
187
|
-
<label>{config?.name}</label>
|
|
188
|
-
)}
|
|
189
|
-
{config?.description && (
|
|
190
|
-
<p>{config?.description}</p>
|
|
191
|
-
)}
|
|
192
|
-
{
|
|
193
|
-
config?.options?.length > 0 && config?.options?.map((item, j) => (
|
|
194
|
-
<FormGroupWrapper key={j}>
|
|
195
|
-
<FormGroupCheck className='checkbox'>
|
|
196
|
-
<label>
|
|
197
|
-
<input
|
|
198
|
-
type='checkbox'
|
|
199
|
-
name={item?.value}
|
|
200
|
-
data-id={config?.id}
|
|
201
|
-
defaultChecked={config?.value.split('|').includes(item?.value)}
|
|
202
|
-
onChange={(e) => handleCheckBoxChange(e, true, config?.value)}
|
|
203
|
-
/>
|
|
204
|
-
{t(item.text.toUpperCase(), item.text.replace(/_/g, ' ').toLowerCase())}
|
|
205
|
-
</label>
|
|
206
|
-
</FormGroupCheck>
|
|
207
|
-
</FormGroupWrapper>
|
|
208
|
-
))
|
|
209
|
-
}
|
|
210
|
-
{
|
|
211
|
-
!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>
|
|
212
|
-
}
|
|
213
|
-
</CheckBoxWrapper>
|
|
214
|
-
)
|
|
215
|
-
}
|
|
216
|
-
{
|
|
217
|
-
config.type === 4 && (
|
|
218
|
-
config.key === 'driver_tip_options' ? (
|
|
148
|
+
<div key={i}>
|
|
149
|
+
{
|
|
150
|
+
config.type === 1 && (
|
|
219
151
|
<FormGroupText className='form-group'>
|
|
220
152
|
<label>{config?.name}</label>
|
|
221
153
|
{config?.description && <Description>{config?.description}</Description>}
|
|
222
154
|
<input
|
|
223
155
|
type='text'
|
|
224
|
-
|
|
156
|
+
value={config?.value}
|
|
225
157
|
onChange={(e) => handleInputChange(e.target.value, config?.id)}
|
|
158
|
+
onKeyPress={(e) => handleKeyPress(e, config?.key)}
|
|
226
159
|
className='form-control'
|
|
227
|
-
placeholder=
|
|
160
|
+
placeholder={config?.name}
|
|
228
161
|
/>
|
|
229
162
|
</FormGroupText>
|
|
230
|
-
)
|
|
163
|
+
)
|
|
164
|
+
}
|
|
165
|
+
{
|
|
166
|
+
config.type === 2 && (
|
|
167
|
+
config.key === 'country_autocomplete' ? (
|
|
168
|
+
<SettingsCountryFilter
|
|
169
|
+
defaultValue={config?.value}
|
|
170
|
+
handleSelectChange={(value) => handleInputChange(value, config?.id)}
|
|
171
|
+
label={config?.name}
|
|
172
|
+
description={config?.description}
|
|
173
|
+
/>
|
|
174
|
+
) : (
|
|
175
|
+
<SettingsSelectUI
|
|
176
|
+
config={config}
|
|
177
|
+
defaultValue={config?.value}
|
|
178
|
+
handleSelectChange={(value) => handleInputChange(value, config?.id)}
|
|
179
|
+
/>
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
{
|
|
184
|
+
config.type === 3 && (
|
|
231
185
|
<CheckBoxWrapper>
|
|
232
186
|
{config?.name && (
|
|
233
187
|
<label>{config?.name}</label>
|
|
@@ -244,28 +198,74 @@ export const SettingsListUI = (props) => {
|
|
|
244
198
|
type='checkbox'
|
|
245
199
|
name={item?.value}
|
|
246
200
|
data-id={config?.id}
|
|
247
|
-
defaultChecked={
|
|
248
|
-
onChange={(e) => handleCheckBoxChange(e,
|
|
201
|
+
defaultChecked={config?.value.split('|').includes(item?.value)}
|
|
202
|
+
onChange={(e) => handleCheckBoxChange(e, true, config?.value)}
|
|
249
203
|
/>
|
|
250
|
-
{item.text}
|
|
204
|
+
{t(item.text.toUpperCase(), item.text.replace(/_/g, ' ').toLowerCase())}
|
|
251
205
|
</label>
|
|
252
206
|
</FormGroupCheck>
|
|
253
207
|
</FormGroupWrapper>
|
|
254
208
|
))
|
|
255
209
|
}
|
|
256
|
-
{
|
|
210
|
+
{
|
|
211
|
+
!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>
|
|
212
|
+
}
|
|
257
213
|
</CheckBoxWrapper>
|
|
258
214
|
)
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
215
|
+
}
|
|
216
|
+
{
|
|
217
|
+
config.type === 4 && (
|
|
218
|
+
config.key === 'driver_tip_options' ? (
|
|
219
|
+
<FormGroupText className='form-group'>
|
|
220
|
+
<label>{config?.name}</label>
|
|
221
|
+
{config?.description && <Description>{config?.description}</Description>}
|
|
222
|
+
<input
|
|
223
|
+
type='text'
|
|
224
|
+
defaultValue={formatArray(config?.value)}
|
|
225
|
+
onChange={(e) => handleInputChange(e.target.value, config?.id)}
|
|
226
|
+
className='form-control'
|
|
227
|
+
placeholder='placeholder'
|
|
228
|
+
/>
|
|
229
|
+
</FormGroupText>
|
|
230
|
+
) : (
|
|
231
|
+
<CheckBoxWrapper>
|
|
232
|
+
{config?.name && (
|
|
233
|
+
<label>{config?.name}</label>
|
|
234
|
+
)}
|
|
235
|
+
{config?.description && (
|
|
236
|
+
<p>{config?.description}</p>
|
|
237
|
+
)}
|
|
238
|
+
{
|
|
239
|
+
config?.options?.length > 0 && config?.options?.map((item, j) => (
|
|
240
|
+
<FormGroupWrapper key={j}>
|
|
241
|
+
<FormGroupCheck className='checkbox'>
|
|
242
|
+
<label>
|
|
243
|
+
<input
|
|
244
|
+
type='checkbox'
|
|
245
|
+
name={item?.value}
|
|
246
|
+
data-id={config?.id}
|
|
247
|
+
defaultChecked={JSON.parse(config?.value).includes(parseInt(item?.value))}
|
|
248
|
+
onChange={(e) => handleCheckBoxChange(e, false, config?.value)}
|
|
249
|
+
/>
|
|
250
|
+
{item.text}
|
|
251
|
+
</label>
|
|
252
|
+
</FormGroupCheck>
|
|
253
|
+
</FormGroupWrapper>
|
|
254
|
+
))
|
|
255
|
+
}
|
|
256
|
+
{!config?.options && <OptionsError>{t('NO_OPTIONS_VALUE', 'There is no options value')}</OptionsError>}
|
|
257
|
+
</CheckBoxWrapper>
|
|
258
|
+
)
|
|
259
|
+
)
|
|
260
|
+
}
|
|
261
|
+
{
|
|
262
|
+
config.type === 5 && (
|
|
263
|
+
<SettingsImage
|
|
264
|
+
config={config}
|
|
265
|
+
saveConfig={saveConfig}
|
|
266
|
+
/>
|
|
267
|
+
)
|
|
268
|
+
}
|
|
269
269
|
{/* {config.type === 6 && (
|
|
270
270
|
<>
|
|
271
271
|
<FormGroupText className='form-group'>
|
|
@@ -289,7 +289,7 @@ export const SettingsListUI = (props) => {
|
|
|
289
289
|
</FormGroupText>
|
|
290
290
|
</>
|
|
291
291
|
)} */}
|
|
292
|
-
|
|
292
|
+
</div>
|
|
293
293
|
)
|
|
294
294
|
))
|
|
295
295
|
}
|
|
@@ -53,7 +53,7 @@ const ScheduleUI = (props) => {
|
|
|
53
53
|
const [{ configs }] = useConfig()
|
|
54
54
|
const [{ parseDate }] = useUtils()
|
|
55
55
|
|
|
56
|
-
const is12Hours = configs
|
|
56
|
+
const is12Hours = configs?.general_hour_format?.value?.includes('hh:mm')
|
|
57
57
|
|
|
58
58
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
59
59
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
X as CloseIcon
|
|
23
23
|
} from 'react-bootstrap-icons'
|
|
24
24
|
import { useTheme } from 'styled-components'
|
|
25
|
-
import { SidebarMenu as SidebarMenuController, useEvent, useLanguage, useSession, useConfig, useApi } from 'ordering-components-admin-external'
|
|
25
|
+
import { SidebarMenu as SidebarMenuController, useEvent, useLanguage, useSession, useConfig, useApi, useSite } from 'ordering-components-admin-external'
|
|
26
26
|
import { useWindowSize } from '../../hooks/useWindowSize'
|
|
27
27
|
import { Accordion, Image, Button, AccordionContext, useAccordionToggle } from 'react-bootstrap'
|
|
28
28
|
import { LanguageSelector } from '../LanguageSelector'
|
|
@@ -53,6 +53,7 @@ const SidebarMenuUI = (props) => {
|
|
|
53
53
|
const [events] = useEvent()
|
|
54
54
|
const [, t] = useLanguage()
|
|
55
55
|
const [sessionState] = useSession()
|
|
56
|
+
const [{ site }] = useSite()
|
|
56
57
|
const [{ configs }] = useConfig()
|
|
57
58
|
const [ordering] = useApi()
|
|
58
59
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
@@ -388,7 +389,12 @@ const SidebarMenuUI = (props) => {
|
|
|
388
389
|
}
|
|
389
390
|
|
|
390
391
|
const handleOpenSite = () => {
|
|
391
|
-
|
|
392
|
+
const siteUrl = site?.domain && site?.ssl_process_status === 'ended'
|
|
393
|
+
? `https://${site?.domain}`
|
|
394
|
+
: configs?.site_url?.value
|
|
395
|
+
? configs?.site_url?.value
|
|
396
|
+
: `https://${ordering.project}.tryordering.com`
|
|
397
|
+
handleGoToLink(siteUrl)
|
|
392
398
|
}
|
|
393
399
|
|
|
394
400
|
useEffect(() => {
|
|
@@ -222,9 +222,11 @@ const BusinessProductsListingUI = (props) => {
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
const handleOpenSite = () => {
|
|
225
|
-
const storeUrl =
|
|
226
|
-
?
|
|
227
|
-
:
|
|
225
|
+
const storeUrl = siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended'
|
|
226
|
+
? `https://${siteState?.site?.domain}/store/${businessState?.business?.slug}`
|
|
227
|
+
: configs?.site_url?.value
|
|
228
|
+
? `${checkSiteUrl(configs?.site_url?.value)}store/${businessState?.business?.slug}`
|
|
229
|
+
: `https://${ordering.project}.tryordering.com/store/${businessState?.business?.slug}`
|
|
228
230
|
window.open(storeUrl, '_blank')
|
|
229
231
|
}
|
|
230
232
|
|
|
@@ -60,9 +60,11 @@ export const BusinessQRCodeOption = (props) => {
|
|
|
60
60
|
})
|
|
61
61
|
return
|
|
62
62
|
}
|
|
63
|
-
const storeUrl =
|
|
64
|
-
?
|
|
65
|
-
:
|
|
63
|
+
const storeUrl = siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended'
|
|
64
|
+
? `https://${siteState?.site?.domain}/store/${business?.slug}`
|
|
65
|
+
: configs?.site_url?.value
|
|
66
|
+
? `${checkSiteUrl(configs?.site_url?.value)}store/${business?.slug}`
|
|
67
|
+
: `https://${ordering.project}.tryordering.com/store/${business?.slug}`
|
|
66
68
|
const tsNumber = item?.key !== 'pick_up'
|
|
67
69
|
? (item?.key === 'eat_in'
|
|
68
70
|
? `&table_number=${numberRef?.current?.value}`
|
|
@@ -60,9 +60,11 @@ export const BusinessSummary = (props) => {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
const handleOpenSite = () => {
|
|
63
|
-
const storeUrl =
|
|
64
|
-
?
|
|
65
|
-
:
|
|
63
|
+
const storeUrl = siteState?.site?.domain && siteState?.site?.ssl_process_status === 'ended'
|
|
64
|
+
? `https://${siteState?.site?.domain}/store/${businessState?.business?.slug}`
|
|
65
|
+
: configs?.site_url?.value
|
|
66
|
+
? `${checkSiteUrl(configs?.site_url?.value)}store/${businessState?.business?.slug}`
|
|
67
|
+
: `https://${ordering.project}.tryordering.com/store/${businessState?.business?.slug}`
|
|
66
68
|
window.open(storeUrl, '_blank')
|
|
67
69
|
}
|
|
68
70
|
|