ordering-ui-admin-external 1.15.0 → 1.15.2
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.761f3d55438faf70811d.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 +13 -5
- package/_modules/components/Delivery/DriversCompaniesListing/index.js +36 -13
- package/_modules/components/Delivery/DriversCompanyDetailsForm/index.js +31 -6
- package/_modules/components/Delivery/DriversGroupBusinesses/index.js +4 -2
- package/_modules/components/Delivery/DriversGroupBusinesses/styles.js +17 -14
- package/_modules/components/Delivery/DriversGroupDeliveryDetails/index.js +5 -2
- package/_modules/components/Delivery/DriversGroupDeliveryDetails/styles.js +9 -4
- package/_modules/components/Delivery/DriversGroupDetails/index.js +35 -5
- package/_modules/components/Delivery/DriversGroupGeneralForm/index.js +3 -1
- package/_modules/components/Delivery/DriversGroupGeneralForm/styles.js +8 -5
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +21 -4
- package/_modules/components/Delivery/DriversGroupLogistics/styles.js +16 -13
- package/_modules/components/Delivery/DriversGroupLogs/index.js +8 -4
- package/_modules/components/Delivery/DriversGroupLogs/styles.js +19 -16
- package/_modules/components/Delivery/DriversGroupPaymethods/index.js +5 -2
- package/_modules/components/Delivery/DriversGroupPaymethods/styles.js +14 -11
- package/_modules/components/Delivery/DriversGroupsList/index.js +5 -2
- package/_modules/components/Delivery/DriversGroupsList/styles.js +5 -2
- package/_modules/components/Delivery/DriversGroupsListing/index.js +37 -16
- package/_modules/components/Delivery/UserAddForm/index.js +29 -3
- package/_modules/components/Delivery/UserAddForm/styles.js +21 -3
- package/_modules/components/Delivery/UserDetails/index.js +33 -5
- package/_modules/components/Delivery/UsersList/index.js +6 -3
- package/_modules/components/Delivery/UsersList/styles.js +10 -7
- package/_modules/components/Delivery/UsersListingHeader/index.js +8 -4
- 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/UsersDeleteButton/index.js +3 -2
- package/_modules/components/Users/UsersExportCSV/index.js +3 -2
- package/_modules/components/Users/UsersListing/index.js +8 -3
- package/package.json +2 -2
- package/src/components/Delivery/DeliveryUsersListing/index.js +7 -2
- package/src/components/Delivery/DriversGroupBusinesses/index.js +3 -1
- package/src/components/Delivery/DriversGroupBusinesses/styles.js +4 -0
- package/src/components/Delivery/DriversGroupDeliveryDetails/index.js +5 -2
- package/src/components/Delivery/DriversGroupDeliveryDetails/styles.js +5 -1
- package/src/components/Delivery/DriversGroupDetails/index.js +4 -1
- package/src/components/Delivery/DriversGroupGeneralForm/index.js +2 -1
- package/src/components/Delivery/DriversGroupGeneralForm/styles.js +4 -0
- package/src/components/Delivery/DriversGroupLogistics/index.js +5 -2
- package/src/components/Delivery/DriversGroupLogistics/styles.js +4 -0
- package/src/components/Delivery/DriversGroupLogs/index.js +6 -3
- package/src/components/Delivery/DriversGroupLogs/styles.js +4 -0
- package/src/components/Delivery/DriversGroupPaymethods/index.js +5 -2
- package/src/components/Delivery/DriversGroupPaymethods/styles.js +4 -0
- package/src/components/Delivery/DriversGroupsList/index.js +4 -1
- package/src/components/Delivery/DriversGroupsList/styles.js +6 -0
- package/src/components/Delivery/DriversGroupsListing/index.js +6 -2
- package/src/components/Delivery/UserAddForm/index.js +42 -3
- package/src/components/Delivery/UserAddForm/styles.js +34 -0
- package/src/components/Delivery/UserDetails/index.js +6 -4
- package/src/components/Delivery/UsersList/index.js +8 -3
- package/src/components/Delivery/UsersList/styles.js +5 -0
- package/src/components/Delivery/UsersListingHeader/index.js +5 -1
- package/src/components/Users/UsersDeleteButton/index.js +3 -2
- package/src/components/Users/UsersExportCSV/index.js +3 -2
- /package/_bundles/{ordering-ui-admin.e2a58dcc95d6a983dfc0.js.LICENSE.txt → ordering-ui-admin.761f3d55438faf70811d.js.LICENSE.txt} +0 -0
|
@@ -29,8 +29,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
29
29
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
30
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
31
|
var BusinessReviewDetailsUI = function BusinessReviewDetailsUI(props) {
|
|
32
|
-
var _theme$images, _theme$images$dummies;
|
|
33
|
-
var
|
|
32
|
+
var _businessState$busine, _businessState$busine2, _theme$images, _theme$images$dummies;
|
|
33
|
+
var businessState = props.businessState,
|
|
34
34
|
reviewsList = props.reviewsList,
|
|
35
35
|
handleOpenProducts = props.handleOpenProducts,
|
|
36
36
|
handleChangeReviewEnabled = props.handleChangeReviewEnabled;
|
|
@@ -46,14 +46,14 @@ var BusinessReviewDetailsUI = function BusinessReviewDetailsUI(props) {
|
|
|
46
46
|
var getReviewPercent = function getReviewPercent(quality) {
|
|
47
47
|
return quality / 5 * 100;
|
|
48
48
|
};
|
|
49
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, business === null ||
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, (_businessState$busine = businessState.business) === null || _businessState$busine === void 0 ? void 0 : _businessState$busine.name), /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
50
50
|
color: "lightPrimary",
|
|
51
51
|
borderRadius: "8px",
|
|
52
52
|
onClick: function onClick() {
|
|
53
|
-
return handleOpenProducts(business);
|
|
53
|
+
return handleOpenProducts(businessState.business);
|
|
54
54
|
}
|
|
55
55
|
}, t('PRODUCT_REVIEW', 'Product review'))), /*#__PURE__*/_react.default.createElement(_styles2.BusinessLogoContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.WrapperImage, null, /*#__PURE__*/_react.default.createElement(_styles2.Image, {
|
|
56
|
-
bgimage: optimizeImage((business === null ||
|
|
56
|
+
bgimage: optimizeImage(((_businessState$busine2 = businessState.business) === null || _businessState$busine2 === void 0 ? void 0 : _businessState$busine2.logo) || ((_theme$images = theme.images) === null || _theme$images === void 0 ? void 0 : (_theme$images$dummies = _theme$images.dummies) === null || _theme$images$dummies === void 0 ? void 0 : _theme$images$dummies.businessLogo), 'h_120,c_limit')
|
|
57
57
|
}))), reviewsList !== null && reviewsList !== void 0 && reviewsList.loading ? _toConsumableArray(Array(10).keys()).map(function (i) {
|
|
58
58
|
return /*#__PURE__*/_react.default.createElement(_styles2.ReviewItemContatiner, {
|
|
59
59
|
key: i
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.BusinessReviewList = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
11
12
|
var _styledComponents = require("styled-components");
|
|
@@ -40,6 +41,8 @@ var BusinessReviewsListingUI = function BusinessReviewsListingUI(props) {
|
|
|
40
41
|
handleUpdateReview = props.handleUpdateReview,
|
|
41
42
|
onSearch = props.onSearch,
|
|
42
43
|
handleOpenProducts = props.handleOpenProducts;
|
|
44
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
45
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
43
46
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
44
47
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
45
48
|
t = _useLanguage2[1];
|
|
@@ -63,6 +66,10 @@ var BusinessReviewsListingUI = function BusinessReviewsListingUI(props) {
|
|
|
63
66
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
64
67
|
curBusiness = _useState6[0],
|
|
65
68
|
setCurBusiness = _useState6[1];
|
|
69
|
+
var _useState7 = (0, _react.useState)(null),
|
|
70
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
71
|
+
curBusinessId = _useState8[0],
|
|
72
|
+
setCurBusinessId = _useState8[1];
|
|
66
73
|
var handleChangePage = function handleChangePage(page) {
|
|
67
74
|
getPageBusinesses(pagination.pageSize, page);
|
|
68
75
|
};
|
|
@@ -70,14 +77,33 @@ var BusinessReviewsListingUI = function BusinessReviewsListingUI(props) {
|
|
|
70
77
|
var expectedPage = Math.ceil(pagination.from / pageSize);
|
|
71
78
|
getPageBusinesses(pageSize, expectedPage);
|
|
72
79
|
};
|
|
73
|
-
var handleOpenReview = function handleOpenReview(business) {
|
|
80
|
+
var handleOpenReview = function handleOpenReview(business, isInitialRender) {
|
|
74
81
|
setCurBusiness(business);
|
|
82
|
+
setCurBusinessId(business.id);
|
|
75
83
|
setOpenReview(true);
|
|
84
|
+
if (!isInitialRender) {
|
|
85
|
+
var tab = query.get('tab');
|
|
86
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab, "&id=").concat(business.id));
|
|
87
|
+
}
|
|
76
88
|
};
|
|
77
89
|
(0, _react.useEffect)(function () {
|
|
78
90
|
if (parentSearchValue === null) return;
|
|
79
91
|
onSearch(parentSearchValue);
|
|
80
92
|
}, [parentSearchValue]);
|
|
93
|
+
var handleCloseReviewDetails = function handleCloseReviewDetails() {
|
|
94
|
+
setCurBusiness(null);
|
|
95
|
+
setOpenReview(false);
|
|
96
|
+
var tab = query.get('tab');
|
|
97
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab));
|
|
98
|
+
};
|
|
99
|
+
(0, _react.useEffect)(function () {
|
|
100
|
+
var tab = query.get('tab');
|
|
101
|
+
var id = query.get('id');
|
|
102
|
+
if (tab === 'business' && id) {
|
|
103
|
+
setCurBusinessId(Number(id));
|
|
104
|
+
setOpenReview(true);
|
|
105
|
+
}
|
|
106
|
+
}, []);
|
|
81
107
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewsTable, null, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewObject, {
|
|
82
108
|
isHeader: true
|
|
83
109
|
}, t('BUSINESS', 'Business'))), /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewMarkerWrapper, {
|
|
@@ -120,13 +146,12 @@ var BusinessReviewsListingUI = function BusinessReviewsListingUI(props) {
|
|
|
120
146
|
defaultSideBarWidth: 550,
|
|
121
147
|
open: openReview,
|
|
122
148
|
onClose: function onClose() {
|
|
123
|
-
|
|
124
|
-
setOpenReview(false);
|
|
149
|
+
return handleCloseReviewDetails();
|
|
125
150
|
},
|
|
126
151
|
showExpandIcon: true
|
|
127
152
|
}, /*#__PURE__*/_react.default.createElement(_BusinessReviewDetails.BusinessReviewDetails, {
|
|
128
153
|
business: curBusiness,
|
|
129
|
-
businessId:
|
|
154
|
+
businessId: curBusinessId,
|
|
130
155
|
reviews: curBusiness === null || curBusiness === void 0 ? void 0 : (_curBusiness$reviews = curBusiness.reviews) === null || _curBusiness$reviews === void 0 ? void 0 : _curBusiness$reviews.reviews,
|
|
131
156
|
handleUpdateReview: handleUpdateReview,
|
|
132
157
|
handleOpenProducts: handleOpenProducts
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.InvoiceBusinessManager = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _Shared = require("../../Shared");
|
|
11
12
|
var _styles = require("./styles");
|
|
@@ -30,6 +31,8 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
30
31
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
31
32
|
var InvoiceBusinessManagerUI = function InvoiceBusinessManagerUI(props) {
|
|
32
33
|
var exportInvoiceList = props.exportInvoiceList;
|
|
34
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
35
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
33
36
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
34
37
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
35
38
|
t = _useLanguage2[1];
|
|
@@ -43,15 +46,27 @@ var InvoiceBusinessManagerUI = function InvoiceBusinessManagerUI(props) {
|
|
|
43
46
|
_useState2 = _slicedToArray(_useState, 2),
|
|
44
47
|
selectedDetailType = _useState2[0],
|
|
45
48
|
setSelectedDetailType = _useState2[1];
|
|
46
|
-
var changeSelectedAnalyticsStatus = function changeSelectedAnalyticsStatus(detailType) {
|
|
49
|
+
var changeSelectedAnalyticsStatus = function changeSelectedAnalyticsStatus(detailType, isInitialRender) {
|
|
47
50
|
window.scrollTo(0, 0);
|
|
48
51
|
setSelectedDetailType(detailType);
|
|
52
|
+
if (!isInitialRender) {
|
|
53
|
+
var invoice = query.get('invoice');
|
|
54
|
+
history.replace("".concat(location.pathname, "?invoice=").concat(invoice, "&tab=").concat(detailType));
|
|
55
|
+
}
|
|
49
56
|
};
|
|
50
57
|
(0, _react.useEffect)(function () {
|
|
51
58
|
if (!(exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.loading) && exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.invoice) {
|
|
52
59
|
inputRef.current.value = invoicePdfRef === null || invoicePdfRef === void 0 ? void 0 : invoicePdfRef.current.innerHTML;
|
|
53
60
|
}
|
|
54
61
|
}, [exportInvoiceList === null || exportInvoiceList === void 0 ? void 0 : exportInvoiceList.loading]);
|
|
62
|
+
(0, _react.useEffect)(function () {
|
|
63
|
+
var tab = query.get('tab');
|
|
64
|
+
if (tab) {
|
|
65
|
+
changeSelectedAnalyticsStatus(tab, true);
|
|
66
|
+
} else {
|
|
67
|
+
changeSelectedAnalyticsStatus(selectedDetailType);
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
55
70
|
return /*#__PURE__*/_react.default.createElement(_styles.InvoiceDriversContainer, null, /*#__PURE__*/_react.default.createElement(_styles.DetailsHeader, null, /*#__PURE__*/_react.default.createElement("h2", null, t('BUSINESS_INVOICE', 'Business invoice')), /*#__PURE__*/_react.default.createElement(_styles2.IconButton, {
|
|
56
71
|
color: "black",
|
|
57
72
|
disabled: (exportInvoiceList === null || exportInvoiceList === void 0 ? void 0 : exportInvoiceList.loading) || !(exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.invoice),
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.InvoiceDriverManager = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _Shared = require("../../Shared");
|
|
11
12
|
var _styles = require("./styles");
|
|
@@ -29,6 +30,8 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
29
30
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
31
|
var InvoiceDriverManagerUI = function InvoiceDriverManagerUI(props) {
|
|
31
32
|
var exportInvoiceList = props.exportInvoiceList;
|
|
33
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
34
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
32
35
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
33
36
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
34
37
|
t = _useLanguage2[1];
|
|
@@ -42,15 +45,27 @@ var InvoiceDriverManagerUI = function InvoiceDriverManagerUI(props) {
|
|
|
42
45
|
var inputRef = (0, _react.useRef)(null);
|
|
43
46
|
var submitBtnRef = (0, _react.useRef)(null);
|
|
44
47
|
var invoicePdfRef = (0, _react.useRef)(null);
|
|
45
|
-
var changeSelectedAnalyticsStatus = function changeSelectedAnalyticsStatus(detailType) {
|
|
48
|
+
var changeSelectedAnalyticsStatus = function changeSelectedAnalyticsStatus(detailType, isInitialRender) {
|
|
46
49
|
window.scrollTo(0, 0);
|
|
47
50
|
setSelectedDetailType(detailType);
|
|
51
|
+
if (!isInitialRender) {
|
|
52
|
+
var invoice = query.get('invoice');
|
|
53
|
+
history.replace("".concat(location.pathname, "?invoice=").concat(invoice, "&tab=").concat(detailType));
|
|
54
|
+
}
|
|
48
55
|
};
|
|
49
56
|
(0, _react.useEffect)(function () {
|
|
50
57
|
if (!(exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.loading) && exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.invoice) {
|
|
51
58
|
inputRef.current.value = invoicePdfRef === null || invoicePdfRef === void 0 ? void 0 : invoicePdfRef.current.innerHTML;
|
|
52
59
|
}
|
|
53
60
|
}, [exportInvoiceList === null || exportInvoiceList === void 0 ? void 0 : exportInvoiceList.loading]);
|
|
61
|
+
(0, _react.useEffect)(function () {
|
|
62
|
+
var tab = query.get('tab');
|
|
63
|
+
if (tab) {
|
|
64
|
+
changeSelectedAnalyticsStatus(tab, true);
|
|
65
|
+
} else {
|
|
66
|
+
changeSelectedAnalyticsStatus(selectedDetailType);
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
54
69
|
return /*#__PURE__*/_react.default.createElement(_styles.InvoiceDriversContainer, null, /*#__PURE__*/_react.default.createElement(_styles.DetailsHeader, null, /*#__PURE__*/_react.default.createElement("h2", null, t('DRIVER_INVOICE', 'Driver invoice')), /*#__PURE__*/_react.default.createElement(_styles2.IconButton, {
|
|
55
70
|
color: "black",
|
|
56
71
|
disabled: (exportInvoiceList === null || exportInvoiceList === void 0 ? void 0 : exportInvoiceList.loading) || !(exportInvoiceList !== null && exportInvoiceList !== void 0 && exportInvoiceList.invoice),
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.InvoiceManager = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _InfoShareContext = require("../../../contexts/InfoShareContext");
|
|
11
12
|
var _styles = require("../../../styles");
|
|
@@ -22,6 +23,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
22
23
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
23
24
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
25
|
var InvoiceManager = function InvoiceManager(props) {
|
|
26
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
27
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
25
28
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
26
29
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
27
30
|
t = _useLanguage2[1];
|
|
@@ -50,14 +53,24 @@ var InvoiceManager = function InvoiceManager(props) {
|
|
|
50
53
|
icon: /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.Truck, null),
|
|
51
54
|
description: t('DRIVER_INVOICE_DESCRIPTION', 'Driver invoice description')
|
|
52
55
|
}];
|
|
53
|
-
var handleOpenInvoiceDetail = function handleOpenInvoiceDetail(index) {
|
|
56
|
+
var handleOpenInvoiceDetail = function handleOpenInvoiceDetail(index, isInitialRender) {
|
|
54
57
|
setOpenInvoiceDetail(true);
|
|
55
58
|
setSelectedInvoice(index);
|
|
59
|
+
if (!isInitialRender) {
|
|
60
|
+
history.replace("".concat(location.pathname, "?invoice=").concat(index));
|
|
61
|
+
}
|
|
56
62
|
};
|
|
57
63
|
var handleCloseInvoiceDetail = function handleCloseInvoiceDetail() {
|
|
58
64
|
setOpenInvoiceDetail(false);
|
|
59
65
|
setSelectedInvoice(null);
|
|
66
|
+
history.replace("".concat(location.pathname));
|
|
60
67
|
};
|
|
68
|
+
(0, _react.useEffect)(function () {
|
|
69
|
+
var invoice = query.get('invoice');
|
|
70
|
+
if (invoice) {
|
|
71
|
+
handleOpenInvoiceDetail(invoice, true);
|
|
72
|
+
}
|
|
73
|
+
}, []);
|
|
61
74
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.InvoiceManagerContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.HeaderContainer, null, isCollapse && /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
62
75
|
color: "black",
|
|
63
76
|
onClick: function onClick() {
|
|
@@ -17,5 +17,5 @@ var CheckboxWrapper = _styledComponents.default.div(_templateObject2 || (_templa
|
|
|
17
17
|
return ((_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.rtl) && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-left: 20px;\n margin-right: 0;\n "])));
|
|
18
18
|
});
|
|
19
19
|
exports.CheckboxWrapper = CheckboxWrapper;
|
|
20
|
-
var ActionBtnWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: sticky;\n top: 100%;\n\n > button {\n height: 44px;\n }\n"])));
|
|
20
|
+
var ActionBtnWrapper = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n position: sticky;\n top: 100%;\n margin-top: 30px;\n\n > button {\n height: 44px;\n }\n"])));
|
|
21
21
|
exports.ActionBtnWrapper = ActionBtnWrapper;
|
|
@@ -27,7 +27,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
27
27
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
28
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
29
|
var ProductReviewDetailsUI = function ProductReviewDetailsUI(props) {
|
|
30
|
-
var product
|
|
30
|
+
var _productState$product, _productState$product2, _productState$product3;
|
|
31
|
+
var productState = props.productState,
|
|
31
32
|
productReviewList = props.productReviewList;
|
|
32
33
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
33
34
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -35,8 +36,8 @@ var ProductReviewDetailsUI = function ProductReviewDetailsUI(props) {
|
|
|
35
36
|
var _useUtils = (0, _orderingComponentsAdminExternal.useUtils)(),
|
|
36
37
|
_useUtils2 = _slicedToArray(_useUtils, 1),
|
|
37
38
|
optimizeImage = _useUtils2[0].optimizeImage;
|
|
38
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, product === null || product === void 0 ? void 0 : product.name)), /*#__PURE__*/_react.default.createElement(_styles.ProductImageContainer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, product !== null &&
|
|
39
|
-
bgimage: optimizeImage(product === null ||
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, (_productState$product = productState.product) === null || _productState$product === void 0 ? void 0 : _productState$product.name)), /*#__PURE__*/_react.default.createElement(_styles.ProductImageContainer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, (_productState$product2 = productState.product) !== null && _productState$product2 !== void 0 && _productState$product2.images ? /*#__PURE__*/_react.default.createElement(_styles.Image, {
|
|
40
|
+
bgimage: optimizeImage((_productState$product3 = productState.product) === null || _productState$product3 === void 0 ? void 0 : _productState$product3.images, 'h_120,c_limit')
|
|
40
41
|
}) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.ImageFill, null))), productReviewList !== null && productReviewList !== void 0 && productReviewList.loading ? _toConsumableArray(Array(10).keys()).map(function (i) {
|
|
41
42
|
return /*#__PURE__*/_react.default.createElement(_styles.ReviewContentWrapper, {
|
|
42
43
|
key: i
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.Reports = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _InfoShareContext = require("../../../contexts/InfoShareContext");
|
|
10
11
|
var _styles = require("../../../styles");
|
|
11
12
|
var _useWindowSize2 = require("../../../hooks/useWindowSize");
|
|
@@ -43,6 +44,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
43
44
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
44
45
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
45
46
|
var Reports = function Reports(props) {
|
|
47
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
48
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
46
49
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
47
50
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
48
51
|
t = _useLanguage2[1];
|
|
@@ -165,11 +168,21 @@ var Reports = function Reports(props) {
|
|
|
165
168
|
var handleCloseSidebar = function handleCloseSidebar() {
|
|
166
169
|
setIsOpen(false);
|
|
167
170
|
setSelectedReport(0);
|
|
171
|
+
history.replace("".concat(location.pathname));
|
|
168
172
|
};
|
|
169
|
-
var handleOpenSlider = function handleOpenSlider(index) {
|
|
173
|
+
var handleOpenSlider = function handleOpenSlider(index, isInitialRender) {
|
|
170
174
|
setSelectedReport(index);
|
|
171
175
|
setIsOpen(true);
|
|
176
|
+
if (!isInitialRender) {
|
|
177
|
+
history.replace("".concat(location.pathname, "?id=").concat(index));
|
|
178
|
+
}
|
|
172
179
|
};
|
|
180
|
+
(0, _react.useEffect)(function () {
|
|
181
|
+
var id = query.get('id');
|
|
182
|
+
if (id) {
|
|
183
|
+
handleOpenSlider(Number(id), true);
|
|
184
|
+
}
|
|
185
|
+
}, []);
|
|
173
186
|
return /*#__PURE__*/_react.default.createElement(_styles2.ReportsContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.HeaderTitleContainer, null, isCollapse && /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
174
187
|
color: "black",
|
|
175
188
|
onClick: function onClick() {
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ReviewProductsListingUI = exports.ReviewProductsListing = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
11
12
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
@@ -37,6 +38,8 @@ var ReviewProductsListingUI = function ReviewProductsListingUI(props) {
|
|
|
37
38
|
searchValue = props.searchValue,
|
|
38
39
|
parentSearchValue = props.parentSearchValue,
|
|
39
40
|
businessId = props.businessId;
|
|
41
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
42
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
40
43
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
41
44
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
42
45
|
t = _useLanguage2[1];
|
|
@@ -51,22 +54,30 @@ var ReviewProductsListingUI = function ReviewProductsListingUI(props) {
|
|
|
51
54
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
52
55
|
curProduct = _useState4[0],
|
|
53
56
|
setCurProduct = _useState4[1];
|
|
54
|
-
var _useState5 = (0, _react.useState)(
|
|
57
|
+
var _useState5 = (0, _react.useState)(null),
|
|
55
58
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var _useState7 = (0, _react.useState)(
|
|
59
|
+
curProductId = _useState6[0],
|
|
60
|
+
setCurProductId = _useState6[1];
|
|
61
|
+
var _useState7 = (0, _react.useState)(null),
|
|
59
62
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
var _useState9 = (0, _react.useState)(
|
|
63
|
+
curCategoryId = _useState8[0],
|
|
64
|
+
setCurCategoryId = _useState8[1];
|
|
65
|
+
var _useState9 = (0, _react.useState)(1),
|
|
63
66
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
var _useState11 = (0, _react.useState)(
|
|
67
|
+
currentPage = _useState10[0],
|
|
68
|
+
setCurrentPage = _useState10[1];
|
|
69
|
+
var _useState11 = (0, _react.useState)(10),
|
|
67
70
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
productsPerPage = _useState12[0],
|
|
72
|
+
setProductsPerPage = _useState12[1];
|
|
73
|
+
var _useState13 = (0, _react.useState)([]),
|
|
74
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
75
|
+
currentProducts = _useState14[0],
|
|
76
|
+
setCurrentProducts = _useState14[1];
|
|
77
|
+
var _useState15 = (0, _react.useState)(null),
|
|
78
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
79
|
+
totalPages = _useState16[0],
|
|
80
|
+
setTotalPages = _useState16[1];
|
|
70
81
|
var handleChangePage = function handleChangePage(page) {
|
|
71
82
|
setCurrentPage(page);
|
|
72
83
|
};
|
|
@@ -87,9 +98,25 @@ var ReviewProductsListingUI = function ReviewProductsListingUI(props) {
|
|
|
87
98
|
setTotalPages(_totalPages);
|
|
88
99
|
setCurrentProducts(_currentProducts);
|
|
89
100
|
}, [productState, currentPage, productsPerPage]);
|
|
90
|
-
var handleOpenReview = function handleOpenReview(product) {
|
|
101
|
+
var handleOpenReview = function handleOpenReview(product, isInitialRender) {
|
|
102
|
+
var _product$category;
|
|
91
103
|
setCurProduct(product);
|
|
104
|
+
setCurProductId(product === null || product === void 0 ? void 0 : product.id);
|
|
105
|
+
setCurCategoryId(product === null || product === void 0 ? void 0 : (_product$category = product.category) === null || _product$category === void 0 ? void 0 : _product$category.id);
|
|
92
106
|
setOpenReview(true);
|
|
107
|
+
if (!isInitialRender) {
|
|
108
|
+
var _product$category2;
|
|
109
|
+
var tab = query.get('tab');
|
|
110
|
+
var business = query.get('business');
|
|
111
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab, "&business=").concat(business, "&category=").concat(product === null || product === void 0 ? void 0 : (_product$category2 = product.category) === null || _product$category2 === void 0 ? void 0 : _product$category2.id, "&product=").concat(product.id));
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
var handleCloseReviewDetails = function handleCloseReviewDetails() {
|
|
115
|
+
setCurProduct(null);
|
|
116
|
+
setOpenReview(false);
|
|
117
|
+
var tab = query.get('tab');
|
|
118
|
+
var business = query.get('business');
|
|
119
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab, "&business=").concat(business));
|
|
93
120
|
};
|
|
94
121
|
(0, _react.useEffect)(function () {
|
|
95
122
|
setCurrentPage(1);
|
|
@@ -97,6 +124,15 @@ var ReviewProductsListingUI = function ReviewProductsListingUI(props) {
|
|
|
97
124
|
(0, _react.useEffect)(function () {
|
|
98
125
|
handleChangeSearch(parentSearchValue);
|
|
99
126
|
}, [parentSearchValue]);
|
|
127
|
+
(0, _react.useEffect)(function () {
|
|
128
|
+
var category = query.get('category');
|
|
129
|
+
var product = query.get('product');
|
|
130
|
+
if (category && product) {
|
|
131
|
+
setCurCategoryId(Number(category));
|
|
132
|
+
setCurProductId(Number(product));
|
|
133
|
+
setOpenReview(true);
|
|
134
|
+
}
|
|
135
|
+
}, []);
|
|
100
136
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewsListingContainer, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewsTable, null, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewObject, {
|
|
101
137
|
isHeader: true
|
|
102
138
|
}, t('PRODUCT', 'Product'))), /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewMarkerWrapper, {
|
|
@@ -136,13 +172,13 @@ var ReviewProductsListingUI = function ReviewProductsListingUI(props) {
|
|
|
136
172
|
defaultSideBarWidth: 550,
|
|
137
173
|
open: openReview,
|
|
138
174
|
onClose: function onClose() {
|
|
139
|
-
|
|
140
|
-
setOpenReview(false);
|
|
175
|
+
return handleCloseReviewDetails();
|
|
141
176
|
}
|
|
142
177
|
}, /*#__PURE__*/_react.default.createElement(_ProductReviewDetails.ProductReviewDetails, {
|
|
143
178
|
businessId: businessId,
|
|
144
179
|
product: curProduct,
|
|
145
|
-
productId:
|
|
180
|
+
productId: curProductId,
|
|
181
|
+
categoryId: curCategoryId
|
|
146
182
|
})));
|
|
147
183
|
};
|
|
148
184
|
exports.ReviewProductsListingUI = ReviewProductsListingUI;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ReviewsListing = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _InfoShareContext = require("../../../contexts/InfoShareContext");
|
|
11
12
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
@@ -25,6 +26,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
25
26
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
26
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
27
28
|
var ReviewsListing = function ReviewsListing(props) {
|
|
29
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
30
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
28
31
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
29
32
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
30
33
|
t = _useLanguage2[1];
|
|
@@ -48,19 +51,44 @@ var ReviewsListing = function ReviewsListing(props) {
|
|
|
48
51
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
49
52
|
business = _useState8[0],
|
|
50
53
|
setBusiness = _useState8[1];
|
|
54
|
+
var _useState9 = (0, _react.useState)(null),
|
|
55
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
56
|
+
businessId = _useState10[0],
|
|
57
|
+
setBusinessId = _useState10[1];
|
|
51
58
|
var changeBusinessState = function changeBusinessState(business) {
|
|
52
59
|
setShowSelect(false);
|
|
53
60
|
setBusiness(business);
|
|
61
|
+
setBusinessId(business.id);
|
|
62
|
+
var tab = query.get('tab');
|
|
63
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab, "&business=").concat(business.id));
|
|
54
64
|
};
|
|
55
|
-
var handleChangeOption = function handleChangeOption(option) {
|
|
65
|
+
var handleChangeOption = function handleChangeOption(option, isInitialRender) {
|
|
56
66
|
setShowOption(option);
|
|
57
|
-
if (option === 'products' && !
|
|
67
|
+
if (option === 'products' && !businessId) setShowSelect(true);
|
|
68
|
+
if (!isInitialRender) {
|
|
69
|
+
history.replace("".concat(location.pathname, "?tab=").concat(option));
|
|
70
|
+
}
|
|
58
71
|
};
|
|
59
72
|
var handleOpenProducts = function handleOpenProducts(business) {
|
|
60
73
|
setBusiness(business);
|
|
61
74
|
setShowOption('products');
|
|
62
75
|
setShowSelect(false);
|
|
63
76
|
};
|
|
77
|
+
(0, _react.useEffect)(function () {
|
|
78
|
+
var tab = query.get('tab');
|
|
79
|
+
if (tab) {
|
|
80
|
+
var _businessId = query.get('business');
|
|
81
|
+
if (tab === 'products' && _businessId) {
|
|
82
|
+
setShowOption('products');
|
|
83
|
+
setShowSelect(false);
|
|
84
|
+
setBusinessId(Number(_businessId));
|
|
85
|
+
} else {
|
|
86
|
+
handleChangeOption(tab, true);
|
|
87
|
+
}
|
|
88
|
+
} else {
|
|
89
|
+
handleChangeOption(showOption);
|
|
90
|
+
}
|
|
91
|
+
}, []);
|
|
64
92
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.ReviewsListingContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.Header, null, /*#__PURE__*/_react.default.createElement(_styles2.HeaderLeft, null, isCollapse && /*#__PURE__*/_react.default.createElement(_styles.IconButton, {
|
|
65
93
|
color: "black",
|
|
66
94
|
onClick: function onClick() {
|
|
@@ -125,9 +153,9 @@ var ReviewsListing = function ReviewsListing(props) {
|
|
|
125
153
|
}), showOption === 'professionals' && /*#__PURE__*/_react.default.createElement(_UsersReviewList.UsersReviewList, {
|
|
126
154
|
defaultUserTypesSelected: [8],
|
|
127
155
|
parentSearchValue: searchValue
|
|
128
|
-
}), showOption === 'products' &&
|
|
156
|
+
}), showOption === 'products' && businessId && /*#__PURE__*/_react.default.createElement(_ReviewProductsListing.ReviewProductsListing, {
|
|
129
157
|
parentSearchValue: searchValue,
|
|
130
|
-
businessId:
|
|
158
|
+
businessId: businessId
|
|
131
159
|
})));
|
|
132
160
|
};
|
|
133
161
|
exports.ReviewsListing = ReviewsListing;
|
|
@@ -27,7 +27,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
27
27
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
28
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
29
|
var UserReviewDetailsUI = function UserReviewDetailsUI(props) {
|
|
30
|
-
var
|
|
30
|
+
var _userState$user, _userState$user2, _userState$user3, _userState$user4;
|
|
31
|
+
var userState = props.userState,
|
|
31
32
|
userReviewState = props.userReviewState;
|
|
32
33
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
33
34
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
@@ -51,8 +52,8 @@ var UserReviewDetailsUI = function UserReviewDetailsUI(props) {
|
|
|
51
52
|
return quality / 5 * 100;
|
|
52
53
|
}
|
|
53
54
|
};
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Header, null, /*#__PURE__*/_react.default.createElement("h1", null,
|
|
55
|
-
bgimage: optimizeImage(
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewDetailsContainer, null, /*#__PURE__*/_react.default.createElement(_styles.Header, null, /*#__PURE__*/_react.default.createElement("h1", null, (_userState$user = userState.user) === null || _userState$user === void 0 ? void 0 : _userState$user.name, " ", (_userState$user2 = userState.user) === null || _userState$user2 === void 0 ? void 0 : _userState$user2.lastname)), /*#__PURE__*/_react.default.createElement(_styles.DriverPhotoContainer, null, /*#__PURE__*/_react.default.createElement(_styles.WrapperImage, null, (_userState$user3 = userState.user) !== null && _userState$user3 !== void 0 && _userState$user3.photo ? /*#__PURE__*/_react.default.createElement(_styles.Image, {
|
|
56
|
+
bgimage: optimizeImage((_userState$user4 = userState.user) === null || _userState$user4 === void 0 ? void 0 : _userState$user4.photo, 'w_120,c_limit')
|
|
56
57
|
}) : /*#__PURE__*/_react.default.createElement(_reactBootstrapIcons.PersonFill, null))), userReviewState.loading ? _toConsumableArray(Array(5).keys()).map(function (i) {
|
|
57
58
|
return /*#__PURE__*/_react.default.createElement(_styles.ReviewItemContatiner, {
|
|
58
59
|
key: i
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.UsersReviewList = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _reactRouterDom = require("react-router-dom");
|
|
9
10
|
var _orderingComponentsAdminExternal = require("ordering-components-admin-external");
|
|
10
11
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
11
12
|
var _reactBootstrapIcons = require("react-bootstrap-icons");
|
|
@@ -37,6 +38,8 @@ var DriversReviewListUI = function DriversReviewListUI(props) {
|
|
|
37
38
|
getUsers = props.getUsers,
|
|
38
39
|
onSearch = props.onSearch,
|
|
39
40
|
defaultUserTypesSelected = props.defaultUserTypesSelected;
|
|
41
|
+
var history = (0, _reactRouterDom.useHistory)();
|
|
42
|
+
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
40
43
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
41
44
|
_useLanguage2 = _slicedToArray(_useLanguage, 2),
|
|
42
45
|
t = _useLanguage2[1];
|
|
@@ -51,8 +54,12 @@ var DriversReviewListUI = function DriversReviewListUI(props) {
|
|
|
51
54
|
setOpenReview = _useState2[1];
|
|
52
55
|
var _useState3 = (0, _react.useState)(null),
|
|
53
56
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
curUser = _useState4[0],
|
|
58
|
+
setCurUser = _useState4[1];
|
|
59
|
+
var _useState5 = (0, _react.useState)(null),
|
|
60
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
61
|
+
curUserId = _useState6[0],
|
|
62
|
+
setCurUserId = _useState6[1];
|
|
56
63
|
var headerTitle = defaultUserTypesSelected.length === 1 && defaultUserTypesSelected[0] === 3 ? t('CUSTOMER', 'Customer') : defaultUserTypesSelected[0] === 8 ? t('PROFESSIONAL', 'Professional') : t('DRIVER', 'Driver');
|
|
57
64
|
var handleChangePage = function handleChangePage(page) {
|
|
58
65
|
getUsers(page, 10);
|
|
@@ -66,14 +73,33 @@ var DriversReviewListUI = function DriversReviewListUI(props) {
|
|
|
66
73
|
onSearch(parentSearchValue);
|
|
67
74
|
}, [parentSearchValue]);
|
|
68
75
|
var handleOpenReview = function handleOpenReview(user) {
|
|
69
|
-
|
|
76
|
+
setCurUser(user);
|
|
77
|
+
setCurUserId(user.id);
|
|
70
78
|
setOpenReview(true);
|
|
71
79
|
};
|
|
72
|
-
var handleClickReview = function handleClickReview(e, user) {
|
|
73
|
-
var
|
|
80
|
+
var handleClickReview = function handleClickReview(e, user, isInitialRender) {
|
|
81
|
+
var _e$target;
|
|
82
|
+
var isInvalid = (e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.closest('.review-enabled')) || e.target.closest('.review-actions');
|
|
74
83
|
if (isInvalid) return;
|
|
75
84
|
handleOpenReview(user);
|
|
85
|
+
if (!isInitialRender) {
|
|
86
|
+
var tab = query.get('tab');
|
|
87
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab, "&id=").concat(user.id));
|
|
88
|
+
}
|
|
76
89
|
};
|
|
90
|
+
var handleCloseReviewDetails = function handleCloseReviewDetails() {
|
|
91
|
+
setCurUser(null);
|
|
92
|
+
setOpenReview(false);
|
|
93
|
+
var tab = query.get('tab');
|
|
94
|
+
history.replace("".concat(location.pathname, "?tab=").concat(tab));
|
|
95
|
+
};
|
|
96
|
+
(0, _react.useEffect)(function () {
|
|
97
|
+
var id = query.get('id');
|
|
98
|
+
if (id) {
|
|
99
|
+
setCurUserId(Number(id));
|
|
100
|
+
setOpenReview(true);
|
|
101
|
+
}
|
|
102
|
+
}, []);
|
|
77
103
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles.ReviewsTable, null, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewObject, {
|
|
78
104
|
isHeader: true
|
|
79
105
|
}, headerTitle)), /*#__PURE__*/_react.default.createElement("th", null, /*#__PURE__*/_react.default.createElement(_styles.ReviewMarkerWrapper, {
|
|
@@ -96,7 +122,7 @@ var DriversReviewListUI = function DriversReviewListUI(props) {
|
|
|
96
122
|
}) : usersList.users.map(function (user) {
|
|
97
123
|
return /*#__PURE__*/_react.default.createElement(_styles.ReviewTbody, {
|
|
98
124
|
key: user.id,
|
|
99
|
-
active: user.id === (
|
|
125
|
+
active: user.id === (curUser === null || curUser === void 0 ? void 0 : curUser.id),
|
|
100
126
|
onClick: function onClick(e) {
|
|
101
127
|
return handleClickReview(e, user);
|
|
102
128
|
}
|
|
@@ -116,13 +142,12 @@ var DriversReviewListUI = function DriversReviewListUI(props) {
|
|
|
116
142
|
defaultSideBarWidth: 550,
|
|
117
143
|
open: openReview,
|
|
118
144
|
onClose: function onClose() {
|
|
119
|
-
|
|
120
|
-
setOpenReview(false);
|
|
145
|
+
return handleCloseReviewDetails();
|
|
121
146
|
},
|
|
122
147
|
showExpandIcon: true
|
|
123
148
|
}, /*#__PURE__*/_react.default.createElement(_UserReviewDetails.UserReviewDetails, {
|
|
124
|
-
userId:
|
|
125
|
-
|
|
149
|
+
userId: curUserId,
|
|
150
|
+
user: curUser
|
|
126
151
|
})));
|
|
127
152
|
};
|
|
128
153
|
var UsersReviewList = function UsersReviewList(props) {
|