ordering-ui-admin-external 1.14.3 → 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/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 +3 -3
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
4
|
import { BusinessDeliveryDetails } from '../BusinessDeliveryDetails'
|
|
4
5
|
import { BusinessPickupDetails } from '../BusinessPickupDetails'
|
|
@@ -17,6 +18,8 @@ export const BusinessDeliveryPickupMore = (props) => {
|
|
|
17
18
|
setIsExtendExtraOpen
|
|
18
19
|
} = props
|
|
19
20
|
|
|
21
|
+
const history = useHistory()
|
|
22
|
+
const query = new URLSearchParams(useLocation().search)
|
|
20
23
|
const [, t] = useLanguage()
|
|
21
24
|
const [selectedTab, setSelectedTab] = useState('delivery')
|
|
22
25
|
|
|
@@ -31,6 +34,24 @@ export const BusinessDeliveryPickupMore = (props) => {
|
|
|
31
34
|
setIsExtendExtraOpen(false)
|
|
32
35
|
}, [selectedTab])
|
|
33
36
|
|
|
37
|
+
const handleTabClick = (tab, isInitialRender) => {
|
|
38
|
+
setSelectedTab(tab)
|
|
39
|
+
if (!isInitialRender) {
|
|
40
|
+
const businessId = query.get('id')
|
|
41
|
+
const section = query.get('section')
|
|
42
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
const tab = query.get('tab')
|
|
48
|
+
if (tab) {
|
|
49
|
+
handleTabClick(tab, true)
|
|
50
|
+
} else {
|
|
51
|
+
handleTabClick('delivery')
|
|
52
|
+
}
|
|
53
|
+
}, [])
|
|
54
|
+
|
|
34
55
|
return (
|
|
35
56
|
<Container>
|
|
36
57
|
<h1>{t('DELIVERY_PICKUP_MORE', 'Delivery, pickup & more')}</h1>
|
|
@@ -40,7 +61,7 @@ export const BusinessDeliveryPickupMore = (props) => {
|
|
|
40
61
|
<Tab
|
|
41
62
|
key={tab.key}
|
|
42
63
|
active={tab.key === selectedTab}
|
|
43
|
-
onClick={() =>
|
|
64
|
+
onClick={() => handleTabClick(tab.key)}
|
|
44
65
|
>
|
|
45
66
|
{tab.content}
|
|
46
67
|
</Tab>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import {
|
|
3
4
|
useLanguage,
|
|
4
5
|
BusinessDeliveryZone as BusinessDeliveryZoneController
|
|
@@ -34,6 +35,8 @@ const BusinessDeliveryZoneDetailsUI = (props) => {
|
|
|
34
35
|
handleSuccessUpdate
|
|
35
36
|
} = props
|
|
36
37
|
|
|
38
|
+
const history = useHistory()
|
|
39
|
+
const query = new URLSearchParams(useLocation().search)
|
|
37
40
|
const theme = useTheme()
|
|
38
41
|
const [, t] = useLanguage()
|
|
39
42
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
@@ -55,6 +58,26 @@ const BusinessDeliveryZoneDetailsUI = (props) => {
|
|
|
55
58
|
})
|
|
56
59
|
}
|
|
57
60
|
|
|
61
|
+
const handleTabClick = (zoneTab, isInitialRender) => {
|
|
62
|
+
setSelectedMenuOption(zoneTab)
|
|
63
|
+
if (!isInitialRender) {
|
|
64
|
+
const businessId = query.get('id')
|
|
65
|
+
const section = query.get('section')
|
|
66
|
+
const tab = query.get('tab')
|
|
67
|
+
const zone = query.get('zone')
|
|
68
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}&zone=${zone}&zone_tab=${zoneTab}`)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
useEffect(() => {
|
|
73
|
+
const zoneTab = query.get('zone_tab')
|
|
74
|
+
if (zoneTab) {
|
|
75
|
+
handleTabClick(zoneTab, true)
|
|
76
|
+
} else {
|
|
77
|
+
handleTabClick('information')
|
|
78
|
+
}
|
|
79
|
+
}, [])
|
|
80
|
+
|
|
58
81
|
return (
|
|
59
82
|
<>
|
|
60
83
|
<Container>
|
|
@@ -81,7 +104,7 @@ const BusinessDeliveryZoneDetailsUI = (props) => {
|
|
|
81
104
|
<Tab
|
|
82
105
|
key={tab.key}
|
|
83
106
|
active={selectedMenuOption === tab.key}
|
|
84
|
-
onClick={() =>
|
|
107
|
+
onClick={() => handleTabClick(tab.key)}
|
|
85
108
|
>
|
|
86
109
|
{tab.content}
|
|
87
110
|
</Tab>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
4
|
import { BusinessDeliveryZoneDetails } from '../BusinessDeliveryZoneDetails'
|
|
4
5
|
import { SideBar } from '../../Shared'
|
|
@@ -23,6 +24,8 @@ export const BusinessDeliveryZoneList = (props) => {
|
|
|
23
24
|
handleChangeAllZoneState
|
|
24
25
|
} = props
|
|
25
26
|
|
|
27
|
+
const history = useHistory()
|
|
28
|
+
const query = new URLSearchParams(useLocation().search)
|
|
26
29
|
const [, t] = useLanguage()
|
|
27
30
|
const [isOpenDetails, setIsOpenDetails] = useState(false)
|
|
28
31
|
const [curZone, setCurZone] = useState(null)
|
|
@@ -31,16 +34,40 @@ export const BusinessDeliveryZoneList = (props) => {
|
|
|
31
34
|
setIsOpenDetails(false)
|
|
32
35
|
setIsExtendExtraOpen(false)
|
|
33
36
|
setCurZone(null)
|
|
37
|
+
|
|
38
|
+
const businessId = query.get('id')
|
|
39
|
+
const section = query.get('section')
|
|
40
|
+
const tab = query.get('tab')
|
|
41
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
34
42
|
}
|
|
35
43
|
|
|
36
|
-
const handleOpenZone = (e, zone) => {
|
|
37
|
-
const isInvalid = e
|
|
44
|
+
const handleOpenZone = (e, zone, isInitialRender) => {
|
|
45
|
+
const isInvalid = e?.target?.closest('.zone-enabled')
|
|
38
46
|
if (isInvalid) return
|
|
39
47
|
setCurZone(zone)
|
|
40
48
|
setIsExtendExtraOpen(true)
|
|
41
49
|
setIsOpenDetails(true)
|
|
50
|
+
|
|
51
|
+
if (!isInitialRender) {
|
|
52
|
+
const businessId = query.get('id')
|
|
53
|
+
const section = query.get('section')
|
|
54
|
+
const tab = query.get('tab')
|
|
55
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}&zone=${zone.id}`)
|
|
56
|
+
}
|
|
42
57
|
}
|
|
43
58
|
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
const zoneId = query.get('zone')
|
|
61
|
+
if (zoneId) {
|
|
62
|
+
const initZone = business?.zones?.find(zone => zone.id === Number(zoneId))
|
|
63
|
+
if (initZone) {
|
|
64
|
+
setTimeout(() => {
|
|
65
|
+
handleOpenZone(null, initZone, true)
|
|
66
|
+
}, 500)
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}, [])
|
|
70
|
+
|
|
44
71
|
return (
|
|
45
72
|
<>
|
|
46
73
|
<ZoneContainer>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
3
4
|
import { BusinessInfoSettingList } from '../BusinessInfoSettingList'
|
|
4
5
|
import { BusinessOwners } from '../BusinessOwners'
|
|
5
6
|
import { BusinessTypes } from '../BusinessTypes'
|
|
@@ -31,13 +32,31 @@ export const BusinessDetail = (props) => {
|
|
|
31
32
|
handleUpdateBusinessState
|
|
32
33
|
} = props
|
|
33
34
|
|
|
35
|
+
const history = useHistory()
|
|
36
|
+
const query = new URLSearchParams(useLocation().search)
|
|
34
37
|
const [, t] = useLanguage()
|
|
35
38
|
const [selectedInfoItem, setSelctedInfoItem] = useState('information')
|
|
36
39
|
|
|
40
|
+
const handleSelectInfoItem = (tab) => {
|
|
41
|
+
setSelctedInfoItem(tab)
|
|
42
|
+
const businessId = query.get('id')
|
|
43
|
+
const section = query.get('section')
|
|
44
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
useEffect(() => {
|
|
38
48
|
setIsExtendExtraOpen(false)
|
|
39
49
|
}, [selectedInfoItem])
|
|
40
50
|
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
const tab = query.get('tab')
|
|
53
|
+
if (tab) {
|
|
54
|
+
setSelctedInfoItem(tab)
|
|
55
|
+
} else {
|
|
56
|
+
handleSelectInfoItem('information')
|
|
57
|
+
}
|
|
58
|
+
}, [])
|
|
59
|
+
|
|
41
60
|
return (
|
|
42
61
|
<>
|
|
43
62
|
<Container>
|
|
@@ -45,7 +64,7 @@ export const BusinessDetail = (props) => {
|
|
|
45
64
|
<h1>{t('STORE_DETAILS', 'Store details')}</h1>
|
|
46
65
|
<BusinessInfoSettingList
|
|
47
66
|
selectedInfoItem={selectedInfoItem}
|
|
48
|
-
handleSelectInfoItem={
|
|
67
|
+
handleSelectInfoItem={handleSelectInfoItem}
|
|
49
68
|
/>
|
|
50
69
|
{selectedInfoItem === 'information' && (
|
|
51
70
|
<BusinessInformation
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useSession, useLanguage, BusinessDetails as BusinessDetailsController } from 'ordering-components-admin-external'
|
|
3
4
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
4
5
|
import { BusinessSummary } from '../BusinessSummary'
|
|
@@ -48,6 +49,8 @@ export const BusinessDetailsUI = (props) => {
|
|
|
48
49
|
handleUpdatePreorderConfigs
|
|
49
50
|
} = props
|
|
50
51
|
|
|
52
|
+
const history = useHistory()
|
|
53
|
+
const query = new URLSearchParams(useLocation().search)
|
|
51
54
|
const [, t] = useLanguage()
|
|
52
55
|
const { width } = useWindowSize()
|
|
53
56
|
const [{ user }] = useSession()
|
|
@@ -81,16 +84,22 @@ export const BusinessDetailsUI = (props) => {
|
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
|
|
84
|
-
const handleSelectedItem = (item) => {
|
|
87
|
+
const handleSelectedItem = (item, isInitialRender) => {
|
|
85
88
|
setIsExtendExtraOpen(false)
|
|
86
89
|
setSelectedItem(item)
|
|
87
90
|
setExtraOpen(true)
|
|
91
|
+
if (!isInitialRender) {
|
|
92
|
+
const businessId = query.get('id')
|
|
93
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${item}`)
|
|
94
|
+
}
|
|
88
95
|
}
|
|
89
96
|
|
|
90
97
|
const handleCloseExtraOpen = () => {
|
|
91
98
|
setIsExtendExtraOpen(false)
|
|
92
99
|
setExtraOpen(false)
|
|
93
100
|
setSelectedItem(null)
|
|
101
|
+
const businessId = query.get('id')
|
|
102
|
+
history.replace(`${location.pathname}?id=${businessId}`)
|
|
94
103
|
}
|
|
95
104
|
|
|
96
105
|
useEffect(() => {
|
|
@@ -139,6 +148,14 @@ export const BusinessDetailsUI = (props) => {
|
|
|
139
148
|
})
|
|
140
149
|
}, [actionStatus?.error])
|
|
141
150
|
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
if (businessState?.loading) return
|
|
153
|
+
const detailKey = query.get('section')
|
|
154
|
+
if (detailKey) {
|
|
155
|
+
handleSelectedItem(detailKey, true)
|
|
156
|
+
}
|
|
157
|
+
}, [businessState?.loading])
|
|
158
|
+
|
|
142
159
|
return (
|
|
143
160
|
<BarContainer id='business_details_bar'>
|
|
144
161
|
{(!isExtendExtraOpen || width < 1000) && (
|
|
@@ -36,7 +36,8 @@ import {
|
|
|
36
36
|
GroceriesProductListWrapper,
|
|
37
37
|
GroceriesCategoryListWrapper,
|
|
38
38
|
GroceriesProductListContent,
|
|
39
|
-
ActionButtonWrapper
|
|
39
|
+
ActionButtonWrapper,
|
|
40
|
+
SendCustomLayoutWrapper
|
|
40
41
|
} from './styles'
|
|
41
42
|
|
|
42
43
|
export const BusinessFrontLayout = (props) => {
|
|
@@ -199,6 +200,17 @@ export const BusinessFrontLayout = (props) => {
|
|
|
199
200
|
</LayoutBoxWrapper>
|
|
200
201
|
)}
|
|
201
202
|
</LayoutContentWrappper>
|
|
203
|
+
<SendCustomLayoutWrapper>
|
|
204
|
+
<p>{t('SEND_CUSTOM_LAYOUT_IDEA_DESCRIPTION', 'Would you like another kind of layout for your business menu? Send us your idea! We will take at it and help you make your idea a reality.')}</p>
|
|
205
|
+
<Button
|
|
206
|
+
outline
|
|
207
|
+
borderRadius='8px'
|
|
208
|
+
color='primary'
|
|
209
|
+
onClick={() => window.open('https://www.ordering.co/quote-project-request', '_blank')}
|
|
210
|
+
>
|
|
211
|
+
{t('SEND_CUSTOM_LAYOUT_IDEA', 'Send custom layout idea')}
|
|
212
|
+
</Button>
|
|
213
|
+
</SendCustomLayoutWrapper>
|
|
202
214
|
</BusinessFrontLayoutContainer>
|
|
203
215
|
<ActionButtonWrapper>
|
|
204
216
|
<Button color='primary' onClick={handleSaveLayout}>{t('SAVE', 'Save')}</Button>
|
|
@@ -414,3 +414,14 @@ export const ActionButtonWrapper = styled.div`
|
|
|
414
414
|
margin: 20px;
|
|
415
415
|
}
|
|
416
416
|
`
|
|
417
|
+
|
|
418
|
+
export const SendCustomLayoutWrapper = styled.div`
|
|
419
|
+
margin: 20px 10px;
|
|
420
|
+
p {
|
|
421
|
+
font-size: 14px;
|
|
422
|
+
}
|
|
423
|
+
button {
|
|
424
|
+
height: 44px;
|
|
425
|
+
width: 100%;
|
|
426
|
+
}
|
|
427
|
+
`
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, BusinessMenu as BusinessMenuController } from 'ordering-components-admin-external'
|
|
3
4
|
import { BusinessMenuOptions } from '../BusinessMenuOptions'
|
|
4
5
|
import { Confirm, Modal, SearchBar } from '../../Shared'
|
|
@@ -31,6 +32,9 @@ const BusinessMenuUI = (props) => {
|
|
|
31
32
|
setIsSelectedSharedMenus,
|
|
32
33
|
sitesState
|
|
33
34
|
} = props
|
|
35
|
+
|
|
36
|
+
const history = useHistory()
|
|
37
|
+
const query = new URLSearchParams(useLocation().search)
|
|
34
38
|
const [, t] = useLanguage()
|
|
35
39
|
const { width } = useWindowSize()
|
|
36
40
|
|
|
@@ -40,6 +44,7 @@ const BusinessMenuUI = (props) => {
|
|
|
40
44
|
const [isOpenSharedProduct, setIsOpenSharedProduct] = useState(false)
|
|
41
45
|
const [searchValue, setSearchValue] = useState('')
|
|
42
46
|
const [menuList, setMenuList] = useState([])
|
|
47
|
+
const [initMenuId, setInitMenuId] = useState(null)
|
|
43
48
|
|
|
44
49
|
const handleOpenOptions = (name, menu) => {
|
|
45
50
|
setCurrentMenu(menu)
|
|
@@ -47,17 +52,30 @@ const BusinessMenuUI = (props) => {
|
|
|
47
52
|
setShowOption(name)
|
|
48
53
|
}
|
|
49
54
|
|
|
50
|
-
const handleCloseOption = () => {
|
|
55
|
+
const handleCloseOption = (isTab) => {
|
|
51
56
|
setShowOption(null)
|
|
52
57
|
setIsExtendExtraOpen(false)
|
|
53
58
|
setIsOpenSharedProduct(false)
|
|
54
59
|
setCurrentMenu(null)
|
|
60
|
+
if (!isTab) {
|
|
61
|
+
setInitMenuId(null)
|
|
62
|
+
const businessId = query.get('id')
|
|
63
|
+
const section = query.get('section')
|
|
64
|
+
const tab = isSelectedSharedMenus ? 'shared_menus' : 'menu'
|
|
65
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
66
|
+
}
|
|
55
67
|
}
|
|
56
68
|
|
|
57
|
-
const handleOpenEdit = (e, menu) => {
|
|
58
|
-
const isInvalid = e
|
|
69
|
+
const handleOpenEdit = (e, menu, isInitialRender) => {
|
|
70
|
+
const isInvalid = e?.target?.closest('.business_checkbox_control')
|
|
59
71
|
if (isInvalid) return
|
|
60
72
|
handleOpenOptions('option', menu)
|
|
73
|
+
if (!isInitialRender) {
|
|
74
|
+
const businessId = query.get('id')
|
|
75
|
+
const section = query.get('section')
|
|
76
|
+
const tab = isSelectedSharedMenus ? 'shared_menus' : 'menu'
|
|
77
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}&menu=${menu.id}`)
|
|
78
|
+
}
|
|
61
79
|
}
|
|
62
80
|
|
|
63
81
|
useEffect(() => {
|
|
@@ -66,6 +84,39 @@ const BusinessMenuUI = (props) => {
|
|
|
66
84
|
setMenuList(filteredMenus)
|
|
67
85
|
}, [JSON.stringify(businessMenusState.menus), JSON.stringify(businessMenusState.menusShared), searchValue, isSelectedSharedMenus])
|
|
68
86
|
|
|
87
|
+
const handleTabClick = (isShared, isInitialRender) => {
|
|
88
|
+
handleCloseOption(true)
|
|
89
|
+
setIsSelectedSharedMenus(isShared)
|
|
90
|
+
if (!isInitialRender) {
|
|
91
|
+
const businessId = query.get('id')
|
|
92
|
+
const section = query.get('section')
|
|
93
|
+
const tab = isShared ? 'shared_menus' : 'menu'
|
|
94
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
useEffect(() => {
|
|
99
|
+
if (businessMenusState.loading || !initMenuId) return
|
|
100
|
+
const tab = query.get('tab')
|
|
101
|
+
const updatedMenus = [...(tab === 'shared_menus' ? businessMenusState?.menusShared : businessMenusState?.menus)]
|
|
102
|
+
const selectedMenu = updatedMenus.find(menu => menu.id === Number(initMenuId))
|
|
103
|
+
handleOpenEdit(null, selectedMenu, true)
|
|
104
|
+
}, [initMenuId, businessMenusState.loading])
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const tab = query.get('tab')
|
|
108
|
+
const menuId = query.get('menu')
|
|
109
|
+
setInitMenuId(menuId)
|
|
110
|
+
if (tab === 'shared_menus') {
|
|
111
|
+
handleTabClick(true, true)
|
|
112
|
+
} else {
|
|
113
|
+
handleTabClick(false, true)
|
|
114
|
+
}
|
|
115
|
+
return () => {
|
|
116
|
+
setInitMenuId(null)
|
|
117
|
+
}
|
|
118
|
+
}, [])
|
|
119
|
+
|
|
69
120
|
return (
|
|
70
121
|
<MainContainer>
|
|
71
122
|
<MenuContainer isHide={isOpenSharedProduct}>
|
|
@@ -83,19 +134,13 @@ const BusinessMenuUI = (props) => {
|
|
|
83
134
|
<TabsContainer>
|
|
84
135
|
<Tab
|
|
85
136
|
active={!isSelectedSharedMenus}
|
|
86
|
-
onClick={() =>
|
|
87
|
-
handleCloseOption()
|
|
88
|
-
setIsSelectedSharedMenus(false)
|
|
89
|
-
}}
|
|
137
|
+
onClick={() => handleTabClick(false)}
|
|
90
138
|
>
|
|
91
139
|
{t('MENU_V21', 'Menu')}
|
|
92
140
|
</Tab>
|
|
93
141
|
<Tab
|
|
94
142
|
active={isSelectedSharedMenus}
|
|
95
|
-
onClick={() =>
|
|
96
|
-
handleCloseOption()
|
|
97
|
-
setIsSelectedSharedMenus(true)
|
|
98
|
-
}}
|
|
143
|
+
onClick={() => handleTabClick(true)}
|
|
99
144
|
>
|
|
100
145
|
{t('SHARED_MENUS', 'Shared menus')}
|
|
101
146
|
</Tab>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import {
|
|
3
4
|
useLanguage,
|
|
4
5
|
BusinessMenuOptions as BusinessMenuOptionsController
|
|
@@ -38,6 +39,8 @@ const BusinessMenuOptionsUI = (props) => {
|
|
|
38
39
|
sitesState
|
|
39
40
|
} = props
|
|
40
41
|
|
|
42
|
+
const history = useHistory()
|
|
43
|
+
const query = new URLSearchParams(useLocation().search)
|
|
41
44
|
const theme = useTheme()
|
|
42
45
|
const [, t] = useLanguage()
|
|
43
46
|
const { width } = useWindowSize()
|
|
@@ -88,6 +91,28 @@ const BusinessMenuOptionsUI = (props) => {
|
|
|
88
91
|
}
|
|
89
92
|
}, [menu])
|
|
90
93
|
|
|
94
|
+
const handleTabClick = (settingTab) => {
|
|
95
|
+
setSelectedMenuOption(settingTab)
|
|
96
|
+
const businessId = query.get('id')
|
|
97
|
+
const section = query.get('section')
|
|
98
|
+
const tab = isSelectedSharedMenus ? 'shared_menus' : 'menu'
|
|
99
|
+
const menu = query.get('menu')
|
|
100
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}&menu=${menu}&setting_tab=${settingTab}`)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
if (isSelectedSharedMenus) {
|
|
105
|
+
|
|
106
|
+
} else {
|
|
107
|
+
const settingTab = query.get('setting_tab')
|
|
108
|
+
if (settingTab) {
|
|
109
|
+
handleTabClick(settingTab)
|
|
110
|
+
} else {
|
|
111
|
+
handleTabClick('basic')
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, [isSelectedSharedMenus])
|
|
115
|
+
|
|
91
116
|
return (
|
|
92
117
|
<>
|
|
93
118
|
<Container id='menu_options'>
|
|
@@ -131,14 +156,14 @@ const BusinessMenuOptionsUI = (props) => {
|
|
|
131
156
|
<AutoScroll innerScroll scrollId='menu_options'>
|
|
132
157
|
<Tab
|
|
133
158
|
active={selectedMenuOption === 'basic'}
|
|
134
|
-
onClick={() =>
|
|
159
|
+
onClick={() => handleTabClick('basic')}
|
|
135
160
|
>
|
|
136
161
|
{t('BASIC', 'Basic')}
|
|
137
162
|
</Tab>
|
|
138
163
|
{sitesState?.sites?.length > 0 && (
|
|
139
164
|
<Tab
|
|
140
165
|
active={selectedMenuOption === 'channels'}
|
|
141
|
-
onClick={() =>
|
|
166
|
+
onClick={() => handleTabClick('channels')}
|
|
142
167
|
>
|
|
143
168
|
{t('CHANNELS', 'Channels')}
|
|
144
169
|
</Tab>
|
|
@@ -146,7 +171,7 @@ const BusinessMenuOptionsUI = (props) => {
|
|
|
146
171
|
{Object.keys(menu).length > 0 && (
|
|
147
172
|
<Tab
|
|
148
173
|
active={selectedMenuOption === 'share_with'}
|
|
149
|
-
onClick={() =>
|
|
174
|
+
onClick={() => handleTabClick('share_with')}
|
|
150
175
|
>
|
|
151
176
|
{t('SHARE_WITH', 'Share with')}
|
|
152
177
|
</Tab>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
4
|
import { Button, Input } from '../../../styles'
|
|
4
5
|
import { Alert } from '../../Shared'
|
|
@@ -22,6 +23,8 @@ export const BusinessOrderingChannels = (props) => {
|
|
|
22
23
|
setFormState
|
|
23
24
|
} = props
|
|
24
25
|
|
|
26
|
+
const history = useHistory()
|
|
27
|
+
const query = new URLSearchParams(useLocation().search)
|
|
25
28
|
const [, t] = useLanguage()
|
|
26
29
|
const [slug, setSlug] = useState('')
|
|
27
30
|
const [selectedOption, setSelectedOption] = useState('custom_slug')
|
|
@@ -55,8 +58,13 @@ export const BusinessOrderingChannels = (props) => {
|
|
|
55
58
|
})
|
|
56
59
|
}
|
|
57
60
|
|
|
58
|
-
const handleChangeOption = (
|
|
59
|
-
setSelectedOption(
|
|
61
|
+
const handleChangeOption = (tab, isInitialRender) => {
|
|
62
|
+
setSelectedOption(tab)
|
|
63
|
+
if (!isInitialRender) {
|
|
64
|
+
const businessId = query.get('id')
|
|
65
|
+
const section = query.get('section')
|
|
66
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&tab=${tab}`)
|
|
67
|
+
}
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
useEffect(() => {
|
|
@@ -68,6 +76,15 @@ export const BusinessOrderingChannels = (props) => {
|
|
|
68
76
|
if (business) setSlug(business?.slug)
|
|
69
77
|
}, [business])
|
|
70
78
|
|
|
79
|
+
useEffect(() => {
|
|
80
|
+
const tab = query.get('tab')
|
|
81
|
+
if (tab) {
|
|
82
|
+
handleChangeOption(tab, true)
|
|
83
|
+
} else {
|
|
84
|
+
handleChangeOption('custom_slug')
|
|
85
|
+
}
|
|
86
|
+
}, [])
|
|
87
|
+
|
|
71
88
|
return (
|
|
72
89
|
<>
|
|
73
90
|
<BusinessOrderingChannelsContainer>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import Skeleton from 'react-loading-skeleton'
|
|
3
4
|
import {
|
|
4
5
|
useLanguage,
|
|
@@ -64,6 +65,8 @@ const BusinessPaymentMethodsUI = (props) => {
|
|
|
64
65
|
handleTutorialContinue
|
|
65
66
|
} = props
|
|
66
67
|
|
|
68
|
+
const history = useHistory()
|
|
69
|
+
const query = new URLSearchParams(useLocation().search)
|
|
67
70
|
const [, t] = useLanguage()
|
|
68
71
|
const [{ configs }] = useConfig()
|
|
69
72
|
const { width } = useWindowSize()
|
|
@@ -106,8 +109,8 @@ const BusinessPaymentMethodsUI = (props) => {
|
|
|
106
109
|
return found
|
|
107
110
|
}
|
|
108
111
|
|
|
109
|
-
const handleOpenEdit = (e, paymethodId, paymethodGateway) => {
|
|
110
|
-
const inValid = e
|
|
112
|
+
const handleOpenEdit = (e, paymethodId, paymethodGateway, isInitialRender) => {
|
|
113
|
+
const inValid = e?.target?.closest('.paymethod-checkbox')
|
|
111
114
|
if (inValid) return true
|
|
112
115
|
if (!isTutorialMode && isCheckFoundBusinessPaymethod(paymethodId)) {
|
|
113
116
|
setSelectedPaymethodGateway(paymethodGateway)
|
|
@@ -116,6 +119,11 @@ const BusinessPaymentMethodsUI = (props) => {
|
|
|
116
119
|
setIsEdit(true)
|
|
117
120
|
setIsExtendExtraOpen(true)
|
|
118
121
|
}
|
|
122
|
+
if (!isInitialRender) {
|
|
123
|
+
const businessId = query.get('id')
|
|
124
|
+
const section = query.get('section')
|
|
125
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}&paymethod=${paymethodId}`)
|
|
126
|
+
}
|
|
119
127
|
}
|
|
120
128
|
|
|
121
129
|
const handleClickCheckBox = (id) => {
|
|
@@ -140,6 +148,9 @@ const BusinessPaymentMethodsUI = (props) => {
|
|
|
140
148
|
setIsEdit(false)
|
|
141
149
|
setSelectedBusinessPaymethod(null)
|
|
142
150
|
setIsSuccessDeleted(false)
|
|
151
|
+
const businessId = query.get('id')
|
|
152
|
+
const section = query.get('section')
|
|
153
|
+
history.replace(`${location.pathname}?id=${businessId}§ion=${section}`)
|
|
143
154
|
}
|
|
144
155
|
|
|
145
156
|
useEffect(() => {
|
|
@@ -153,6 +164,17 @@ const BusinessPaymentMethodsUI = (props) => {
|
|
|
153
164
|
setSelectedBusinessPaymethod(updatedPaymethod)
|
|
154
165
|
}, [businessPaymethodsState?.paymethods, selectedBusinessPaymethod])
|
|
155
166
|
|
|
167
|
+
useEffect(() => {
|
|
168
|
+
if (paymethodsList.loading || businessPaymethodsState.loading) return
|
|
169
|
+
const paymethodId = query.get('paymethod')
|
|
170
|
+
if (paymethodId) {
|
|
171
|
+
const initPaymethod = paymethodsList.paymethods.find(paymethod => paymethod.id === Number(paymethodId))
|
|
172
|
+
if (initPaymethod) {
|
|
173
|
+
handleOpenEdit(null, initPaymethod.id, initPaymethod.gateway, true)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}, [paymethodsList.loading, businessPaymethodsState.loading])
|
|
177
|
+
|
|
156
178
|
return (
|
|
157
179
|
<MainContainer>
|
|
158
180
|
<PaymentMethodsContainer isOpenWalletDetails={isOpenWalletDetails}>
|