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
|
@@ -2,6 +2,8 @@ import React, { useEffect, useRef, useState } from 'react'
|
|
|
2
2
|
import { useConfig } from 'ordering-components-admin-external'
|
|
3
3
|
import GoogleMapReact, { fitBounds } from 'google-map-react'
|
|
4
4
|
import { DriverMapMarkerAndInfo } from '../DriverMapMarkerAndInfo'
|
|
5
|
+
import { InterActOrderMarker } from '../InterActOrderMarker'
|
|
6
|
+
import { SpinnerLoader } from '../../Shared'
|
|
5
7
|
|
|
6
8
|
import {
|
|
7
9
|
WrapperMap
|
|
@@ -12,7 +14,9 @@ export const DriversLocation = (props) => {
|
|
|
12
14
|
driversIsOnline,
|
|
13
15
|
onlineDrivers,
|
|
14
16
|
offlineDrivers,
|
|
15
|
-
selectedDriver
|
|
17
|
+
selectedDriver,
|
|
18
|
+
selectedOrder,
|
|
19
|
+
assignedOrders
|
|
16
20
|
} = props
|
|
17
21
|
|
|
18
22
|
const [configState] = useConfig()
|
|
@@ -39,7 +43,7 @@ export const DriversLocation = (props) => {
|
|
|
39
43
|
const mapFit = () => {
|
|
40
44
|
const bounds = new window.google.maps.LatLngBounds()
|
|
41
45
|
|
|
42
|
-
if (showDrivers.length === 1) {
|
|
46
|
+
if (showDrivers.length === 1 && !selectedOrder && !assignedOrders?.orders?.length) {
|
|
43
47
|
setMapCenter(
|
|
44
48
|
(showDrivers[0].location !== null && typeof showDrivers[0].location === 'object' && showDrivers[0].location?.lat && showDrivers[0].location?.lng)
|
|
45
49
|
? showDrivers[0].location
|
|
@@ -67,6 +71,29 @@ export const DriversLocation = (props) => {
|
|
|
67
71
|
bounds.extend(newPoint)
|
|
68
72
|
}
|
|
69
73
|
|
|
74
|
+
let marker, newPoint
|
|
75
|
+
if (selectedDriver && selectedOrder) {
|
|
76
|
+
marker = selectedOrder?.business?.location !== null ? selectedOrder?.business?.location : defaultCenter
|
|
77
|
+
newPoint = new window.google.maps.LatLng(marker.lat, marker.lng)
|
|
78
|
+
bounds.extend(newPoint)
|
|
79
|
+
|
|
80
|
+
marker = selectedOrder?.customer?.location !== null && selectedOrder?.customer?.location?.lat ? selectedOrder.customer.location : defaultCenter
|
|
81
|
+
newPoint = new window.google.maps.LatLng(marker.lat, marker.lng)
|
|
82
|
+
bounds.extend(newPoint)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (selectedDriver && assignedOrders?.orders?.length) {
|
|
86
|
+
assignedOrders.orders.forEach(order => {
|
|
87
|
+
marker = order?.business?.location !== null ? order?.business?.location : defaultCenter
|
|
88
|
+
newPoint = new window.google.maps.LatLng(marker.lat, marker.lng)
|
|
89
|
+
bounds.extend(newPoint)
|
|
90
|
+
|
|
91
|
+
marker = order?.customer?.location !== null && order?.customer?.location?.lat ? order.customer.location : defaultCenter
|
|
92
|
+
newPoint = new window.google.maps.LatLng(marker.lat, marker.lng)
|
|
93
|
+
bounds.extend(newPoint)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
70
97
|
const newBounds = {
|
|
71
98
|
ne: {
|
|
72
99
|
lat: bounds.getNorthEast().lat(),
|
|
@@ -97,10 +124,14 @@ export const DriversLocation = (props) => {
|
|
|
97
124
|
setMapFitted(false)
|
|
98
125
|
return
|
|
99
126
|
}
|
|
127
|
+
if ((selectedOrder && selectedDriver) || (selectedDriver && assignedOrders?.orders?.length)) {
|
|
128
|
+
mapFit()
|
|
129
|
+
return
|
|
130
|
+
}
|
|
100
131
|
if (!mapFitted) {
|
|
101
132
|
mapFit()
|
|
102
133
|
}
|
|
103
|
-
}, [showDrivers, mapLoaded, mapFitted])
|
|
134
|
+
}, [showDrivers, mapLoaded, mapFitted, selectedOrder, assignedOrders?.orders])
|
|
104
135
|
|
|
105
136
|
useEffect(() => {
|
|
106
137
|
if (selectedDriver) {
|
|
@@ -124,46 +155,89 @@ export const DriversLocation = (props) => {
|
|
|
124
155
|
}, [selectedDriver?.id])
|
|
125
156
|
|
|
126
157
|
return (
|
|
127
|
-
|
|
128
|
-
{
|
|
129
|
-
<
|
|
130
|
-
bootstrapURLKeys={{
|
|
131
|
-
key: window.document.getElementById('__googleMapsScriptId') ? null : googleMapsApiKey,
|
|
132
|
-
libraries: ['places', 'geometry', 'drawing', 'visualization']
|
|
133
|
-
}}
|
|
134
|
-
onGoogleApiLoaded={() => setMapLoaded(false)}
|
|
135
|
-
defaultCenter={defaultCenter}
|
|
136
|
-
center={mapCenter}
|
|
137
|
-
defaultZoom={defaultZoom}
|
|
138
|
-
zoom={mapZoom}
|
|
139
|
-
options={{ fullscreenControl: true }}
|
|
140
|
-
className='map'
|
|
141
|
-
onChange={(data) => handleMapChange(data)}
|
|
142
|
-
yesIWantToUseGoogleMapApiInternals
|
|
143
|
-
>
|
|
144
|
-
{showDrivers.length !== 0 &&
|
|
145
|
-
showDrivers.map((driver) => (
|
|
146
|
-
<DriverMapMarkerAndInfo
|
|
147
|
-
key={driver.id}
|
|
148
|
-
driver={driver}
|
|
149
|
-
lat={
|
|
150
|
-
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lat)
|
|
151
|
-
? driver.location.lat
|
|
152
|
-
: typeof driver.location === 'string'
|
|
153
|
-
? parseFloat(driver?.location?.split(',')[0].replace(/[^-.0-9]/g, ''))
|
|
154
|
-
: defaultCenter.lat
|
|
155
|
-
}
|
|
156
|
-
lng={
|
|
157
|
-
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lng)
|
|
158
|
-
? driver.location.lng
|
|
159
|
-
: typeof driver.location === 'string'
|
|
160
|
-
? parseFloat(driver?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
161
|
-
: defaultCenter.lng
|
|
162
|
-
}
|
|
163
|
-
/>
|
|
164
|
-
))}
|
|
165
|
-
</GoogleMapReact>
|
|
158
|
+
<>
|
|
159
|
+
{selectedDriver && assignedOrders?.loading && (
|
|
160
|
+
<SpinnerLoader primary />
|
|
166
161
|
)}
|
|
167
|
-
|
|
162
|
+
<WrapperMap ref={mapRef} className='drivers-location'>
|
|
163
|
+
{googleMapsApiKey && (
|
|
164
|
+
<GoogleMapReact
|
|
165
|
+
bootstrapURLKeys={{
|
|
166
|
+
key: window.document.getElementById('__googleMapsScriptId') ? null : googleMapsApiKey,
|
|
167
|
+
libraries: ['places', 'geometry', 'drawing', 'visualization']
|
|
168
|
+
}}
|
|
169
|
+
onGoogleApiLoaded={() => setMapLoaded(false)}
|
|
170
|
+
defaultCenter={defaultCenter}
|
|
171
|
+
center={mapCenter}
|
|
172
|
+
defaultZoom={defaultZoom}
|
|
173
|
+
zoom={mapZoom}
|
|
174
|
+
options={{ fullscreenControl: true }}
|
|
175
|
+
className='map'
|
|
176
|
+
onChange={(data) => handleMapChange(data)}
|
|
177
|
+
yesIWantToUseGoogleMapApiInternals
|
|
178
|
+
>
|
|
179
|
+
{showDrivers.length !== 0 &&
|
|
180
|
+
showDrivers.map((driver) => (
|
|
181
|
+
<DriverMapMarkerAndInfo
|
|
182
|
+
key={driver.id}
|
|
183
|
+
driver={driver}
|
|
184
|
+
lat={
|
|
185
|
+
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lat)
|
|
186
|
+
? driver.location.lat
|
|
187
|
+
: typeof driver.location === 'string'
|
|
188
|
+
? parseFloat(driver?.location?.split(',')[0].replace(/[^-.0-9]/g, ''))
|
|
189
|
+
: defaultCenter.lat
|
|
190
|
+
}
|
|
191
|
+
lng={
|
|
192
|
+
(driver.location !== null && typeof driver.location === 'object' && driver.location?.lng)
|
|
193
|
+
? driver.location.lng
|
|
194
|
+
: typeof driver.location === 'string'
|
|
195
|
+
? parseFloat(driver?.location?.split(',')[1].replace(/[^-.0-9]/g, ''))
|
|
196
|
+
: defaultCenter.lng
|
|
197
|
+
}
|
|
198
|
+
/>
|
|
199
|
+
))}
|
|
200
|
+
{selectedDriver && selectedOrder && (
|
|
201
|
+
<InterActOrderMarker
|
|
202
|
+
customer={selectedOrder?.customer}
|
|
203
|
+
lat={selectedOrder?.customer?.location?.lat ? selectedOrder?.customer?.location?.lat : defaultCenter.lat}
|
|
204
|
+
lng={selectedOrder?.customer?.location?.lng ? selectedOrder?.customer?.location?.lng : defaultCenter.lng}
|
|
205
|
+
image={selectedOrder?.customer?.photo}
|
|
206
|
+
/>
|
|
207
|
+
)}
|
|
208
|
+
{selectedDriver && selectedOrder && (
|
|
209
|
+
<InterActOrderMarker
|
|
210
|
+
business={selectedOrder?.business}
|
|
211
|
+
lat={selectedOrder?.business?.location?.lat}
|
|
212
|
+
lng={selectedOrder?.business?.location?.lng}
|
|
213
|
+
image={selectedOrder?.business?.logo}
|
|
214
|
+
/>
|
|
215
|
+
)}
|
|
216
|
+
{selectedDriver && assignedOrders?.orders?.length > 0 && (
|
|
217
|
+
assignedOrders.orders.map(order => (
|
|
218
|
+
<InterActOrderMarker
|
|
219
|
+
key={order.id}
|
|
220
|
+
customer={order?.customer}
|
|
221
|
+
lat={order?.customer?.location?.lat ? order?.customer?.location?.lat : defaultCenter.lat}
|
|
222
|
+
lng={order?.customer?.location?.lng ? order?.customer?.location?.lng : defaultCenter.lng}
|
|
223
|
+
image={order?.customer?.photo}
|
|
224
|
+
/>
|
|
225
|
+
))
|
|
226
|
+
)}
|
|
227
|
+
{selectedDriver && assignedOrders?.orders?.length > 0 && (
|
|
228
|
+
assignedOrders.orders.map(order => (
|
|
229
|
+
<InterActOrderMarker
|
|
230
|
+
key={order.id}
|
|
231
|
+
business={order?.business}
|
|
232
|
+
lat={order?.business?.location?.lat}
|
|
233
|
+
lng={order?.business?.location?.lng}
|
|
234
|
+
image={order?.business?.logo}
|
|
235
|
+
/>
|
|
236
|
+
))
|
|
237
|
+
)}
|
|
238
|
+
</GoogleMapReact>
|
|
239
|
+
)}
|
|
240
|
+
</WrapperMap>
|
|
241
|
+
</>
|
|
168
242
|
)
|
|
169
243
|
}
|
|
@@ -23,7 +23,9 @@ const DriversManagerUI = (props) => {
|
|
|
23
23
|
onDriverRedirect,
|
|
24
24
|
handleChangeSearch,
|
|
25
25
|
searchValue,
|
|
26
|
-
driversIsOnline
|
|
26
|
+
driversIsOnline,
|
|
27
|
+
selectedDriver,
|
|
28
|
+
setSelectedDriver
|
|
27
29
|
} = props
|
|
28
30
|
|
|
29
31
|
const { drivers, loading } = props.driversList
|
|
@@ -35,7 +37,6 @@ const DriversManagerUI = (props) => {
|
|
|
35
37
|
|
|
36
38
|
const query = new URLSearchParams(useLocation().search)
|
|
37
39
|
const [isOpenDriverOrders, setIsOpenDriverOrders] = useState(false)
|
|
38
|
-
const [selectedDriver, setSelectedDriver] = useState(null)
|
|
39
40
|
const [openDriver, setOpenDriver] = useState(null)
|
|
40
41
|
|
|
41
42
|
const handleBackRedirect = () => {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, GiftCardsList as GiftCardsListController } from 'ordering-components-admin-external'
|
|
3
4
|
import Skeleton from 'react-loading-skeleton'
|
|
4
5
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
5
6
|
import { List as MenuIcon } from 'react-bootstrap-icons'
|
|
6
7
|
import { IconButton } from '../../../styles'
|
|
7
8
|
import { Pagination, SearchBar } from '../../Shared'
|
|
9
|
+
import { addQueryToUrl } from '../../../utils'
|
|
8
10
|
|
|
9
11
|
import {
|
|
10
12
|
Container,
|
|
@@ -27,12 +29,16 @@ const GiftCardsListingUI = (props) => {
|
|
|
27
29
|
setActiveStatus,
|
|
28
30
|
getGiftCards,
|
|
29
31
|
searchValue,
|
|
30
|
-
onSearch
|
|
32
|
+
onSearch,
|
|
33
|
+
isUseQuery
|
|
31
34
|
} = props
|
|
32
35
|
|
|
33
36
|
const [, t] = useLanguage()
|
|
34
37
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
35
38
|
|
|
39
|
+
const query = new URLSearchParams(useLocation().search)
|
|
40
|
+
const defaultStatus = query.get('status')
|
|
41
|
+
|
|
36
42
|
const handleChangePage = (page) => {
|
|
37
43
|
getGiftCards(page, paginationProps.pageSize)
|
|
38
44
|
}
|
|
@@ -42,6 +48,30 @@ const GiftCardsListingUI = (props) => {
|
|
|
42
48
|
getGiftCards(expectedPage, pageSize)
|
|
43
49
|
}
|
|
44
50
|
|
|
51
|
+
const handleChangeStatus = (status) => {
|
|
52
|
+
setActiveStatus(status)
|
|
53
|
+
if (isUseQuery) {
|
|
54
|
+
addQueryToUrl({ status: status })
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
if (!isUseQuery) return
|
|
60
|
+
if (defaultStatus) {
|
|
61
|
+
setActiveStatus(defaultStatus)
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
addQueryToUrl({ status: 'pending' })
|
|
65
|
+
}, [])
|
|
66
|
+
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!isUseQuery || !paginationProps?.currentPage || !paginationProps?.pageSize || !paginationProps?.totalPages) return
|
|
69
|
+
addQueryToUrl({
|
|
70
|
+
page: paginationProps.currentPage,
|
|
71
|
+
pageSize: paginationProps.pageSize
|
|
72
|
+
})
|
|
73
|
+
}, [paginationProps?.currentPage, paginationProps?.pageSize, paginationProps?.totalPages])
|
|
74
|
+
|
|
45
75
|
return (
|
|
46
76
|
<Container>
|
|
47
77
|
<HeaderContainer>
|
|
@@ -69,13 +99,13 @@ const GiftCardsListingUI = (props) => {
|
|
|
69
99
|
<TabsWrapper>
|
|
70
100
|
<Tab
|
|
71
101
|
active={activeStatus === 'pending'}
|
|
72
|
-
onClick={() =>
|
|
102
|
+
onClick={() => handleChangeStatus('pending')}
|
|
73
103
|
>
|
|
74
104
|
{t('ORDER_PENDING', 'Pending')}
|
|
75
105
|
</Tab>
|
|
76
106
|
<Tab
|
|
77
107
|
active={activeStatus === 'activated'}
|
|
78
|
-
onClick={() =>
|
|
108
|
+
onClick={() => handleChangeStatus('activated')}
|
|
79
109
|
>
|
|
80
110
|
{t('REDEEMED', 'Redeemed')}
|
|
81
111
|
</Tab>
|
|
@@ -166,13 +196,22 @@ const GiftCardsListingUI = (props) => {
|
|
|
166
196
|
}
|
|
167
197
|
|
|
168
198
|
export const GiftCardsListing = (props) => {
|
|
199
|
+
const query = new URLSearchParams(useLocation().search)
|
|
200
|
+
const defaultStatus = query.get('status')
|
|
201
|
+
const defaultPage = query.get('page') || 1
|
|
202
|
+
const defaultPageSize = query.get('pageSize') || 10
|
|
169
203
|
const giftCardsProps = {
|
|
170
204
|
...props,
|
|
171
205
|
UIComponent: GiftCardsListingUI,
|
|
172
206
|
isSearchById: true,
|
|
173
207
|
isSearchByAuthorName: true,
|
|
174
208
|
isSearchByAuthorEmail: true,
|
|
175
|
-
isSearchByAuthorPhone: true
|
|
209
|
+
isSearchByAuthorPhone: true,
|
|
210
|
+
defaultStatus: defaultStatus,
|
|
211
|
+
paginationSettings: {
|
|
212
|
+
initialPage: Number(defaultPage),
|
|
213
|
+
pageSize: Number(defaultPageSize)
|
|
214
|
+
}
|
|
176
215
|
}
|
|
177
216
|
return <GiftCardsListController {...giftCardsProps} />
|
|
178
217
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import { useUtils, useLanguage, useSession, Messages as MessagesController } from 'ordering-components-admin-external'
|
|
4
4
|
import { useForm, Controller } from 'react-hook-form'
|
|
5
5
|
import { useTheme } from 'styled-components'
|
|
@@ -8,6 +8,7 @@ import AiOutlineInfoCircle from '@meronex/icons/ai/AiOutlineInfoCircle'
|
|
|
8
8
|
import MdcCloseOctagonOutline from '@meronex/icons/mdc/MdcCloseOctagonOutline'
|
|
9
9
|
import MdClose from '@meronex/icons/md/MdClose'
|
|
10
10
|
import { OverlayTrigger, Tooltip } from 'react-bootstrap'
|
|
11
|
+
import { addQueryToUrl } from '../../../utils'
|
|
11
12
|
|
|
12
13
|
import {
|
|
13
14
|
MessagesContainer,
|
|
@@ -83,7 +84,6 @@ export const MessagesUI = (props) => {
|
|
|
83
84
|
getHistoryComment
|
|
84
85
|
} = props
|
|
85
86
|
|
|
86
|
-
const routerHistory = useHistory()
|
|
87
87
|
const query = new URLSearchParams(useLocation().search)
|
|
88
88
|
const [, t] = useLanguage()
|
|
89
89
|
const theme = useTheme()
|
|
@@ -303,9 +303,9 @@ export const MessagesUI = (props) => {
|
|
|
303
303
|
const handleTabClick = (tab, isInitialRender) => {
|
|
304
304
|
setTabActive(tab)
|
|
305
305
|
if (!isInitialRender) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
306
|
+
addQueryToUrl({
|
|
307
|
+
tab: tab
|
|
308
|
+
})
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
|
|
@@ -39,8 +39,9 @@ export const OrderContactInformation = (props) => {
|
|
|
39
39
|
handleOpenMessages,
|
|
40
40
|
isServiceOrder,
|
|
41
41
|
handleUpdateCustomerInfo,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
setAddressState,
|
|
43
|
+
setCommentInfostate,
|
|
44
|
+
commentInfoState
|
|
44
45
|
} = props
|
|
45
46
|
|
|
46
47
|
const [, t] = useLanguage()
|
|
@@ -54,8 +55,6 @@ export const OrderContactInformation = (props) => {
|
|
|
54
55
|
const [currentCustomer, setCurrentCustomer] = useState(null)
|
|
55
56
|
const [isEdit, setIsEdit] = useState(false)
|
|
56
57
|
|
|
57
|
-
console.log(customerInfoState, 'customerInfoState')
|
|
58
|
-
|
|
59
58
|
const pastOrderStatuses = [1, 2, 5, 6, 10, 11, 12, 15, 16, 17]
|
|
60
59
|
|
|
61
60
|
const handleReviewCustomer = (customer) => {
|
|
@@ -230,6 +229,13 @@ export const OrderContactInformation = (props) => {
|
|
|
230
229
|
autoComplete='new-password'
|
|
231
230
|
countryCode={configs?.country_autocomplete?.value || '*'}
|
|
232
231
|
/>
|
|
232
|
+
<Input
|
|
233
|
+
placeholder={t('NOTES', 'Notes')}
|
|
234
|
+
defaultValue={customerInfoState?.customer?.address_notes ?? order?.customer?.address_notes ?? ''}
|
|
235
|
+
onChange={(e) => {
|
|
236
|
+
handleChangeCustomerInfoState({ address_notes: e.target.value })
|
|
237
|
+
}}
|
|
238
|
+
/>
|
|
233
239
|
{/* <ReviewWrapper>
|
|
234
240
|
<label>{t('REVIEW_FROM_DRIVER_OR_ADMIN', 'Review from driver or admin')}</label>
|
|
235
241
|
<TextArea
|
|
@@ -325,20 +331,20 @@ export const OrderContactInformation = (props) => {
|
|
|
325
331
|
/>
|
|
326
332
|
</CompanySelectorContainer>
|
|
327
333
|
)}
|
|
328
|
-
{!order?.driver_company_id && (
|
|
334
|
+
{!order?.driver_company_id && !commentInfoState?.open && (
|
|
329
335
|
<DriverSelectorContainer>
|
|
330
336
|
<p>{t('DRIVER_ASSIGN', 'Driver assign')}</p>
|
|
331
337
|
<DriverSelector
|
|
332
338
|
small
|
|
333
339
|
isPhoneView
|
|
334
|
-
defaultValue={order?.driver_id ?? 'default'}
|
|
340
|
+
defaultValue={commentInfoState?.driverId ?? order?.driver_id ?? 'default'}
|
|
335
341
|
order={order}
|
|
336
342
|
isTourOpen={isTourOpen}
|
|
337
343
|
setCurrentTourStep={setCurrentTourStep}
|
|
338
344
|
handleOpenMessages={handleOpenMessages}
|
|
339
345
|
isOrderDrivers
|
|
340
346
|
orderId={order?.id}
|
|
341
|
-
|
|
347
|
+
setCommentInfostate={setCommentInfostate}
|
|
342
348
|
/>
|
|
343
349
|
</DriverSelectorContainer>
|
|
344
350
|
)}
|
|
@@ -202,7 +202,7 @@ export const StatusBlock = (props) => {
|
|
|
202
202
|
style={{ width: inputWidth }}
|
|
203
203
|
onChange={(e) => handleMiuteChange(e)}
|
|
204
204
|
onKeyPress={(e) => {
|
|
205
|
-
if (
|
|
205
|
+
if (!/^-?\d*$/.test(e.target.value)) {
|
|
206
206
|
e.preventDefault()
|
|
207
207
|
}
|
|
208
208
|
}}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useLocation } from 'react-router-dom'
|
|
3
3
|
import Skeleton from 'react-loading-skeleton'
|
|
4
4
|
import { useLanguage, useUtils, useSession, OrderDetails as OrderDetailsController } from 'ordering-components-admin-external'
|
|
5
5
|
import { ProductItemAccordion } from '../ProductItemAccordion'
|
|
@@ -15,7 +15,7 @@ import { NotFoundSource, Modal, Alert } from '../../Shared'
|
|
|
15
15
|
import { Button, IconButton, TextArea } from '../../../styles'
|
|
16
16
|
import { OrderToPrint } from '../OrderToPrint'
|
|
17
17
|
import { OrderToPrintTicket } from '../OrderToPrintTicket'
|
|
18
|
-
import { getOrderStatuPickUp, getOrderStatus, getCurrenySymbol } from '../../../utils'
|
|
18
|
+
import { getOrderStatuPickUp, getOrderStatus, getCurrenySymbol, addQueryToUrl, removeQueryToUrl } from '../../../utils'
|
|
19
19
|
import { useForm } from 'react-hook-form'
|
|
20
20
|
|
|
21
21
|
import {
|
|
@@ -71,7 +71,6 @@ const OrderDetailsUI = (props) => {
|
|
|
71
71
|
handleSubmit,
|
|
72
72
|
formState: { errors }
|
|
73
73
|
} = useForm()
|
|
74
|
-
const history = useHistory()
|
|
75
74
|
const query = new URLSearchParams(useLocation().search)
|
|
76
75
|
const [, t] = useLanguage()
|
|
77
76
|
const { width } = useWindowSize()
|
|
@@ -87,7 +86,7 @@ const OrderDetailsUI = (props) => {
|
|
|
87
86
|
const [extraOpen, setExtraOpen] = useState(false)
|
|
88
87
|
const [isExpand, setIsExpand] = useState(false)
|
|
89
88
|
const [alertState, setAlertState] = useState({ open: false, content: [] })
|
|
90
|
-
const [
|
|
89
|
+
const [commentInfoState, setCommentInfostate] = useState({ open: false, driverId: null })
|
|
91
90
|
|
|
92
91
|
const placeSpotEnabled = [3, 4]
|
|
93
92
|
const {
|
|
@@ -156,8 +155,9 @@ const OrderDetailsUI = (props) => {
|
|
|
156
155
|
setExtraOpen(true)
|
|
157
156
|
|
|
158
157
|
if (!isInitialRender) {
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
addQueryToUrl({
|
|
159
|
+
section: option
|
|
160
|
+
})
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
|
|
@@ -267,13 +267,12 @@ const OrderDetailsUI = (props) => {
|
|
|
267
267
|
setExtraOpen(false)
|
|
268
268
|
setOpenMessages({ chat: false, history: false })
|
|
269
269
|
setShowOption(null)
|
|
270
|
-
|
|
271
|
-
history.replace(`${location.pathname}?id=${orderId}`)
|
|
270
|
+
removeQueryToUrl(['section', 'tab'])
|
|
272
271
|
}
|
|
273
272
|
|
|
274
273
|
const onSubmit = (data) => {
|
|
275
|
-
handleUpdateComment(data?.manual_driver_assignment_comment)
|
|
276
|
-
|
|
274
|
+
handleUpdateComment({ comment: data?.manual_driver_assignment_comment, driverId: commentInfoState?.driverId })
|
|
275
|
+
setCommentInfostate({ ...commentInfoState, open: false })
|
|
277
276
|
}
|
|
278
277
|
|
|
279
278
|
useEffect(() => {
|
|
@@ -342,9 +341,9 @@ const OrderDetailsUI = (props) => {
|
|
|
342
341
|
<OrderStatus isDisabled={isTourOpen && currentTourStep === 1}>
|
|
343
342
|
<div>
|
|
344
343
|
<h2>{t('ORDER_STATUS_TEXT', 'Order status')}</h2>
|
|
345
|
-
{order?.delivery_datetime_utc &&
|
|
346
|
-
|
|
347
|
-
}
|
|
344
|
+
{order?.delivery_datetime_utc && (
|
|
345
|
+
<p>{parseDate(order?.delivery_datetime_utc)}</p>
|
|
346
|
+
)}
|
|
348
347
|
{order?.delivery_datetime && (
|
|
349
348
|
<p>{parseDate(order?.delivery_datetime, { utc: false })} {`(${t('BUSINESS_TIME', 'Business time')})`}</p>
|
|
350
349
|
)}
|
|
@@ -408,7 +407,8 @@ const OrderDetailsUI = (props) => {
|
|
|
408
407
|
setCurrentTourStep={setCurrentTourStep}
|
|
409
408
|
setAddressState={setAddressState}
|
|
410
409
|
handleShowOption={handleShowOption}
|
|
411
|
-
|
|
410
|
+
setCommentInfostate={setCommentInfostate}
|
|
411
|
+
commentInfoState={commentInfoState}
|
|
412
412
|
/>
|
|
413
413
|
<OrderProducts>
|
|
414
414
|
<h2>{t('EXPORT_SUMMARY', 'Summary')}</h2>
|
|
@@ -570,9 +570,9 @@ const OrderDetailsUI = (props) => {
|
|
|
570
570
|
/>
|
|
571
571
|
<Modal
|
|
572
572
|
width='500px'
|
|
573
|
-
open={
|
|
573
|
+
open={commentInfoState?.open}
|
|
574
574
|
title={t('ORDERING', 'Ordering')}
|
|
575
|
-
onClose={() =>
|
|
575
|
+
onClose={() => setCommentInfostate({ driverId: null, open: false })}
|
|
576
576
|
>
|
|
577
577
|
<AssigmentCommentContainer onSubmit={handleSubmit(onSubmit)}>
|
|
578
578
|
<FormControl isError={errors.manual_driver_assignment_comment}>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import React from 'react'
|
|
1
|
+
import React, { useEffect } from 'react'
|
|
2
2
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
3
|
import { DragScroll } from '../../Shared'
|
|
4
4
|
import CgSpinnerTwoAlt from '@meronex/icons/cg/CgSpinnerTwoAlt'
|
|
5
|
+
import { useLocation } from 'react-router-dom'
|
|
6
|
+
import { addQueryToUrl } from '../../../utils'
|
|
5
7
|
|
|
6
8
|
import {
|
|
7
9
|
OrderStatusFilterContainer,
|
|
@@ -10,17 +12,32 @@ import {
|
|
|
10
12
|
|
|
11
13
|
export const OrderStatusFilterBar = (props) => {
|
|
12
14
|
const {
|
|
15
|
+
isUseQuery,
|
|
13
16
|
selectedOrderStatus,
|
|
14
17
|
changeOrderStatus,
|
|
15
18
|
ordersAmountByStatus
|
|
16
19
|
} = props
|
|
17
20
|
|
|
21
|
+
const [, t] = useLanguage()
|
|
22
|
+
const query = new URLSearchParams(useLocation().search)
|
|
23
|
+
const defaultStatus = query.get('status')
|
|
24
|
+
|
|
18
25
|
const changeSelectedOrderStatus = (orderStatus) => {
|
|
19
26
|
window.scrollTo(0, 0)
|
|
20
27
|
changeOrderStatus(orderStatus)
|
|
28
|
+
if (isUseQuery) {
|
|
29
|
+
addQueryToUrl({ status: orderStatus })
|
|
30
|
+
}
|
|
21
31
|
}
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if (!isUseQuery) return
|
|
35
|
+
if (defaultStatus) {
|
|
36
|
+
changeOrderStatus(defaultStatus)
|
|
37
|
+
return
|
|
38
|
+
}
|
|
39
|
+
addQueryToUrl({ status: 'pending' })
|
|
40
|
+
}, [])
|
|
24
41
|
|
|
25
42
|
return (
|
|
26
43
|
<>
|
|
@@ -6,6 +6,7 @@ import Skeleton from 'react-loading-skeleton'
|
|
|
6
6
|
import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
7
7
|
import { Pagination } from '../../Shared'
|
|
8
8
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
9
|
+
import { addQueryToUrl } from '../../../utils'
|
|
9
10
|
|
|
10
11
|
import {
|
|
11
12
|
OrdersListContainer,
|
|
@@ -34,7 +35,8 @@ export const OrdersCards = (props) => {
|
|
|
34
35
|
handleOrderCardClick,
|
|
35
36
|
handleUpdateDriverLocation,
|
|
36
37
|
slaSettingTime,
|
|
37
|
-
isDelivery
|
|
38
|
+
isDelivery,
|
|
39
|
+
isUseQuery
|
|
38
40
|
} = props
|
|
39
41
|
const [, t] = useLanguage()
|
|
40
42
|
const theme = useTheme()
|
|
@@ -159,6 +161,14 @@ export const OrdersCards = (props) => {
|
|
|
159
161
|
})
|
|
160
162
|
}, [configState.loading])
|
|
161
163
|
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (!isUseQuery || !pagination?.currentPage || !pagination?.pageSize || !pagination?.total) return
|
|
166
|
+
addQueryToUrl({
|
|
167
|
+
page: pagination.currentPage,
|
|
168
|
+
pageSize: pagination.pageSize
|
|
169
|
+
})
|
|
170
|
+
}, [pagination?.currentPage, pagination?.pageSize, pagination?.total])
|
|
171
|
+
|
|
162
172
|
return (
|
|
163
173
|
<>
|
|
164
174
|
<OrdersListContainer>
|
|
@@ -17,7 +17,9 @@ export const OrdersDashboardControls = (props) => {
|
|
|
17
17
|
handleDeleteMultiOrders,
|
|
18
18
|
handleChangeMultiOrdersStatus,
|
|
19
19
|
handleOpenCustomOrderDetail,
|
|
20
|
-
handleOpenOrderDetail
|
|
20
|
+
handleOpenOrderDetail,
|
|
21
|
+
ordersStatusGroup,
|
|
22
|
+
selectedSubOrderStatus
|
|
21
23
|
} = props
|
|
22
24
|
|
|
23
25
|
const [{ user }] = useSession()
|
|
@@ -27,7 +29,11 @@ export const OrdersDashboardControls = (props) => {
|
|
|
27
29
|
<OrderDashboardControlsContainer>
|
|
28
30
|
<InnerContnet>
|
|
29
31
|
<CreateCustomOrder handleOpenCustomOrderDetail={handleOpenCustomOrderDetail} handleOpenOrderDetail={handleOpenOrderDetail} />
|
|
30
|
-
<OrdersExportCSV
|
|
32
|
+
<OrdersExportCSV
|
|
33
|
+
filterValues={filterValues}
|
|
34
|
+
ordersStatusGroup={ordersStatusGroup}
|
|
35
|
+
selectedSubOrderStatus={selectedSubOrderStatus}
|
|
36
|
+
/>
|
|
31
37
|
{selectedOrderNumber > 0 && (
|
|
32
38
|
<>
|
|
33
39
|
{user?.level !== 5 && (
|