ordering-ui-admin-external 1.17.0 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js → ordering-ui-admin.661a37246ac77dcc4edf.js} +2 -2
- package/_modules/components/Delivery/DeliveryUsersListing/index.js +4 -2
- package/_modules/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/_modules/components/Delivery/DriversGroupLogs/index.js +1 -0
- package/_modules/components/Delivery/UsersList/index.js +47 -51
- package/_modules/components/Delivery/UsersList/styles.js +6 -4
- package/_modules/components/Home/HomePage/index.js +7 -1
- package/_modules/components/Login/LoginForm/index.js +7 -1
- package/_modules/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/_modules/components/Messages/MessagesListing/index.js +1 -1
- package/_modules/components/MyProducts/AdvancedSettings/ButtonShadow.js +98 -0
- package/_modules/components/MyProducts/AdvancedSettings/FontStyleGroup.js +28 -7
- package/_modules/components/MyProducts/AdvancedSettings/HideCheckBox.js +47 -0
- package/_modules/components/MyProducts/AdvancedSettings/ImageBox.js +12 -3
- package/_modules/components/MyProducts/AdvancedSettings/SettingComponent.js +15 -15
- package/_modules/components/MyProducts/AdvancedSettings/index.js +102 -117
- package/_modules/components/MyProducts/AppResources/index.js +132 -0
- package/_modules/components/MyProducts/OrderingWebsite/index.js +47 -2
- package/_modules/components/MyProducts/OrderingWebsite/styles.js +13 -3
- package/_modules/components/OrderingProducts/SiteTheme/index.js +13 -9
- package/_modules/components/Orders/DeliveriesManager/index.js +1 -1
- package/_modules/components/Orders/Messages/index.js +25 -94
- package/_modules/components/Orders/OrderBill/index.js +3 -3
- package/_modules/components/Orders/OrderNotification/index.js +4 -2
- package/_modules/components/Orders/OrdersManager/index.js +3 -1
- package/_modules/components/SidebarMenu/index.js +34 -33
- package/_modules/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/_modules/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/_modules/components/Stores/BusinessDetails/index.js +27 -8
- package/_modules/components/Stores/BusinessLocation/index.js +8 -7
- package/_modules/components/Stores/BusinessPlace/index.js +127 -0
- package/_modules/components/Stores/BusinessPlace/styles.js +55 -0
- package/_modules/components/Stores/BusinessPlaceGroup/index.js +258 -0
- package/_modules/components/Stores/BusinessPlaceGroup/styles.js +102 -0
- package/_modules/components/Stores/BusinessProductList/index.js +3 -3
- package/_modules/components/Stores/BusinessProductsListing/index.js +2 -1
- package/_modules/components/Stores/BusinessSummary/index.js +12 -3
- package/_modules/components/Stores/ProductStep/index.js +15 -3
- package/_modules/components/Stores/SpoonityApiKey/index.js +97 -0
- package/_modules/components/Stores/SpoonityApiKey/styles.js +47 -0
- package/_modules/components/Stores/UploadMenuGuide/index.js +8 -0
- package/_modules/components/Users/CustomerPointsWallet/index.js +126 -9
- package/_modules/components/Users/CustomerPointsWallet/styles.js +8 -4
- package/package.json +2 -2
- package/src/components/Delivery/DeliveryUsersListing/index.js +3 -1
- package/src/components/Delivery/DriversGroupLogistics/index.js +1 -1
- package/src/components/Delivery/DriversGroupLogs/index.js +2 -0
- package/src/components/Delivery/UsersList/index.js +79 -61
- package/src/components/Delivery/UsersList/styles.js +4 -12
- package/src/components/Home/HomePage/index.js +2 -2
- package/src/components/Login/LoginForm/index.js +4 -1
- package/src/components/Marketing/EnterprisePromotionListing/index.js +1 -1
- package/src/components/Messages/MessagesListing/index.js +1 -1
- package/src/components/MyProducts/AdvancedSettings/ButtonShadow.js +102 -0
- package/src/components/MyProducts/AdvancedSettings/FontStyleGroup.js +23 -5
- package/src/components/MyProducts/AdvancedSettings/HideCheckBox.js +33 -0
- package/src/components/MyProducts/AdvancedSettings/ImageBox.js +10 -3
- package/src/components/MyProducts/AdvancedSettings/SettingComponent.js +10 -15
- package/src/components/MyProducts/AdvancedSettings/index.js +119 -149
- package/src/components/MyProducts/AppResources/index.js +167 -0
- package/src/components/MyProducts/OrderingWebsite/index.js +66 -2
- package/src/components/MyProducts/OrderingWebsite/styles.js +37 -0
- package/src/components/OrderingProducts/SiteTheme/index.js +7 -3
- package/src/components/Orders/DeliveriesManager/index.js +1 -1
- package/src/components/Orders/Messages/index.js +56 -216
- package/src/components/Orders/OrderBill/index.js +6 -2
- package/src/components/Orders/OrderNotification/index.js +6 -2
- package/src/components/Orders/OrdersManager/index.js +1 -1
- package/src/components/SidebarMenu/index.js +8 -8
- package/src/components/Stores/BusinessAdd/DeliveryZone/index.js +1 -1
- package/src/components/Stores/BusinessDeliveryZoneInformation/index.js +1 -1
- package/src/components/Stores/BusinessDetails/index.js +24 -1
- package/src/components/Stores/BusinessLocation/index.js +2 -1
- package/src/components/Stores/BusinessPlace/index.js +137 -0
- package/src/components/Stores/BusinessPlace/styles.js +132 -0
- package/src/components/Stores/BusinessPlaceGroup/index.js +272 -0
- package/src/components/Stores/BusinessPlaceGroup/styles.js +248 -0
- package/src/components/Stores/BusinessProductList/index.js +9 -1
- package/src/components/Stores/BusinessProductsListing/index.js +1 -0
- package/src/components/Stores/BusinessSummary/index.js +16 -5
- package/src/components/Stores/ProductStep/index.js +19 -2
- package/src/components/Stores/SpoonityApiKey/index.js +87 -0
- package/src/components/Stores/SpoonityApiKey/styles.js +68 -0
- package/src/components/Stores/UploadMenuGuide/index.js +10 -1
- package/src/components/Users/CustomerPointsWallet/index.js +130 -2
- package/src/components/Users/CustomerPointsWallet/styles.js +40 -1
- /package/_bundles/{ordering-ui-admin.6c1919d6b0356a2f522f.js.LICENSE.txt → ordering-ui-admin.661a37246ac77dcc4edf.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Title = exports.Tabs = exports.Tab = exports.Label = exports.FormControl = exports.BusinessOrderingChannelsContainer = exports.BusinessCustomSlugContainer = void 0;
|
|
8
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
|
+
var BusinessOrderingChannelsContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n box-sizing: border-box;\n @media (min-width: 576px) {\n padding: 20px;\n }\n"])));
|
|
14
|
+
exports.BusinessOrderingChannelsContainer = BusinessOrderingChannelsContainer;
|
|
15
|
+
var Title = _styledComponents.default.h1(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n font-size: 20px;\n font-weight: 700;\n color: ", ";\n margin-bottom: 25px;\n"])), function (props) {
|
|
16
|
+
var _props$theme$colors;
|
|
17
|
+
return (_props$theme$colors = props.theme.colors) === null || _props$theme$colors === void 0 ? void 0 : _props$theme$colors.headingColor;
|
|
18
|
+
});
|
|
19
|
+
exports.Title = Title;
|
|
20
|
+
var BusinessCustomSlugContainer = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n button {\n border-radius: 7.6px;\n height: 44px;\n }\n"])));
|
|
21
|
+
exports.BusinessCustomSlugContainer = BusinessCustomSlugContainer;
|
|
22
|
+
var FormControl = _styledComponents.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n margin-bottom: 20px;\n\n input[type=text] {\n border: 1px solid #DEE2E6;\n box-sizing: border-box;\n border-radius: 7.6px;\n height: 44px;\n width: 100%;\n }\n"])));
|
|
23
|
+
exports.FormControl = FormControl;
|
|
24
|
+
var Label = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 14px;\n color: ", ";\n"])), function (props) {
|
|
25
|
+
var _props$theme;
|
|
26
|
+
return (_props$theme = props.theme) === null || _props$theme === void 0 ? void 0 : _props$theme.colors.headingColor;
|
|
27
|
+
});
|
|
28
|
+
exports.Label = Label;
|
|
29
|
+
var Tabs = _styledComponents.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n margin-bottom: 25px;\n border-bottom: 1px solid ", ";\n"])), function (props) {
|
|
30
|
+
return props.theme.colors.borderColor;
|
|
31
|
+
});
|
|
32
|
+
exports.Tabs = Tabs;
|
|
33
|
+
var Tab = _styledComponents.default.div(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n user-select: none;\n padding: 10px 0px;\n cursor: pointer;\n color: ", ";\n font-size: 14px;\n white-space: nowrap;\n color: ", ";\n ", "\n\n ", "\n"])), function (props) {
|
|
34
|
+
var _props$theme$colors2;
|
|
35
|
+
return (_props$theme$colors2 = props.theme.colors) === null || _props$theme$colors2 === void 0 ? void 0 : _props$theme$colors2.headingColor;
|
|
36
|
+
}, function (props) {
|
|
37
|
+
return props.theme.colors.lightGray;
|
|
38
|
+
}, function (props) {
|
|
39
|
+
var _props$theme2;
|
|
40
|
+
return (_props$theme2 = props.theme) !== null && _props$theme2 !== void 0 && _props$theme2.rtl ? (0, _styledComponents.css)(_templateObject8 || (_templateObject8 = _taggedTemplateLiteral(["\n margin-left: 30px;\n "]))) : (0, _styledComponents.css)(_templateObject9 || (_templateObject9 = _taggedTemplateLiteral(["\n margin-right: 30px;\n "])));
|
|
41
|
+
}, function (_ref) {
|
|
42
|
+
var active = _ref.active;
|
|
43
|
+
return active && (0, _styledComponents.css)(_templateObject10 || (_templateObject10 = _taggedTemplateLiteral(["\n border-bottom: 1px solid;\n font-weight: 500;\n color: ", ";\n "])), function (props) {
|
|
44
|
+
return props.theme.colors.headingColor;
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
exports.Tab = Tab;
|
|
@@ -99,6 +99,14 @@ var UploadMenuGuideUI = function UploadMenuGuideUI(props) {
|
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
+
(0, _react.useEffect)(function () {
|
|
103
|
+
if (formState !== null && formState !== void 0 && formState.error) {
|
|
104
|
+
setAlertState({
|
|
105
|
+
open: true,
|
|
106
|
+
content: formState.error
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
}, [formState === null || formState === void 0 ? void 0 : formState.error]);
|
|
102
110
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.Container, null, /*#__PURE__*/_react.default.createElement("h2", null, t('UPLOAD_YOUR_MENU', 'Upload your menu')), /*#__PURE__*/_react.default.createElement("p", null, t('UPLOAD_YOUR_MENU_DESC', 'Click to upload your menu (PDF or image file) or share your menu link (For website or another online ordering system)')), /*#__PURE__*/_react.default.createElement(_styles2.FileUploadBox, {
|
|
103
111
|
onClick: function onClick() {
|
|
104
112
|
return fileRef.current.click();
|
|
@@ -11,7 +11,9 @@ var _orderingComponentsAdminExternal = require("ordering-components-admin-extern
|
|
|
11
11
|
var _styledComponents = require("styled-components");
|
|
12
12
|
var _reactLoadingSkeleton = _interopRequireDefault(require("react-loading-skeleton"));
|
|
13
13
|
var _CustomerWalletEvents = require("../CustomerWalletEvents");
|
|
14
|
-
var _styles = require("
|
|
14
|
+
var _styles = require("../../../styles");
|
|
15
|
+
var _Shared = require("../../Shared");
|
|
16
|
+
var _styles2 = require("./styles");
|
|
15
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -29,7 +31,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
29
31
|
var CustomerPointsWalletUI = function CustomerPointsWalletUI(props) {
|
|
30
32
|
var _walletState$wallet, _user$loyalty_level$i, _user$loyalty_level, _user$loyalty_level2;
|
|
31
33
|
var walletState = props.walletState,
|
|
32
|
-
user = props.user
|
|
34
|
+
user = props.user,
|
|
35
|
+
handleChangeInput = props.handleChangeInput,
|
|
36
|
+
actionState = props.actionState,
|
|
37
|
+
addWalletState = props.addWalletState,
|
|
38
|
+
reduceWalletState = props.reduceWalletState,
|
|
39
|
+
handleAddWalletMoney = props.handleAddWalletMoney,
|
|
40
|
+
handleReduceWalletMoney = props.handleReduceWalletMoney;
|
|
33
41
|
var history = (0, _reactRouterDom.useHistory)();
|
|
34
42
|
var query = new URLSearchParams((0, _reactRouterDom.useLocation)().search);
|
|
35
43
|
var _useLanguage = (0, _orderingComponentsAdminExternal.useLanguage)(),
|
|
@@ -40,6 +48,13 @@ var CustomerPointsWalletUI = function CustomerPointsWalletUI(props) {
|
|
|
40
48
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
49
|
showOption = _useState2[0],
|
|
42
50
|
setShowOption = _useState2[1];
|
|
51
|
+
var _useState3 = (0, _react.useState)({
|
|
52
|
+
open: false,
|
|
53
|
+
content: []
|
|
54
|
+
}),
|
|
55
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
56
|
+
alertState = _useState4[0],
|
|
57
|
+
setAlertState = _useState4[1];
|
|
43
58
|
var handleTabClick = function handleTabClick(tab, isInitialRender) {
|
|
44
59
|
setShowOption(tab);
|
|
45
60
|
if (!isInitialRender) {
|
|
@@ -57,26 +72,53 @@ var CustomerPointsWalletUI = function CustomerPointsWalletUI(props) {
|
|
|
57
72
|
handleTabClick(showOption);
|
|
58
73
|
}
|
|
59
74
|
}, []);
|
|
60
|
-
|
|
75
|
+
var onAddWalletMoney = function onAddWalletMoney() {
|
|
76
|
+
if (!(addWalletState !== null && addWalletState !== void 0 && addWalletState.amount)) {
|
|
77
|
+
setAlertState({
|
|
78
|
+
open: true,
|
|
79
|
+
content: [t('VALIDATION_ERROR_REQUIRED', 'The amount is required').replace('_attribute_', t('AMOUNT', 'Amount'))]
|
|
80
|
+
});
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
handleAddWalletMoney();
|
|
84
|
+
};
|
|
85
|
+
var onReduceWalletMoney = function onReduceWalletMoney() {
|
|
86
|
+
if (!(reduceWalletState !== null && reduceWalletState !== void 0 && reduceWalletState.amount)) {
|
|
87
|
+
setAlertState({
|
|
88
|
+
open: true,
|
|
89
|
+
content: [t('VALIDATION_ERROR_REQUIRED', 'The amount is required').replace('_attribute_', t('AMOUNT', 'Amount'))]
|
|
90
|
+
});
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
handleReduceWalletMoney();
|
|
94
|
+
};
|
|
95
|
+
(0, _react.useEffect)(function () {
|
|
96
|
+
if (actionState.loading || !actionState.error) return;
|
|
97
|
+
setAlertState({
|
|
98
|
+
open: true,
|
|
99
|
+
content: actionState.error
|
|
100
|
+
});
|
|
101
|
+
}, [actionState]);
|
|
102
|
+
return /*#__PURE__*/_react.default.createElement(_styles2.Container, null, /*#__PURE__*/_react.default.createElement("h1", null, t('POINTS_WALLET', 'Points wallet')), /*#__PURE__*/_react.default.createElement(_styles2.Tabs, null, /*#__PURE__*/_react.default.createElement(_styles2.Tab, {
|
|
61
103
|
active: showOption === 'points_wallet',
|
|
62
104
|
onClick: function onClick() {
|
|
63
105
|
return handleTabClick('points_wallet');
|
|
64
106
|
}
|
|
65
|
-
}, t('POINTS_WALLET', 'Points wallet')), /*#__PURE__*/_react.default.createElement(
|
|
107
|
+
}, t('POINTS_WALLET', 'Points wallet')), /*#__PURE__*/_react.default.createElement(_styles2.Tab, {
|
|
66
108
|
active: showOption === 'history',
|
|
67
109
|
onClick: function onClick() {
|
|
68
110
|
return handleTabClick('history');
|
|
69
111
|
}
|
|
70
|
-
}, t('TRANSACTION_HISTORY', 'Transaction history'))), showOption === 'points_wallet' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, walletState !== null && walletState !== void 0 && walletState.loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
112
|
+
}, t('TRANSACTION_HISTORY', 'Transaction history'))), showOption === 'points_wallet' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, walletState !== null && walletState !== void 0 && walletState.loading ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.PointsWalletContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.PointsWrapper, null, /*#__PURE__*/_react.default.createElement("h2", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
71
113
|
width: 70,
|
|
72
114
|
height: 20
|
|
73
115
|
})), /*#__PURE__*/_react.default.createElement("p", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
74
116
|
width: 30,
|
|
75
117
|
height: 15
|
|
76
|
-
}))), /*#__PURE__*/_react.default.createElement(
|
|
118
|
+
}))), /*#__PURE__*/_react.default.createElement(_styles2.LoyaltyLevel, null, /*#__PURE__*/_react.default.createElement("h2", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
77
119
|
width: 70,
|
|
78
120
|
height: 20
|
|
79
|
-
})), /*#__PURE__*/_react.default.createElement(
|
|
121
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.LoyaltyLevelContent, null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
80
122
|
height: 150,
|
|
81
123
|
style: {
|
|
82
124
|
width: '100%'
|
|
@@ -84,10 +126,85 @@ var CustomerPointsWalletUI = function CustomerPointsWalletUI(props) {
|
|
|
84
126
|
}), /*#__PURE__*/_react.default.createElement("h3", null, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
85
127
|
width: 100,
|
|
86
128
|
height: 23
|
|
87
|
-
})))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(
|
|
129
|
+
})))))) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_styles2.PointsWalletContainer, null, /*#__PURE__*/_react.default.createElement(_styles2.PointsWrapper, null, /*#__PURE__*/_react.default.createElement("h2", null, ((_walletState$wallet = walletState.wallet) === null || _walletState$wallet === void 0 ? void 0 : _walletState$wallet.balance) || 0), /*#__PURE__*/_react.default.createElement("p", null, t('POINTS', 'Points'))), (user === null || user === void 0 ? void 0 : user.loyalty_level) && /*#__PURE__*/_react.default.createElement(_styles2.LoyaltyLevel, null, /*#__PURE__*/_react.default.createElement("h2", null, t('LEVEL', 'Level')), /*#__PURE__*/_react.default.createElement(_styles2.LoyaltyLevelContent, null, /*#__PURE__*/_react.default.createElement("img", {
|
|
88
130
|
src: (_user$loyalty_level$i = user === null || user === void 0 ? void 0 : (_user$loyalty_level = user.loyalty_level) === null || _user$loyalty_level === void 0 ? void 0 : _user$loyalty_level.image) !== null && _user$loyalty_level$i !== void 0 ? _user$loyalty_level$i : theme.images.general.level,
|
|
89
131
|
alt: ""
|
|
90
|
-
}), /*#__PURE__*/_react.default.createElement("h3", null, user === null || user === void 0 ? void 0 : (_user$loyalty_level2 = user.loyalty_level) === null || _user$loyalty_level2 === void 0 ? void 0 : _user$loyalty_level2.name)))))
|
|
132
|
+
}), /*#__PURE__*/_react.default.createElement("h3", null, user === null || user === void 0 ? void 0 : (_user$loyalty_level2 = user.loyalty_level) === null || _user$loyalty_level2 === void 0 ? void 0 : _user$loyalty_level2.name))), /*#__PURE__*/_react.default.createElement(_styles2.SectionContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('ADD_WALLET_MONEY', 'Add wallet money')), /*#__PURE__*/_react.default.createElement(_styles2.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('INDICATE_THE_AMOUNT_TO_ADD', 'Indicate the amount to add')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
133
|
+
type: "number",
|
|
134
|
+
name: "amount",
|
|
135
|
+
placeholder: t('POINTS', 'Points'),
|
|
136
|
+
onKeyPress: function onKeyPress(e) {
|
|
137
|
+
if (!/^[0-9.]$/.test(e.key)) {
|
|
138
|
+
e.preventDefault();
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
value: (addWalletState === null || addWalletState === void 0 ? void 0 : addWalletState.amount) || '',
|
|
142
|
+
onChange: function onChange(e) {
|
|
143
|
+
return handleChangeInput(e, true);
|
|
144
|
+
}
|
|
145
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('COMMENT', 'Comment')), /*#__PURE__*/_react.default.createElement(_styles.TextArea, {
|
|
146
|
+
name: "description",
|
|
147
|
+
rows: 3,
|
|
148
|
+
value: (addWalletState === null || addWalletState === void 0 ? void 0 : addWalletState.description) || '',
|
|
149
|
+
onChange: function onChange(e) {
|
|
150
|
+
return handleChangeInput(e, true);
|
|
151
|
+
},
|
|
152
|
+
placeholder: t('WRITE_SHORT_COMMENT', 'Write a short comment')
|
|
153
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
154
|
+
borderRadius: "8px",
|
|
155
|
+
color: "primary",
|
|
156
|
+
onClick: function onClick() {
|
|
157
|
+
return onAddWalletMoney();
|
|
158
|
+
},
|
|
159
|
+
disabled: actionState.loading || Object.keys(addWalletState).length === 0
|
|
160
|
+
}, t('ADD', 'Add'))), /*#__PURE__*/_react.default.createElement(_styles2.SectionContainer, null, /*#__PURE__*/_react.default.createElement("p", null, t('REDUCE_WALLET_MONEY', 'Reduce wallet money')), /*#__PURE__*/_react.default.createElement(_styles2.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('INDICATE_THE_AMOUNT_TO_REDUCE', 'Indicate the amount to reduce')), /*#__PURE__*/_react.default.createElement(_styles.Input, {
|
|
161
|
+
type: "number",
|
|
162
|
+
name: "amount",
|
|
163
|
+
placeholder: t('POINTS', 'Points'),
|
|
164
|
+
value: (reduceWalletState === null || reduceWalletState === void 0 ? void 0 : reduceWalletState.amount) || '',
|
|
165
|
+
onChange: function onChange(e) {
|
|
166
|
+
return handleChangeInput(e, false);
|
|
167
|
+
},
|
|
168
|
+
onKeyPress: function onKeyPress(e) {
|
|
169
|
+
if (!/^[0-9.]$/.test(e.key)) {
|
|
170
|
+
e.preventDefault();
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
})), /*#__PURE__*/_react.default.createElement(_styles2.FormController, null, /*#__PURE__*/_react.default.createElement("label", null, t('COMMENT', 'Comment')), /*#__PURE__*/_react.default.createElement(_styles.TextArea, {
|
|
174
|
+
rows: 3,
|
|
175
|
+
name: "description",
|
|
176
|
+
value: (reduceWalletState === null || reduceWalletState === void 0 ? void 0 : reduceWalletState.description) || '',
|
|
177
|
+
onChange: function onChange(e) {
|
|
178
|
+
return handleChangeInput(e, false);
|
|
179
|
+
},
|
|
180
|
+
placeholder: t('WRITE_SHORT_COMMENT', 'Write a short comment')
|
|
181
|
+
})), /*#__PURE__*/_react.default.createElement(_styles.Button, {
|
|
182
|
+
borderRadius: "8px",
|
|
183
|
+
color: "black",
|
|
184
|
+
onClick: function onClick() {
|
|
185
|
+
return onReduceWalletMoney();
|
|
186
|
+
},
|
|
187
|
+
disabled: actionState.loading || Object.keys(reduceWalletState).length === 0
|
|
188
|
+
}, t('REDUCE', 'Reduce')))))), showOption === 'history' && /*#__PURE__*/_react.default.createElement(_CustomerWalletEvents.CustomerWalletEvents, props), /*#__PURE__*/_react.default.createElement(_Shared.Alert, {
|
|
189
|
+
width: "800px",
|
|
190
|
+
title: t('LOGIN'),
|
|
191
|
+
content: alertState.content,
|
|
192
|
+
acceptText: t('ACCEPT'),
|
|
193
|
+
open: alertState.open,
|
|
194
|
+
onClose: function onClose() {
|
|
195
|
+
return setAlertState({
|
|
196
|
+
open: false,
|
|
197
|
+
content: []
|
|
198
|
+
});
|
|
199
|
+
},
|
|
200
|
+
onAccept: function onAccept() {
|
|
201
|
+
return setAlertState({
|
|
202
|
+
open: false,
|
|
203
|
+
content: []
|
|
204
|
+
});
|
|
205
|
+
},
|
|
206
|
+
closeOnBackdrop: false
|
|
207
|
+
}));
|
|
91
208
|
};
|
|
92
209
|
var CustomerPointsWallet = function CustomerPointsWallet(props) {
|
|
93
210
|
var customerPointsWalletProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -4,15 +4,15 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Tabs = exports.Tab = exports.PointsWrapper = exports.PointsWalletContainer = exports.LoyaltyLevelContent = exports.LoyaltyLevel = exports.LevelWrapper = exports.EqualWrapper = exports.Container = void 0;
|
|
7
|
+
exports.Tabs = exports.Tab = exports.SectionContainer = exports.PointsWrapper = exports.PointsWalletContainer = exports.LoyaltyLevelContent = exports.LoyaltyLevel = exports.LevelWrapper = exports.FormController = exports.EqualWrapper = exports.Container = void 0;
|
|
8
8
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
9
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14;
|
|
9
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
|
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
12
12
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
13
13
|
var Container = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n padding: 20px;\n width: 100%;\n\n > h1 {\n font-size: 20px;\n font-weight: 700;\n margin-top: 0;\n margin-bottom: 7px;\n }\n"])));
|
|
14
14
|
exports.Container = Container;
|
|
15
|
-
var PointsWalletContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n padding
|
|
15
|
+
var PointsWalletContainer = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 100%;\n padding: 30px 0;\n"])));
|
|
16
16
|
exports.PointsWalletContainer = PointsWalletContainer;
|
|
17
17
|
var PointsWrapper = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n h2 {\n font-weight: 500;\n font-size: 24px;\n line-height: 36px;\n margin: 0px;\n }\n p {\n margin: 0px;\n font-size: 14px;\n line-height: 24px;\n }\n"])));
|
|
18
18
|
exports.PointsWrapper = PointsWrapper;
|
|
@@ -46,4 +46,8 @@ exports.LoyaltyLevel = LoyaltyLevel;
|
|
|
46
46
|
var LoyaltyLevelContent = _styledComponents.default.div(_templateObject14 || (_templateObject14 = _taggedTemplateLiteral(["\n width: 100%;\n max-width: 359px;\n\n img {\n width: 100%;\n object-fit: cover;\n }\n\n h3 {\n font-weight: 600;\n font-size: 28px;\n line-height: 42px;\n color: ", ";\n margin-top: 15px;\n text-align: center;\n }\n"])), function (props) {
|
|
47
47
|
return props.theme.colors.primary;
|
|
48
48
|
});
|
|
49
|
-
exports.LoyaltyLevelContent = LoyaltyLevelContent;
|
|
49
|
+
exports.LoyaltyLevelContent = LoyaltyLevelContent;
|
|
50
|
+
var SectionContainer = _styledComponents.default.div(_templateObject15 || (_templateObject15 = _taggedTemplateLiteral(["\n margin-top: 54px;\n margin-bottom: 30px;\n > p {\n font-size: 16px;\n font-weight: 600;\n margin-top: 0;\n margin-bottom: 22px;\n }\n > button {\n height: 44px;\n }\n"])));
|
|
51
|
+
exports.SectionContainer = SectionContainer;
|
|
52
|
+
var FormController = _styledComponents.default.div(_templateObject16 || (_templateObject16 = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n margin-bottom: 26px;\n\n label {\n font-size: 14px;\n margin-bottom: 10px;\n }\n\n input,\n textarea {\n font-size: 14px;\n }\n\n input::-webkit-outer-spin-button,\n input::-webkit-inner-spin-button {\n -webkit-appearance: none;\n margin: 0;\n }\n\n input[type=number] {\n -moz-appearance: textfield;\n }\n"])));
|
|
53
|
+
exports.FormController = FormController;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ordering-ui-admin-external",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
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.19.0",
|
|
87
87
|
"polished": "^3.6.7",
|
|
88
88
|
"prop-types": "^15.7.2",
|
|
89
89
|
"react-big-calendar": "^1.4.2",
|
|
@@ -49,7 +49,8 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
49
49
|
handleSuccessAddUser,
|
|
50
50
|
handleSuccessDeleteUser,
|
|
51
51
|
actionDisabled,
|
|
52
|
-
driversGroupsState
|
|
52
|
+
driversGroupsState,
|
|
53
|
+
setSelectedUsers
|
|
53
54
|
} = props
|
|
54
55
|
|
|
55
56
|
const history = useHistory()
|
|
@@ -195,6 +196,7 @@ const DeliveryUsersListingUI = (props) => {
|
|
|
195
196
|
handleOpenUserDetails={handleOpenUserDetails}
|
|
196
197
|
handleOpenUserAddForm={handleOpenUserAddForm}
|
|
197
198
|
actionDisabled={actionDisabled}
|
|
199
|
+
setSelectedUsers={setSelectedUsers}
|
|
198
200
|
/>
|
|
199
201
|
</UsersListingContainer>
|
|
200
202
|
|
|
@@ -128,7 +128,7 @@ export const DriversGroupLogistics = (props) => {
|
|
|
128
128
|
<LogisticsConfigItem
|
|
129
129
|
active={showConfig === 'GROUP_ORDERS'}
|
|
130
130
|
onClick={() => handleOpenConfig('GROUP_ORDERS')}
|
|
131
|
-
>
|
|
131
|
+
>
|
|
132
132
|
<span>{t('GROUP_ORDERS', 'Group Orders')}</span>
|
|
133
133
|
<ChevronRight />
|
|
134
134
|
</LogisticsConfigItem>
|
|
@@ -7,7 +7,6 @@ import FaUserAlt from '@meronex/icons/fa/FaUserAlt'
|
|
|
7
7
|
import { Envelope, Phone } from 'react-bootstrap-icons'
|
|
8
8
|
|
|
9
9
|
import { Switch } from '../../../styles'
|
|
10
|
-
import { UserTypeSelector } from '../../Users'
|
|
11
10
|
import { Pagination, ConfirmAdmin } from '../../Shared'
|
|
12
11
|
|
|
13
12
|
import {
|
|
@@ -19,13 +18,13 @@ import {
|
|
|
19
18
|
UserMainInfo,
|
|
20
19
|
CheckBoxWrapper,
|
|
21
20
|
InfoBlock,
|
|
22
|
-
UserTypeWrapper,
|
|
23
21
|
UserEnableWrapper,
|
|
24
22
|
WrapperPagination,
|
|
25
23
|
AddNewUserButton,
|
|
26
24
|
UsersBottomContainer,
|
|
27
25
|
VerifiedItemsContainer,
|
|
28
|
-
VerifiedItem
|
|
26
|
+
VerifiedItem,
|
|
27
|
+
UserIdWrapper
|
|
29
28
|
} from './styles'
|
|
30
29
|
|
|
31
30
|
export const UsersList = (props) => {
|
|
@@ -34,7 +33,6 @@ export const UsersList = (props) => {
|
|
|
34
33
|
usersList,
|
|
35
34
|
paginationProps,
|
|
36
35
|
getUsers,
|
|
37
|
-
handleChangeUserType,
|
|
38
36
|
handleChangeActiveUser,
|
|
39
37
|
selectedUsers,
|
|
40
38
|
handleSelectedUsers,
|
|
@@ -42,25 +40,15 @@ export const UsersList = (props) => {
|
|
|
42
40
|
handleOpenUserAddForm,
|
|
43
41
|
isDriversPage,
|
|
44
42
|
isDriversManagersPage,
|
|
45
|
-
actionDisabled
|
|
43
|
+
actionDisabled,
|
|
44
|
+
setSelectedUsers
|
|
46
45
|
} = props
|
|
47
46
|
|
|
48
47
|
const [, t] = useLanguage()
|
|
49
48
|
const [{ optimizeImage }] = useUtils()
|
|
50
49
|
|
|
51
50
|
const [confirmAdmin, setConfirmAdmin] = useState({ open: false, handleOnConfirm: null })
|
|
52
|
-
|
|
53
|
-
const getUserType = (type) => {
|
|
54
|
-
const userTypes = [
|
|
55
|
-
{ key: 0, value: t('ADMINISTRATOR', 'Administrator') },
|
|
56
|
-
{ key: 1, value: t('CITY_MANAGER', 'City manager') },
|
|
57
|
-
{ key: 2, value: t('BUSINESS_OWNER', 'Business owner') },
|
|
58
|
-
{ key: 3, value: t('USER', 'User') }
|
|
59
|
-
]
|
|
60
|
-
|
|
61
|
-
const objectStatus = userTypes.find(o => o.key === type)
|
|
62
|
-
return objectStatus && objectStatus
|
|
63
|
-
}
|
|
51
|
+
const [isAllChecked, setIsAllChecked] = useState(false)
|
|
64
52
|
|
|
65
53
|
const onChangeUserDetails = (e, user) => {
|
|
66
54
|
const isInvalid = e.target.closest('.user_checkbox') || e.target.closest('.user_type_selector') || e.target.closest('.user_enable_control') || e.target.closest('.user_action')
|
|
@@ -91,20 +79,26 @@ export const UsersList = (props) => {
|
|
|
91
79
|
}
|
|
92
80
|
}
|
|
93
81
|
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
82
|
+
const handleSelecteAllUser = () => {
|
|
83
|
+
const userIds = usersList.users?.reduce((ids, user) => [...ids, user.id], [])
|
|
84
|
+
if (!isAllChecked) {
|
|
85
|
+
setSelectedUsers([...selectedUsers, ...userIds])
|
|
97
86
|
} else {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
setConfirmAdmin({ ...confirmAdmin, open: false })
|
|
102
|
-
handleChangeUserType(type)
|
|
103
|
-
}
|
|
87
|
+
const userIdsToDeleteSet = new Set(userIds)
|
|
88
|
+
const updatedSelectedOrderIds = selectedUsers.filter((name) => {
|
|
89
|
+
return !userIdsToDeleteSet.has(name)
|
|
104
90
|
})
|
|
91
|
+
setSelectedUsers(updatedSelectedOrderIds)
|
|
105
92
|
}
|
|
106
93
|
}
|
|
107
94
|
|
|
95
|
+
useEffect(() => {
|
|
96
|
+
if (usersList.loading) return
|
|
97
|
+
const userIds = usersList.users?.reduce((ids, user) => [...ids, user.id], [])
|
|
98
|
+
const _isAllChecked = userIds.every(elem => selectedUsers.includes(elem))
|
|
99
|
+
setIsAllChecked(_isAllChecked)
|
|
100
|
+
}, [usersList.users, selectedUsers])
|
|
101
|
+
|
|
108
102
|
useEffect(() => {
|
|
109
103
|
if (usersList.loading || usersList.users.length > 0 || paginationProps.totalPages <= 1) return
|
|
110
104
|
if (paginationProps.currentPage !== paginationProps.totalPages) {
|
|
@@ -121,9 +115,26 @@ export const UsersList = (props) => {
|
|
|
121
115
|
<UsersTable>
|
|
122
116
|
<thead>
|
|
123
117
|
<tr>
|
|
118
|
+
{isDriversPage && (
|
|
119
|
+
<th>
|
|
120
|
+
<UserIdWrapper>
|
|
121
|
+
<CheckBoxWrapper
|
|
122
|
+
className='all-checkbox'
|
|
123
|
+
isChecked={!usersList?.loading && isAllChecked}
|
|
124
|
+
onClick={() => handleSelecteAllUser()}
|
|
125
|
+
>
|
|
126
|
+
{(!usersList?.loading && isAllChecked) ? (
|
|
127
|
+
<MdCheckBox />
|
|
128
|
+
) : (
|
|
129
|
+
<MdCheckBoxOutlineBlank />
|
|
130
|
+
)}
|
|
131
|
+
</CheckBoxWrapper>
|
|
132
|
+
{t('ID', 'ID')}
|
|
133
|
+
</UserIdWrapper>
|
|
134
|
+
</th>
|
|
135
|
+
)}
|
|
124
136
|
<th>{t('USER', 'User')}</th>
|
|
125
137
|
<th>{t('DETAILS', 'Details')}</th>
|
|
126
|
-
<th />
|
|
127
138
|
<th colSpan={2}>{t('ACTION', 'Action')}</th>
|
|
128
139
|
</tr>
|
|
129
140
|
</thead>
|
|
@@ -131,11 +142,18 @@ export const UsersList = (props) => {
|
|
|
131
142
|
[...Array(10).keys()].map(i => (
|
|
132
143
|
<tbody key={i}>
|
|
133
144
|
<tr>
|
|
145
|
+
{isDriversPage && (
|
|
146
|
+
<td>
|
|
147
|
+
<UserIdWrapper>
|
|
148
|
+
<CheckBoxWrapper>
|
|
149
|
+
<Skeleton width={20} height={20} />
|
|
150
|
+
</CheckBoxWrapper>
|
|
151
|
+
<Skeleton width={40} />
|
|
152
|
+
</UserIdWrapper>
|
|
153
|
+
</td>
|
|
154
|
+
)}
|
|
134
155
|
<td>
|
|
135
156
|
<UserMainInfo>
|
|
136
|
-
<CheckBoxWrapper>
|
|
137
|
-
<Skeleton width={20} height={20} />
|
|
138
|
-
</CheckBoxWrapper>
|
|
139
157
|
<WrapperImage isSkeleton>
|
|
140
158
|
<Skeleton width={45} height={45} />
|
|
141
159
|
</WrapperImage>
|
|
@@ -151,14 +169,6 @@ export const UsersList = (props) => {
|
|
|
151
169
|
<p><Skeleton width={100} /></p>
|
|
152
170
|
</InfoBlock>
|
|
153
171
|
</td>
|
|
154
|
-
<td>
|
|
155
|
-
{!(isDriversPage || isDriversManagersPage) && (
|
|
156
|
-
<UserTypeWrapper>
|
|
157
|
-
<Skeleton width={100} />
|
|
158
|
-
<p><Skeleton width={100} /></p>
|
|
159
|
-
</UserTypeWrapper>
|
|
160
|
-
)}
|
|
161
|
-
</td>
|
|
162
172
|
<td>
|
|
163
173
|
<UserEnableWrapper>
|
|
164
174
|
<span><Skeleton width={100} /></span>
|
|
@@ -174,19 +184,39 @@ export const UsersList = (props) => {
|
|
|
174
184
|
<tr
|
|
175
185
|
onClick={(e) => onChangeUserDetails(e, user)}
|
|
176
186
|
>
|
|
187
|
+
{isDriversPage && (
|
|
188
|
+
<td>
|
|
189
|
+
<UserIdWrapper>
|
|
190
|
+
<CheckBoxWrapper
|
|
191
|
+
className='user_checkbox'
|
|
192
|
+
isChecked={selectedUsers.includes(user.id)}
|
|
193
|
+
onClick={() => handleSelectedUsers(user.id)}
|
|
194
|
+
>
|
|
195
|
+
{selectedUsers.includes(user.id) ? (
|
|
196
|
+
<MdCheckBox />
|
|
197
|
+
) : (
|
|
198
|
+
<MdCheckBoxOutlineBlank />
|
|
199
|
+
)}
|
|
200
|
+
</CheckBoxWrapper>
|
|
201
|
+
{user?.id}
|
|
202
|
+
</UserIdWrapper>
|
|
203
|
+
</td>
|
|
204
|
+
)}
|
|
177
205
|
<td>
|
|
178
206
|
<UserMainInfo>
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
207
|
+
{isDriversManagersPage && (
|
|
208
|
+
<CheckBoxWrapper
|
|
209
|
+
className='user_checkbox'
|
|
210
|
+
isChecked={selectedUsers.includes(user.id)}
|
|
211
|
+
onClick={() => handleSelectedUsers(user.id)}
|
|
212
|
+
>
|
|
213
|
+
{selectedUsers.includes(user.id) ? (
|
|
214
|
+
<MdCheckBox />
|
|
215
|
+
) : (
|
|
216
|
+
<MdCheckBoxOutlineBlank />
|
|
217
|
+
)}
|
|
218
|
+
</CheckBoxWrapper>
|
|
219
|
+
)}
|
|
190
220
|
<WrapperImage>
|
|
191
221
|
{user?.photo ? (
|
|
192
222
|
<Image bgimage={optimizeImage(user?.photo, 'h_50,c_limit')} />
|
|
@@ -223,18 +253,6 @@ export const UsersList = (props) => {
|
|
|
223
253
|
<p>{user?.cellphone}</p>
|
|
224
254
|
</InfoBlock>
|
|
225
255
|
</td>
|
|
226
|
-
<td>
|
|
227
|
-
{!(isDriversPage || isDriversManagersPage) && (
|
|
228
|
-
<UserTypeWrapper className='user_type_selector'>
|
|
229
|
-
<UserTypeSelector
|
|
230
|
-
userId={user.id}
|
|
231
|
-
defaultUserType={user?.level}
|
|
232
|
-
handleChangeUserType={(type) => onChangeUserType(user, type)}
|
|
233
|
-
/>
|
|
234
|
-
<p>{getUserType(user?.level)?.value}</p>
|
|
235
|
-
</UserTypeWrapper>
|
|
236
|
-
)}
|
|
237
|
-
</td>
|
|
238
256
|
<td>
|
|
239
257
|
<UserEnableWrapper className='user_enable_control'>
|
|
240
258
|
<span>{t('ENABLE', 'Enable')}</span>
|
|
@@ -17,18 +17,6 @@ export const UsersTable = styled.table`
|
|
|
17
17
|
td, th {
|
|
18
18
|
padding: 10px 0;
|
|
19
19
|
font-size: 14px;
|
|
20
|
-
&:first-child {
|
|
21
|
-
width: 40%;
|
|
22
|
-
}
|
|
23
|
-
&:nth-child(2) {
|
|
24
|
-
width: 20%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&:nth-child(4),
|
|
28
|
-
|
|
29
|
-
&:nth-child(5) {
|
|
30
|
-
width: 10%;
|
|
31
|
-
}
|
|
32
20
|
}
|
|
33
21
|
|
|
34
22
|
thead {
|
|
@@ -266,3 +254,7 @@ export const VerifiedItemsContainer = styled.div`
|
|
|
266
254
|
}
|
|
267
255
|
}
|
|
268
256
|
`
|
|
257
|
+
export const UserIdWrapper = styled.div`
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
`
|
|
@@ -249,13 +249,13 @@ const HomeUI = (props) => {
|
|
|
249
249
|
>
|
|
250
250
|
{project[projectStatus.project?.current_status]?.status}
|
|
251
251
|
</ProjectCurrentStatus>
|
|
252
|
-
|
|
252
|
+
<Button
|
|
253
253
|
color='primary'
|
|
254
254
|
borderRadius='8px'
|
|
255
255
|
onClick={() => window.open(`https://${ordering?.project}.tryordering.com`, '_blank')}
|
|
256
256
|
>
|
|
257
257
|
{t('VISIT_MY_WEBSITE', 'Visit my Website')}
|
|
258
|
-
</Button>
|
|
258
|
+
</Button>
|
|
259
259
|
</ProjectStatusWrapper>
|
|
260
260
|
</ProjectInfoWrapper>
|
|
261
261
|
<img src={project[projectStatus.project?.current_status]?.image} alt='' />
|
|
@@ -498,10 +498,13 @@ const LoginFormUI = (props) => {
|
|
|
498
498
|
}
|
|
499
499
|
|
|
500
500
|
export const LoginForm = (props) => {
|
|
501
|
+
const [configFile, setConfigFile] = useContext(ConfigFileContext)
|
|
501
502
|
const loginControllerProps = {
|
|
502
503
|
...props,
|
|
503
504
|
UIComponent: LoginFormUI,
|
|
504
|
-
allowedLevels: [0, 2, 5, 8]
|
|
505
|
+
allowedLevels: [0, 2, 5, 8],
|
|
506
|
+
configFile,
|
|
507
|
+
setConfigFile
|
|
505
508
|
}
|
|
506
509
|
return <LoginFormController {...loginControllerProps} />
|
|
507
510
|
}
|