ordering-ui-admin-external 1.14.3 → 1.15.1
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.e2a58dcc95d6a983dfc0.js → ordering-ui-admin.7c0f4e22698e5dbd9b25.js} +2 -2
- package/_modules/components/BusinessIntelligence/BusinessReviewDetails/index.js +5 -5
- package/_modules/components/BusinessIntelligence/BusinessReviewList/index.js +29 -4
- package/_modules/components/BusinessIntelligence/InvoiceBusinessManager/index.js +16 -1
- package/_modules/components/BusinessIntelligence/InvoiceDriverManager/index.js +16 -1
- package/_modules/components/BusinessIntelligence/InvoiceManager/index.js +14 -1
- package/_modules/components/BusinessIntelligence/InvoiceOrdertype/styles.js +1 -1
- package/_modules/components/BusinessIntelligence/ProductReviewDetails/index.js +4 -3
- package/_modules/components/BusinessIntelligence/Reports/index.js +14 -1
- package/_modules/components/BusinessIntelligence/ReviewProductsListing/index.js +52 -16
- package/_modules/components/BusinessIntelligence/ReviewsListing/index.js +32 -4
- package/_modules/components/BusinessIntelligence/UserReviewDetails/index.js +4 -3
- package/_modules/components/BusinessIntelligence/UsersReviewList/index.js +35 -10
- package/_modules/components/CartRecovery/RecoveryActionDetail/index.js +21 -2
- package/_modules/components/CartRecovery/RecoveryActionListing/index.js +22 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +2 -0
- package/_modules/components/Delivery/DriversCompaniesListing/index.js +36 -13
- package/_modules/components/Delivery/DriversCompanyDetailsForm/index.js +31 -6
- package/_modules/components/Delivery/DriversGroupDetails/index.js +29 -2
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +16 -2
- package/_modules/components/Delivery/DriversGroupsListing/index.js +28 -11
- package/_modules/components/Delivery/UserDetails/index.js +24 -1
- package/_modules/components/Loyalty/GiftCardDetail/styles.js +68 -0
- package/_modules/components/Loyalty/GiftCards/index.js +23 -2
- package/_modules/components/Loyalty/PointsWalletBusinessList/index.js +26 -1
- package/_modules/components/Loyalty/PointsWalletLevels/index.js +22 -1
- package/_modules/components/Loyalty/RewardsPrograms/index.js +34 -4
- package/_modules/components/Loyalty/Wallet/index.js +20 -1
- package/_modules/components/Marketing/AdBannersListing/index.js +24 -5
- package/_modules/components/Marketing/BannerImageDetails/index.js +2 -1
- package/_modules/components/Marketing/CampaignDetail/index.js +19 -1
- package/_modules/components/Marketing/CampaignEmail/styles.js +5 -3
- package/_modules/components/Marketing/CampaignListing/index.js +19 -0
- package/_modules/components/Marketing/CampaignNotification/styles.js +5 -3
- package/_modules/components/Marketing/CampaignSMS/styles.js +5 -3
- package/_modules/components/Marketing/EnterprisePromotionGeneralDetails/index.js +2 -1
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +24 -4
- package/_modules/components/Marketing/PageBanner/index.js +27 -3
- package/_modules/components/Messages/MessagesListing/index.js +18 -1
- package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +85 -0
- package/_modules/components/MyProducts/AdvancedSettings/OrderType.js +45 -0
- package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +91 -0
- package/_modules/components/MyProducts/AdvancedSettings/index.js +626 -0
- package/_modules/components/MyProducts/AdvancedSettings/styles.js +146 -0
- package/_modules/components/MyProducts/AppLayout/index.js +9 -1
- package/_modules/components/MyProducts/AppLayout/styles.js +20 -3
- package/_modules/components/MyProducts/CallCenterApp/index.js +1 -1
- package/_modules/components/MyProducts/CustomerApp/index.js +2 -2
- package/_modules/components/MyProducts/DriverApp/index.js +2 -2
- package/_modules/components/MyProducts/KioskApp/index.js +1 -1
- package/_modules/components/MyProducts/OrderingWebsite/index.js +37 -6
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +39 -5
- package/_modules/components/MyProducts/PosApp/index.js +1 -1
- package/_modules/components/MyProducts/StoreApp/index.js +2 -2
- package/_modules/components/OrderingProducts/OrderingProductDetails/index.js +21 -1
- package/_modules/components/OrderingProducts/OrderingProductsListing/index.js +18 -1
- package/_modules/components/Orders/DeliveriesManager/index.js +0 -1
- package/_modules/components/Orders/Messages/index.js +32 -29
- package/_modules/components/Orders/OrderDetails/index.js +38 -22
- package/_modules/components/Orders/OrderDetailsHeader/index.js +2 -3
- package/_modules/components/Orders/OrdersContentHeader/index.js +2 -2
- package/_modules/components/Orders/OrdersFilterGroup/index.js +112 -9
- package/_modules/components/Orders/OrdersFilterGroup/styles.js +11 -3
- package/_modules/components/Orders/OrdersManager/index.js +0 -1
- package/_modules/components/Settings/CountriesList/index.js +27 -4
- package/_modules/components/Settings/Deliverect/index.js +23 -2
- package/_modules/components/Settings/DoordashConnect/index.js +23 -2
- package/_modules/components/Settings/DropdownOptionList/index.js +27 -4
- package/_modules/components/Settings/IntegrationListing/index.js +3 -3
- package/_modules/components/Settings/ItsaCheckmate/index.js +23 -2
- package/_modules/components/Settings/LalamoveConnect/index.js +23 -2
- package/_modules/components/Settings/PickerExpress/index.js +23 -2
- package/_modules/components/Settings/PlaceListing/index.js +40 -4
- package/_modules/components/Settings/Settings/index.js +86 -45
- package/_modules/components/Settings/SettingsDetail/index.js +14 -1
- package/_modules/components/Settings/SitesAuthSettings/index.js +17 -1
- package/_modules/components/SidebarMenu/index.js +0 -1
- package/_modules/components/Stores/BusinessAdd/BusinessDetails/index.js +4 -9
- package/_modules/components/Stores/BusinessAdd/BusinessDetails/styles.js +3 -1
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +13 -4
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/styles.js +16 -10
- package/_modules/components/Stores/BusinessAdd/PaymentMethods/index.js +11 -3
- package/_modules/components/Stores/BusinessAdd/PaymentMethods/styles.js +3 -1
- package/_modules/components/Stores/BusinessAdd/ReceiveOrders/index.js +17 -6
- package/_modules/components/Stores/BusinessAdd/ReceiveOrders/styles.js +3 -1
- package/_modules/components/Stores/BusinessAdd/index.js +38 -8
- package/_modules/components/Stores/BusinessAdd/styles.js +8 -4
- package/_modules/components/Stores/BusinessAddStore/index.js +1 -1
- package/_modules/components/Stores/BusinessBrandListing/index.js +37 -4
- package/_modules/components/Stores/BusinessDeliveryPickupMore/index.js +20 -1
- package/_modules/components/Stores/BusinessDeliveryZoneDetails/index.js +22 -1
- package/_modules/components/Stores/BusinessDeliveryZoneList/index.js +32 -4
- package/_modules/components/Stores/BusinessDetail/index.js +18 -1
- package/_modules/components/Stores/BusinessDetails/index.js +17 -1
- package/_modules/components/Stores/BusinessFrontLayout/index.js +8 -1
- package/_modules/components/Stores/BusinessFrontLayout/styles.js +5 -3
- package/_modules/components/Stores/BusinessMenu/index.js +58 -7
- package/_modules/components/Stores/BusinessMenuOptions/index.js +24 -3
- package/_modules/components/Stores/BusinessOrderingChannels/index.js +18 -2
- package/_modules/components/Stores/BusinessPaymentMethods/index.js +26 -2
- package/_modules/components/Stores/BusinessPlaceGroupList/index.js +183 -0
- package/_modules/components/Stores/BusinessPlaceGroupList/styles.js +66 -0
- package/_modules/components/Stores/BusinessProductsCategoyDetails/index.js +21 -1
- package/_modules/components/Stores/BusinessProductsListing/index.js +74 -22
- package/_modules/components/Stores/BusinessPromotionGeneralForm/index.js +2 -2
- package/_modules/components/Stores/BusinessSharedMenuProducts/index.js +29 -2
- package/_modules/components/Stores/BusinessSync/index.js +16 -1
- package/_modules/components/Stores/BusinessTypes/index.js +27 -4
- package/_modules/components/Stores/BusinessWalletsList/index.js +24 -1
- package/_modules/components/Stores/BusinessesListing/index.js +9 -1
- package/_modules/components/Stores/ImportersButton/index.js +19 -6
- package/_modules/components/Stores/PaymentOption/index.js +29 -9
- package/_modules/components/Stores/PaymentOptionMethods/index.js +23 -3
- package/_modules/components/Stores/PaymentOptionPaypal/index.js +23 -3
- package/_modules/components/Stores/PaymentOptionSquare/index.js +23 -3
- package/_modules/components/Stores/PaymentOptionStripeDirect/index.js +23 -3
- package/_modules/components/Stores/PaymethodOptionPaypalExpress/index.js +23 -3
- package/_modules/components/Stores/PaymethodOptionStripeConnect/index.js +23 -3
- package/_modules/components/Stores/PaymethodOptionStripeRedirect/index.js +23 -3
- package/_modules/components/Stores/ProductDetails/index.js +18 -1
- package/_modules/components/Stores/ProductExtras/index.js +25 -2
- package/_modules/components/Stores/ProductIngredient/index.js +23 -1
- package/_modules/components/Stores/ProductMainDetails/index.js +18 -1
- package/_modules/components/Stores/ProductTagsList/index.js +28 -2
- package/_modules/components/Users/CustomerCashWallet/index.js +22 -2
- package/_modules/components/Users/CustomerDetails/index.js +19 -1
- package/_modules/components/Users/CustomerPointsWallet/index.js +22 -2
- package/_modules/components/Users/CustomersListing/index.js +8 -3
- package/_modules/components/Users/ProfessionalDetail/index.js +25 -1
- package/_modules/components/Users/ProfessionalListing/index.js +8 -3
- package/_modules/components/Users/UserActiveStateFilter/index.js +18 -4
- package/_modules/components/Users/UserDetails/index.js +27 -1
- package/_modules/components/Users/UsersListing/index.js +8 -3
- package/package.json +2 -2
- package/src/components/BusinessIntelligence/BusinessReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/BusinessReviewList/index.js +29 -6
- package/src/components/BusinessIntelligence/InvoiceBusinessManager/index.js +17 -1
- package/src/components/BusinessIntelligence/InvoiceDriverManager/index.js +17 -1
- package/src/components/BusinessIntelligence/InvoiceManager/index.js +16 -2
- package/src/components/BusinessIntelligence/InvoiceOrdertype/styles.js +1 -0
- package/src/components/BusinessIntelligence/ProductReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/Reports/index.js +16 -2
- package/src/components/BusinessIntelligence/ReviewProductsListing/index.js +34 -6
- package/src/components/BusinessIntelligence/ReviewsListing/index.js +31 -5
- package/src/components/BusinessIntelligence/UserReviewDetails/index.js +4 -4
- package/src/components/BusinessIntelligence/UsersReviewList/index.js +32 -11
- package/src/components/CartRecovery/RecoveryActionDetail/index.js +19 -1
- package/src/components/CartRecovery/RecoveryActionListing/index.js +21 -3
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversCompaniesListing/index.js +27 -9
- package/src/components/Delivery/DriversCompanyDetailsForm/index.js +37 -8
- package/src/components/Delivery/DriversGroupDetails/index.js +36 -4
- package/src/components/Delivery/DriversGroupLogistics/index.js +18 -2
- package/src/components/Delivery/DriversGroupsListing/index.js +20 -6
- package/src/components/Delivery/UserDetails/index.js +26 -1
- package/src/components/Loyalty/GiftCardDetail/styles.js +192 -0
- package/src/components/Loyalty/GiftCards/index.js +22 -2
- package/src/components/Loyalty/PointsWalletBusinessList/index.js +24 -1
- package/src/components/Loyalty/PointsWalletLevels/index.js +21 -1
- package/src/components/Loyalty/RewardsPrograms/index.js +30 -3
- package/src/components/Loyalty/Wallet/index.js +22 -1
- package/src/components/Marketing/AdBannersListing/index.js +25 -8
- package/src/components/Marketing/BannerImageDetails/index.js +2 -1
- package/src/components/Marketing/CampaignDetail/index.js +22 -1
- package/src/components/Marketing/CampaignEmail/styles.js +3 -0
- package/src/components/Marketing/CampaignListing/index.js +18 -1
- package/src/components/Marketing/CampaignNotification/styles.js +3 -0
- package/src/components/Marketing/CampaignSMS/styles.js +3 -0
- package/src/components/Marketing/EnterprisePromotionGeneralDetails/index.js +2 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +19 -1
- package/src/components/Marketing/PageBanner/index.js +26 -3
- package/src/components/Messages/MessagesListing/index.js +17 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +64 -0
- package/src/components/MyProducts/AdvancedSettings/OrderType.js +40 -0
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +104 -0
- package/src/components/MyProducts/AdvancedSettings/index.js +541 -0
- package/src/components/MyProducts/AdvancedSettings/styles.js +388 -0
- package/src/components/MyProducts/AppLayout/index.js +19 -2
- package/src/components/MyProducts/AppLayout/styles.js +65 -0
- package/src/components/MyProducts/CallCenterApp/index.js +1 -1
- package/src/components/MyProducts/CustomerApp/index.js +2 -2
- package/src/components/MyProducts/DriverApp/index.js +2 -2
- package/src/components/MyProducts/KioskApp/index.js +1 -1
- package/src/components/MyProducts/OrderingWebsite/index.js +309 -255
- package/src/components/MyProducts/OrderingWebsite/styles.js +99 -2
- package/src/components/MyProducts/PosApp/index.js +1 -1
- package/src/components/MyProducts/StoreApp/index.js +2 -2
- package/src/components/OrderingProducts/OrderingProductDetails/index.js +24 -2
- package/src/components/OrderingProducts/OrderingProductsListing/index.js +17 -1
- package/src/components/Orders/DeliveriesManager/index.js +0 -1
- package/src/components/Orders/Messages/index.js +31 -11
- package/src/components/Orders/OrderDetails/index.js +34 -20
- package/src/components/Orders/OrderDetailsHeader/index.js +2 -3
- package/src/components/Orders/OrdersContentHeader/index.js +1 -1
- package/src/components/Orders/OrdersFilterGroup/index.js +111 -13
- package/src/components/Orders/OrdersFilterGroup/styles.js +26 -0
- package/src/components/Orders/OrdersManager/index.js +0 -1
- package/src/components/Settings/CountriesList/index.js +26 -6
- package/src/components/Settings/Deliverect/index.js +26 -2
- package/src/components/Settings/DoordashConnect/index.js +26 -2
- package/src/components/Settings/DropdownOptionList/index.js +27 -6
- package/src/components/Settings/IntegrationListing/index.js +3 -3
- package/src/components/Settings/ItsaCheckmate/index.js +26 -2
- package/src/components/Settings/LalamoveConnect/index.js +26 -2
- package/src/components/Settings/PickerExpress/index.js +26 -2
- package/src/components/Settings/PlaceListing/index.js +38 -6
- package/src/components/Settings/Settings/index.js +79 -37
- package/src/components/Settings/SettingsDetail/index.js +15 -1
- package/src/components/Settings/SitesAuthSettings/index.js +18 -1
- package/src/components/SidebarMenu/index.js +0 -2
- package/src/components/Stores/BusinessAdd/BusinessDetails/index.js +1 -10
- package/src/components/Stores/BusinessAdd/BusinessDetails/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +120 -109
- package/src/components/Stores/BusinessAdd/DeliveryZone/styles.js +22 -1
- package/src/components/Stores/BusinessAdd/PaymentMethods/index.js +8 -2
- package/src/components/Stores/BusinessAdd/PaymentMethods/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/ReceiveOrders/index.js +11 -6
- package/src/components/Stores/BusinessAdd/ReceiveOrders/styles.js +4 -0
- package/src/components/Stores/BusinessAdd/index.js +47 -16
- package/src/components/Stores/BusinessAdd/styles.js +27 -1
- package/src/components/Stores/BusinessAddStore/index.js +1 -1
- package/src/components/Stores/BusinessBrandListing/index.js +37 -4
- package/src/components/Stores/BusinessDeliveryPickupMore/index.js +22 -1
- package/src/components/Stores/BusinessDeliveryZoneDetails/index.js +25 -2
- package/src/components/Stores/BusinessDeliveryZoneList/index.js +30 -3
- package/src/components/Stores/BusinessDetail/index.js +20 -1
- package/src/components/Stores/BusinessDetails/index.js +18 -1
- package/src/components/Stores/BusinessFrontLayout/index.js +13 -1
- package/src/components/Stores/BusinessFrontLayout/styles.js +11 -0
- package/src/components/Stores/BusinessMenu/index.js +56 -11
- package/src/components/Stores/BusinessMenuOptions/index.js +28 -3
- package/src/components/Stores/BusinessOrderingChannels/index.js +19 -2
- package/src/components/Stores/BusinessPaymentMethods/index.js +24 -2
- package/src/components/Stores/BusinessPlaceGroupList/index.js +193 -0
- package/src/components/Stores/BusinessPlaceGroupList/styles.js +143 -0
- package/src/components/Stores/BusinessProductsCategoyDetails/index.js +21 -1
- package/src/components/Stores/BusinessProductsListing/index.js +49 -8
- package/src/components/Stores/BusinessPromotionGeneralForm/index.js +2 -2
- package/src/components/Stores/BusinessSharedMenuProducts/index.js +29 -3
- package/src/components/Stores/BusinessSync/index.js +18 -2
- package/src/components/Stores/BusinessTypes/index.js +26 -4
- package/src/components/Stores/BusinessWalletsList/index.js +23 -1
- package/src/components/Stores/BusinessesListing/index.js +11 -2
- package/src/components/Stores/ImportersButton/index.js +24 -3
- package/src/components/Stores/PaymentOption/index.js +29 -8
- package/src/components/Stores/PaymentOptionMethods/index.js +25 -3
- package/src/components/Stores/PaymentOptionPaypal/index.js +25 -3
- package/src/components/Stores/PaymentOptionSquare/index.js +25 -3
- package/src/components/Stores/PaymentOptionStripeDirect/index.js +25 -3
- package/src/components/Stores/PaymethodOptionPaypalExpress/index.js +25 -3
- package/src/components/Stores/PaymethodOptionStripeConnect/index.js +25 -3
- package/src/components/Stores/PaymethodOptionStripeRedirect/index.js +25 -3
- package/src/components/Stores/ProductDetails/index.js +19 -1
- package/src/components/Stores/ProductExtras/index.js +23 -2
- package/src/components/Stores/ProductIngredient/index.js +23 -2
- package/src/components/Stores/ProductMainDetails/index.js +20 -2
- package/src/components/Stores/ProductTagsList/index.js +28 -3
- package/src/components/Users/CustomerCashWallet/index.js +25 -3
- package/src/components/Users/CustomerDetails/index.js +20 -1
- package/src/components/Users/CustomerPointsWallet/index.js +25 -3
- package/src/components/Users/CustomersListing/index.js +9 -4
- package/src/components/Users/ProfessionalDetail/index.js +27 -1
- package/src/components/Users/ProfessionalListing/index.js +9 -4
- package/src/components/Users/UserActiveStateFilter/index.js +16 -3
- package/src/components/Users/UserDetails/index.js +27 -1
- package/src/components/Users/UsersListing/index.js +9 -4
- package/template/pages/BusinessProductsList/index.js +1 -1
- /package/_bundles/{ordering-ui-admin.e2a58dcc95d6a983dfc0.js.LICENSE.txt → ordering-ui-admin.7c0f4e22698e5dbd9b25.js.LICENSE.txt} +0 -0
|
@@ -51,7 +51,6 @@ var UsersListingUI = function UsersListingUI(props) {
|
|
|
51
51
|
handleSelectedUsers = props.handleSelectedUsers,
|
|
52
52
|
deleteUsersActionState = props.deleteUsersActionState,
|
|
53
53
|
handleDeleteSeveralUsers = props.handleDeleteSeveralUsers,
|
|
54
|
-
onUserRedirect = props.onUserRedirect,
|
|
55
54
|
handleSuccessUpdate = props.handleSuccessUpdate,
|
|
56
55
|
handleSuccessAddUser = props.handleSuccessAddUser,
|
|
57
56
|
handleSuccessDeleteUser = props.handleSuccessDeleteUser,
|
|
@@ -61,6 +60,7 @@ var UsersListingUI = function UsersListingUI(props) {
|
|
|
61
60
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
62
61
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
63
62
|
t = _useLanguage2[1];
|
|
63
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
64
64
|
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
65
65
|
var _useState = (0, _react.useState)(null),
|
|
66
66
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -82,10 +82,12 @@ var UsersListingUI = function UsersListingUI(props) {
|
|
|
82
82
|
setIsOpenUserDetails(false);
|
|
83
83
|
setOpenUser(null);
|
|
84
84
|
setQueryId(null);
|
|
85
|
-
|
|
85
|
+
var enabled = selectedUserActiveState ? 'active' : 'inactive';
|
|
86
|
+
history.replace("".concat(location.pathname, "?enabled=").concat(enabled));
|
|
86
87
|
};
|
|
87
88
|
var handleOpenUserDetails = function handleOpenUserDetails(user) {
|
|
88
|
-
|
|
89
|
+
var enabled = selectedUserActiveState ? 'active' : 'inactive';
|
|
90
|
+
history.replace("".concat(location.pathname, "?enabled=").concat(enabled, "&id=").concat(user === null || user === void 0 ? void 0 : user.id));
|
|
89
91
|
setOpenUser(user);
|
|
90
92
|
setOpenUserAddForm(false);
|
|
91
93
|
setIsOpenUserDetails(true);
|
|
@@ -179,7 +181,10 @@ var UsersListingUI = function UsersListingUI(props) {
|
|
|
179
181
|
})));
|
|
180
182
|
};
|
|
181
183
|
var UsersListing = function UsersListing(props) {
|
|
184
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
185
|
+
var defaultUserActiveState = query.get('enabled') !== 'inactive';
|
|
182
186
|
var usersListingProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
187
|
+
defaultUserActiveState: defaultUserActiveState,
|
|
183
188
|
UIComponent: UsersListingUI,
|
|
184
189
|
isSearchByUserEmail: true,
|
|
185
190
|
isSearchByUserPhone: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "Ordering UI Admin Components",
|
|
5
5
|
"main": "./_modules/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"lodash": "^4.17.20",
|
|
84
84
|
"moment": "^2.29.1",
|
|
85
85
|
"moment-range": "^4.0.2",
|
|
86
|
-
"ordering-components-admin-external": "1.
|
|
86
|
+
"ordering-components-admin-external": "1.15.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
|
|
26
26
|
const BusinessReviewDetailsUI = (props) => {
|
|
27
27
|
const {
|
|
28
|
-
|
|
28
|
+
businessState,
|
|
29
29
|
reviewsList,
|
|
30
30
|
handleOpenProducts,
|
|
31
31
|
handleChangeReviewEnabled
|
|
@@ -43,18 +43,18 @@ const BusinessReviewDetailsUI = (props) => {
|
|
|
43
43
|
<>
|
|
44
44
|
<ReviewDetailsContainer>
|
|
45
45
|
<Header>
|
|
46
|
-
<h1>{business?.name}</h1>
|
|
46
|
+
<h1>{businessState.business?.name}</h1>
|
|
47
47
|
<Button
|
|
48
48
|
color='lightPrimary'
|
|
49
49
|
borderRadius='8px'
|
|
50
|
-
onClick={() => handleOpenProducts(business)}
|
|
50
|
+
onClick={() => handleOpenProducts(businessState.business)}
|
|
51
51
|
>
|
|
52
52
|
{t('PRODUCT_REVIEW', 'Product review')}
|
|
53
53
|
</Button>
|
|
54
54
|
</Header>
|
|
55
55
|
<BusinessLogoContainer>
|
|
56
56
|
<WrapperImage>
|
|
57
|
-
<Image bgimage={optimizeImage(business?.logo || theme.images?.dummies?.businessLogo, 'h_120,c_limit')} />
|
|
57
|
+
<Image bgimage={optimizeImage(businessState.business?.logo || theme.images?.dummies?.businessLogo, 'h_120,c_limit')} />
|
|
58
58
|
</WrapperImage>
|
|
59
59
|
</BusinessLogoContainer>
|
|
60
60
|
{reviewsList?.loading ? (
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, useUtils, DashboardBusinessList as BusinessListController } from 'ordering-components-admin-external'
|
|
3
4
|
import Skeleton from 'react-loading-skeleton'
|
|
4
5
|
import { useTheme } from 'styled-components'
|
|
@@ -27,12 +28,16 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
27
28
|
onSearch,
|
|
28
29
|
handleOpenProducts
|
|
29
30
|
} = props
|
|
31
|
+
|
|
32
|
+
const history = useHistory()
|
|
33
|
+
const query = new URLSearchParams(useLocation().search)
|
|
30
34
|
const [, t] = useLanguage()
|
|
31
35
|
const theme = useTheme()
|
|
32
36
|
const [{ optimizeImage }] = useUtils()
|
|
33
37
|
const [confirm, setConfirm] = useState({ open: false, content: null, handleOnAccept: null })
|
|
34
38
|
const [openReview, setOpenReview] = useState(false)
|
|
35
39
|
const [curBusiness, setCurBusiness] = useState(null)
|
|
40
|
+
const [curBusinessId, setCurBusinessId] = useState(null)
|
|
36
41
|
|
|
37
42
|
const handleChangePage = (page) => {
|
|
38
43
|
getPageBusinesses(pagination.pageSize, page)
|
|
@@ -43,9 +48,14 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
43
48
|
getPageBusinesses(pageSize, expectedPage)
|
|
44
49
|
}
|
|
45
50
|
|
|
46
|
-
const handleOpenReview = (business) => {
|
|
51
|
+
const handleOpenReview = (business, isInitialRender) => {
|
|
47
52
|
setCurBusiness(business)
|
|
53
|
+
setCurBusinessId(business.id)
|
|
48
54
|
setOpenReview(true)
|
|
55
|
+
if (!isInitialRender) {
|
|
56
|
+
const tab = query.get('tab')
|
|
57
|
+
history.replace(`${location.pathname}?tab=${tab}&id=${business.id}`)
|
|
58
|
+
}
|
|
49
59
|
}
|
|
50
60
|
|
|
51
61
|
useEffect(() => {
|
|
@@ -53,6 +63,22 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
53
63
|
onSearch(parentSearchValue)
|
|
54
64
|
}, [parentSearchValue])
|
|
55
65
|
|
|
66
|
+
const handleCloseReviewDetails = () => {
|
|
67
|
+
setCurBusiness(null)
|
|
68
|
+
setOpenReview(false)
|
|
69
|
+
const tab = query.get('tab')
|
|
70
|
+
history.replace(`${location.pathname}?tab=${tab}`)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
const tab = query.get('tab')
|
|
75
|
+
const id = query.get('id')
|
|
76
|
+
if (tab === 'business' && id) {
|
|
77
|
+
setCurBusinessId(Number(id))
|
|
78
|
+
setOpenReview(true)
|
|
79
|
+
}
|
|
80
|
+
}, [])
|
|
81
|
+
|
|
56
82
|
return (
|
|
57
83
|
<>
|
|
58
84
|
<ReviewsTable>
|
|
@@ -134,15 +160,12 @@ const BusinessReviewsListingUI = (props) => {
|
|
|
134
160
|
<SideBar
|
|
135
161
|
defaultSideBarWidth={550}
|
|
136
162
|
open={openReview}
|
|
137
|
-
onClose={() =>
|
|
138
|
-
setCurBusiness(null)
|
|
139
|
-
setOpenReview(false)
|
|
140
|
-
}}
|
|
163
|
+
onClose={() => handleCloseReviewDetails()}
|
|
141
164
|
showExpandIcon
|
|
142
165
|
>
|
|
143
166
|
<BusinessReviewDetails
|
|
144
167
|
business={curBusiness}
|
|
145
|
-
businessId={
|
|
168
|
+
businessId={curBusinessId}
|
|
146
169
|
reviews={curBusiness?.reviews?.reviews}
|
|
147
170
|
handleUpdateReview={handleUpdateReview}
|
|
148
171
|
handleOpenProducts={handleOpenProducts}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, useApi, InvoiceBusinessManager as InvoiceBusinessManagerController } from 'ordering-components-admin-external'
|
|
3
4
|
import { DragScroll, SpinnerLoader } from '../../Shared'
|
|
4
5
|
import {
|
|
@@ -23,6 +24,8 @@ const InvoiceBusinessManagerUI = (props) => {
|
|
|
23
24
|
exportInvoiceList
|
|
24
25
|
} = props
|
|
25
26
|
|
|
27
|
+
const history = useHistory()
|
|
28
|
+
const query = new URLSearchParams(useLocation().search)
|
|
26
29
|
const [, t] = useLanguage()
|
|
27
30
|
const [ordering] = useApi()
|
|
28
31
|
const inputRef = useRef(null)
|
|
@@ -31,9 +34,13 @@ const InvoiceBusinessManagerUI = (props) => {
|
|
|
31
34
|
|
|
32
35
|
const [selectedDetailType, setSelectedDetailType] = useState('general')
|
|
33
36
|
|
|
34
|
-
const changeSelectedAnalyticsStatus = (detailType) => {
|
|
37
|
+
const changeSelectedAnalyticsStatus = (detailType, isInitialRender) => {
|
|
35
38
|
window.scrollTo(0, 0)
|
|
36
39
|
setSelectedDetailType(detailType)
|
|
40
|
+
if (!isInitialRender) {
|
|
41
|
+
const invoice = query.get('invoice')
|
|
42
|
+
history.replace(`${location.pathname}?invoice=${invoice}&tab=${detailType}`)
|
|
43
|
+
}
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
useEffect(() => {
|
|
@@ -42,6 +49,15 @@ const InvoiceBusinessManagerUI = (props) => {
|
|
|
42
49
|
}
|
|
43
50
|
}, [exportInvoiceList?.loading])
|
|
44
51
|
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
const tab = query.get('tab')
|
|
54
|
+
if (tab) {
|
|
55
|
+
changeSelectedAnalyticsStatus(tab, true)
|
|
56
|
+
} else {
|
|
57
|
+
changeSelectedAnalyticsStatus(selectedDetailType)
|
|
58
|
+
}
|
|
59
|
+
}, [])
|
|
60
|
+
|
|
45
61
|
return (
|
|
46
62
|
<InvoiceDriversContainer>
|
|
47
63
|
<DetailsHeader>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useRef, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, useApi, InvoiceDriverManager as InvoiceDriverManagerController } from 'ordering-components-admin-external'
|
|
3
4
|
import { DragScroll, SpinnerLoader } from '../../Shared'
|
|
4
5
|
import {
|
|
@@ -21,6 +22,8 @@ const InvoiceDriverManagerUI = (props) => {
|
|
|
21
22
|
exportInvoiceList
|
|
22
23
|
} = props
|
|
23
24
|
|
|
25
|
+
const history = useHistory()
|
|
26
|
+
const query = new URLSearchParams(useLocation().search)
|
|
24
27
|
const [, t] = useLanguage()
|
|
25
28
|
const [ordering] = useApi()
|
|
26
29
|
const [selectedDetailType, setSelectedDetailType] = useState('general')
|
|
@@ -28,9 +31,13 @@ const InvoiceDriverManagerUI = (props) => {
|
|
|
28
31
|
const submitBtnRef = useRef(null)
|
|
29
32
|
const invoicePdfRef = useRef(null)
|
|
30
33
|
|
|
31
|
-
const changeSelectedAnalyticsStatus = (detailType) => {
|
|
34
|
+
const changeSelectedAnalyticsStatus = (detailType, isInitialRender) => {
|
|
32
35
|
window.scrollTo(0, 0)
|
|
33
36
|
setSelectedDetailType(detailType)
|
|
37
|
+
if (!isInitialRender) {
|
|
38
|
+
const invoice = query.get('invoice')
|
|
39
|
+
history.replace(`${location.pathname}?invoice=${invoice}&tab=${detailType}`)
|
|
40
|
+
}
|
|
34
41
|
}
|
|
35
42
|
|
|
36
43
|
useEffect(() => {
|
|
@@ -39,6 +46,15 @@ const InvoiceDriverManagerUI = (props) => {
|
|
|
39
46
|
}
|
|
40
47
|
}, [exportInvoiceList?.loading])
|
|
41
48
|
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
const tab = query.get('tab')
|
|
51
|
+
if (tab) {
|
|
52
|
+
changeSelectedAnalyticsStatus(tab, true)
|
|
53
|
+
} else {
|
|
54
|
+
changeSelectedAnalyticsStatus(selectedDetailType)
|
|
55
|
+
}
|
|
56
|
+
}, [])
|
|
57
|
+
|
|
42
58
|
return (
|
|
43
59
|
<InvoiceDriversContainer>
|
|
44
60
|
<DetailsHeader>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
4
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
4
5
|
import { IconButton } from '../../../styles'
|
|
@@ -20,6 +21,8 @@ import {
|
|
|
20
21
|
} from './styles'
|
|
21
22
|
|
|
22
23
|
export const InvoiceManager = (props) => {
|
|
24
|
+
const history = useHistory()
|
|
25
|
+
const query = new URLSearchParams(useLocation().search)
|
|
23
26
|
const [, t] = useLanguage()
|
|
24
27
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
25
28
|
const [openInvoiceDetail, setOpenInvoiceDetail] = useState(false)
|
|
@@ -30,16 +33,27 @@ export const InvoiceManager = (props) => {
|
|
|
30
33
|
{ id: 2, key: 'driver', name: t('DRIVER_INVOICE', 'Driver invoice'), icon: <DriverIcon />, description: t('DRIVER_INVOICE_DESCRIPTION', 'Driver invoice description') }
|
|
31
34
|
]
|
|
32
35
|
|
|
33
|
-
const handleOpenInvoiceDetail = (index) => {
|
|
36
|
+
const handleOpenInvoiceDetail = (index, isInitialRender) => {
|
|
34
37
|
setOpenInvoiceDetail(true)
|
|
35
38
|
setSelectedInvoice(index)
|
|
39
|
+
if (!isInitialRender) {
|
|
40
|
+
history.replace(`${location.pathname}?invoice=${index}`)
|
|
41
|
+
}
|
|
36
42
|
}
|
|
37
43
|
|
|
38
44
|
const handleCloseInvoiceDetail = () => {
|
|
39
45
|
setOpenInvoiceDetail(false)
|
|
40
46
|
setSelectedInvoice(null)
|
|
47
|
+
history.replace(`${location.pathname}`)
|
|
41
48
|
}
|
|
42
49
|
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
const invoice = query.get('invoice')
|
|
52
|
+
if (invoice) {
|
|
53
|
+
handleOpenInvoiceDetail(invoice, true)
|
|
54
|
+
}
|
|
55
|
+
}, [])
|
|
56
|
+
|
|
43
57
|
return (
|
|
44
58
|
<>
|
|
45
59
|
<InvoiceManagerContainer>
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
|
|
19
19
|
const ProductReviewDetailsUI = (props) => {
|
|
20
20
|
const {
|
|
21
|
-
|
|
21
|
+
productState,
|
|
22
22
|
productReviewList
|
|
23
23
|
} = props
|
|
24
24
|
|
|
@@ -29,12 +29,12 @@ const ProductReviewDetailsUI = (props) => {
|
|
|
29
29
|
<>
|
|
30
30
|
<ReviewDetailsContainer>
|
|
31
31
|
<Header>
|
|
32
|
-
<h1>{product?.name}</h1>
|
|
32
|
+
<h1>{productState.product?.name}</h1>
|
|
33
33
|
</Header>
|
|
34
34
|
<ProductImageContainer>
|
|
35
35
|
<WrapperImage>
|
|
36
|
-
{product?.images ? (
|
|
37
|
-
<Image bgimage={optimizeImage(product?.images, 'h_120,c_limit')} />
|
|
36
|
+
{productState.product?.images ? (
|
|
37
|
+
<Image bgimage={optimizeImage(productState.product?.images, 'h_120,c_limit')} />
|
|
38
38
|
) : (
|
|
39
39
|
<ImageFill />
|
|
40
40
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
3
4
|
import { IconButton } from '../../../styles'
|
|
4
5
|
import { useWindowSize } from '../../../hooks/useWindowSize'
|
|
@@ -56,6 +57,8 @@ import {
|
|
|
56
57
|
} from './styles'
|
|
57
58
|
|
|
58
59
|
export const Reports = (props) => {
|
|
60
|
+
const history = useHistory()
|
|
61
|
+
const query = new URLSearchParams(useLocation().search)
|
|
59
62
|
const [, t] = useLanguage()
|
|
60
63
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
61
64
|
const [isOpen, setIsOpen] = useState(false)
|
|
@@ -89,13 +92,24 @@ export const Reports = (props) => {
|
|
|
89
92
|
const handleCloseSidebar = () => {
|
|
90
93
|
setIsOpen(false)
|
|
91
94
|
setSelectedReport(0)
|
|
95
|
+
history.replace(`${location.pathname}`)
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
const handleOpenSlider = (index) => {
|
|
98
|
+
const handleOpenSlider = (index, isInitialRender) => {
|
|
95
99
|
setSelectedReport(index)
|
|
96
100
|
setIsOpen(true)
|
|
101
|
+
if (!isInitialRender) {
|
|
102
|
+
history.replace(`${location.pathname}?id=${index}`)
|
|
103
|
+
}
|
|
97
104
|
}
|
|
98
105
|
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
const id = query.get('id')
|
|
108
|
+
if (id) {
|
|
109
|
+
handleOpenSlider(Number(id), true)
|
|
110
|
+
}
|
|
111
|
+
}, [])
|
|
112
|
+
|
|
99
113
|
return (
|
|
100
114
|
<ReportsContainer>
|
|
101
115
|
<HeaderTitleContainer>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage, useUtils, ReviewProductList as ReviewProductListController } from 'ordering-components-admin-external'
|
|
3
4
|
import { ImageFill, StarFill } from 'react-bootstrap-icons'
|
|
4
5
|
import Skeleton from 'react-loading-skeleton'
|
|
@@ -25,11 +26,15 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
25
26
|
businessId
|
|
26
27
|
} = props
|
|
27
28
|
|
|
29
|
+
const history = useHistory()
|
|
30
|
+
const query = new URLSearchParams(useLocation().search)
|
|
28
31
|
const [, t] = useLanguage()
|
|
29
32
|
const [{ optimizeImage }] = useUtils()
|
|
30
33
|
|
|
31
34
|
const [openReview, setOpenReview] = useState(false)
|
|
32
35
|
const [curProduct, setCurProduct] = useState(null)
|
|
36
|
+
const [curProductId, setCurProductId] = useState(null)
|
|
37
|
+
const [curCategoryId, setCurCategoryId] = useState(null)
|
|
33
38
|
|
|
34
39
|
const [currentPage, setCurrentPage] = useState(1)
|
|
35
40
|
const [productsPerPage, setProductsPerPage] = useState(10)
|
|
@@ -59,9 +64,24 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
59
64
|
setCurrentProducts(_currentProducts)
|
|
60
65
|
}, [productState, currentPage, productsPerPage])
|
|
61
66
|
|
|
62
|
-
const handleOpenReview = (product) => {
|
|
67
|
+
const handleOpenReview = (product, isInitialRender) => {
|
|
63
68
|
setCurProduct(product)
|
|
69
|
+
setCurProductId(product?.id)
|
|
70
|
+
setCurCategoryId(product?.category?.id)
|
|
64
71
|
setOpenReview(true)
|
|
72
|
+
if (!isInitialRender) {
|
|
73
|
+
const tab = query.get('tab')
|
|
74
|
+
const business = query.get('business')
|
|
75
|
+
history.replace(`${location.pathname}?tab=${tab}&business=${business}&category=${product?.category?.id}&product=${product.id}`)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const handleCloseReviewDetails = () => {
|
|
80
|
+
setCurProduct(null)
|
|
81
|
+
setOpenReview(false)
|
|
82
|
+
const tab = query.get('tab')
|
|
83
|
+
const business = query.get('business')
|
|
84
|
+
history.replace(`${location.pathname}?tab=${tab}&business=${business}`)
|
|
65
85
|
}
|
|
66
86
|
|
|
67
87
|
useEffect(() => {
|
|
@@ -72,6 +92,16 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
72
92
|
handleChangeSearch(parentSearchValue)
|
|
73
93
|
}, [parentSearchValue])
|
|
74
94
|
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
const category = query.get('category')
|
|
97
|
+
const product = query.get('product')
|
|
98
|
+
if (category && product) {
|
|
99
|
+
setCurCategoryId(Number(category))
|
|
100
|
+
setCurProductId(Number(product))
|
|
101
|
+
setOpenReview(true)
|
|
102
|
+
}
|
|
103
|
+
}, [])
|
|
104
|
+
|
|
75
105
|
return (
|
|
76
106
|
<>
|
|
77
107
|
<ReviewsListingContainer>
|
|
@@ -154,15 +184,13 @@ export const ReviewProductsListingUI = (props) => {
|
|
|
154
184
|
sidebarId='review-details'
|
|
155
185
|
defaultSideBarWidth={550}
|
|
156
186
|
open={openReview}
|
|
157
|
-
onClose={() =>
|
|
158
|
-
setCurProduct(null)
|
|
159
|
-
setOpenReview(false)
|
|
160
|
-
}}
|
|
187
|
+
onClose={() => handleCloseReviewDetails()}
|
|
161
188
|
>
|
|
162
189
|
<ProductReviewDetails
|
|
163
190
|
businessId={businessId}
|
|
164
191
|
product={curProduct}
|
|
165
|
-
productId={
|
|
192
|
+
productId={curProductId}
|
|
193
|
+
categoryId={curCategoryId}
|
|
166
194
|
/>
|
|
167
195
|
</SideBar>
|
|
168
196
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React, { useState } from 'react'
|
|
1
|
+
import React, { useEffect, useState } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import { useLanguage } from 'ordering-components-admin-external'
|
|
3
4
|
import { useInfoShare } from '../../../contexts/InfoShareContext'
|
|
4
5
|
import { List as MenuIcon, CaretDownFill } from 'react-bootstrap-icons'
|
|
@@ -21,21 +22,30 @@ import {
|
|
|
21
22
|
} from './styles'
|
|
22
23
|
|
|
23
24
|
export const ReviewsListing = (props) => {
|
|
25
|
+
const history = useHistory()
|
|
26
|
+
const query = new URLSearchParams(useLocation().search)
|
|
24
27
|
const [, t] = useLanguage()
|
|
25
28
|
const [{ isCollapse }, { handleMenuCollapse }] = useInfoShare()
|
|
26
29
|
const [showOption, setShowOption] = useState('business')
|
|
27
30
|
const [searchValue, setSearchValue] = useState(null)
|
|
28
31
|
const [showSelect, setShowSelect] = useState(false)
|
|
29
32
|
const [business, setBusiness] = useState('')
|
|
33
|
+
const [businessId, setBusinessId] = useState(null)
|
|
30
34
|
|
|
31
35
|
const changeBusinessState = (business) => {
|
|
32
36
|
setShowSelect(false)
|
|
33
37
|
setBusiness(business)
|
|
38
|
+
setBusinessId(business.id)
|
|
39
|
+
const tab = query.get('tab')
|
|
40
|
+
history.replace(`${location.pathname}?tab=${tab}&business=${business.id}`)
|
|
34
41
|
}
|
|
35
42
|
|
|
36
|
-
const handleChangeOption = (option) => {
|
|
43
|
+
const handleChangeOption = (option, isInitialRender) => {
|
|
37
44
|
setShowOption(option)
|
|
38
|
-
if (option === 'products' && !
|
|
45
|
+
if (option === 'products' && !businessId) setShowSelect(true)
|
|
46
|
+
if (!isInitialRender) {
|
|
47
|
+
history.replace(`${location.pathname}?tab=${option}`)
|
|
48
|
+
}
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
const handleOpenProducts = (business) => {
|
|
@@ -44,6 +54,22 @@ export const ReviewsListing = (props) => {
|
|
|
44
54
|
setShowSelect(false)
|
|
45
55
|
}
|
|
46
56
|
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
const tab = query.get('tab')
|
|
59
|
+
if (tab) {
|
|
60
|
+
const businessId = query.get('business')
|
|
61
|
+
if (tab === 'products' && businessId) {
|
|
62
|
+
setShowOption('products')
|
|
63
|
+
setShowSelect(false)
|
|
64
|
+
setBusinessId(Number(businessId))
|
|
65
|
+
} else {
|
|
66
|
+
handleChangeOption(tab, true)
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
handleChangeOption(showOption)
|
|
70
|
+
}
|
|
71
|
+
}, [])
|
|
72
|
+
|
|
47
73
|
return (
|
|
48
74
|
<>
|
|
49
75
|
<ReviewsListingContainer>
|
|
@@ -138,10 +164,10 @@ export const ReviewsListing = (props) => {
|
|
|
138
164
|
parentSearchValue={searchValue}
|
|
139
165
|
/>
|
|
140
166
|
)}
|
|
141
|
-
{showOption === 'products' &&
|
|
167
|
+
{showOption === 'products' && businessId && (
|
|
142
168
|
<ReviewProductsListing
|
|
143
169
|
parentSearchValue={searchValue}
|
|
144
|
-
businessId={
|
|
170
|
+
businessId={businessId}
|
|
145
171
|
/>
|
|
146
172
|
)}
|
|
147
173
|
</ReviewsListingContainer>
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
|
|
21
21
|
const UserReviewDetailsUI = (props) => {
|
|
22
22
|
const {
|
|
23
|
-
|
|
23
|
+
userState,
|
|
24
24
|
userReviewState
|
|
25
25
|
} = props
|
|
26
26
|
|
|
@@ -48,12 +48,12 @@ const UserReviewDetailsUI = (props) => {
|
|
|
48
48
|
<>
|
|
49
49
|
<ReviewDetailsContainer>
|
|
50
50
|
<Header>
|
|
51
|
-
<h1>{
|
|
51
|
+
<h1>{userState.user?.name} {userState.user?.lastname}</h1>
|
|
52
52
|
</Header>
|
|
53
53
|
<DriverPhotoContainer>
|
|
54
54
|
<WrapperImage>
|
|
55
|
-
{
|
|
56
|
-
<Image bgimage={optimizeImage(
|
|
55
|
+
{userState.user?.photo ? (
|
|
56
|
+
<Image bgimage={optimizeImage(userState.user?.photo, 'w_120,c_limit')} />
|
|
57
57
|
) : (
|
|
58
58
|
<PersonFill />
|
|
59
59
|
)}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { useHistory, useLocation } from 'react-router-dom'
|
|
2
3
|
import {
|
|
3
4
|
useLanguage,
|
|
4
5
|
useUtils,
|
|
@@ -30,11 +31,14 @@ const DriversReviewListUI = (props) => {
|
|
|
30
31
|
defaultUserTypesSelected
|
|
31
32
|
} = props
|
|
32
33
|
|
|
34
|
+
const history = useHistory()
|
|
35
|
+
const query = new URLSearchParams(useLocation().search)
|
|
33
36
|
const [, t] = useLanguage()
|
|
34
37
|
const [{ optimizeImage, parseNumber }] = useUtils()
|
|
35
38
|
|
|
36
39
|
const [openReview, setOpenReview] = useState(false)
|
|
37
|
-
const [
|
|
40
|
+
const [curUser, setCurUser] = useState(null)
|
|
41
|
+
const [curUserId, setCurUserId] = useState(null)
|
|
38
42
|
const headerTitle = defaultUserTypesSelected.length === 1 && defaultUserTypesSelected[0] === 3 ? t('CUSTOMER', 'Customer') : defaultUserTypesSelected[0] === 8 ? t('PROFESSIONAL', 'Professional') : t('DRIVER', 'Driver')
|
|
39
43
|
|
|
40
44
|
const handleChangePage = (page) => {
|
|
@@ -52,16 +56,36 @@ const DriversReviewListUI = (props) => {
|
|
|
52
56
|
}, [parentSearchValue])
|
|
53
57
|
|
|
54
58
|
const handleOpenReview = (user) => {
|
|
55
|
-
|
|
59
|
+
setCurUser(user)
|
|
60
|
+
setCurUserId(user.id)
|
|
56
61
|
setOpenReview(true)
|
|
57
62
|
}
|
|
58
63
|
|
|
59
|
-
const handleClickReview = (e, user) => {
|
|
60
|
-
const isInvalid = e
|
|
64
|
+
const handleClickReview = (e, user, isInitialRender) => {
|
|
65
|
+
const isInvalid = e?.target?.closest('.review-enabled') || e.target.closest('.review-actions')
|
|
61
66
|
if (isInvalid) return
|
|
62
67
|
handleOpenReview(user)
|
|
68
|
+
if (!isInitialRender) {
|
|
69
|
+
const tab = query.get('tab')
|
|
70
|
+
history.replace(`${location.pathname}?tab=${tab}&id=${user.id}`)
|
|
71
|
+
}
|
|
63
72
|
}
|
|
64
73
|
|
|
74
|
+
const handleCloseReviewDetails = () => {
|
|
75
|
+
setCurUser(null)
|
|
76
|
+
setOpenReview(false)
|
|
77
|
+
const tab = query.get('tab')
|
|
78
|
+
history.replace(`${location.pathname}?tab=${tab}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
useEffect(() => {
|
|
82
|
+
const id = query.get('id')
|
|
83
|
+
if (id) {
|
|
84
|
+
setCurUserId(Number(id))
|
|
85
|
+
setOpenReview(true)
|
|
86
|
+
}
|
|
87
|
+
}, [])
|
|
88
|
+
|
|
65
89
|
return (
|
|
66
90
|
<>
|
|
67
91
|
<ReviewsTable>
|
|
@@ -94,7 +118,7 @@ const DriversReviewListUI = (props) => {
|
|
|
94
118
|
usersList.users.map(user => (
|
|
95
119
|
<ReviewTbody
|
|
96
120
|
key={user.id}
|
|
97
|
-
active={user.id ===
|
|
121
|
+
active={user.id === curUser?.id}
|
|
98
122
|
onClick={e => handleClickReview(e, user)}
|
|
99
123
|
>
|
|
100
124
|
<tr>
|
|
@@ -144,15 +168,12 @@ const DriversReviewListUI = (props) => {
|
|
|
144
168
|
sidebarId='driver-review-details'
|
|
145
169
|
defaultSideBarWidth={550}
|
|
146
170
|
open={openReview}
|
|
147
|
-
onClose={() =>
|
|
148
|
-
setCurDriver(null)
|
|
149
|
-
setOpenReview(false)
|
|
150
|
-
}}
|
|
171
|
+
onClose={() => handleCloseReviewDetails()}
|
|
151
172
|
showExpandIcon
|
|
152
173
|
>
|
|
153
174
|
<UserReviewDetails
|
|
154
|
-
userId={
|
|
155
|
-
|
|
175
|
+
userId={curUserId}
|
|
176
|
+
user={curUser}
|
|
156
177
|
/>
|
|
157
178
|
</SideBar>
|
|
158
179
|
)}
|