ordering-ui-admin-external 1.14.2 → 1.15.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.ffcf30d2b952270f0af3.js → ordering-ui-admin.e2a58dcc95d6a983dfc0.js} +2 -2
- package/_modules/components/Settings/IntegrationListing/index.js +0 -8
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/BusinessReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/BusinessReviewList/index.js +29 -6
- package/src/components/BusinessIntelligence/InvoiceBusinessManager/index.js +17 -1
- package/src/components/BusinessIntelligence/InvoiceDriverManager/index.js +17 -1
- package/src/components/BusinessIntelligence/InvoiceManager/index.js +16 -2
- package/src/components/BusinessIntelligence/InvoiceOrdertype/styles.js +1 -0
- package/src/components/BusinessIntelligence/ProductReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/Reports/index.js +16 -2
- package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +34 -6
- package/src/components/BusinessIntelligence/ReviewsListing/index.js +31 -5
- package/src/components/BusinessIntelligence/UserReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/UsersReviewList/index.js +32 -11
- package/src/components/CartRecovery/RecoveryActionDetail/index.js +19 -1
- package/src/components/CartRecovery/RecoveryActionListing/index.js +21 -3
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversCompaniesListing/index.js +27 -9
- package/src/components/Delivery/DriversCompanyDetailsForm/index.js +37 -8
- package/src/components/Delivery/DriversGroupDetails/index.js +36 -4
- package/src/components/Delivery/DriversGroupLogistics/index.js +18 -2
- package/src/components/Delivery/DriversGroupsListing/index.js +20 -6
- package/src/components/Delivery/UserDetails/index.js +26 -1
- package/src/components/Loyalty/GiftCardDetail/styles.js +192 -0
- package/src/components/Loyalty/GiftCards/index.js +22 -2
- package/src/components/Loyalty/PointsWalletBusinessList/index.js +24 -1
- package/src/components/Loyalty/PointsWalletLevels/index.js +21 -1
- package/src/components/Loyalty/RewardsPrograms/index.js +30 -3
- package/src/components/Loyalty/Wallet/index.js +22 -1
- package/src/components/Marketing/AdBannersListing/index.js +25 -8
- package/src/components/Marketing/BannerImageDetails/index.js +2 -1
- package/src/components/Marketing/CampaignDetail/index.js +22 -1
- package/src/components/Marketing/CampaignEmail/styles.js +3 -0
- package/src/components/Marketing/CampaignListing/index.js +18 -1
- package/src/components/Marketing/CampaignNotification/styles.js +3 -0
- package/src/components/Marketing/CampaignSMS/styles.js +3 -0
- package/src/components/Marketing/EnterprisePromotionGeneralDetails/index.js +2 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +19 -1
- package/src/components/Marketing/PageBanner/index.js +26 -3
- package/src/components/Messages/MessagesListing/index.js +17 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +64 -0
- package/src/components/MyProducts/AdvancedSettings/OrderType.js +40 -0
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +104 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +541 -0
- package/src/components/MyProducts/AdvancedSettings/styles.js +388 -0
- package/src/components/MyProducts/AppLayout/index.js +19 -2
- package/src/components/MyProducts/AppLayout/styles.js +65 -0
- package/src/components/MyProducts/CallCenterApp/index.js +1 -1
- package/src/components/MyProducts/CustomerApp/index.js +2 -2
- package/src/components/MyProducts/DriverApp/index.js +2 -2
- package/src/components/MyProducts/KioskApp/index.js +1 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +309 -255
- package/src/components/MyProducts/OrderingWebsite/styles.js +99 -2
- package/src/components/MyProducts/PosApp/index.js +1 -1
- package/src/components/MyProducts/StoreApp/index.js +2 -2
- package/src/components/OrderingProducts/OrderingProductDetails/index.js +24 -2
- package/src/components/OrderingProducts/OrderingProductsListing/index.js +17 -1
- package/src/components/Orders/DeliveriesManager/index.js +0 -1
- package/src/components/Orders/Messages/index.js +31 -11
- package/src/components/Orders/OrderDetails/index.js +34 -20
- package/src/components/Orders/OrderDetailsHeader/index.js +2 -3
- package/src/components/Orders/OrdersContentHeader/index.js +1 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +111 -13
- package/src/components/Orders/OrdersFilterGroup/styles.js +26 -0
- package/src/components/Orders/OrdersManager/index.js +0 -1
- package/src/components/Settings/CountriesList/index.js +26 -6
- package/src/components/Settings/Deliverect/index.js +26 -2
- package/src/components/Settings/DoordashConnect/index.js +26 -2
- package/src/components/Settings/DropdownOptionList/index.js +27 -6
- package/src/components/Settings/IntegrationListing/index.js +5 -5
- package/src/components/Settings/ItsaCheckmate/index.js +26 -2
- package/src/components/Settings/LalamoveConnect/index.js +26 -2
- package/src/components/Settings/PickerExpress/index.js +26 -2
- package/src/components/Settings/PlaceListing/index.js +38 -6
- package/src/components/Settings/Settings/index.js +79 -37
- package/src/components/Settings/SettingsDetail/index.js +15 -1
- package/src/components/Settings/SitesAuthSettings/index.js +18 -1
- package/src/components/SidebarMenu/index.js +0 -2
- package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +1 -10
- package/src/components/Stores/BusinessAdd/BusinessDetails/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +120 -109
- package/src/components/Stores/BusinessAdd/DeliveryZone/styles.js +22 -1
- package/src/components/Stores/BusinessAdd/PaymentMethods/index.js +8 -2
- package/src/components/Stores/BusinessAdd/PaymentMethods/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/ReceiveOrders/index.js +11 -6
- package/src/components/Stores/BusinessAdd/ReceiveOrders/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/index.js +47 -16
- package/src/components/Stores/BusinessAdd/styles.js +27 -1
- package/src/components/Stores/BusinessAddStore/index.js +1 -1
- package/src/components/Stores/BusinessBrandListing/index.js +37 -4
- package/src/components/Stores/BusinessDeliveryPickupMore/index.js +22 -1
- package/src/components/Stores/BusinessDeliveryZoneDetails/index.js +25 -2
- package/src/components/Stores/BusinessDeliveryZoneList/index.js +30 -3
- package/src/components/Stores/BusinessDetail/index.js +20 -1
- package/src/components/Stores/BusinessDetails/index.js +18 -1
- package/src/components/Stores/BusinessFrontLayout/index.js +13 -1
- package/src/components/Stores/BusinessFrontLayout/styles.js +11 -0
- package/src/components/Stores/BusinessMenu/index.js +56 -11
- package/src/components/Stores/BusinessMenuOptions/index.js +28 -3
- package/src/components/Stores/BusinessOrderingChannels/index.js +19 -2
- package/src/components/Stores/BusinessPaymentMethods/index.js +24 -2
- package/src/components/Stores/BusinessPlaceGroupList/index.js +193 -0
- package/src/components/Stores/BusinessPlaceGroupList/styles.js +143 -0
- package/src/components/Stores/BusinessProductsCategoyDetails/index.js +21 -1
- package/src/components/Stores/BusinessProductsListing/index.js +49 -8
- package/src/components/Stores/BusinessPromotionGeneralForm/index.js +2 -2
- package/src/components/Stores/BusinessSharedMenuProducts/index.js +29 -3
- package/src/components/Stores/BusinessSync/index.js +18 -2
- package/src/components/Stores/BusinessTypes/index.js +26 -4
- package/src/components/Stores/BusinessWalletsList/index.js +23 -1
- package/src/components/Stores/BusinessesListing/index.js +11 -2
- package/src/components/Stores/ImportersButton/index.js +24 -3
- package/src/components/Stores/PaymentOption/index.js +29 -8
- package/src/components/Stores/PaymentOptionMethods/index.js +25 -3
- package/src/components/Stores/PaymentOptionPaypal/index.js +25 -3
- package/src/components/Stores/PaymentOptionSquare/index.js +25 -3
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +25 -3
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +25 -3
- package/src/components/Stores/PaymethodOptionStripeConnect/index.js +25 -3
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +25 -3
- package/src/components/Stores/ProductDetails/index.js +19 -1
- package/src/components/Stores/ProductExtras/index.js +23 -2
- package/src/components/Stores/ProductIngredient/index.js +23 -2
- package/src/components/Stores/ProductMainDetails/index.js +20 -2
- package/src/components/Stores/ProductTagsList/index.js +28 -3
- package/src/components/Users/CustomerCashWallet/index.js +25 -3
- package/src/components/Users/CustomerDetails/index.js +20 -1
- package/src/components/Users/CustomerPointsWallet/index.js +25 -3
- package/src/components/Users/CustomersListing/index.js +9 -4
- package/src/components/Users/ProfessionalDetail/index.js +27 -1
- package/src/components/Users/ProfessionalListing/index.js +9 -4
- package/src/components/Users/UserActiveStateFilter/index.js +16 -3
- package/src/components/Users/UserDetails/index.js +27 -1
- package/src/components/Users/UsersListing/index.js +9 -4
- package/template/pages/BusinessProductsList/index.js +1 -1
- /package/_bundles/{ordering-ui-admin.ffcf30d2b952270f0af3.js.LICENSE.txt → ordering-ui-admin.e2a58dcc95d6a983dfc0.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, ApiKeysList as ApiKeysListController } from 'ordering-components-admin-external'
|
|
3
4
|
import { Button, IconButton } from '../../../styles'
|
|
4
5
|
import { Alert, Confirm, DragScroll, Modal } from '../../Shared'
|
|
@@ -26,6 +27,8 @@ const PickerExpressUI = (props) => {
|
|
|
26
27
|
onClose
|
|
27
28
|
} = props
|
|
28
29
|
|
|
30
|
+
const history = useHistory()
|
|
31
|
+
const query = new URLSearchParams(useLocation().search)
|
|
29
32
|
const [, t] = useLanguage()
|
|
30
33
|
const { width } = useWindowSize()
|
|
31
34
|
|
|
@@ -78,12 +81,33 @@ const PickerExpressUI = (props) => {
|
|
|
78
81
|
toggleMainContent()
|
|
79
82
|
}, [width])
|
|
80
83
|
|
|
84
|
+
const handleOpenMore = (isInitialRender) => {
|
|
85
|
+
setSettingsOpen(true)
|
|
86
|
+
if (!isInitialRender) {
|
|
87
|
+
const id = query.get('id')
|
|
88
|
+
history.replace(`${location.pathname}?id=${id}&more=settings`)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const handleCloseDescription = () => {
|
|
93
|
+
setSettingsOpen(false)
|
|
94
|
+
const id = query.get('id')
|
|
95
|
+
history.replace(`${location.pathname}?id=${id}`)
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
const more = query.get('more')
|
|
100
|
+
if (more === 'settings') {
|
|
101
|
+
handleOpenMore(true)
|
|
102
|
+
}
|
|
103
|
+
}, [])
|
|
104
|
+
|
|
81
105
|
const LalaMoveConnectDescription = () => {
|
|
82
106
|
return (
|
|
83
107
|
<CategoryExtraContent>
|
|
84
108
|
<IconButton
|
|
85
109
|
color='black'
|
|
86
|
-
onClick={() =>
|
|
110
|
+
onClick={() => handleCloseDescription()}
|
|
87
111
|
>
|
|
88
112
|
<XLg />
|
|
89
113
|
</IconButton>
|
|
@@ -179,7 +203,7 @@ const PickerExpressUI = (props) => {
|
|
|
179
203
|
<Description>
|
|
180
204
|
{t('CONNECT_WITH_PICKER_EXPRESS_DESCRIPTION', 'If you have already worked with Pickerexpress or are running your business with Pickerexpress and Ordering simultaneously, this integration will help you connect both platforms and assign orders through them, making your job easy and automated.')}
|
|
181
205
|
</Description>
|
|
182
|
-
<Button color='primary' borderRadius='8px' className='all-setting' onClick={() =>
|
|
206
|
+
<Button color='primary' borderRadius='8px' className='all-setting' onClick={() => handleOpenMore()}>
|
|
183
207
|
<span>{t('SETTINGS', 'All settings')}</span>
|
|
184
208
|
<BsArrowRight />
|
|
185
209
|
</Button>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, PlaceList as PlaceListController } from 'ordering-components-admin-external'
|
|
3
4
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
4
5
|
import { Button, IconButton, Switch } from '../../../styles'
|
|
@@ -76,6 +77,8 @@ const PlaceListingUI = (props) => {
|
|
|
76
77
|
handleSeveralDeleteZones
|
|
77
78
|
} = props
|
|
78
79
|
|
|
80
|
+
const history = useHistory()
|
|
81
|
+
const query = new URLSearchParams(useLocation().search)
|
|
79
82
|
const [, t] = useLanguage()
|
|
80
83
|
const theme = useTheme()
|
|
81
84
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
@@ -135,10 +138,19 @@ const PlaceListingUI = (props) => {
|
|
|
135
138
|
setOpenCity(true)
|
|
136
139
|
}
|
|
137
140
|
|
|
138
|
-
const handleClickCity = (e, city) => {
|
|
139
|
-
const isInvalid = e
|
|
141
|
+
const handleClickCity = (e, city, isInitialRender) => {
|
|
142
|
+
const isInvalid = e?.target?.closest('.city-checkbox') || e?.target?.closest('.city-enabled') || e?.target?.closest('.city-actions')
|
|
140
143
|
if (isInvalid) return
|
|
141
144
|
handleOpenCityDetails(city)
|
|
145
|
+
if (!isInitialRender) {
|
|
146
|
+
history.replace(`${location.pathname}?country=${city.country_id}&city=${city.id}`)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const handleCloseCityDetail = () => {
|
|
151
|
+
setSelectedCity(null)
|
|
152
|
+
setOpenCity(false)
|
|
153
|
+
history.replace(`${location.pathname}`)
|
|
142
154
|
}
|
|
143
155
|
|
|
144
156
|
const handleOpenZoneDropdownDetails = (zone) => {
|
|
@@ -159,6 +171,29 @@ const PlaceListingUI = (props) => {
|
|
|
159
171
|
cleanChagesState()
|
|
160
172
|
}, [showOption])
|
|
161
173
|
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
if (countriesState.loading) return
|
|
176
|
+
const countryId = query.get('country')
|
|
177
|
+
const cityId = query.get('city')
|
|
178
|
+
if (countryId && cityId) {
|
|
179
|
+
setShowOption('cities')
|
|
180
|
+
const initCountry = countriesState.countries.find(country => country.id === Number(countryId))
|
|
181
|
+
if (initCountry) {
|
|
182
|
+
const initCity = initCountry.cities.find(city => city.id === Number(cityId))
|
|
183
|
+
if (initCity) {
|
|
184
|
+
handleClickCity(null, initCity, true)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}, [countriesState.loading])
|
|
189
|
+
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
const zone = query.get('zone')
|
|
192
|
+
if (zone) {
|
|
193
|
+
setShowOption('zones')
|
|
194
|
+
}
|
|
195
|
+
}, [])
|
|
196
|
+
|
|
162
197
|
return (
|
|
163
198
|
<>
|
|
164
199
|
<PlaceListContainer>
|
|
@@ -430,10 +465,7 @@ const PlaceListingUI = (props) => {
|
|
|
430
465
|
sidebarId='city-details'
|
|
431
466
|
defaultSideBarWidth={550}
|
|
432
467
|
open={openCity}
|
|
433
|
-
onClose={() =>
|
|
434
|
-
setSelectedCity(null)
|
|
435
|
-
setOpenCity(false)
|
|
436
|
-
}}
|
|
468
|
+
onClose={() => handleCloseCityDetail()}
|
|
437
469
|
showExpandIcon
|
|
438
470
|
>
|
|
439
471
|
<CityDetails
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useLocation } from 'react-router-dom'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
3
3
|
import { useTheme } from 'styled-components'
|
|
4
4
|
import { useLanguage, useEvent, useConfig, Settings as SettingsController } from 'ordering-components-admin-external'
|
|
5
5
|
import { SettingItemUI } from '../SettingItemUI'
|
|
@@ -11,6 +11,7 @@ import { SideBar } from '../../Shared'
|
|
|
11
11
|
import { CheckoutFieldsSetting } from '../CheckoutFieldsSetting'
|
|
12
12
|
import { AddressFieldsSetting } from '../AddressFieldsSetting'
|
|
13
13
|
import { LanguageSetting } from '../LanguageSetting'
|
|
14
|
+
import { SitesAuthSettings } from '../SitesAuthSettings'
|
|
14
15
|
import { MultiCountrySettings } from '../MultiCountrySettings'
|
|
15
16
|
|
|
16
17
|
import {
|
|
@@ -31,28 +32,21 @@ const SettingsUI = (props) => {
|
|
|
31
32
|
handChangeConfig
|
|
32
33
|
} = props
|
|
33
34
|
|
|
35
|
+
const history = useHistory()
|
|
36
|
+
const query = new URLSearchParams(useLocation().search)
|
|
34
37
|
const [, t] = useLanguage()
|
|
35
38
|
const theme = useTheme()
|
|
36
39
|
const [{ configs }] = useConfig()
|
|
37
40
|
const isMulticountryEnabled = configs?.multicountry?.value
|
|
38
41
|
|
|
39
42
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
40
|
-
const { search } = useLocation()
|
|
41
|
-
|
|
42
43
|
const [isOpenDescription, setIsOpenDescription] = useState(false)
|
|
43
44
|
const [selectedCategory, setSelectedCategory] = useState(null)
|
|
44
45
|
const [isOpenSettingDetails, setIsOpenSettingDetails] = useState(null)
|
|
46
|
+
const [openSitesAuthSettings, setOpenSitesAuthSettings] = useState(false)
|
|
45
47
|
const [openMultiCountrySettings, setOpenMultiCountrySettings] = useState(false)
|
|
46
48
|
const [moveDistance, setMoveDistance] = useState(0)
|
|
47
49
|
|
|
48
|
-
let category
|
|
49
|
-
|
|
50
|
-
if (search) {
|
|
51
|
-
const data = search.substring(1).split('&')
|
|
52
|
-
category = data[0]
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const categoryId = category && category.split('=')[1]
|
|
56
50
|
const [events] = useEvent()
|
|
57
51
|
|
|
58
52
|
const settingPageList = {
|
|
@@ -74,43 +68,77 @@ const SettingsUI = (props) => {
|
|
|
74
68
|
}
|
|
75
69
|
}
|
|
76
70
|
|
|
77
|
-
const handleOpenDescription = (category) => {
|
|
71
|
+
const handleOpenDescription = (category, isInitialRender) => {
|
|
78
72
|
setIsOpenSettingDetails(null)
|
|
73
|
+
setOpenSitesAuthSettings(false)
|
|
79
74
|
setOpenMultiCountrySettings(false)
|
|
80
75
|
setIsOpenDescription(true)
|
|
81
76
|
setSelectedCategory(category)
|
|
82
|
-
onBasicSettingsRedirect({ category: category?.id })
|
|
83
77
|
handChangeConfig && handChangeConfig(false)
|
|
78
|
+
if (!isInitialRender) {
|
|
79
|
+
history.replace(`${location.pathname}?category=${category?.id}`)
|
|
80
|
+
}
|
|
84
81
|
}
|
|
85
82
|
|
|
86
|
-
const handleOpenSettingDetails = (item) => {
|
|
83
|
+
const handleOpenSettingDetails = (item, isInitialRender) => {
|
|
87
84
|
setIsOpenDescription(false)
|
|
85
|
+
setOpenSitesAuthSettings(false)
|
|
88
86
|
setOpenMultiCountrySettings(false)
|
|
89
87
|
setSelectedCategory(null)
|
|
90
88
|
setIsOpenSettingDetails(item)
|
|
89
|
+
if (!isInitialRender) {
|
|
90
|
+
history.replace(`${location.pathname}?category=${item}`)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const handleOpenSites = (isInitialRender) => {
|
|
95
|
+
setIsOpenDescription(false)
|
|
96
|
+
setIsOpenSettingDetails(null)
|
|
97
|
+
setOpenSitesAuthSettings(true)
|
|
98
|
+
if (!isInitialRender) {
|
|
99
|
+
history.replace(`${location.pathname}?category=sites`)
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const handleOpenMultiCountry = (isInitialRender) => {
|
|
104
|
+
setIsOpenDescription(false)
|
|
105
|
+
setIsOpenSettingDetails(null)
|
|
106
|
+
setOpenMultiCountrySettings(true)
|
|
107
|
+
if (!isInitialRender) {
|
|
108
|
+
history.replace(`${location.pathname}?category=multi_country`)
|
|
109
|
+
}
|
|
91
110
|
}
|
|
92
111
|
|
|
93
112
|
const handleBackRedirect = () => {
|
|
94
113
|
setIsOpenDescription(false)
|
|
95
114
|
setSelectedCategory(null)
|
|
96
|
-
|
|
115
|
+
setIsOpenSettingDetails(null)
|
|
116
|
+
setMoveDistance(0)
|
|
117
|
+
setOpenMultiCountrySettings(false)
|
|
118
|
+
setOpenSitesAuthSettings(false)
|
|
119
|
+
history.replace(`${location.pathname}`)
|
|
97
120
|
}
|
|
98
121
|
|
|
99
122
|
useEffect(() => {
|
|
123
|
+
if (categoryList.loading) return
|
|
124
|
+
const categoryId = query.get('category')
|
|
100
125
|
if (categoryId) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
if (isNaN(Number(categoryId))) {
|
|
127
|
+
if (categoryId === 'sites') {
|
|
128
|
+
handleOpenSites(true)
|
|
129
|
+
} else if (categoryId === 'multi_country') {
|
|
130
|
+
handleOpenMultiCountry(true)
|
|
131
|
+
} else {
|
|
132
|
+
handleOpenSettingDetails(categoryId, true)
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
const categorySelected = categoryList?.categories.find(item => item?.id === parseInt(categoryId))
|
|
136
|
+
if (categorySelected) {
|
|
137
|
+
handleOpenDescription(categorySelected, true)
|
|
138
|
+
}
|
|
139
|
+
}
|
|
112
140
|
}
|
|
113
|
-
}, [categoryList
|
|
141
|
+
}, [categoryList.loading])
|
|
114
142
|
|
|
115
143
|
return (
|
|
116
144
|
<>
|
|
@@ -180,14 +208,21 @@ const SettingsUI = (props) => {
|
|
|
180
208
|
active={isOpenSettingDetails === 'address'}
|
|
181
209
|
/>
|
|
182
210
|
</SettingItemWrapper>
|
|
211
|
+
<SettingItemWrapper
|
|
212
|
+
className='col-md-4 col-sm-6'
|
|
213
|
+
onClick={() => handleOpenSites()}
|
|
214
|
+
>
|
|
215
|
+
<SettingItemUI
|
|
216
|
+
title={t('SITES_LOGIN_SIGNUP_SETTINGS', 'Sites Login/Signup Settings')}
|
|
217
|
+
description={t('SITES_LOGIN_SIGNUP_SETTINGS_DESC', 'Advanced sites login/sign up settings')}
|
|
218
|
+
icon={<GearFill />}
|
|
219
|
+
active={openSitesAuthSettings}
|
|
220
|
+
/>
|
|
221
|
+
</SettingItemWrapper>
|
|
183
222
|
{isMulticountryEnabled && (
|
|
184
223
|
<SettingItemWrapper
|
|
185
224
|
className='col-md-4 col-sm-6'
|
|
186
|
-
onClick={() =>
|
|
187
|
-
setIsOpenDescription(false)
|
|
188
|
-
setIsOpenSettingDetails(null)
|
|
189
|
-
setOpenMultiCountrySettings(true)
|
|
190
|
-
}}
|
|
225
|
+
onClick={() => handleOpenMultiCountry()}
|
|
191
226
|
>
|
|
192
227
|
<SettingItemUI
|
|
193
228
|
title={t('MULTI_COUNTRY_SETTINGS', 'Multi country settings')}
|
|
@@ -245,15 +280,22 @@ const SettingsUI = (props) => {
|
|
|
245
280
|
/>
|
|
246
281
|
)
|
|
247
282
|
}
|
|
283
|
+
{openSitesAuthSettings && (
|
|
284
|
+
<SideBar
|
|
285
|
+
defaultSideBarWidth={500 + moveDistance}
|
|
286
|
+
moveDistance={moveDistance}
|
|
287
|
+
open={openSitesAuthSettings}
|
|
288
|
+
onClose={() => handleBackRedirect()}
|
|
289
|
+
>
|
|
290
|
+
<SitesAuthSettings setMoveDistance={setMoveDistance} />
|
|
291
|
+
</SideBar>
|
|
292
|
+
)}
|
|
248
293
|
{openMultiCountrySettings && (
|
|
249
294
|
<SideBar
|
|
250
295
|
defaultSideBarWidth={500 + moveDistance}
|
|
251
296
|
moveDistance={moveDistance}
|
|
252
297
|
open={openMultiCountrySettings}
|
|
253
|
-
onClose={() =>
|
|
254
|
-
setMoveDistance(0)
|
|
255
|
-
setOpenMultiCountrySettings(false)
|
|
256
|
-
}}
|
|
298
|
+
onClose={() => handleBackRedirect()}
|
|
257
299
|
>
|
|
258
300
|
<MultiCountrySettings setMoveDistance={setMoveDistance} />
|
|
259
301
|
</SideBar>
|
|
@@ -264,7 +306,7 @@ const SettingsUI = (props) => {
|
|
|
264
306
|
sidebarId='setting-details'
|
|
265
307
|
defaultSideBarWidth={550}
|
|
266
308
|
open={isOpenSettingDetails}
|
|
267
|
-
onClose={() =>
|
|
309
|
+
onClose={() => handleBackRedirect()}
|
|
268
310
|
showExpandIcon
|
|
269
311
|
>
|
|
270
312
|
{isOpenSettingDetails === 'checkout' && (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { XLg, LifePreserver, ArrowsAngleContract, ArrowsAngleExpand } from 'react-bootstrap-icons'
|
|
3
4
|
import Skeleton from 'react-loading-skeleton'
|
|
4
5
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
@@ -35,6 +36,8 @@ export const SettingsDetail = (props) => {
|
|
|
35
36
|
isUpdateConfig
|
|
36
37
|
} = props
|
|
37
38
|
|
|
39
|
+
const history = useHistory()
|
|
40
|
+
const query = new URLSearchParams(useLocation().search)
|
|
38
41
|
const [, t] = useLanguage()
|
|
39
42
|
const { width } = useWindowSize()
|
|
40
43
|
|
|
@@ -102,13 +105,17 @@ export const SettingsDetail = (props) => {
|
|
|
102
105
|
vid.play()
|
|
103
106
|
}
|
|
104
107
|
|
|
105
|
-
const handleExtraOpen = (isMoreInfo) => {
|
|
108
|
+
const handleExtraOpen = (isMoreInfo, isInitialRender) => {
|
|
106
109
|
if (isMoreInfo) {
|
|
107
110
|
setExtraInfoOpen(true)
|
|
108
111
|
setExtraSubCatOpen(false)
|
|
109
112
|
} else {
|
|
110
113
|
setExtraInfoOpen(false)
|
|
111
114
|
setExtraSubCatOpen(true)
|
|
115
|
+
if (!isInitialRender) {
|
|
116
|
+
const category = query.get('category')
|
|
117
|
+
history.replace(`${location.pathname}?category=${category}&more=settings`)
|
|
118
|
+
}
|
|
112
119
|
}
|
|
113
120
|
}
|
|
114
121
|
|
|
@@ -136,6 +143,13 @@ export const SettingsDetail = (props) => {
|
|
|
136
143
|
return () => document.removeEventListener('keydown', onCloseSidebar)
|
|
137
144
|
}, [open])
|
|
138
145
|
|
|
146
|
+
useEffect(() => {
|
|
147
|
+
const more = query.get('more')
|
|
148
|
+
if (more === 'settings') {
|
|
149
|
+
handleExtraOpen(false, true)
|
|
150
|
+
}
|
|
151
|
+
}, [])
|
|
152
|
+
|
|
139
153
|
return (
|
|
140
154
|
<Container
|
|
141
155
|
id='catDescription'
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, SitesAuthSettings as SitesAuthSettingsController } from 'ordering-components-admin-external'
|
|
3
4
|
import Skeleton from 'react-loading-skeleton'
|
|
4
5
|
import BsChevronRight from '@meronex/icons/bs/BsChevronRight'
|
|
@@ -25,6 +26,8 @@ const SitesAuthSettingsUI = (props) => {
|
|
|
25
26
|
handleChangeConfig
|
|
26
27
|
} = props
|
|
27
28
|
|
|
29
|
+
const history = useHistory()
|
|
30
|
+
const query = new URLSearchParams(useLocation().search)
|
|
28
31
|
const [, t] = useLanguage()
|
|
29
32
|
const { width } = useWindowSize()
|
|
30
33
|
|
|
@@ -32,15 +35,21 @@ const SitesAuthSettingsUI = (props) => {
|
|
|
32
35
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
33
36
|
const [isExpand, setIsExpand] = useState(false)
|
|
34
37
|
|
|
35
|
-
const handleOpenSiteSettingDetails = (siteId) => {
|
|
38
|
+
const handleOpenSiteSettingDetails = (siteId, isInitialRender) => {
|
|
36
39
|
handleGetSiteConfigs(siteId)
|
|
37
40
|
setSelectedSiteId(siteId)
|
|
38
41
|
setMoveDistance(500)
|
|
42
|
+
if (!isInitialRender) {
|
|
43
|
+
const category = query.get('category')
|
|
44
|
+
history.replace(`${location.pathname}?category=${category}&site=${siteId}`)
|
|
45
|
+
}
|
|
39
46
|
}
|
|
40
47
|
|
|
41
48
|
const handleCloseDetails = () => {
|
|
42
49
|
setSelectedSiteId(null)
|
|
43
50
|
setMoveDistance(0)
|
|
51
|
+
const category = query.get('category')
|
|
52
|
+
history.replace(`${location.pathname}?category=${category}`)
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
const expandSideBar = () => {
|
|
@@ -59,6 +68,14 @@ const SitesAuthSettingsUI = (props) => {
|
|
|
59
68
|
}
|
|
60
69
|
}, [actionState.error])
|
|
61
70
|
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
if (sitesState.loading) return
|
|
73
|
+
const site = query.get('site')
|
|
74
|
+
if (site) {
|
|
75
|
+
handleOpenSiteSettingDetails(Number(site), true)
|
|
76
|
+
}
|
|
77
|
+
}, [sitesState.loading])
|
|
78
|
+
|
|
62
79
|
return (
|
|
63
80
|
<>
|
|
64
81
|
<SitesListContainer>
|
|
@@ -42,7 +42,7 @@ export const BusinessDetails = (props) => {
|
|
|
42
42
|
<h2>{t('BUSINESS_DETAILS', 'Business details')}</h2>
|
|
43
43
|
<ContentWrapper>
|
|
44
44
|
<FormControl>
|
|
45
|
-
<label>{t('BUSINESS_NAME', 'Business Name')}
|
|
45
|
+
<label>{t('BUSINESS_NAME', 'Business Name')}<sup>*</sup></label>
|
|
46
46
|
<Input
|
|
47
47
|
name='name'
|
|
48
48
|
placeholder={t('NAME', 'Name')}
|
|
@@ -72,15 +72,6 @@ export const BusinessDetails = (props) => {
|
|
|
72
72
|
/>
|
|
73
73
|
)}
|
|
74
74
|
</FormControl>
|
|
75
|
-
<FormControl>
|
|
76
|
-
<label>{t('ZIPCODE', 'Zipcode')}</label>
|
|
77
|
-
<Input
|
|
78
|
-
name='zipcode'
|
|
79
|
-
placeholder={t('ZIPCODE', 'Zipcode')}
|
|
80
|
-
defaultValue={formState?.changes?.zipcode ?? ''}
|
|
81
|
-
onChange={handleChangeInput}
|
|
82
|
-
/>
|
|
83
|
-
</FormControl>
|
|
84
75
|
<GoogleMapContainer>
|
|
85
76
|
<label>{t('GOOGLE_PLACE_ID', 'Google place ID')}</label>
|
|
86
77
|
<p>{placeId ?? googleMapsApiKey}</p>
|