ordering-ui-admin-external 1.33.1 → 1.35.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.462f5c3aad7a320965e9.js → ordering-ui-admin.78f6259366a43cc634db.js} +2 -2
- package/_modules/components/BusinessIntelligence/AnalyticsCalendar/index.js +1 -0
- package/_modules/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +40 -133
- package/_modules/components/BusinessIntelligence/BusinessReviewList/index.js +14 -6
- package/_modules/components/BusinessIntelligence/InvoiceBusinessManager/index.js +4 -3
- package/_modules/components/BusinessIntelligence/InvoiceDriverManager/index.js +4 -3
- package/_modules/components/BusinessIntelligence/InvoiceManager/index.js +5 -3
- package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +173 -0
- package/_modules/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +93 -0
- package/_modules/components/BusinessIntelligence/Reports/index.js +12 -4
- package/_modules/components/BusinessIntelligence/ReviewProductsListing/index.js +21 -10
- package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +52 -12
- package/_modules/components/BusinessIntelligence/UsersReviewList/index.js +14 -6
- package/_modules/components/CartRecovery/OpenCartList/index.js +12 -3
- package/_modules/components/CartRecovery/OpenCartListing/index.js +16 -4
- package/_modules/components/CartRecovery/OpenCartsDetail/index.js +52 -2
- package/_modules/components/CartRecovery/OpenCartsDetail/styles.js +20 -3
- package/_modules/components/CartRecovery/RecoveryActionDetail/index.js +4 -3
- package/_modules/components/CartRecovery/RecoveryActionList/index.js +10 -1
- package/_modules/components/CartRecovery/RecoveryActionListing/index.js +15 -5
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +19 -6
- package/_modules/components/Delivery/DriversCompaniesList/index.js +16 -3
- package/_modules/components/Delivery/DriversCompaniesListing/index.js +9 -5
- package/_modules/components/Delivery/DriversCompanyDetailsForm/index.js +4 -3
- package/_modules/components/Delivery/DriversGroupDetails/index.js +4 -3
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +4 -4
- package/_modules/components/Delivery/DriversGroupsList/index.js +16 -3
- package/_modules/components/Delivery/DriversGroupsListing/index.js +9 -5
- package/_modules/components/Delivery/UserDetails/index.js +4 -8
- package/_modules/components/Delivery/UserFormDetails/index.js +9 -1
- package/_modules/components/Delivery/UsersList/index.js +10 -1
- package/_modules/components/Marketing/AdBannersListing/index.js +6 -3
- package/_modules/components/Marketing/CampaignDetail/index.js +4 -3
- package/_modules/components/Marketing/CampaignList/index.js +10 -1
- package/_modules/components/Marketing/CampaignListing/index.js +14 -4
- package/_modules/components/Marketing/EnterprisePromotionList/index.js +10 -1
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +14 -4
- package/_modules/components/Marketing/PageBanner/index.js +5 -5
- package/_modules/components/Messages/MessagesListing/index.js +15 -5
- package/_modules/components/MyProducts/AdvancedSettings/index.js +12 -0
- package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +4 -2
- package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +23 -5
- package/_modules/components/Orders/AllInOne/DriversManager/styles.js +1 -1
- package/_modules/components/Orders/AllInOne/index.js +7 -3
- package/_modules/components/Orders/AllInOne/styles.js +2 -2
- package/_modules/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +2 -16
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/index.js +26 -3
- package/_modules/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +7 -2
- package/_modules/components/Orders/DeliveriesManager/index.js +4 -2
- package/_modules/components/Orders/DeliveryDashboard/index.js +4 -1
- package/_modules/components/Orders/DriverSelector/index.js +17 -5
- package/_modules/components/Orders/DriversDashboard/index.js +4 -2
- package/_modules/components/Orders/DriversLocation/index.js +70 -9
- package/_modules/components/Orders/DriversManager/index.js +5 -7
- package/_modules/components/Orders/DriversManager/styles.js +1 -1
- package/_modules/components/Orders/GiftCardsListing/index.js +46 -5
- package/_modules/components/Orders/Messages/index.js +4 -4
- package/_modules/components/Orders/OrderContactInformation/index.js +28 -20
- package/_modules/components/Orders/OrderDashboardSLASetting/index.js +1 -1
- package/_modules/components/Orders/OrderDetails/index.js +24 -13
- package/_modules/components/Orders/OrderStatusFilterBar/index.js +28 -5
- package/_modules/components/Orders/OrdersCards/index.js +10 -1
- package/_modules/components/Orders/OrdersDashboardControls/index.js +6 -2
- package/_modules/components/Orders/OrdersDashboardList/index.js +34 -4
- package/_modules/components/Orders/OrdersFilterGroup/styles.js +1 -1
- package/_modules/components/Orders/OrdersListing/index.js +6 -3
- package/_modules/components/Orders/OrdersManager/index.js +7 -2
- package/_modules/components/Orders/OrdersManager/styles.js +3 -3
- package/_modules/components/Orders/OrdersTable/index.js +9 -1
- package/_modules/components/Orders/OrdersTable/styles.js +1 -1
- package/_modules/components/Settings/Cms/index.js +14 -3
- package/_modules/components/Settings/LanguageManager/index.js +3 -1
- package/_modules/components/Settings/LanguageTransTable/index.js +14 -3
- package/_modules/components/Settings/SettingsList/index.js +1 -2
- package/_modules/components/Settings/WebhookDelaySelector/index.js +3 -0
- package/_modules/components/Settings/WebhookList/styles.js +1 -1
- package/_modules/components/Settings/WebhookListSelector/index.js +3 -0
- package/_modules/components/Shared/Pagination/index.js +1 -1
- package/_modules/components/Stores/BusinessActiveStateFilter/index.js +28 -5
- package/_modules/components/Stores/BusinessAdd/BusinessDetails/index.js +3 -2
- package/_modules/components/Stores/BusinessAdd/OrderTypePriceLevel/index.js +10 -5
- package/_modules/components/Stores/BusinessAdd/PaymentMethods/index.js +2 -1
- package/_modules/components/Stores/BusinessBrandListing/index.js +8 -5
- package/_modules/components/Stores/BusinessDeliveryPickupMore/index.js +4 -4
- package/_modules/components/Stores/BusinessDeliveryZoneDetails/index.js +4 -6
- package/_modules/components/Stores/BusinessDeliveryZoneList/index.js +5 -9
- package/_modules/components/Stores/BusinessDetail/index.js +4 -4
- package/_modules/components/Stores/BusinessDetails/index.js +5 -5
- package/_modules/components/Stores/BusinessDeviceListing/index.js +5 -4
- package/_modules/components/Stores/BusinessInformation/index.js +10 -6
- package/_modules/components/Stores/BusinessInformation/styles.js +1 -1
- package/_modules/components/Stores/BusinessMenu/index.js +8 -12
- package/_modules/components/Stores/BusinessMenuBasicOptions/index.js +8 -0
- package/_modules/components/Stores/BusinessMenuOptions/index.js +4 -6
- package/_modules/components/Stores/BusinessOrderingChannels/index.js +4 -4
- package/_modules/components/Stores/BusinessPaymentMethods/index.js +11 -7
- package/_modules/components/Stores/BusinessPlaceGroupList/index.js +5 -7
- package/_modules/components/Stores/BusinessPreorderDetails/index.js +13 -1
- package/_modules/components/Stores/BusinessProductList/index.js +1 -1
- package/_modules/components/Stores/BusinessProductsCategoyDetails/index.js +4 -3
- package/_modules/components/Stores/BusinessProductsListing/index.js +10 -6
- package/_modules/components/Stores/BusinessSharedMenuProducts/index.js +5 -11
- package/_modules/components/Stores/BusinessSync/index.js +4 -3
- package/_modules/components/Stores/BusinessTypes/index.js +5 -9
- package/_modules/components/Stores/BusinessWalletsList/index.js +5 -7
- package/_modules/components/Stores/BusinessWebhooks/index.js +12 -6
- package/_modules/components/Stores/BusinessesList/index.js +10 -1
- package/_modules/components/Stores/BusinessesListing/index.js +21 -6
- package/_modules/components/Stores/ImportersButton/index.js +5 -3
- package/_modules/components/Stores/PaymentOption/index.js +4 -5
- package/_modules/components/Stores/PaymentOptionMethods/index.js +4 -5
- package/_modules/components/Stores/PaymentOptionPaypal/index.js +4 -5
- package/_modules/components/Stores/PaymentOptionSquare/index.js +4 -5
- package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +4 -5
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +4 -5
- package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +4 -5
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +4 -5
- package/_modules/components/Stores/ProductDetails/index.js +5 -7
- package/_modules/components/Stores/ProductExtras/index.js +95 -23
- package/_modules/components/Stores/ProductExtras/styles.js +14 -8
- package/_modules/components/Stores/ProductIngredient/index.js +5 -9
- package/_modules/components/Stores/ProductMainDetails/index.js +4 -5
- package/_modules/components/Stores/ProductTagsList/index.js +5 -11
- package/_modules/components/Users/CustomerCashWallet/index.js +4 -5
- package/_modules/components/Users/CustomerDetails/index.js +21 -17
- package/_modules/components/Users/CustomerPointsWallet/index.js +4 -5
- package/_modules/components/Users/CustomersListing/index.js +17 -8
- package/_modules/components/Users/ProfessionalDetail/index.js +4 -9
- package/_modules/components/Users/ProfessionalList/index.js +10 -1
- package/_modules/components/Users/ProfessionalListing/index.js +17 -8
- package/_modules/components/Users/UserActiveStateFilter/index.js +7 -3
- package/_modules/components/Users/UserDetails/index.js +4 -9
- package/_modules/components/Users/UsersList/index.js +10 -1
- package/_modules/components/Users/UsersListing/index.js +17 -8
- package/_modules/index.js +12 -0
- package/_modules/utils/index.js +39 -2
- package/index-template.js +1 -1
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/AnalyticsCalendar/index.js +4 -0
- package/src/components/BusinessIntelligence/AnalyticsOrdersOrSales/index.js +33 -123
- package/src/components/BusinessIntelligence/BusinessReviewList/index.js +13 -7
- package/src/components/BusinessIntelligence/InvoiceBusinessManager/index.js +3 -4
- package/src/components/BusinessIntelligence/InvoiceDriverManager/index.js +3 -4
- package/src/components/BusinessIntelligence/InvoiceManager/index.js +4 -4
- package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/index.js +200 -0
- package/src/components/BusinessIntelligence/Reports/ReportsSlaOrders/styles.js +239 -0
- package/src/components/BusinessIntelligence/Reports/index.js +10 -6
- package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +23 -11
- package/src/components/BusinessIntelligence/ReviewsListing/index.js +54 -10
- package/src/components/BusinessIntelligence/UsersReviewList/index.js +14 -7
- package/src/components/CartRecovery/OpenCartList/index.js +15 -5
- package/src/components/CartRecovery/OpenCartListing/index.js +14 -3
- package/src/components/CartRecovery/OpenCartsDetail/index.js +44 -4
- package/src/components/CartRecovery/OpenCartsDetail/styles.js +54 -0
- package/src/components/CartRecovery/RecoveryActionDetail/index.js +3 -4
- package/src/components/CartRecovery/RecoveryActionList/index.js +12 -2
- package/src/components/CartRecovery/RecoveryActionListing/index.js +14 -6
- package/src/components/Delivery/DeliveryUsersListing/index.js +19 -8
- package/src/components/Delivery/DriversCompaniesList/index.js +17 -3
- package/src/components/Delivery/DriversCompaniesListing/index.js +7 -5
- package/src/components/Delivery/DriversCompanyDetailsForm/index.js +3 -4
- package/src/components/Delivery/DriversGroupDetails/index.js +3 -4
- package/src/components/Delivery/DriversGroupLogistics/index.js +3 -5
- package/src/components/Delivery/DriversGroupsList/index.js +17 -3
- package/src/components/Delivery/DriversGroupsListing/index.js +7 -5
- package/src/components/Delivery/UserDetails/index.js +4 -9
- package/src/components/Delivery/UserFormDetails/index.js +9 -0
- package/src/components/Delivery/UsersList/index.js +11 -1
- package/src/components/Marketing/AdBannersListing/index.js +5 -4
- package/src/components/Marketing/CampaignDetail/index.js +3 -4
- package/src/components/Marketing/CampaignList/index.js +12 -2
- package/src/components/Marketing/CampaignListing/index.js +14 -5
- package/src/components/Marketing/EnterprisePromotionList/index.js +11 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +13 -5
- package/src/components/Marketing/PageBanner/index.js +5 -6
- package/src/components/Messages/MessagesListing/index.js +14 -5
- package/src/components/MyProducts/AdvancedSettings/index.js +4 -1
- package/src/components/OrderingProducts/OrderingProductDetails/index.js +4 -3
- package/src/components/OrderingProducts/OrderingProductsListing/index.js +23 -6
- package/src/components/Orders/AllInOne/DriversManager/styles.js +1 -1
- package/src/components/Orders/AllInOne/index.js +5 -1
- package/src/components/Orders/AllInOne/styles.js +6 -2
- package/src/components/Orders/CreateCustomOrder/CustomOrderDetails/index.js +4 -17
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/index.js +23 -2
- package/src/components/Orders/CreateCustomOrder/SelectCustomer/styles.js +22 -0
- package/src/components/Orders/DeliveriesManager/index.js +3 -1
- package/src/components/Orders/DeliveryDashboard/index.js +4 -1
- package/src/components/Orders/DriverSelector/index.js +8 -2
- package/src/components/Orders/DriversDashboard/index.js +3 -1
- package/src/components/Orders/DriversLocation/index.js +117 -43
- package/src/components/Orders/DriversManager/index.js +3 -2
- package/src/components/Orders/DriversManager/styles.js +1 -1
- package/src/components/Orders/GiftCardsListing/index.js +44 -5
- package/src/components/Orders/Messages/index.js +5 -5
- package/src/components/Orders/OrderContactInformation/index.js +13 -7
- package/src/components/Orders/OrderDashboardSLASetting/index.js +1 -1
- package/src/components/Orders/OrderDetails/index.js +16 -16
- package/src/components/Orders/OrderStatusFilterBar/index.js +19 -2
- package/src/components/Orders/OrdersCards/index.js +11 -1
- package/src/components/Orders/OrdersDashboardControls/index.js +8 -2
- package/src/components/Orders/OrdersDashboardList/index.js +34 -2
- package/src/components/Orders/OrdersFilterGroup/styles.js +1 -1
- package/src/components/Orders/OrdersListing/index.js +4 -1
- package/src/components/Orders/OrdersManager/index.js +6 -1
- package/src/components/Orders/OrdersManager/styles.js +4 -2
- package/src/components/Orders/OrdersTable/index.js +11 -2
- package/src/components/Orders/OrdersTable/styles.js +0 -6
- package/src/components/Settings/Cms/index.js +15 -2
- package/src/components/Settings/LanguageManager/index.js +5 -1
- package/src/components/Settings/LanguageTransTable/index.js +15 -2
- package/src/components/Settings/SettingsList/index.js +90 -94
- package/src/components/Settings/WebhookDelaySelector/index.js +3 -2
- package/src/components/Settings/WebhookList/styles.js +3 -0
- package/src/components/Settings/WebhookListSelector/index.js +1 -0
- package/src/components/Shared/Pagination/index.js +1 -1
- package/src/components/Stores/BusinessActiveStateFilter/index.js +24 -4
- package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +1 -1
- package/src/components/Stores/BusinessAdd/OrderTypePriceLevel/index.js +9 -6
- package/src/components/Stores/BusinessAdd/PaymentMethods/index.js +1 -1
- package/src/components/Stores/BusinessBrandListing/index.js +6 -6
- package/src/components/Stores/BusinessDeliveryPickupMore/index.js +3 -5
- package/src/components/Stores/BusinessDeliveryZoneDetails/index.js +3 -7
- package/src/components/Stores/BusinessDeliveryZoneList/index.js +4 -11
- package/src/components/Stores/BusinessDetail/index.js +4 -5
- package/src/components/Stores/BusinessDetails/index.js +4 -6
- package/src/components/Stores/BusinessDeviceListing/index.js +4 -4
- package/src/components/Stores/BusinessInformation/index.js +8 -6
- package/src/components/Stores/BusinessInformation/styles.js +1 -0
- package/src/components/Stores/BusinessMenu/index.js +5 -13
- package/src/components/Stores/BusinessMenuBasicOptions/index.js +3 -2
- package/src/components/Stores/BusinessMenuOptions/index.js +3 -7
- package/src/components/Stores/BusinessOrderingChannels/index.js +3 -5
- package/src/components/Stores/BusinessPaymentMethods/index.js +7 -9
- package/src/components/Stores/BusinessPlaceGroupList/index.js +4 -8
- package/src/components/Stores/BusinessPreorderDetails/index.js +2 -2
- package/src/components/Stores/BusinessProductList/index.js +1 -1
- package/src/components/Stores/BusinessProductsCategoyDetails/index.js +3 -5
- package/src/components/Stores/BusinessProductsListing/index.js +9 -7
- package/src/components/Stores/BusinessSharedMenuProducts/index.js +4 -12
- package/src/components/Stores/BusinessSync/index.js +3 -4
- package/src/components/Stores/BusinessTypes/index.js +4 -11
- package/src/components/Stores/BusinessWalletsList/index.js +4 -8
- package/src/components/Stores/BusinessWebhooks/index.js +6 -4
- package/src/components/Stores/BusinessesList/index.js +11 -1
- package/src/components/Stores/BusinessesListing/index.js +21 -7
- package/src/components/Stores/ImportersButton/index.js +4 -5
- package/src/components/Stores/PaymentOption/index.js +3 -6
- package/src/components/Stores/PaymentOptionMethods/index.js +3 -6
- package/src/components/Stores/PaymentOptionPaypal/index.js +3 -6
- package/src/components/Stores/PaymentOptionSquare/index.js +3 -6
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +3 -6
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +3 -6
- package/src/components/Stores/PaymethodOptionStripeConnect/index.js +3 -6
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +3 -6
- package/src/components/Stores/ProductDetails/index.js +5 -8
- package/src/components/Stores/ProductExtras/index.js +65 -14
- package/src/components/Stores/ProductExtras/styles.js +41 -1
- package/src/components/Stores/ProductIngredient/index.js +4 -10
- package/src/components/Stores/ProductMainDetails/index.js +4 -6
- package/src/components/Stores/ProductTagsList/index.js +4 -12
- package/src/components/Users/CustomerCashWallet/index.js +3 -6
- package/src/components/Users/CustomerDetails/index.js +13 -11
- package/src/components/Users/CustomerPointsWallet/index.js +3 -6
- package/src/components/Users/CustomersListing/index.js +15 -8
- package/src/components/Users/ProfessionalDetail/index.js +3 -10
- package/src/components/Users/ProfessionalList/index.js +11 -1
- package/src/components/Users/ProfessionalListing/index.js +15 -8
- package/src/components/Users/UserActiveStateFilter/index.js +5 -4
- package/src/components/Users/UserDetails/index.js +3 -10
- package/src/components/Users/UsersList/index.js +11 -1
- package/src/components/Users/UsersListing/index.js +15 -8
- package/src/index.js +3 -1
- package/src/utils/index.js +27 -0
- package/template/pages/AllInOne/index.js +4 -4
- package/template/pages/BusinessesList/index.js +4 -4
- package/template/pages/CampaignListing/index.js +5 -1
- package/template/pages/CustomersList/index.js +5 -4
- package/template/pages/DeliveriesManager/index.js +5 -4
- package/template/pages/DeliveryDriversList/index.js +5 -4
- package/template/pages/DriversCompaniesList/index.js +5 -1
- package/template/pages/DriversGroupsList/index.js +5 -1
- package/template/pages/DriversManagersList/index.js +5 -4
- package/template/pages/EnterprisePromotionList/index.js +1 -0
- package/template/pages/GiftCardsList/index.js +5 -1
- package/template/pages/ManagersList/index.js +5 -4
- package/template/pages/MessagesList/index.js +5 -1
- package/template/pages/OpenCarts/index.js +4 -5
- package/template/pages/OrderingProducts/index.js +2 -1
- package/template/pages/OrdersList/index.js +4 -4
- package/template/pages/Professionals/index.js +5 -4
- package/template/pages/RecoveryActionListing/index.js +5 -1
- package/template/pages/ReviewsList/index.js +5 -1
- /package/_bundles/{ordering-ui-admin.462f5c3aad7a320965e9.js.LICENSE.txt → ordering-ui-admin.78f6259366a43cc634db.js.LICENSE.txt} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react'
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
4
4
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
5
5
|
import { List as MenuIcon, CaretDownFill } from 'react-bootstrap-icons'
|
|
@@ -9,6 +9,7 @@ import { BusinessReviewList } from '../BusinessReviewList'
|
|
|
9
9
|
import { UsersReviewList } from '../UsersReviewList'
|
|
10
10
|
import { BusinessSelectHeader } from '../../Stores/BusinessSelectHeader'
|
|
11
11
|
import { ReviewProductsListing } from '../ReviewProductsListing'
|
|
12
|
+
import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
ReviewsListingContainer,
|
|
@@ -22,11 +23,20 @@ import {
|
|
|
22
23
|
} from './styles'
|
|
23
24
|
|
|
24
25
|
export const ReviewsListing = (props) => {
|
|
25
|
-
const
|
|
26
|
+
const {
|
|
27
|
+
isUseQuery
|
|
28
|
+
} = props
|
|
29
|
+
|
|
26
30
|
const query = new URLSearchParams(useLocation().search)
|
|
31
|
+
const defaultTab = query.get('tab')
|
|
32
|
+
const defaultPage = query.get('page') || 1
|
|
33
|
+
const defaultPageSize = query.get('pageSize') || 10
|
|
34
|
+
|
|
27
35
|
const [, t] = useLanguage()
|
|
28
36
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
29
|
-
|
|
37
|
+
|
|
38
|
+
const firstRender = useRef(true)
|
|
39
|
+
const [showOption, setShowOption] = useState(defaultTab || 'business')
|
|
30
40
|
const [searchValue, setSearchValue] = useState(null)
|
|
31
41
|
const [showSelect, setShowSelect] = useState(false)
|
|
32
42
|
const [business, setBusiness] = useState('')
|
|
@@ -36,15 +46,18 @@ export const ReviewsListing = (props) => {
|
|
|
36
46
|
setShowSelect(false)
|
|
37
47
|
setBusiness(business)
|
|
38
48
|
setBusinessId(business.id)
|
|
39
|
-
|
|
40
|
-
history.replace(`${location.pathname}?tab=${tab}&business=${business.id}`)
|
|
49
|
+
addQueryToUrl({ business: business.id })
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
const handleChangeOption = (option, isInitialRender) => {
|
|
44
|
-
setShowOption(option)
|
|
45
|
-
if (option === 'products' && !businessId) setShowSelect(true)
|
|
46
53
|
if (!isInitialRender) {
|
|
47
|
-
|
|
54
|
+
firstRender.current = false
|
|
55
|
+
removeQueryToUrl(['page', 'pageSize', 'business', 'category', 'product', 'id'])
|
|
56
|
+
addQueryToUrl({ tab: option })
|
|
57
|
+
}
|
|
58
|
+
setShowOption(option)
|
|
59
|
+
if (option === 'products' && !businessId) {
|
|
60
|
+
setShowSelect(true)
|
|
48
61
|
}
|
|
49
62
|
}
|
|
50
63
|
|
|
@@ -144,30 +157,61 @@ export const ReviewsListing = (props) => {
|
|
|
144
157
|
</Tab>
|
|
145
158
|
</Tabs>
|
|
146
159
|
{showOption === 'business' && (
|
|
147
|
-
<BusinessReviewList
|
|
160
|
+
<BusinessReviewList
|
|
161
|
+
parentSearchValue={searchValue}
|
|
162
|
+
handleOpenProducts={handleOpenProducts}
|
|
163
|
+
isUseQuery={isUseQuery}
|
|
164
|
+
paginationSettings={{
|
|
165
|
+
initialPage: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
166
|
+
pageSize: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
167
|
+
controlType: 'pages'
|
|
168
|
+
}}
|
|
169
|
+
/>
|
|
148
170
|
)}
|
|
149
171
|
{showOption === 'drivers' && (
|
|
150
172
|
<UsersReviewList
|
|
151
173
|
defaultUserTypesSelected={[4]}
|
|
152
174
|
parentSearchValue={searchValue}
|
|
175
|
+
isUseQuery={isUseQuery}
|
|
176
|
+
paginationSettings={{
|
|
177
|
+
initialPage: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
178
|
+
pageSize: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
179
|
+
controlType: 'pages'
|
|
180
|
+
}}
|
|
153
181
|
/>
|
|
154
182
|
)}
|
|
155
183
|
{showOption === 'customers' && (
|
|
156
184
|
<UsersReviewList
|
|
157
185
|
defaultUserTypesSelected={[3]}
|
|
158
186
|
parentSearchValue={searchValue}
|
|
187
|
+
isUseQuery={isUseQuery}
|
|
188
|
+
paginationSettings={{
|
|
189
|
+
initialPage: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
190
|
+
pageSize: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
191
|
+
controlType: 'pages'
|
|
192
|
+
}}
|
|
159
193
|
/>
|
|
160
194
|
)}
|
|
161
195
|
{showOption === 'professionals' && (
|
|
162
196
|
<UsersReviewList
|
|
163
197
|
defaultUserTypesSelected={[8]}
|
|
164
198
|
parentSearchValue={searchValue}
|
|
199
|
+
isUseQuery={isUseQuery}
|
|
200
|
+
paginationSettings={{
|
|
201
|
+
initialPage: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
202
|
+
pageSize: isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
203
|
+
controlType: 'pages'
|
|
204
|
+
}}
|
|
165
205
|
/>
|
|
166
206
|
)}
|
|
167
207
|
{showOption === 'products' && businessId && (
|
|
168
208
|
<ReviewProductsListing
|
|
169
209
|
parentSearchValue={searchValue}
|
|
170
210
|
businessId={businessId}
|
|
211
|
+
isUseQuery={isUseQuery}
|
|
212
|
+
defaultPage={isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPage) : 1}
|
|
213
|
+
defaultPageSize={isUseQuery && firstRender.current && !isNaN(defaultPage) ? Number(defaultPageSize) : 10}
|
|
214
|
+
firstRender={firstRender.current}
|
|
171
215
|
/>
|
|
172
216
|
)}
|
|
173
217
|
</ReviewsListingContainer>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import {
|
|
4
4
|
useLanguage,
|
|
5
5
|
useUtils,
|
|
@@ -9,6 +9,7 @@ import Skeleton from 'react-loading-skeleton'
|
|
|
9
9
|
import { StarFill, PersonFill } from 'react-bootstrap-icons'
|
|
10
10
|
import { Pagination, SideBar } from '../../Shared'
|
|
11
11
|
import { UserReviewDetails } from '../UserReviewDetails'
|
|
12
|
+
import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
|
|
12
13
|
|
|
13
14
|
import {
|
|
14
15
|
ReviewsTable,
|
|
@@ -28,10 +29,10 @@ const DriversReviewListUI = (props) => {
|
|
|
28
29
|
paginationProps,
|
|
29
30
|
getUsers,
|
|
30
31
|
onSearch,
|
|
31
|
-
defaultUserTypesSelected
|
|
32
|
+
defaultUserTypesSelected,
|
|
33
|
+
isUseQuery
|
|
32
34
|
} = props
|
|
33
35
|
|
|
34
|
-
const history = useHistory()
|
|
35
36
|
const query = new URLSearchParams(useLocation().search)
|
|
36
37
|
const [, t] = useLanguage()
|
|
37
38
|
const [{ optimizeImage, parseNumber }] = useUtils()
|
|
@@ -66,16 +67,14 @@ const DriversReviewListUI = (props) => {
|
|
|
66
67
|
if (isInvalid) return
|
|
67
68
|
handleOpenReview(user)
|
|
68
69
|
if (!isInitialRender) {
|
|
69
|
-
|
|
70
|
-
history.replace(`${location.pathname}?tab=${tab}&id=${user.id}`)
|
|
70
|
+
addQueryToUrl({ id: user.id })
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
const handleCloseReviewDetails = () => {
|
|
75
75
|
setCurUser(null)
|
|
76
76
|
setOpenReview(false)
|
|
77
|
-
|
|
78
|
-
history.replace(`${location.pathname}?tab=${tab}`)
|
|
77
|
+
removeQueryToUrl(['id'])
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
useEffect(() => {
|
|
@@ -86,6 +85,14 @@ const DriversReviewListUI = (props) => {
|
|
|
86
85
|
}
|
|
87
86
|
}, [])
|
|
88
87
|
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (!isUseQuery || !paginationProps?.currentPage || !paginationProps?.pageSize || !paginationProps?.totalPages) return
|
|
90
|
+
addQueryToUrl({
|
|
91
|
+
page: paginationProps.currentPage,
|
|
92
|
+
pageSize: paginationProps.pageSize
|
|
93
|
+
})
|
|
94
|
+
}, [paginationProps?.currentPage, paginationProps?.pageSize, paginationProps?.totalPages])
|
|
95
|
+
|
|
89
96
|
return (
|
|
90
97
|
<>
|
|
91
98
|
<ReviewsTable>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
3
3
|
// import { Square, CheckSquareFill } from 'react-bootstrap-icons'
|
|
4
4
|
import Skeleton from 'react-loading-skeleton'
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from 'ordering-components-admin-external'
|
|
9
9
|
import { useTheme } from 'styled-components'
|
|
10
10
|
import { ColumnAllowSettingPopover, Pagination } from '../../Shared'
|
|
11
|
+
import { addQueryToUrl } from '../../../utils'
|
|
12
|
+
|
|
11
13
|
import {
|
|
12
14
|
CartsContainer,
|
|
13
15
|
Table,
|
|
@@ -31,7 +33,8 @@ export const OpenCartList = (props) => {
|
|
|
31
33
|
getCartList,
|
|
32
34
|
// handleSelectedCartIds,
|
|
33
35
|
// setSelectedCartIds,
|
|
34
|
-
handleOpenCartDetail
|
|
36
|
+
handleOpenCartDetail,
|
|
37
|
+
isUseQuery
|
|
35
38
|
} = props
|
|
36
39
|
|
|
37
40
|
const [, t] = useLanguage()
|
|
@@ -118,6 +121,14 @@ export const OpenCartList = (props) => {
|
|
|
118
121
|
// setIsAllChecked(_isAllChecked)
|
|
119
122
|
// }, [cartList.carts, selectedCartIds])
|
|
120
123
|
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
if (!isUseQuery || !pagination?.currentPage || !pagination?.pageSize || !pagination?.totalPages) return
|
|
126
|
+
addQueryToUrl({
|
|
127
|
+
page: pagination.currentPage,
|
|
128
|
+
pageSize: pagination.pageSize
|
|
129
|
+
})
|
|
130
|
+
}, [pagination?.currentPage, pagination?.pageSize, pagination?.totalPages])
|
|
131
|
+
|
|
121
132
|
return (
|
|
122
133
|
<>
|
|
123
134
|
<CartsContainer id='cartTable'>
|
|
@@ -226,11 +237,10 @@ export const OpenCartList = (props) => {
|
|
|
226
237
|
</CartBody>
|
|
227
238
|
))
|
|
228
239
|
) : (
|
|
229
|
-
cartList.carts.map(
|
|
240
|
+
cartList.carts.map(cart => (
|
|
230
241
|
<CartBody
|
|
231
|
-
key={
|
|
242
|
+
key={cart?.id}
|
|
232
243
|
className={parseInt(cartDetailId) === cart.id ? 'active' : ''}
|
|
233
|
-
|
|
234
244
|
onClick={(e) => handleClickCart(cart, e)}
|
|
235
245
|
>
|
|
236
246
|
<tr>
|
|
@@ -29,7 +29,9 @@ const OpenCartListingUI = (props) => {
|
|
|
29
29
|
cartList,
|
|
30
30
|
pagination,
|
|
31
31
|
getCartList,
|
|
32
|
-
onCartRedirect
|
|
32
|
+
onCartRedirect,
|
|
33
|
+
handleSuccessDeleteCart,
|
|
34
|
+
isUseQuery
|
|
33
35
|
} = props
|
|
34
36
|
|
|
35
37
|
const query = new URLSearchParams(useLocation().search)
|
|
@@ -110,6 +112,7 @@ const OpenCartListingUI = (props) => {
|
|
|
110
112
|
getCartList={getCartList}
|
|
111
113
|
handleSelectedCartIds={handleSelectedCartIds}
|
|
112
114
|
handleOpenCartDetail={handleOpenCartDetail}
|
|
115
|
+
isUseQuery={isUseQuery}
|
|
113
116
|
/>
|
|
114
117
|
</WrapItemView>
|
|
115
118
|
</OpenCartsInnerContent>
|
|
@@ -121,6 +124,7 @@ const OpenCartListingUI = (props) => {
|
|
|
121
124
|
cart={detailsCart}
|
|
122
125
|
cartId={cartDetailId}
|
|
123
126
|
onClose={() => handleBackRedirect()}
|
|
127
|
+
handleSuccessDeleteCart={handleSuccessDeleteCart}
|
|
124
128
|
/>
|
|
125
129
|
)}
|
|
126
130
|
{totalSelectedOrder > 0 && (
|
|
@@ -129,16 +133,23 @@ const OpenCartListingUI = (props) => {
|
|
|
129
133
|
</WrapperIndicator>
|
|
130
134
|
)}
|
|
131
135
|
</>
|
|
132
|
-
|
|
133
136
|
)
|
|
134
137
|
}
|
|
135
138
|
|
|
136
139
|
export const OpenCartListing = (props) => {
|
|
140
|
+
const query = new URLSearchParams(useLocation().search)
|
|
141
|
+
const defaultPage = query.get('page') || 1
|
|
142
|
+
const defaultPageSize = query.get('pageSize') || 10
|
|
137
143
|
const openCartsProps = {
|
|
138
144
|
...props,
|
|
139
145
|
UIComponent: OpenCartListingUI,
|
|
140
146
|
isSearchByCartId: true,
|
|
141
|
-
isSearchByCityName: true
|
|
147
|
+
isSearchByCityName: true,
|
|
148
|
+
paginationSettings: {
|
|
149
|
+
initialPage: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
150
|
+
pageSize: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
151
|
+
controlType: 'pages'
|
|
152
|
+
}
|
|
142
153
|
}
|
|
143
154
|
return <OpenCartListingController {...openCartsProps} />
|
|
144
155
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { useLanguage, useUtils, OpenCartsDetail as OpenCartsDetailController } from 'ordering-components-admin-external'
|
|
3
|
+
import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
4
|
+
import { useTheme } from 'styled-components'
|
|
3
5
|
import { ProductItemAccordion } from '../../Orders/ProductItemAccordion'
|
|
4
6
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
5
7
|
import { OpenCartBill } from '../OpenCartBill'
|
|
6
8
|
import { OpenCartsContactInformation } from '../OpenCartsContactInformation'
|
|
7
|
-
import { NotFoundSource } from '../../Shared'
|
|
9
|
+
import { NotFoundSource, Confirm } from '../../Shared'
|
|
8
10
|
import { IconButton as ButtonLink } from '../../../styles'
|
|
9
|
-
import { ArrowsAngleContract, ArrowsAngleExpand, XLg as CloseIcon } from 'react-bootstrap-icons'
|
|
11
|
+
import { ArrowsAngleContract, ArrowsAngleExpand, XLg as CloseIcon, ThreeDots } from 'react-bootstrap-icons'
|
|
10
12
|
import Skeleton from 'react-loading-skeleton'
|
|
11
13
|
|
|
12
14
|
import {
|
|
@@ -16,7 +18,8 @@ import {
|
|
|
16
18
|
HeaderContainer,
|
|
17
19
|
OrderInfoWrapper,
|
|
18
20
|
ButtonGroup,
|
|
19
|
-
SkeletonWrapper
|
|
21
|
+
SkeletonWrapper,
|
|
22
|
+
ActionSelectorWrapper
|
|
20
23
|
} from './styles'
|
|
21
24
|
|
|
22
25
|
const OpenCartsDetailUI = (props) => {
|
|
@@ -24,15 +27,18 @@ const OpenCartsDetailUI = (props) => {
|
|
|
24
27
|
isSelectedOrders,
|
|
25
28
|
open,
|
|
26
29
|
handleBackRedirect,
|
|
27
|
-
cartState
|
|
30
|
+
cartState,
|
|
31
|
+
handleDeleteCart
|
|
28
32
|
} = props
|
|
29
33
|
|
|
34
|
+
const theme = useTheme()
|
|
30
35
|
const [, t] = useLanguage()
|
|
31
36
|
const { width } = useWindowSize()
|
|
32
37
|
const [{ parseDate }] = useUtils()
|
|
33
38
|
|
|
34
39
|
const [isMenuOpen, setIsMenuOpen] = useState(false)
|
|
35
40
|
const [isExpand, setIsExpand] = useState(false)
|
|
41
|
+
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
36
42
|
|
|
37
43
|
const actionSidebar = (value) => {
|
|
38
44
|
setIsMenuOpen(value)
|
|
@@ -74,6 +80,17 @@ const OpenCartsDetailUI = (props) => {
|
|
|
74
80
|
setIsExpand(prev => !prev)
|
|
75
81
|
}
|
|
76
82
|
|
|
83
|
+
const onDeleteCart = (cart) => {
|
|
84
|
+
setConfirm({
|
|
85
|
+
open: true,
|
|
86
|
+
content: t('QUESTION_DELETE_CART', 'Are you sure that you want to delete this cart?'),
|
|
87
|
+
handleOnAccept: () => {
|
|
88
|
+
setConfirm({ ...confirm, open: false })
|
|
89
|
+
handleDeleteCart(cart)
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
}
|
|
93
|
+
|
|
77
94
|
useEffect(() => {
|
|
78
95
|
if (!open) return
|
|
79
96
|
document.addEventListener('keydown', onCloseSidebar)
|
|
@@ -116,6 +133,17 @@ const OpenCartsDetailUI = (props) => {
|
|
|
116
133
|
{isExpand ? <ArrowsAngleContract /> : <ArrowsAngleExpand />}
|
|
117
134
|
</ButtonLink>
|
|
118
135
|
)}
|
|
136
|
+
<ActionSelectorWrapper>
|
|
137
|
+
<DropdownButton
|
|
138
|
+
menuAlign={theme?.rtl ? 'left' : 'right'}
|
|
139
|
+
title={<ThreeDots />}
|
|
140
|
+
id={theme?.rtl ? 'dropdown-menu-align-left' : 'dropdown-menu-align-right'}
|
|
141
|
+
>
|
|
142
|
+
<Dropdown.Item onClick={() => onDeleteCart(cartState?.cart)}>
|
|
143
|
+
{t('DELETE', 'Delete')}
|
|
144
|
+
</Dropdown.Item>
|
|
145
|
+
</DropdownButton>
|
|
146
|
+
</ActionSelectorWrapper>
|
|
119
147
|
<ButtonLink
|
|
120
148
|
color='black'
|
|
121
149
|
onClick={() => props.onClose() && props.onClose()}
|
|
@@ -154,6 +182,18 @@ const OpenCartsDetailUI = (props) => {
|
|
|
154
182
|
onClickButton={handleBackRedirect}
|
|
155
183
|
/>
|
|
156
184
|
)}
|
|
185
|
+
|
|
186
|
+
<Confirm
|
|
187
|
+
width='700px'
|
|
188
|
+
title={t('WEB_APPNAME', 'Ordering')}
|
|
189
|
+
content={confirm.content}
|
|
190
|
+
acceptText={t('ACCEPT', 'Accept')}
|
|
191
|
+
open={confirm.open}
|
|
192
|
+
onClose={() => setConfirm({ ...confirm, open: false })}
|
|
193
|
+
onCancel={() => setConfirm({ ...confirm, open: false })}
|
|
194
|
+
onAccept={confirm.handleOnAccept}
|
|
195
|
+
closeOnBackdrop={false}
|
|
196
|
+
/>
|
|
157
197
|
</Container>
|
|
158
198
|
)
|
|
159
199
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components'
|
|
2
|
+
import { darken } from 'polished'
|
|
2
3
|
|
|
3
4
|
export const Container = styled.div`
|
|
4
5
|
display: flex;
|
|
@@ -113,3 +114,56 @@ export const SkeletonWrapper = styled.div`
|
|
|
113
114
|
width: 100%;
|
|
114
115
|
}
|
|
115
116
|
`
|
|
117
|
+
export const ActionSelectorWrapper = styled.div`
|
|
118
|
+
button {
|
|
119
|
+
background: transparent !important;
|
|
120
|
+
border: none;
|
|
121
|
+
padding: 0px 5px;
|
|
122
|
+
&:active,
|
|
123
|
+
&:focus {
|
|
124
|
+
border-color: unset !important;
|
|
125
|
+
box-shadow: none !important;
|
|
126
|
+
}
|
|
127
|
+
svg {
|
|
128
|
+
color: ${props => props.theme.colors.headingColor};
|
|
129
|
+
font-size: 20px;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:after {
|
|
133
|
+
display: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:hover {
|
|
137
|
+
background: ${props => darken(0.04, props.theme.colors.secundary)} !important;
|
|
138
|
+
}
|
|
139
|
+
&:active {
|
|
140
|
+
background: ${props => darken(0.1, props.theme.colors.secundary)} !important;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.show {
|
|
145
|
+
button {
|
|
146
|
+
background: ${props => darken(0.04, props.theme.colors.secundary)} !important;
|
|
147
|
+
}
|
|
148
|
+
>div {
|
|
149
|
+
border: 1px solid ${props => props.theme.colors.borderColor};
|
|
150
|
+
box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.12);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
> div {
|
|
155
|
+
> div {
|
|
156
|
+
border-radius: 8px;
|
|
157
|
+
.dropdown-item {
|
|
158
|
+
font-size: 12px;
|
|
159
|
+
color: ${props => props.theme.colors.headingColor};
|
|
160
|
+
&:active {
|
|
161
|
+
background: ${props => darken(0.1, props.theme.colors.secundary)} !important;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
.dropdown-item:last-child {
|
|
165
|
+
color: #E63757;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
`
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { useLanguage, RecoveryActionDetail as RecoveryActionDetailController } from 'ordering-components-admin-external'
|
|
4
4
|
import { Alert, Confirm } from '../../Shared'
|
|
5
5
|
import { Dropdown, DropdownButton } from 'react-bootstrap'
|
|
6
6
|
import { ArrowsAngleContract, ArrowsAngleExpand, ThreeDots } from 'react-bootstrap-icons'
|
|
7
7
|
import { IconButton, Switch } from '../../../styles'
|
|
8
8
|
import { useTheme } from 'styled-components'
|
|
9
|
+
import { addQueryToUrl } from '../../../utils'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
RecoveryActionDetailContainer,
|
|
@@ -31,7 +32,6 @@ const RecoveryActionDetailUI = (props) => {
|
|
|
31
32
|
handleDeleteRecoveryAction
|
|
32
33
|
} = props
|
|
33
34
|
|
|
34
|
-
const history = useHistory()
|
|
35
35
|
const query = new URLSearchParams(useLocation().search)
|
|
36
36
|
const theme = useTheme()
|
|
37
37
|
const [, t] = useLanguage()
|
|
@@ -57,8 +57,7 @@ const RecoveryActionDetailUI = (props) => {
|
|
|
57
57
|
}
|
|
58
58
|
setSelectedOption(key)
|
|
59
59
|
if (!isInitialRender) {
|
|
60
|
-
|
|
61
|
-
history.replace(`${location.pathname}?id=${id}&tab=${key}`)
|
|
60
|
+
addQueryToUrl({ tab: key })
|
|
62
61
|
}
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import Skeleton from 'react-loading-skeleton'
|
|
3
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
4
4
|
import { ColumnAllowSettingPopover, Pagination } from '../../Shared'
|
|
5
5
|
import { Switch, LinkButton } from '../../../styles'
|
|
6
6
|
import { useTheme } from 'styled-components'
|
|
7
|
+
import { addQueryToUrl } from '../../../utils'
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
10
|
Container,
|
|
@@ -22,7 +23,8 @@ export const RecoveryActionList = (props) => {
|
|
|
22
23
|
getRecoveryList,
|
|
23
24
|
handleOpenDetail,
|
|
24
25
|
handleUpdateAction,
|
|
25
|
-
selectedAction
|
|
26
|
+
selectedAction,
|
|
27
|
+
isUseQuery
|
|
26
28
|
} = props
|
|
27
29
|
|
|
28
30
|
const [, t] = useLanguage()
|
|
@@ -73,6 +75,14 @@ export const RecoveryActionList = (props) => {
|
|
|
73
75
|
handleOpenDetail(action)
|
|
74
76
|
}
|
|
75
77
|
|
|
78
|
+
useEffect(() => {
|
|
79
|
+
if (!isUseQuery || !paginationProps?.currentPage || !paginationProps?.pageSize || !paginationProps?.totalPages) return
|
|
80
|
+
addQueryToUrl({
|
|
81
|
+
page: paginationProps.currentPage,
|
|
82
|
+
pageSize: paginationProps.pageSize
|
|
83
|
+
})
|
|
84
|
+
}, [paginationProps?.currentPage, paginationProps?.pageSize, paginationProps?.totalPages])
|
|
85
|
+
|
|
76
86
|
return (
|
|
77
87
|
<>
|
|
78
88
|
<Container>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { RecoveryActionListing as RecoveryActionListingController } from 'ordering-components-admin-external'
|
|
4
4
|
import { RecoveryActionHeader } from '../RecoveryActionHeader'
|
|
5
5
|
import { RecoveryActionList } from '../RecoveryActionList'
|
|
6
6
|
import { SideBar } from '../../Shared'
|
|
7
7
|
import { RecoveryActionDetail } from '../RecoveryActionDetail'
|
|
8
8
|
import { RecoveryActionAdd } from '../RecoveryActionAdd'
|
|
9
|
+
import { addQueryToUrl, removeQueryToUrl } from '../../../utils'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
RecoveryActionsContainer
|
|
12
13
|
} from './styles'
|
|
13
14
|
|
|
14
15
|
const RecoveryActionListingUI = (props) => {
|
|
15
|
-
const history = useHistory()
|
|
16
16
|
const query = new URLSearchParams(useLocation().search)
|
|
17
17
|
const [isOpenDetail, setIsOpenDetail] = useState(false)
|
|
18
18
|
const [selectedAction, setSelectedAction] = useState(null)
|
|
@@ -23,7 +23,7 @@ const RecoveryActionListingUI = (props) => {
|
|
|
23
23
|
setIsOpenDetail(false)
|
|
24
24
|
setSelectedAction(null)
|
|
25
25
|
setIsAddMode(false)
|
|
26
|
-
|
|
26
|
+
removeQueryToUrl(['id', 'tab'])
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const handleOpenDetail = (action, isInitialRender) => {
|
|
@@ -32,13 +32,13 @@ const RecoveryActionListingUI = (props) => {
|
|
|
32
32
|
setIsOpenDetail(true)
|
|
33
33
|
if (!Object.keys(action || {}).length) {
|
|
34
34
|
setIsAddMode(true)
|
|
35
|
-
|
|
35
|
+
removeQueryToUrl(['id'])
|
|
36
36
|
return
|
|
37
37
|
} else {
|
|
38
38
|
setIsAddMode(false)
|
|
39
39
|
}
|
|
40
40
|
if (action && !isInitialRender) {
|
|
41
|
-
|
|
41
|
+
addQueryToUrl({ id: action.id })
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -92,11 +92,19 @@ const RecoveryActionListingUI = (props) => {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export const RecoveryActionListing = (props) => {
|
|
95
|
+
const query = new URLSearchParams(useLocation().search)
|
|
96
|
+
const defaultPage = query.get('page') || 1
|
|
97
|
+
const defaultPageSize = query.get('pageSize') || 10
|
|
95
98
|
const recoveryActionsProps = {
|
|
96
99
|
...props,
|
|
97
100
|
UIComponent: RecoveryActionListingUI,
|
|
98
101
|
isSearchByName: true,
|
|
99
|
-
isSearchByDescription: true
|
|
102
|
+
isSearchByDescription: true,
|
|
103
|
+
paginationSettings: {
|
|
104
|
+
initialPage: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
105
|
+
pageSize: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
106
|
+
controlType: 'pages'
|
|
107
|
+
}
|
|
100
108
|
}
|
|
101
109
|
return <RecoveryActionListingController {...recoveryActionsProps} />
|
|
102
110
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react'
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { useLanguage, UsersList as UsersListController } from 'ordering-components-admin-external'
|
|
4
|
-
import { getStorageItem, removeStorageItem, setStorageItem } from '../../../utils'
|
|
4
|
+
import { getStorageItem, removeStorageItem, setStorageItem, addQueryToUrl } from '../../../utils'
|
|
5
5
|
|
|
6
6
|
import { UsersListingHeader } from '../UsersListingHeader'
|
|
7
7
|
import { UserTypeFilter } from '../UserTypeFilter'
|
|
@@ -52,12 +52,13 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
52
52
|
actionDisabled,
|
|
53
53
|
driversGroupsState,
|
|
54
54
|
setSelectedUsers,
|
|
55
|
-
actionStatus
|
|
55
|
+
actionStatus,
|
|
56
|
+
isUseQuery
|
|
56
57
|
} = props
|
|
57
58
|
|
|
58
59
|
const [, t] = useLanguage()
|
|
59
|
-
const history = useHistory()
|
|
60
60
|
const query = new URLSearchParams(useLocation().search)
|
|
61
|
+
const firstRender = useRef(true)
|
|
61
62
|
const [queryId, setQueryId] = useState(null)
|
|
62
63
|
const [isOpenUserDetails, setIsOpenUserDetails] = useState(false)
|
|
63
64
|
const [openUser, setOpenUser] = useState(null)
|
|
@@ -79,7 +80,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
79
80
|
setOpenUser(user)
|
|
80
81
|
setOpenUserAddForm(false)
|
|
81
82
|
setIsOpenUserDetails(true)
|
|
82
|
-
|
|
83
|
+
addQueryToUrl({ id: user.id })
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
const handleOpenUserAddForm = () => {
|
|
@@ -105,7 +106,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
useEffect(() => {
|
|
108
|
-
if (usersList.loading) return
|
|
109
|
+
if (usersList.loading || !firstRender.current) return
|
|
109
110
|
const id = query.get('id')
|
|
110
111
|
if (id === null) {
|
|
111
112
|
!isDriversManagersPage && setIsOpenUserDetails(false)
|
|
@@ -118,6 +119,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
118
119
|
}
|
|
119
120
|
setIsOpenUserDetails(true)
|
|
120
121
|
}
|
|
122
|
+
firstRender.current = false
|
|
121
123
|
}, [usersList])
|
|
122
124
|
|
|
123
125
|
const handleCloseAddForm = () => {
|
|
@@ -210,6 +212,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
210
212
|
handleOpenUserAddForm={handleOpenUserAddForm}
|
|
211
213
|
actionDisabled={actionDisabled}
|
|
212
214
|
setSelectedUsers={setSelectedUsers}
|
|
215
|
+
isUseQuery={isUseQuery}
|
|
213
216
|
/>
|
|
214
217
|
</UsersListingContainer>
|
|
215
218
|
|
|
@@ -268,13 +271,21 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
export const DeliveryUsersListing = (props) => {
|
|
274
|
+
const query = new URLSearchParams(useLocation().search)
|
|
275
|
+
const defaultPage = query.get('page') || 1
|
|
276
|
+
const defaultPageSize = query.get('pageSize') || 10
|
|
271
277
|
const usersListingProps = {
|
|
272
278
|
...props,
|
|
273
279
|
UIComponent: DeliveryUsersListingUI,
|
|
274
280
|
isSearchByUserEmail: true,
|
|
275
281
|
isSearchByUserPhone: true,
|
|
276
282
|
isSearchByUserName: true,
|
|
277
|
-
isDriver: true
|
|
283
|
+
isDriver: true,
|
|
284
|
+
paginationSettings: {
|
|
285
|
+
initialPage: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPage) : 1,
|
|
286
|
+
pageSize: props.isUseQuery && !isNaN(defaultPage) ? Number(defaultPageSize) : 10,
|
|
287
|
+
controlType: 'pages'
|
|
288
|
+
}
|
|
278
289
|
}
|
|
279
290
|
return (
|
|
280
291
|
<UsersListController {...usersListingProps} />
|