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
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { RecoveryActionListing as RecoveryActionListingController } from 'ordering-components-admin-external'
|
|
3
4
|
import { RecoveryActionHeader } from '../RecoveryActionHeader'
|
|
4
5
|
import { RecoveryActionList } from '../RecoveryActionList'
|
|
@@ -10,19 +11,36 @@ import {
|
|
|
10
11
|
} from './styles'
|
|
11
12
|
|
|
12
13
|
const RecoveryActionListingUI = (props) => {
|
|
14
|
+
const history = useHistory()
|
|
15
|
+
const query = new URLSearchParams(useLocation().search)
|
|
13
16
|
const [isOpenDetail, setIsOpenDetail] = useState(false)
|
|
14
17
|
const [selectedAction, setSelectedAction] = useState(null)
|
|
18
|
+
const [selectedActionId, setSelectedActionId] = useState(null)
|
|
15
19
|
|
|
16
20
|
const handleCloseDetail = () => {
|
|
17
21
|
setIsOpenDetail(false)
|
|
18
22
|
setSelectedAction(null)
|
|
23
|
+
history.replace(`${location.pathname}`)
|
|
19
24
|
}
|
|
20
25
|
|
|
21
|
-
const handleOpenDetail = (action) => {
|
|
26
|
+
const handleOpenDetail = (action, isInitialRender) => {
|
|
22
27
|
setSelectedAction(action)
|
|
28
|
+
setSelectedActionId(action?.id)
|
|
23
29
|
setIsOpenDetail(true)
|
|
30
|
+
if (action && !isInitialRender) {
|
|
31
|
+
history.replace(`${location.pathname}?id=${action.id}`)
|
|
32
|
+
}
|
|
24
33
|
}
|
|
25
34
|
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
const id = query.get('id')
|
|
37
|
+
if (id) {
|
|
38
|
+
setSelectedAction({})
|
|
39
|
+
setSelectedActionId(Number(id))
|
|
40
|
+
setIsOpenDetail(true)
|
|
41
|
+
}
|
|
42
|
+
}, [])
|
|
43
|
+
|
|
26
44
|
return (
|
|
27
45
|
<>
|
|
28
46
|
<RecoveryActionsContainer>
|
|
@@ -38,7 +56,6 @@ const RecoveryActionListingUI = (props) => {
|
|
|
38
56
|
</RecoveryActionsContainer>
|
|
39
57
|
{isOpenDetail && (
|
|
40
58
|
<SideBar
|
|
41
|
-
sidebarId='loyaltyWallet'
|
|
42
59
|
open={isOpenDetail}
|
|
43
60
|
onClose={() => handleCloseDetail()}
|
|
44
61
|
defaultSideBarWidth={550}
|
|
@@ -46,6 +63,7 @@ const RecoveryActionListingUI = (props) => {
|
|
|
46
63
|
<RecoveryActionDetail
|
|
47
64
|
{...props}
|
|
48
65
|
action={selectedAction}
|
|
66
|
+
actionId={selectedActionId}
|
|
49
67
|
onClose={() => handleCloseDetail()}
|
|
50
68
|
/>
|
|
51
69
|
</SideBar>
|
|
@@ -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 { UsersList as UsersListController } from 'ordering-components-admin-external'
|
|
4
4
|
import { getStorageItem, removeStorageItem, setStorageItem } from '../../../utils'
|
|
5
5
|
|
|
@@ -50,6 +50,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
50
50
|
handleSuccessDeleteUser
|
|
51
51
|
} = props
|
|
52
52
|
|
|
53
|
+
const history = useHistory()
|
|
53
54
|
const query = new URLSearchParams(useLocation().search)
|
|
54
55
|
const [queryId, setQueryId] = useState(null)
|
|
55
56
|
const [isOpenUserDetails, setIsOpenUserDetails] = useState(false)
|
|
@@ -71,6 +72,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
71
72
|
setOpenUser(user)
|
|
72
73
|
setOpenUserAddForm(false)
|
|
73
74
|
setIsOpenUserDetails(true)
|
|
75
|
+
history.replace(`${location.pathname}?id=${user.id}`)
|
|
74
76
|
}
|
|
75
77
|
|
|
76
78
|
const handleOpenUserAddForm = () => {
|
|
@@ -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
|
DriversCompaniesList as DriversCompaniesListController
|
|
@@ -32,16 +33,23 @@ const DriversCompaniesListingUI = (props) => {
|
|
|
32
33
|
handleDeleteSelectedCompanies
|
|
33
34
|
} = props
|
|
34
35
|
|
|
36
|
+
const history = useHistory()
|
|
37
|
+
const query = new URLSearchParams(useLocation().search)
|
|
35
38
|
const [, t] = useLanguage()
|
|
36
39
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
37
40
|
const [searchValue, setSearchValue] = useState(null)
|
|
38
41
|
const [curDriversCompany, setCurDriversCompany] = useState(null)
|
|
42
|
+
const [curDriversCompanyId, setCurDriversCompanyId] = useState(null)
|
|
39
43
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
40
44
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
41
45
|
|
|
42
|
-
const handleOpenDetails = (driverCompany) => {
|
|
46
|
+
const handleOpenDetails = (driverCompany, isInitialRender) => {
|
|
43
47
|
setCurDriversCompany(driverCompany)
|
|
48
|
+
setCurDriversCompanyId(driverCompany?.id)
|
|
44
49
|
setOpenDetails(true)
|
|
50
|
+
if (!isInitialRender) {
|
|
51
|
+
history.replace(`${location.pathname}?id=${driverCompany?.id}`)
|
|
52
|
+
}
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
useEffect(() => {
|
|
@@ -63,6 +71,21 @@ const DriversCompaniesListingUI = (props) => {
|
|
|
63
71
|
})
|
|
64
72
|
}
|
|
65
73
|
|
|
74
|
+
const handleCloseDetails = () => {
|
|
75
|
+
setCurDriversCompany(null)
|
|
76
|
+
setCurDriversCompanyId(null)
|
|
77
|
+
setOpenDetails(false)
|
|
78
|
+
history.replace(`${location.pathname}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const id = query.get('id')
|
|
83
|
+
if (id) {
|
|
84
|
+
setCurDriversCompanyId(Number(id))
|
|
85
|
+
setOpenDetails(true)
|
|
86
|
+
}
|
|
87
|
+
}, [])
|
|
88
|
+
|
|
66
89
|
return (
|
|
67
90
|
<DriversCompaniesListContainer>
|
|
68
91
|
<HeaderContainer>
|
|
@@ -117,19 +140,14 @@ const DriversCompaniesListingUI = (props) => {
|
|
|
117
140
|
sidebarId='city-details'
|
|
118
141
|
defaultSideBarWidth={550}
|
|
119
142
|
open={openDetails}
|
|
120
|
-
onClose={() =>
|
|
121
|
-
setCurDriversCompany(null)
|
|
122
|
-
setOpenDetails(false)
|
|
123
|
-
}}
|
|
143
|
+
onClose={() => handleCloseDetails()}
|
|
124
144
|
>
|
|
125
145
|
<DriversCompanyDetailsForm
|
|
126
146
|
driversCompaniesState={driversCompaniesState}
|
|
127
147
|
setDriversCompaniesState={setDriversCompaniesState}
|
|
128
148
|
driversCompany={curDriversCompany}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
setOpenDetails(false)
|
|
132
|
-
}}
|
|
149
|
+
driversCompanyId={curDriversCompanyId}
|
|
150
|
+
onClose={() => handleCloseDetails()}
|
|
133
151
|
/>
|
|
134
152
|
</SideBar>
|
|
135
153
|
)}
|
|
@@ -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
|
DriversCompanyDetails as DriversCompanyDetailsController
|
|
@@ -25,13 +26,15 @@ import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
|
25
26
|
|
|
26
27
|
const DriversCompanyDetailsFormUI = (props) => {
|
|
27
28
|
const {
|
|
28
|
-
|
|
29
|
+
companyState,
|
|
29
30
|
changesState,
|
|
30
31
|
actionState,
|
|
31
32
|
cleanActionState,
|
|
32
33
|
handleDeleteDriversCompany
|
|
33
34
|
} = props
|
|
34
35
|
|
|
36
|
+
const history = useHistory()
|
|
37
|
+
const query = new URLSearchParams(useLocation().search)
|
|
35
38
|
const [, t] = useLanguage()
|
|
36
39
|
const theme = useTheme()
|
|
37
40
|
const { width } = useWindowSize()
|
|
@@ -82,14 +85,31 @@ const DriversCompanyDetailsFormUI = (props) => {
|
|
|
82
85
|
}
|
|
83
86
|
}, [actionState])
|
|
84
87
|
|
|
88
|
+
const handleTabClick = (tab, isInitialRender) => {
|
|
89
|
+
setCurrentTabItem(tab)
|
|
90
|
+
if (!isInitialRender) {
|
|
91
|
+
const id = query.get('id')
|
|
92
|
+
history.replace(`${location.pathname}?id=${id}&tab=${tab}`)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const tab = query.get('tab')
|
|
98
|
+
if (tab) {
|
|
99
|
+
handleTabClick(tab, true)
|
|
100
|
+
} else {
|
|
101
|
+
handleTabClick(currentTabItem)
|
|
102
|
+
}
|
|
103
|
+
}, [])
|
|
104
|
+
|
|
85
105
|
return (
|
|
86
106
|
<>
|
|
87
107
|
<DetailsContainer>
|
|
88
108
|
<Header>
|
|
89
109
|
<h1>
|
|
90
110
|
{
|
|
91
|
-
|
|
92
|
-
? changesState?.name ??
|
|
111
|
+
companyState.company
|
|
112
|
+
? changesState?.name ?? companyState.company?.name ?? ''
|
|
93
113
|
: t('DRIVER_COMPANY_SETTINGS', 'Driver company settings')
|
|
94
114
|
}
|
|
95
115
|
</h1>
|
|
@@ -102,7 +122,7 @@ const DriversCompanyDetailsFormUI = (props) => {
|
|
|
102
122
|
{isExpand ? <ArrowsAngleContract /> : <ArrowsAngleExpand />}
|
|
103
123
|
</IconButton>
|
|
104
124
|
)}
|
|
105
|
-
{
|
|
125
|
+
{companyState.company && (
|
|
106
126
|
<ActionSelectorWrapper>
|
|
107
127
|
<DropdownButton
|
|
108
128
|
menuAlign={theme?.rtl ? 'left' : 'right'}
|
|
@@ -125,7 +145,7 @@ const DriversCompanyDetailsFormUI = (props) => {
|
|
|
125
145
|
<Tab
|
|
126
146
|
key={item.key}
|
|
127
147
|
active={item.key === currentTabItem}
|
|
128
|
-
onClick={() =>
|
|
148
|
+
onClick={() => handleTabClick(item.key)}
|
|
129
149
|
>
|
|
130
150
|
{item.content}
|
|
131
151
|
</Tab>
|
|
@@ -134,13 +154,22 @@ const DriversCompanyDetailsFormUI = (props) => {
|
|
|
134
154
|
</TabsContainer>
|
|
135
155
|
|
|
136
156
|
{currentTabItem === 'general' && (
|
|
137
|
-
<DriversCompanyGeneralDetails
|
|
157
|
+
<DriversCompanyGeneralDetails
|
|
158
|
+
{...props}
|
|
159
|
+
driversCompany={companyState.company}
|
|
160
|
+
/>
|
|
138
161
|
)}
|
|
139
162
|
{currentTabItem === 'schedule' && (
|
|
140
|
-
<DriversCompanyScheduleDetails
|
|
163
|
+
<DriversCompanyScheduleDetails
|
|
164
|
+
{...props}
|
|
165
|
+
driversCompany={companyState.company}
|
|
166
|
+
/>
|
|
141
167
|
)}
|
|
142
168
|
{currentTabItem === 'webhooks' && (
|
|
143
|
-
<DriversCompanyWebhooksDetails
|
|
169
|
+
<DriversCompanyWebhooksDetails
|
|
170
|
+
{...props}
|
|
171
|
+
driversCompany={companyState.company}
|
|
172
|
+
/>
|
|
144
173
|
)}
|
|
145
174
|
|
|
146
175
|
</DetailsContainer>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import {
|
|
3
4
|
useLanguage,
|
|
4
5
|
useConfig,
|
|
@@ -37,6 +38,8 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
37
38
|
setIsExtendExtraOpen
|
|
38
39
|
} = props
|
|
39
40
|
|
|
41
|
+
const history = useHistory()
|
|
42
|
+
const query = new URLSearchParams(useLocation().search)
|
|
40
43
|
const theme = useTheme()
|
|
41
44
|
const [, t] = useLanguage()
|
|
42
45
|
const { width } = useWindowSize()
|
|
@@ -123,6 +126,24 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
123
126
|
})
|
|
124
127
|
}, [actionState?.error])
|
|
125
128
|
|
|
129
|
+
const handleTabClick = (tab, isInitialRender) => {
|
|
130
|
+
setShowMenu(tab)
|
|
131
|
+
if (!isInitialRender) {
|
|
132
|
+
const id = query.get('id')
|
|
133
|
+
history.replace(`${location.pathname}?id=${id}&tab=${tab}`)
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
if (driversGroupState.loading) return
|
|
139
|
+
const tab = query.get('tab')
|
|
140
|
+
if (tab) {
|
|
141
|
+
handleTabClick(tab, true)
|
|
142
|
+
} else {
|
|
143
|
+
handleTabClick(showMenu)
|
|
144
|
+
}
|
|
145
|
+
}, [driversGroupState.loading])
|
|
146
|
+
|
|
126
147
|
return (
|
|
127
148
|
<>
|
|
128
149
|
<DetailsContainer>
|
|
@@ -182,7 +203,7 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
182
203
|
<Tab
|
|
183
204
|
key={menu.key}
|
|
184
205
|
active={menu.key === showMenu}
|
|
185
|
-
onClick={() =>
|
|
206
|
+
onClick={() => handleTabClick(menu.key)}
|
|
186
207
|
>
|
|
187
208
|
{menu.value}
|
|
188
209
|
</Tab>
|
|
@@ -192,19 +213,29 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
192
213
|
{(showMenu === 'general') && (
|
|
193
214
|
<DriversGroupGeneralForm
|
|
194
215
|
{...props}
|
|
216
|
+
curDriversGroup={driversGroupState.driversGroup}
|
|
195
217
|
useAdvanced={useAdvanced}
|
|
196
218
|
setUseAdvanced={setUseAdvanced}
|
|
197
219
|
handleNextClick={handleNextClick}
|
|
198
220
|
/>
|
|
199
221
|
)}
|
|
200
222
|
{showMenu === 'businesses' && (
|
|
201
|
-
<DriversGroupBusinesses
|
|
223
|
+
<DriversGroupBusinesses
|
|
224
|
+
{...props}
|
|
225
|
+
curDriversGroup={driversGroupState.driversGroup}
|
|
226
|
+
/>
|
|
202
227
|
)}
|
|
203
228
|
{showMenu === 'paymethods' && (
|
|
204
|
-
<DriversGroupPaymethods
|
|
229
|
+
<DriversGroupPaymethods
|
|
230
|
+
{...props}
|
|
231
|
+
curDriversGroup={driversGroupState.driversGroup}
|
|
232
|
+
/>
|
|
205
233
|
)}
|
|
206
234
|
{showMenu === 'advanced_logistics' && (
|
|
207
|
-
<DriversGroupLogistics
|
|
235
|
+
<DriversGroupLogistics
|
|
236
|
+
{...props}
|
|
237
|
+
curDriversGroup={driversGroupState.driversGroup}
|
|
238
|
+
/>
|
|
208
239
|
)}
|
|
209
240
|
{showMenu === 'logs' && (
|
|
210
241
|
<DriversGroupLogs driversGroupId={driversGroupState.driversGroup?.id} />
|
|
@@ -212,6 +243,7 @@ const DriversGroupDetailsUI = (props) => {
|
|
|
212
243
|
{showMenu === 'delivery_zones' && (
|
|
213
244
|
<DriverGroupDeliveryDetails
|
|
214
245
|
{...props}
|
|
246
|
+
curDriversGroup={driversGroupState.driversGroup}
|
|
215
247
|
handleParentSidebarMove={handleParentSidebarMove}
|
|
216
248
|
drivergroup={driversGroupState.driversGroup}
|
|
217
249
|
setIsExtendExtraOpen={setIsExtendExtraOpen}
|
|
@@ -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 { Circle, RecordCircleFill, ChevronRight } from 'react-bootstrap-icons'
|
|
4
5
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
@@ -25,18 +26,26 @@ export const DriversGroupLogistics = (props) => {
|
|
|
25
26
|
handleUpdateDriversGroup
|
|
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
|
|
|
31
34
|
const [showConfig, setShowConfig] = useState(null)
|
|
32
35
|
const [openConfig, setOpenConfig] = useState(false)
|
|
33
36
|
|
|
34
|
-
const handleOpenConfig = (option) => {
|
|
37
|
+
const handleOpenConfig = (option, isInitialRender) => {
|
|
35
38
|
setShowConfig(option)
|
|
36
39
|
setOpenConfig(true)
|
|
37
40
|
if (width >= 1200) {
|
|
38
41
|
handleParentSidebarMove(700)
|
|
39
42
|
}
|
|
43
|
+
|
|
44
|
+
if (!isInitialRender) {
|
|
45
|
+
const id = query.get('id')
|
|
46
|
+
const tab = query.get('tab')
|
|
47
|
+
history.replace(`${location.pathname}?id=${id}&tab=${tab}&config=${option}`)
|
|
48
|
+
}
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
const handleCloseSidebar = () => {
|
|
@@ -57,6 +66,13 @@ export const DriversGroupLogistics = (props) => {
|
|
|
57
66
|
setOpenConfig(false)
|
|
58
67
|
}, [driversGroupState.driversGroup?.id])
|
|
59
68
|
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
const config = query.get('config')
|
|
71
|
+
if (config) {
|
|
72
|
+
handleOpenConfig(config, true)
|
|
73
|
+
}
|
|
74
|
+
}, [])
|
|
75
|
+
|
|
60
76
|
return (
|
|
61
77
|
<LogisticsContainer>
|
|
62
78
|
<OrderStatusWrapper
|
|
@@ -109,7 +125,7 @@ export const DriversGroupLogistics = (props) => {
|
|
|
109
125
|
<LogisticsConfigItem
|
|
110
126
|
active={showConfig === 'GROUP_ORDERS'}
|
|
111
127
|
onClick={() => handleOpenConfig('GROUP_ORDERS')}
|
|
112
|
-
>
|
|
128
|
+
>a
|
|
113
129
|
<span>{t('GROUP_ORDERS', 'Group Orders')}</span>
|
|
114
130
|
<ChevronRight />
|
|
115
131
|
</LogisticsConfigItem>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import { useHistory } from 'react-router-dom'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
3
3
|
import { useLanguage, DriversGroupsList as DriversGroupsListController } from 'ordering-components-admin-external'
|
|
4
4
|
import { List as MenuIcon, LifePreserver } from 'react-bootstrap-icons'
|
|
5
5
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
|
@@ -37,6 +37,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
37
37
|
} = props
|
|
38
38
|
|
|
39
39
|
const history = useHistory()
|
|
40
|
+
const query = new URLSearchParams(useLocation().search)
|
|
40
41
|
const [, t] = useLanguage()
|
|
41
42
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
42
43
|
const [searchValue, setSearchValue] = useState(null)
|
|
@@ -45,6 +46,7 @@ const DriversGroupsListingUI = (props) => {
|
|
|
45
46
|
const [moveDistance, setMoveDistance] = useState(0)
|
|
46
47
|
const [openDetails, setOpenDetails] = useState(false)
|
|
47
48
|
const [curDriversGroup, setCurDriversGroup] = useState(null)
|
|
49
|
+
const [curDriversGroupId, setCurDriversGroupId] = useState(null)
|
|
48
50
|
const [isExtendExtraOpen, setIsExtendExtraOpen] = useState(false)
|
|
49
51
|
|
|
50
52
|
const [isTourOpen, setIsTourOpen] = useState(false)
|
|
@@ -59,6 +61,8 @@ const DriversGroupsListingUI = (props) => {
|
|
|
59
61
|
setTimeout(() => {
|
|
60
62
|
setCurrentTourStep(5)
|
|
61
63
|
}, 50)
|
|
64
|
+
} else {
|
|
65
|
+
history.replace(`${location.pathname}?id=${driverGroup.id}`)
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
|
|
@@ -112,8 +116,21 @@ const DriversGroupsListingUI = (props) => {
|
|
|
112
116
|
handleOpenTour()
|
|
113
117
|
}
|
|
114
118
|
}
|
|
119
|
+
|
|
120
|
+
const handleCloseDetail = () => {
|
|
121
|
+
setCurDriversGroup(null)
|
|
122
|
+
setOpenDetails(false)
|
|
123
|
+
setIsTourOpen(false)
|
|
124
|
+
history.replace(`${location.pathname}`)
|
|
125
|
+
}
|
|
126
|
+
|
|
115
127
|
useEffect(() => {
|
|
116
128
|
getDataFromStorage()
|
|
129
|
+
const id = query.get('id')
|
|
130
|
+
if (id) {
|
|
131
|
+
setCurDriversGroupId(Number(id))
|
|
132
|
+
setOpenDetails(true)
|
|
133
|
+
}
|
|
117
134
|
}, [])
|
|
118
135
|
|
|
119
136
|
return (
|
|
@@ -191,16 +208,13 @@ const DriversGroupsListingUI = (props) => {
|
|
|
191
208
|
open={openDetails}
|
|
192
209
|
moveDistance={moveDistance}
|
|
193
210
|
noAnimation={isTourOpen}
|
|
194
|
-
onClose={() =>
|
|
195
|
-
setCurDriversGroup(null)
|
|
196
|
-
setOpenDetails(false)
|
|
197
|
-
setIsTourOpen(false)
|
|
198
|
-
}}
|
|
211
|
+
onClose={() => handleCloseDetail()}
|
|
199
212
|
>
|
|
200
213
|
<DriversGroupDetails
|
|
201
214
|
driversGroupsState={driversGroupsState}
|
|
202
215
|
setDriversGroupsState={setDriversGroupsState}
|
|
203
216
|
curDriversGroup={curDriversGroup}
|
|
217
|
+
driversGroupId={curDriversGroupId}
|
|
204
218
|
driversManagers={driversManagersList?.managers}
|
|
205
219
|
businesses={businessesList?.businesses}
|
|
206
220
|
paymethods={paymethodsList?.paymethods}
|
|
@@ -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 { useTheme } from 'styled-components'
|
|
4
5
|
import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
@@ -38,6 +39,8 @@ export const UserDetailsUI = (props) => {
|
|
|
38
39
|
handleScheduleUpdateUser
|
|
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()
|
|
@@ -58,6 +61,28 @@ export const UserDetailsUI = (props) => {
|
|
|
58
61
|
setExtraOpen(false)
|
|
59
62
|
}, [currentMenuSelected])
|
|
60
63
|
|
|
64
|
+
const handleTabClick = (tab, isInitialRender) => {
|
|
65
|
+
setCurrentMenuSelected(tab)
|
|
66
|
+
if (!isInitialRender) {
|
|
67
|
+
const id = query.get('id')
|
|
68
|
+
const section = query.get('section')
|
|
69
|
+
if (section) {
|
|
70
|
+
history.replace(`${location.pathname}?id=${id}§ion=${section}&tab=${tab}`)
|
|
71
|
+
} else {
|
|
72
|
+
history.replace(`${location.pathname}?id=${id}&tab=${tab}`)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
useEffect(() => {
|
|
78
|
+
const tab = query.get('tab')
|
|
79
|
+
if (tab) {
|
|
80
|
+
handleTabClick(tab, true)
|
|
81
|
+
} else {
|
|
82
|
+
handleTabClick(currentMenuSelected)
|
|
83
|
+
}
|
|
84
|
+
}, [])
|
|
85
|
+
|
|
61
86
|
return (
|
|
62
87
|
<>
|
|
63
88
|
<DetailsHeader>
|
|
@@ -114,7 +139,7 @@ export const UserDetailsUI = (props) => {
|
|
|
114
139
|
<UserDetailsMenu
|
|
115
140
|
isDriverMenu={isDriversPage}
|
|
116
141
|
currentMenuSelected={currentMenuSelected}
|
|
117
|
-
handleChangeMenu={
|
|
142
|
+
handleChangeMenu={handleTabClick}
|
|
118
143
|
/>
|
|
119
144
|
{!userState?.loading && userState?.user && (
|
|
120
145
|
<>
|