@itilite/iui-user-management 1.4.6 → 1.4.7
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/dist/index.css +247 -7
- package/dist/index.js +1227 -559
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1227 -559
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails,
|
|
2
|
-
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUISearch, IUICircularProgress, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUICard, IUIBackdrop, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIIconButton, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUIDropdownButton, IUITabs } from '@itilite/iuistyles';
|
|
2
|
+
import React, { useState, useEffect, memo, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
5
5
|
import AddIcon$1 from '@material-ui/icons/Add';
|
|
6
|
-
import DeleteIcon from '@material-ui/icons/Delete';
|
|
6
|
+
import DeleteIcon$1 from '@material-ui/icons/Delete';
|
|
7
7
|
import { useDispatch, useSelector, Provider } from 'react-redux';
|
|
8
8
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
|
-
import { useHistory, useLocation } from 'react-router-dom';
|
|
12
|
+
import { useParams, useHistory, useLocation } from 'react-router-dom';
|
|
13
13
|
import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
14
14
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
15
15
|
import Switch from '@material-ui/core/Switch';
|
|
@@ -18,51 +18,53 @@ import Button from '@material-ui/core/Button';
|
|
|
18
18
|
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography, Box } from '@material-ui/core';
|
|
19
19
|
import { useScrollPosition } from '@n8tb1t/use-scroll-position';
|
|
20
20
|
|
|
21
|
-
function
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
for (var key in source) {
|
|
26
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
27
|
-
target[key] = source[key];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
return _extends.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
36
|
-
if (!o) return;
|
|
37
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
38
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
39
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
40
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
41
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
42
|
-
}
|
|
43
|
-
function _arrayLikeToArray(arr, len) {
|
|
44
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
45
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
46
|
-
return arr2;
|
|
21
|
+
function _arrayLikeToArray(r, a) {
|
|
22
|
+
(null == a || a > r.length) && (a = r.length);
|
|
23
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
24
|
+
return n;
|
|
47
25
|
}
|
|
48
|
-
function _createForOfIteratorHelperLoose(
|
|
49
|
-
var
|
|
50
|
-
if (
|
|
51
|
-
if (Array.isArray(
|
|
52
|
-
|
|
53
|
-
var
|
|
26
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
27
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
28
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
29
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
30
|
+
t && (r = t);
|
|
31
|
+
var o = 0;
|
|
54
32
|
return function () {
|
|
55
|
-
|
|
56
|
-
done:
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
value: o[i++]
|
|
33
|
+
return o >= r.length ? {
|
|
34
|
+
done: !0
|
|
35
|
+
} : {
|
|
36
|
+
done: !1,
|
|
37
|
+
value: r[o++]
|
|
61
38
|
};
|
|
62
39
|
};
|
|
63
40
|
}
|
|
64
41
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
65
42
|
}
|
|
43
|
+
function _extends() {
|
|
44
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
45
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
46
|
+
var t = arguments[e];
|
|
47
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
48
|
+
}
|
|
49
|
+
return n;
|
|
50
|
+
}, _extends.apply(null, arguments);
|
|
51
|
+
}
|
|
52
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
53
|
+
if (null == r) return {};
|
|
54
|
+
var t = {};
|
|
55
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
56
|
+
if (e.includes(n)) continue;
|
|
57
|
+
t[n] = r[n];
|
|
58
|
+
}
|
|
59
|
+
return t;
|
|
60
|
+
}
|
|
61
|
+
function _unsupportedIterableToArray(r, a) {
|
|
62
|
+
if (r) {
|
|
63
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
64
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
65
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
66
68
|
|
|
67
69
|
var _Pact = /*#__PURE__*/function () {
|
|
68
70
|
function _Pact() {}
|
|
@@ -170,6 +172,17 @@ function _catch(body, recover) {
|
|
|
170
172
|
}
|
|
171
173
|
return result;
|
|
172
174
|
}
|
|
175
|
+
function _finallyRethrows(body, finalizer) {
|
|
176
|
+
try {
|
|
177
|
+
var result = body();
|
|
178
|
+
} catch (e) {
|
|
179
|
+
return finalizer(true, e);
|
|
180
|
+
}
|
|
181
|
+
if (result && result.then) {
|
|
182
|
+
return result.then(finalizer.bind(null, false), finalizer.bind(null, true));
|
|
183
|
+
}
|
|
184
|
+
return finalizer(false, result);
|
|
185
|
+
}
|
|
173
186
|
|
|
174
187
|
var styles = {"UUIUserManagementAddEdit":"_3n-WG","pageHeader":"_3qWcA","buttonWrapper":"_1IP9P","scrolled":"_m8f96","headingButtonWrapper":"_w9z7b","headingButtonWrapperProfile":"_12Wd9","hintText":"_ySdbZ","heading":"_2Y1Aw","headingLarge":"_2K1NF","headingMedium":"_RUuAz","headingSmall":"_23Dye","additionalInfoContainer":"_1Suhw","additionalInfoTitle":"_56iJF","titleContainer":"_H5nfl","expandIconAlign":"_3F4i0","detailsContainer":"_2G0LW","formWrapper":"_2fPRc","sectionWrapper":"_37Gqp","margin":"_2Sdl7","minGridWidth":"_2D7iu","firstRowMargin":"_1BozG","firstChildMargin":"_2C3Mb","paddingTop":"_DBPjV","backGrdColorOnHover":"_5oE6H","fieldMargin":"_RCWjq","productContainerGap":"_tuCbi","containerWidth":"_1oWos","productItemBroder":"_T0Hcd","headingPadding":"_2MFfQ","emptyFieldContainer":"_3VWtw","emptyFieldDescription":"_2jC5u","rowGap":"_1NJFY","formTitle":"_GAKk2","formDescription":"_3TZ6Z","themeLink":"_eJ_1B","dashedLine":"_3ZOs1","dividerColor":"_2pxEJ","errorTextCls":"_27eth","backdrop":"_Pm0Au","inputWidth":"_ajB82"};
|
|
175
188
|
|
|
@@ -244,8 +257,7 @@ var GetInputType = React.forwardRef(function (props, ref) {
|
|
|
244
257
|
hasInfoIcon: !!_p.tooltip,
|
|
245
258
|
tooltipText: _p.tooltip,
|
|
246
259
|
required: _p.required,
|
|
247
|
-
disableText: _p.disableText
|
|
248
|
-
className: "test-mudu"
|
|
260
|
+
disableText: _p.disableText
|
|
249
261
|
}));
|
|
250
262
|
case 'select':
|
|
251
263
|
return /*#__PURE__*/React.createElement(IUISelect, {
|
|
@@ -824,7 +836,7 @@ var UserRole = function UserRole(_ref) {
|
|
|
824
836
|
}));
|
|
825
837
|
};
|
|
826
838
|
|
|
827
|
-
var styles$1 = {"card":"_3_S9J","
|
|
839
|
+
var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expiryDate":"_2tBnF","cardImage":"_3QvZh","visa":"_1IpBm","mastercard":"_2x6IX","amex":"_2a38S","discover":"_2vksl","diners":"_2kQRs","jcb":"_2bO1f","unionpay":"_2_jfu","is_nothing":"_1Lrzs","addCard":"_3711U","cardDeleteBtn":"_7Da2t","cardLabel":"_PQTex","defaultLabel":"_smjc4","defaultBtn":"_1_ArA","cursonPointer":"_1L115","sectionWrapper":"_VpUCK","margin":"_1Fs_D","minGridWidth":"_1hl-Z","firstRowMargin":"_1WZZj","firstChildMargin":"_IT_O_","paddingTop":"_Mhnl7","dividerColor":"_3ltFd"};
|
|
828
840
|
|
|
829
841
|
var SHOW_LOADER = 'SHOW_LOADER';
|
|
830
842
|
var STOP_LOADER = 'STOP_LOADER';
|
|
@@ -2257,7 +2269,7 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2257
2269
|
}, /*#__PURE__*/React.createElement("button", {
|
|
2258
2270
|
type: "button",
|
|
2259
2271
|
onClick: handleCardDelete
|
|
2260
|
-
}, /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
2272
|
+
}, /*#__PURE__*/React.createElement(DeleteIcon$1, {
|
|
2261
2273
|
width: "10",
|
|
2262
2274
|
height: "10"
|
|
2263
2275
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -2277,15 +2289,13 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2277
2289
|
}));
|
|
2278
2290
|
};
|
|
2279
2291
|
var AddCard = function AddCard(_ref2) {
|
|
2280
|
-
var
|
|
2281
|
-
var pg = _ref2.pg,
|
|
2282
|
-
defaultCardError = _ref2.defaultCardError;
|
|
2292
|
+
var pg = _ref2.pg;
|
|
2283
2293
|
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2284
2294
|
var handleAddCard = function handleAddCard() {
|
|
2285
2295
|
window.location.assign(_url);
|
|
2286
2296
|
};
|
|
2287
2297
|
return /*#__PURE__*/React.createElement("div", {
|
|
2288
|
-
className: clsx(styles$1.card, styles$1.cursonPointer
|
|
2298
|
+
className: clsx(styles$1.card, styles$1.cursonPointer),
|
|
2289
2299
|
onClick: handleAddCard
|
|
2290
2300
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2291
2301
|
className: styles$1.addCard
|
|
@@ -2293,9 +2303,7 @@ var AddCard = function AddCard(_ref2) {
|
|
|
2293
2303
|
};
|
|
2294
2304
|
var PaymentCards = function PaymentCards(_ref3) {
|
|
2295
2305
|
var _paymentDetails$pg, _paymentDetails$pg2;
|
|
2296
|
-
var paymentDetails = _ref3.paymentDetails
|
|
2297
|
-
_ref3$defaultCardErro = _ref3.defaultCardError,
|
|
2298
|
-
defaultCardError = _ref3$defaultCardErro === void 0 ? null : _ref3$defaultCardErro;
|
|
2306
|
+
var paymentDetails = _ref3.paymentDetails;
|
|
2299
2307
|
if (!paymentDetails || Object.keys(paymentDetails).length === 0 || (!paymentDetails.cards || paymentDetails.cards.length === 0) && ((paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg = paymentDetails.pg) === null || _paymentDetails$pg === void 0 ? void 0 : _paymentDetails$pg.gateway.toLowerCase()) !== 'stripe' || (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg2 = paymentDetails.pg) === null || _paymentDetails$pg2 === void 0 ? void 0 : _paymentDetails$pg2.save_card_enable) !== 1)) {
|
|
2300
2308
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
2301
2309
|
}
|
|
@@ -2304,9 +2312,7 @@ var PaymentCards = function PaymentCards(_ref3) {
|
|
|
2304
2312
|
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2305
2313
|
container: true,
|
|
2306
2314
|
className: clsx(styles$1.sectionWrapper)
|
|
2307
|
-
}, /*#__PURE__*/React.createElement(
|
|
2308
|
-
id: "card-details-scroll"
|
|
2309
|
-
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2315
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2310
2316
|
item: true,
|
|
2311
2317
|
sm: 12,
|
|
2312
2318
|
md: 4
|
|
@@ -2334,14 +2340,9 @@ var PaymentCards = function PaymentCards(_ref3) {
|
|
|
2334
2340
|
isDefaultCard: !!+card.metadata.default_card,
|
|
2335
2341
|
pg: paymentDetails.pg
|
|
2336
2342
|
});
|
|
2337
|
-
}), (!paymentDetails.cards || paymentDetails.cards.length < 10) && paymentDetails.pg.gateway.toLowerCase() === 'stripe' && paymentDetails.pg.save_card_enable === 1 && /*#__PURE__*/React.createElement(
|
|
2338
|
-
pg: paymentDetails.pg
|
|
2339
|
-
|
|
2340
|
-
}), defaultCardError && /*#__PURE__*/React.createElement("p", {
|
|
2341
|
-
style: {
|
|
2342
|
-
color: 'red'
|
|
2343
|
-
}
|
|
2344
|
-
}, ' ', "Please provide default card detail")))))));
|
|
2343
|
+
}), (!paymentDetails.cards || paymentDetails.cards.length < 10) && paymentDetails.pg.gateway.toLowerCase() === 'stripe' && paymentDetails.pg.save_card_enable === 1 && /*#__PURE__*/React.createElement(AddCard, {
|
|
2344
|
+
pg: paymentDetails.pg
|
|
2345
|
+
}))))));
|
|
2345
2346
|
};
|
|
2346
2347
|
|
|
2347
2348
|
function AddIcon(props) {
|
|
@@ -2414,9 +2415,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2414
2415
|
_props$editUserId = props.editUserId,
|
|
2415
2416
|
editUserId = _props$editUserId === void 0 ? null : _props$editUserId,
|
|
2416
2417
|
_props$roles = props.roles,
|
|
2417
|
-
roles = _props$roles === void 0 ? [] : _props$roles
|
|
2418
|
-
_props$errorMsgs = props.errorMsgs,
|
|
2419
|
-
errorMsgs = _props$errorMsgs === void 0 ? null : _props$errorMsgs;
|
|
2418
|
+
roles = _props$roles === void 0 ? [] : _props$roles;
|
|
2420
2419
|
var _useState = useState({
|
|
2421
2420
|
product: '',
|
|
2422
2421
|
approvers: []
|
|
@@ -2712,10 +2711,9 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2712
2711
|
isError: !!errMsg[i],
|
|
2713
2712
|
placeholder: "Example label - \u201CManager\u201D"
|
|
2714
2713
|
}));
|
|
2715
|
-
})))), type === 'travel' && isProfile && paymentDetails && /*#__PURE__*/React.createElement(
|
|
2716
|
-
paymentDetails: paymentDetails
|
|
2717
|
-
|
|
2718
|
-
})));
|
|
2714
|
+
})))), type === 'travel' && isProfile && paymentDetails && /*#__PURE__*/React.createElement(PaymentCards, {
|
|
2715
|
+
paymentDetails: paymentDetails
|
|
2716
|
+
}));
|
|
2719
2717
|
};
|
|
2720
2718
|
|
|
2721
2719
|
var styles$2 = {"inputWidth":"_1qLG1"};
|
|
@@ -4048,18 +4046,6 @@ var setFieldsDisplayAtt = function setFieldsDisplayAtt(objToLoop, visibilityObj,
|
|
|
4048
4046
|
if (labelsObj && Object.hasOwnProperty.call(labelsObj, p.name)) {
|
|
4049
4047
|
p.label = labelsObj[p.name];
|
|
4050
4048
|
}
|
|
4051
|
-
var isProfilePage = window.location.pathname.includes('/profile');
|
|
4052
|
-
if (isProfilePage) {
|
|
4053
|
-
var searchParams = new URL(document.location).searchParams;
|
|
4054
|
-
var required = searchParams.get('required');
|
|
4055
|
-
if (required === 'dob') {
|
|
4056
|
-
if (p.name === 'dob') {
|
|
4057
|
-
if (required === 'dob') {
|
|
4058
|
-
p.required = true;
|
|
4059
|
-
}
|
|
4060
|
-
}
|
|
4061
|
-
}
|
|
4062
|
-
}
|
|
4063
4049
|
return p;
|
|
4064
4050
|
});
|
|
4065
4051
|
};
|
|
@@ -4499,26 +4485,929 @@ var ExpandLessIcon = function ExpandLessIcon(props) {
|
|
|
4499
4485
|
}));
|
|
4500
4486
|
};
|
|
4501
4487
|
|
|
4502
|
-
var
|
|
4503
|
-
|
|
4504
|
-
|
|
4488
|
+
var styles$3 = {"loyaltymodal":"_2LnGt","membershipDeleteModal":"_2LdH8","loyaltyList":"_r0C_N","divider":"_3v2HU","selectSearchBox":"_1bAuu","chevronIcon":"_33J5X","selectWrapper":"_AJzhr","membershipList":"_u-SZq","list":"_2GyN2","memberItem":"_2d9GY","membershipDetails":"_194K1","title":"_l3kQ9","subtitle":"_33IR-","saveMembership":"_35aiF","newMembershipIcon":"_2d5UD","loading":"_1quY2","searchInput":"_1oiP4","membershipChainInfo":"_10Fx3","addNewMembership":"_3Y8Dj","savedMembership":"_2cSoW","iconWrapper":"_1Thb8","iconPar":"_O51oP","icon":"_3CdwB","number":"_1eJyq","actions":"_f_N1r"};
|
|
4489
|
+
|
|
4490
|
+
var ChevronNext = function ChevronNext(_ref) {
|
|
4491
|
+
var _ref$color = _ref.color,
|
|
4492
|
+
color = _ref$color === void 0 ? '#9CA3AF' : _ref$color;
|
|
4505
4493
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4506
4494
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4507
|
-
width:
|
|
4508
|
-
height:
|
|
4495
|
+
width: "8",
|
|
4496
|
+
height: "16",
|
|
4509
4497
|
fill: "none",
|
|
4510
|
-
viewBox: "0 0
|
|
4498
|
+
viewBox: "0 0 8 16"
|
|
4511
4499
|
}, /*#__PURE__*/React.createElement("path", {
|
|
4512
|
-
|
|
4513
|
-
|
|
4500
|
+
stroke: color,
|
|
4501
|
+
strokeLinecap: "round",
|
|
4502
|
+
strokeLinejoin: "round",
|
|
4503
|
+
d: "M2 4l4 4-4 4"
|
|
4504
|
+
}));
|
|
4505
|
+
};
|
|
4506
|
+
|
|
4507
|
+
var sixteenDigitNumber = /^\d{16}$/;
|
|
4508
|
+
var MembershipForm = function MembershipForm(_ref) {
|
|
4509
|
+
var selectedMembershipChain = _ref.selectedMembershipChain,
|
|
4510
|
+
isOtherMembership = _ref.isOtherMembership,
|
|
4511
|
+
membershipName = _ref.membershipName,
|
|
4512
|
+
membershipNumber = _ref.membershipNumber,
|
|
4513
|
+
setMembershipName = _ref.setMembershipName,
|
|
4514
|
+
setMembershipNumber = _ref.setMembershipNumber,
|
|
4515
|
+
type = _ref.type,
|
|
4516
|
+
isEdit = _ref.isEdit,
|
|
4517
|
+
_ref$isAAAloyaltySele = _ref.isAAAloyaltySelected,
|
|
4518
|
+
isAAAloyaltySelected = _ref$isAAAloyaltySele === void 0 ? false : _ref$isAAAloyaltySele;
|
|
4519
|
+
var FallbackIcon = function FallbackIcon() {
|
|
4520
|
+
var url = '';
|
|
4521
|
+
if (type === 'flight') {
|
|
4522
|
+
url = 'https://d2n81k4sk1bpk1.cloudfront.net/dashboard/flightmemfallback.png';
|
|
4523
|
+
} else if (type === 'hotel') {
|
|
4524
|
+
url = 'https://d2n81k4sk1bpk1.cloudfront.net/dashboard/hotelmemfallback.png';
|
|
4525
|
+
} else {
|
|
4526
|
+
url = 'https://d2n81k4sk1bpk1.cloudfront.net/dashboard/carmemfallback.png';
|
|
4527
|
+
}
|
|
4528
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4529
|
+
className: styles$3.newMembershipIcon
|
|
4530
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4531
|
+
src: url
|
|
4532
|
+
}));
|
|
4533
|
+
};
|
|
4534
|
+
var placeholder = 'e.g. SkyMiles';
|
|
4535
|
+
if (type === 'hotel') {
|
|
4536
|
+
placeholder = 'e.g. Best Western';
|
|
4537
|
+
}
|
|
4538
|
+
if (type === 'rental_car') {
|
|
4539
|
+
placeholder = 'e.g. Firefly Car Rental';
|
|
4540
|
+
}
|
|
4541
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4542
|
+
className: styles$3.saveMembership
|
|
4543
|
+
}, isOtherMembership ? /*#__PURE__*/React.createElement("div", {
|
|
4544
|
+
className: styles$3.addNewMembership
|
|
4545
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4546
|
+
className: styles$3.membershipChainInfo
|
|
4547
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, null), /*#__PURE__*/React.createElement("p", null, isEdit ? 'Edit' : 'Add new', " membership")), /*#__PURE__*/React.createElement(IUILabel, {
|
|
4548
|
+
label: "Membership name",
|
|
4549
|
+
required: true
|
|
4550
|
+
}), /*#__PURE__*/React.createElement(IUISearch, {
|
|
4551
|
+
placeholder: placeholder,
|
|
4552
|
+
value: membershipName,
|
|
4553
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
4554
|
+
var inputValue = e.target.value;
|
|
4555
|
+
if ((inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) <= 50) {
|
|
4556
|
+
setMembershipName(inputValue);
|
|
4557
|
+
}
|
|
4558
|
+
},
|
|
4559
|
+
iconComponent: null,
|
|
4560
|
+
style: {
|
|
4561
|
+
width: '100%',
|
|
4562
|
+
paddingLeft: 0,
|
|
4563
|
+
borderRadius: 6
|
|
4564
|
+
}
|
|
4565
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
4566
|
+
className: styles$3.membershipChainInfo
|
|
4567
|
+
}, selectedMembershipChain !== null && selectedMembershipChain !== void 0 && selectedMembershipChain.loyalty_program_image_url ? /*#__PURE__*/React.createElement("img", {
|
|
4568
|
+
src: selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_image_url,
|
|
4569
|
+
alt: selectedMembershipChain.program_name,
|
|
4570
|
+
onError: function onError(e) {
|
|
4571
|
+
e.target.style.display = 'none';
|
|
4572
|
+
var fallbackContainer = e.target.nextElementSibling;
|
|
4573
|
+
if (fallbackContainer) fallbackContainer.style.display = 'block';
|
|
4574
|
+
}
|
|
4575
|
+
}) : /*#__PURE__*/React.createElement(FallbackIcon, null), /*#__PURE__*/React.createElement("div", {
|
|
4576
|
+
style: {
|
|
4577
|
+
display: 'none'
|
|
4578
|
+
}
|
|
4579
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, null)), /*#__PURE__*/React.createElement("p", null, isEdit ? 'Edit' : 'Add', ' ', (selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_name) || (selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.program_name))), /*#__PURE__*/React.createElement(IUILabel, {
|
|
4580
|
+
label: "Membership number",
|
|
4581
|
+
required: true
|
|
4582
|
+
}), /*#__PURE__*/React.createElement(IUISearch, {
|
|
4583
|
+
placeholder: isAAAloyaltySelected ? 'Enter 16-digit AAA membership ID' : 'e.g. ABCD1234',
|
|
4584
|
+
value: membershipNumber,
|
|
4585
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
4586
|
+
var inputValue = e.target.value;
|
|
4587
|
+
if ((inputValue === null || inputValue === void 0 ? void 0 : inputValue.length) <= 50) {
|
|
4588
|
+
setMembershipNumber(inputValue);
|
|
4589
|
+
}
|
|
4590
|
+
},
|
|
4591
|
+
iconComponent: null,
|
|
4592
|
+
style: {
|
|
4593
|
+
width: '100%',
|
|
4594
|
+
paddingLeft: 0,
|
|
4595
|
+
borderRadius: 6
|
|
4596
|
+
}
|
|
4597
|
+
}), isAAAloyaltySelected && membershipNumber && !sixteenDigitNumber.test(membershipNumber) && /*#__PURE__*/React.createElement("div", {
|
|
4598
|
+
style: {
|
|
4599
|
+
color: '#cf2231',
|
|
4600
|
+
marginTop: 5
|
|
4601
|
+
}
|
|
4602
|
+
}, "Enter a valid 16-digit AAA membership ID"));
|
|
4603
|
+
};
|
|
4604
|
+
|
|
4605
|
+
var TravelModeIcon = function TravelModeIcon(_ref) {
|
|
4606
|
+
var type = _ref.type;
|
|
4607
|
+
var FlightIcon = memo(function () {
|
|
4608
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4609
|
+
width: "24",
|
|
4610
|
+
height: "24",
|
|
4611
|
+
viewBox: "0 0 24 24",
|
|
4612
|
+
fill: "none",
|
|
4613
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4614
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4615
|
+
d: "M3 15.7694L8.3033 21.0727L8.81769 20.5583C9.15248 20.2235 9.26938 19.7283 9.11966 19.2791L8.65685 17.8907L12.5459 14.0016L16.7886 21.0727L17.6745 20.1867C18.2231 19.6382 18.4504 18.8457 18.2759 18.0898L16.435 10.1125L20.0906 6.45695C20.2454 6.30211 20.3775 6.12609 20.4713 5.92822C20.7764 5.28463 21.4051 3.76894 20.8544 3.21824C20.3037 2.66754 18.7881 3.29628 18.1445 3.60138C17.9466 3.69518 17.7706 3.82724 17.6157 3.98208L13.9602 7.63766L5.98289 5.79675C5.22698 5.62231 4.43452 5.84959 3.88596 6.39814L3 7.28411L10.0711 11.5267L6.18198 15.4158L4.79356 14.953C4.34439 14.8033 3.84918 14.9202 3.51439 15.255L3 15.7694Z",
|
|
4616
|
+
stroke: "#EC5D25",
|
|
4617
|
+
strokeWidth: "1.5",
|
|
4618
|
+
strokeLinejoin: "round"
|
|
4619
|
+
}));
|
|
4620
|
+
});
|
|
4621
|
+
var HotelIcon = memo(function () {
|
|
4622
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4623
|
+
width: "24",
|
|
4624
|
+
height: "24",
|
|
4625
|
+
viewBox: "0 0 24 24",
|
|
4626
|
+
fill: "none",
|
|
4627
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4628
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4629
|
+
fillRule: "evenodd",
|
|
4630
|
+
clipRule: "evenodd",
|
|
4631
|
+
d: "M2.75 5C3.16421 5 3.5 5.33579 3.5 5.75V14H11V9C11 7.89543 11.8954 7 13 7H19C20.6569 7 22 8.34315 22 10V18.25C22 18.6642 21.6642 19 21.25 19C20.8358 19 20.5 18.6642 20.5 18.25V15.5H3.5V18.25C3.5 18.6642 3.16421 19 2.75 19C2.33579 19 2 18.6642 2 18.25V5.75C2 5.33579 2.33579 5 2.75 5ZM20.5 14V10C20.5 9.17157 19.8284 8.5 19 8.5H13C12.7239 8.5 12.5 8.72386 12.5 9V14H20.5ZM7.5 9.5C6.94772 9.5 6.5 9.94772 6.5 10.5C6.5 11.0523 6.94772 11.5 7.5 11.5C8.05228 11.5 8.5 11.0523 8.5 10.5C8.5 9.94772 8.05228 9.5 7.5 9.5ZM5 10.5C5 9.11929 6.11929 8 7.5 8C8.88071 8 10 9.11929 10 10.5C10 11.8807 8.88071 13 7.5 13C6.11929 13 5 11.8807 5 10.5Z",
|
|
4632
|
+
fill: "#EC5D25"
|
|
4633
|
+
}));
|
|
4634
|
+
});
|
|
4635
|
+
var CarIcon = memo(function () {
|
|
4636
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4637
|
+
width: "24",
|
|
4638
|
+
height: "24",
|
|
4639
|
+
viewBox: "0 0 24 24",
|
|
4640
|
+
fill: "none",
|
|
4641
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4642
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4643
|
+
d: "M8 14C8 14.5523 7.55228 15 7 15C6.44772 15 6 14.5523 6 14C6 13.4477 6.44772 13 7 13C7.55228 13 8 13.4477 8 14Z",
|
|
4644
|
+
fill: "#EC5D25"
|
|
4645
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4646
|
+
d: "M18 14C18 14.5523 17.5523 15 17 15C16.4477 15 16 14.5523 16 14C16 13.4477 16.4477 13 17 13C17.5523 13 18 13.4477 18 14Z",
|
|
4647
|
+
fill: "#EC5D25"
|
|
4648
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
4649
|
+
fillRule: "evenodd",
|
|
4650
|
+
clipRule: "evenodd",
|
|
4651
|
+
d: "M7.69288 5.5C7.46964 5.5 7.27344 5.64799 7.21211 5.86264L6.03001 10H17.97L16.7879 5.86264C16.7266 5.64799 16.5304 5.5 16.3071 5.5H7.69288ZM19.6762 10.5117C20.4737 11.05 21 11.963 21 13V18.75C21 19.4404 20.4404 20 19.75 20C19.0596 20 18.5 19.4404 18.5 18.75V18H5.5V18.75C5.5 19.4404 4.94036 20 4.25 20C3.55964 20 3 19.4404 3 18.75V13C3 11.963 3.52626 11.05 4.32378 10.5117L4.46999 10H3.75C3.33579 10 3 9.66421 3 9.25C3 8.83579 3.33579 8.5 3.75 8.5H4.89856L5.76983 5.45056C6.01514 4.59196 6.79992 4 7.69288 4H16.3071C17.2001 4 17.9849 4.59196 18.2302 5.45056L19.1014 8.5H20.25C20.6642 8.5 21 8.83579 21 9.25C21 9.66421 20.6642 10 20.25 10H19.53L19.6762 10.5117ZM4.5 16.5H19.5V13C19.5 12.4218 19.173 11.9187 18.6904 11.6678C18.4846 11.5608 18.2505 11.5 18 11.5H6C5.7495 11.5 5.51541 11.5608 5.30955 11.6678C4.82695 11.9187 4.5 12.4218 4.5 13V16.5Z",
|
|
4652
|
+
fill: "#EC5D25"
|
|
4653
|
+
}));
|
|
4654
|
+
});
|
|
4655
|
+
if (type === 'flight') return /*#__PURE__*/React.createElement(FlightIcon, null);
|
|
4656
|
+
if (type === 'hotel') return /*#__PURE__*/React.createElement(HotelIcon, null);
|
|
4657
|
+
if (type === 'rental_car') return /*#__PURE__*/React.createElement(CarIcon, null);
|
|
4658
|
+
return null;
|
|
4659
|
+
};
|
|
4660
|
+
|
|
4661
|
+
var Loader = function Loader() {
|
|
4662
|
+
return /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
4663
|
+
color: "inherit",
|
|
4664
|
+
size: 25,
|
|
4665
|
+
style: {
|
|
4666
|
+
color: '#EC5D25'
|
|
4667
|
+
}
|
|
4668
|
+
});
|
|
4669
|
+
};
|
|
4670
|
+
var LoyaltyPrograms = function LoyaltyPrograms(_ref) {
|
|
4671
|
+
var items = _ref.items,
|
|
4672
|
+
handleSelect = _ref.handleSelect,
|
|
4673
|
+
loading = _ref.loading,
|
|
4674
|
+
setIsOtherMembership = _ref.setIsOtherMembership,
|
|
4675
|
+
searchQuery = _ref.searchQuery,
|
|
4676
|
+
fetchItems = _ref.fetchItems,
|
|
4677
|
+
type = _ref.type,
|
|
4678
|
+
_ref$nextPageAvailabl = _ref.nextPageAvailable,
|
|
4679
|
+
nextPageAvailable = _ref$nextPageAvailabl === void 0 ? false : _ref$nextPageAvailabl,
|
|
4680
|
+
page = _ref.page;
|
|
4681
|
+
var observerRef = useRef(null);
|
|
4682
|
+
var delayTimeoutRef = useRef(null);
|
|
4683
|
+
useEffect(function () {
|
|
4684
|
+
if (!nextPageAvailable || loading) return;
|
|
4685
|
+
var observer = new IntersectionObserver(function (entries) {
|
|
4686
|
+
if (entries[0].isIntersecting) {
|
|
4687
|
+
if (nextPageAvailable) fetchItems(searchQuery);
|
|
4688
|
+
}
|
|
4689
|
+
}, {
|
|
4690
|
+
threshold: 0.5
|
|
4691
|
+
});
|
|
4692
|
+
var target = observerRef.current;
|
|
4693
|
+
if (target) {
|
|
4694
|
+
observer.observe(target);
|
|
4695
|
+
}
|
|
4696
|
+
return function () {
|
|
4697
|
+
if (target) {
|
|
4698
|
+
observer.unobserve(target);
|
|
4699
|
+
}
|
|
4700
|
+
if (delayTimeoutRef.current) {
|
|
4701
|
+
clearTimeout(delayTimeoutRef.current);
|
|
4702
|
+
}
|
|
4703
|
+
};
|
|
4704
|
+
}, [loading, nextPageAvailable, searchQuery, fetchItems]);
|
|
4705
|
+
var FallbackIcon = function FallbackIcon() {
|
|
4706
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4707
|
+
className: styles$3.newMembershipIcon
|
|
4708
|
+
}, /*#__PURE__*/React.createElement(TravelModeIcon, {
|
|
4709
|
+
type: type
|
|
4710
|
+
}));
|
|
4711
|
+
};
|
|
4712
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4713
|
+
className: styles$3.list
|
|
4714
|
+
}, page === 1 && loading ? null : items.map(function (item) {
|
|
4715
|
+
var _item$associated_name, _item$associated_name2;
|
|
4716
|
+
var associatedList = (item === null || item === void 0 ? void 0 : item.program_name) === 'Other' ? 'Add new membership program' : type === 'rental_car' ? item === null || item === void 0 ? void 0 : item.program_name : item !== null && item !== void 0 && (_item$associated_name = item.associated_names) !== null && _item$associated_name !== void 0 && _item$associated_name.length ? item === null || item === void 0 ? void 0 : (_item$associated_name2 = item.associated_names) === null || _item$associated_name2 === void 0 ? void 0 : _item$associated_name2.join(', ') : '';
|
|
4717
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4718
|
+
onClick: function onClick() {
|
|
4719
|
+
handleSelect(item);
|
|
4720
|
+
if (item.program_name === 'Other') {
|
|
4721
|
+
setIsOtherMembership(true);
|
|
4722
|
+
}
|
|
4723
|
+
},
|
|
4724
|
+
key: item.id,
|
|
4725
|
+
className: styles$3.memberItem
|
|
4726
|
+
}, item !== null && item !== void 0 && item.loyalty_program_image_url ? /*#__PURE__*/React.createElement("div", {
|
|
4727
|
+
style: {
|
|
4728
|
+
background: "url(" + (item === null || item === void 0 ? void 0 : item.loyalty_program_image_url) + ")",
|
|
4729
|
+
backgroundSize: 600,
|
|
4730
|
+
borderRadius: 6,
|
|
4731
|
+
border: '1px solid #F1F3F5',
|
|
4732
|
+
backgroundPosition: 'top',
|
|
4733
|
+
height: 40,
|
|
4734
|
+
display: 'flex',
|
|
4735
|
+
alignItems: 'center'
|
|
4736
|
+
}
|
|
4737
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4738
|
+
src: item === null || item === void 0 ? void 0 : item.loyalty_program_image_url,
|
|
4739
|
+
alt: item.title,
|
|
4740
|
+
onError: function onError(e) {
|
|
4741
|
+
e.target.style.display = 'none';
|
|
4742
|
+
var fallbackContainer = e.target.nextElementSibling;
|
|
4743
|
+
if (fallbackContainer) fallbackContainer.style.display = 'block';
|
|
4744
|
+
}
|
|
4745
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
4746
|
+
className: styles$3.newMembershipIcon
|
|
4747
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
4748
|
+
className: styles$3.newMembershipIcon,
|
|
4749
|
+
style: {
|
|
4750
|
+
display: 'none'
|
|
4751
|
+
}
|
|
4752
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
4753
|
+
className: styles$3.membershipDetails
|
|
4754
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4755
|
+
className: styles$3.title
|
|
4756
|
+
}, item === null || item === void 0 ? void 0 : item.program_name), /*#__PURE__*/React.createElement("div", {
|
|
4757
|
+
className: styles$3.subtitle,
|
|
4758
|
+
title: associatedList
|
|
4759
|
+
}, associatedList)));
|
|
4760
|
+
}), loading && /*#__PURE__*/React.createElement("div", {
|
|
4761
|
+
className: styles$3.loading
|
|
4762
|
+
}, /*#__PURE__*/React.createElement(Loader, null)), !loading && nextPageAvailable && /*#__PURE__*/React.createElement("div", {
|
|
4763
|
+
ref: observerRef,
|
|
4764
|
+
className: styles$3.loading
|
|
4765
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Loader, null))));
|
|
4766
|
+
};
|
|
4767
|
+
|
|
4768
|
+
var EditIcon = function EditIcon() {
|
|
4769
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4770
|
+
width: "16",
|
|
4771
|
+
height: "16",
|
|
4772
|
+
viewBox: "0 0 16 16",
|
|
4773
|
+
fill: "none",
|
|
4774
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4775
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
4776
|
+
clipPath: "url(#clip0_13010_74651)"
|
|
4777
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4778
|
+
d: "M10.7197 1.72376C11.7029 0.740515 13.2971 0.740516 14.2803 1.72377C15.2636 2.70701 15.2636 4.30118 14.2803 5.28443L5.14645 14.4183C4.77137 14.7934 4.26267 15.0041 3.73223 15.0041H2C1.44772 15.0041 1 14.5564 1 14.0041V12.2719C1 11.7414 1.21071 11.2327 1.58579 10.8576L10.7197 1.72376ZM13.2197 2.78443C12.8222 2.38696 12.1778 2.38696 11.7803 2.78443L11.0607 3.5041L12.5 4.94344L13.2197 4.22376C13.6171 3.8263 13.6171 3.18189 13.2197 2.78443ZM11.4393 6.0041L10 4.56476L2.64645 11.9183C2.55268 12.0121 2.5 12.1393 2.5 12.2719V13.5041H3.73223C3.86484 13.5041 3.99202 13.4514 4.08579 13.3576L11.4393 6.0041Z",
|
|
4779
|
+
fill: "#EC5D25"
|
|
4780
|
+
})), /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
|
|
4781
|
+
id: "clip0_13010_74651"
|
|
4782
|
+
}, /*#__PURE__*/React.createElement("rect", {
|
|
4783
|
+
width: "16",
|
|
4784
|
+
height: "16",
|
|
4785
|
+
fill: "white",
|
|
4786
|
+
transform: "translate(0 0.00390625)"
|
|
4787
|
+
}))));
|
|
4788
|
+
};
|
|
4789
|
+
|
|
4790
|
+
var DeleteIcon = function DeleteIcon() {
|
|
4791
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
4792
|
+
width: "16",
|
|
4793
|
+
height: "16",
|
|
4794
|
+
viewBox: "0 0 16 16",
|
|
4795
|
+
fill: "none",
|
|
4796
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
4797
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
4798
|
+
fillRule: "evenodd",
|
|
4799
|
+
clipRule: "evenodd",
|
|
4800
|
+
d: "M7.33333 2.33716C7.14924 2.33716 7 2.4864 7 2.67049V3.33716H9V2.67049C9 2.4864 8.85076 2.33716 8.66667 2.33716H7.33333ZM10 3.33716V2.67049C10 1.93411 9.40305 1.33716 8.66667 1.33716H7.33333C6.59695 1.33716 6 1.93411 6 2.67049V3.33716H2.5C2.22386 3.33716 2 3.56102 2 3.83716C2 4.1133 2.22386 4.33716 2.5 4.33716H3.03122L3.57716 12.7993C3.64506 13.8516 4.51843 14.6705 5.57301 14.6705H10.427C11.4816 14.6705 12.3549 13.8516 12.4228 12.7993L12.9688 4.33716H13.5C13.7761 4.33716 14 4.1133 14 3.83716C14 3.56102 13.7761 3.33716 13.5 3.33716H10ZM11.9667 4.33716H4.0333L4.57509 12.7349C4.60903 13.2611 5.04572 13.6705 5.57301 13.6705H10.427C10.9543 13.6705 11.391 13.2611 11.4249 12.7349L11.9667 4.33716ZM6.5 6.00383C6.77614 6.00383 7 6.22768 7 6.50383V11.5038C7 11.78 6.77614 12.0038 6.5 12.0038C6.22386 12.0038 6 11.78 6 11.5038V6.50383C6 6.22768 6.22386 6.00383 6.5 6.00383ZM9.5 6.00383C9.77614 6.00383 10 6.22768 10 6.50383V11.5038C10 11.78 9.77614 12.0038 9.5 12.0038C9.22386 12.0038 9 11.78 9 11.5038V6.50383C9 6.22768 9.22386 6.00383 9.5 6.00383Z",
|
|
4801
|
+
fill: "#CF2231"
|
|
4802
|
+
}));
|
|
4803
|
+
};
|
|
4804
|
+
|
|
4805
|
+
var _excluded = ["ind"];
|
|
4806
|
+
var IUIToastMessageService$4 = services.IUIToastMessageService;
|
|
4807
|
+
var api$6 = configs.api;
|
|
4808
|
+
var SavedMemberships = function SavedMemberships(_ref) {
|
|
4809
|
+
var _ref$list = _ref.list,
|
|
4810
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
4811
|
+
type = _ref.type,
|
|
4812
|
+
_ref$updateList = _ref.updateList,
|
|
4813
|
+
updateList = _ref$updateList === void 0 ? function () {} : _ref$updateList,
|
|
4814
|
+
_ref$handleEdit = _ref.handleEdit,
|
|
4815
|
+
handleEdit = _ref$handleEdit === void 0 ? function () {} : _ref$handleEdit;
|
|
4816
|
+
var _useState = useState(false),
|
|
4817
|
+
open = _useState[0],
|
|
4818
|
+
setOpen = _useState[1];
|
|
4819
|
+
var _useState2 = useState(false),
|
|
4820
|
+
isDeleting = _useState2[0],
|
|
4821
|
+
setIsDeleting = _useState2[1];
|
|
4822
|
+
var _useState3 = useState(null),
|
|
4823
|
+
deleteItemData = _useState3[0],
|
|
4824
|
+
setDeleteItemData = _useState3[1];
|
|
4825
|
+
var _useSelector = useSelector(function (state) {
|
|
4826
|
+
return state.common;
|
|
4827
|
+
}),
|
|
4828
|
+
userID = _useSelector.id;
|
|
4829
|
+
var handleClose = function handleClose() {
|
|
4830
|
+
setOpen(false);
|
|
4831
|
+
setDeleteItemData(null);
|
|
4832
|
+
};
|
|
4833
|
+
var handleSubmit = function handleSubmit() {
|
|
4834
|
+
try {
|
|
4835
|
+
var url = "/api/v1/user-management/users/" + userID + "/membership";
|
|
4836
|
+
var index = deleteItemData.ind,
|
|
4837
|
+
rest = _objectWithoutPropertiesLoose(deleteItemData, _excluded);
|
|
4838
|
+
var payload = _extends({}, rest, {
|
|
4839
|
+
user: userID
|
|
4840
|
+
});
|
|
4841
|
+
setIsDeleting(true);
|
|
4842
|
+
var _temp = _catch(function () {
|
|
4843
|
+
return Promise.resolve(api$6["delete"](url, {
|
|
4844
|
+
data: payload
|
|
4845
|
+
})).then(function (response) {
|
|
4846
|
+
var _response$data;
|
|
4847
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.status) {
|
|
4848
|
+
updateList(type, index);
|
|
4849
|
+
setOpen(false);
|
|
4850
|
+
IUIToastMessageService$4.notify("Membership deleted.");
|
|
4851
|
+
} else {
|
|
4852
|
+
IUIToastMessageService$4.warningNotify('Something went wrong!!');
|
|
4853
|
+
}
|
|
4854
|
+
setIsDeleting(false);
|
|
4855
|
+
});
|
|
4856
|
+
}, function (error) {
|
|
4857
|
+
console.error('Error occurred while deleting membership:', error);
|
|
4858
|
+
IUIToastMessageService$4.errorNotify('Failed to delete membership. Please try again.');
|
|
4859
|
+
setIsDeleting(false);
|
|
4860
|
+
});
|
|
4861
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
4862
|
+
} catch (e) {
|
|
4863
|
+
return Promise.reject(e);
|
|
4864
|
+
}
|
|
4865
|
+
};
|
|
4866
|
+
var handleDelete = function handleDelete(mem) {
|
|
4867
|
+
setOpen(true);
|
|
4868
|
+
setDeleteItemData(mem);
|
|
4869
|
+
};
|
|
4870
|
+
var onEdit = function onEdit(mem, index, isOther) {
|
|
4871
|
+
handleEdit(mem, index, isOther);
|
|
4872
|
+
};
|
|
4873
|
+
var FallbackIcon = function FallbackIcon(_ref2) {
|
|
4874
|
+
var type = _ref2.type;
|
|
4875
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4876
|
+
className: styles$3.newMembershipIcon
|
|
4877
|
+
}, /*#__PURE__*/React.createElement(TravelModeIcon, {
|
|
4878
|
+
type: type
|
|
4879
|
+
}));
|
|
4880
|
+
};
|
|
4881
|
+
var _ref3 = deleteItemData || {},
|
|
4882
|
+
_ref3$name = _ref3.name,
|
|
4883
|
+
name = _ref3$name === void 0 ? '' : _ref3$name,
|
|
4884
|
+
_ref3$program_name = _ref3.program_name,
|
|
4885
|
+
program_name = _ref3$program_name === void 0 ? '' : _ref3$program_name,
|
|
4886
|
+
_ref3$loyalty_program = _ref3.loyalty_program_name,
|
|
4887
|
+
loyalty_program_name = _ref3$loyalty_program === void 0 ? '' : _ref3$loyalty_program;
|
|
4888
|
+
var deleteMembershipName = loyalty_program_name === 'Other' ? name || loyalty_program_name || program_name : loyalty_program_name || program_name || name;
|
|
4889
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IUIModal, {
|
|
4890
|
+
isOpen: open,
|
|
4891
|
+
closeHandler: handleClose,
|
|
4892
|
+
cancelLabel: "Cancel",
|
|
4893
|
+
submitLabel: isDeleting ? 'Deleting...' : 'Delete',
|
|
4894
|
+
submitHandler: handleSubmit,
|
|
4895
|
+
modalBodyStyle: {
|
|
4896
|
+
padding: '0px 24px',
|
|
4897
|
+
minHeight: 50,
|
|
4898
|
+
borderBottom: '1px solid #E5E7EB'
|
|
4899
|
+
},
|
|
4900
|
+
isDisabledSubmitBtn: isDeleting,
|
|
4901
|
+
headerText: "Delete " + deleteMembershipName,
|
|
4902
|
+
width: "640px",
|
|
4903
|
+
modalClass: styles$3.membershipDeleteModal
|
|
4904
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
4905
|
+
style: {
|
|
4906
|
+
marginTop: 0,
|
|
4907
|
+
color: '#6B7280'
|
|
4908
|
+
}
|
|
4909
|
+
}, "Are you sure you want to delete ", deleteMembershipName, "? This change is not reversible.")), list.map(function (mem, ind) {
|
|
4910
|
+
var _ref4 = mem || {},
|
|
4911
|
+
_ref4$name = _ref4.name,
|
|
4912
|
+
name = _ref4$name === void 0 ? '' : _ref4$name,
|
|
4913
|
+
_ref4$number = _ref4.number,
|
|
4914
|
+
number = _ref4$number === void 0 ? '' : _ref4$number,
|
|
4915
|
+
_ref4$program_name = _ref4.program_name,
|
|
4916
|
+
program_name = _ref4$program_name === void 0 ? '' : _ref4$program_name,
|
|
4917
|
+
_ref4$loyalty_program = _ref4.loyalty_program_image_url,
|
|
4918
|
+
loyalty_program_image_url = _ref4$loyalty_program === void 0 ? null : _ref4$loyalty_program,
|
|
4919
|
+
_ref4$loyalty_program2 = _ref4.loyalty_program_name,
|
|
4920
|
+
loyalty_program_name = _ref4$loyalty_program2 === void 0 ? '' : _ref4$loyalty_program2;
|
|
4921
|
+
var isOther = (loyalty_program_name || program_name) === 'Other';
|
|
4922
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4923
|
+
className: styles$3.savedMembership,
|
|
4924
|
+
key: ind
|
|
4925
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4926
|
+
className: styles$3.iconWrapper
|
|
4927
|
+
}, loyalty_program_image_url ? /*#__PURE__*/React.createElement("div", {
|
|
4928
|
+
className: styles$3.iconPar,
|
|
4929
|
+
style: {
|
|
4930
|
+
background: "url(" + loyalty_program_image_url + ")",
|
|
4931
|
+
backgroundSize: 600,
|
|
4932
|
+
borderRadius: 6,
|
|
4933
|
+
border: '1px solid #F1F3F5',
|
|
4934
|
+
backgroundPosition: 'top'
|
|
4935
|
+
}
|
|
4936
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4937
|
+
src: loyalty_program_image_url,
|
|
4938
|
+
alt: name,
|
|
4939
|
+
className: styles$3.icon,
|
|
4940
|
+
onError: function onError(e) {
|
|
4941
|
+
e.target.style.display = 'none';
|
|
4942
|
+
var fallbackContainer = e.target.nextElementSibling;
|
|
4943
|
+
if (fallbackContainer) fallbackContainer.style.display = 'block';
|
|
4944
|
+
}
|
|
4945
|
+
})) : /*#__PURE__*/React.createElement(FallbackIcon, {
|
|
4946
|
+
type: type
|
|
4947
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
4948
|
+
className: styles$3.newMembershipIcon,
|
|
4949
|
+
style: {
|
|
4950
|
+
display: 'none'
|
|
4951
|
+
}
|
|
4952
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, {
|
|
4953
|
+
type: type
|
|
4954
|
+
})), /*#__PURE__*/React.createElement("p", null, (loyalty_program_name || program_name) === 'Other' ? name || loyalty_program_name || program_name : loyalty_program_name || program_name || name)), /*#__PURE__*/React.createElement("div", {
|
|
4955
|
+
className: styles$3.number
|
|
4956
|
+
}, number), /*#__PURE__*/React.createElement("div", {
|
|
4957
|
+
className: styles$3.actions
|
|
4958
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4959
|
+
onClick: function onClick() {
|
|
4960
|
+
onEdit(mem, ind, isOther);
|
|
4961
|
+
},
|
|
4962
|
+
style: {
|
|
4963
|
+
marginTop: 1
|
|
4964
|
+
}
|
|
4965
|
+
}, /*#__PURE__*/React.createElement(EditIcon, {
|
|
4966
|
+
width: "14",
|
|
4967
|
+
height: "14",
|
|
4968
|
+
color: "#EC5D25"
|
|
4969
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
4970
|
+
onClick: function onClick() {
|
|
4971
|
+
handleDelete(_extends({}, mem, {
|
|
4972
|
+
ind: ind
|
|
4973
|
+
}));
|
|
4974
|
+
},
|
|
4975
|
+
style: {
|
|
4976
|
+
marginLeft: 10
|
|
4977
|
+
}
|
|
4978
|
+
}, /*#__PURE__*/React.createElement(DeleteIcon, null))));
|
|
4514
4979
|
}));
|
|
4515
4980
|
};
|
|
4516
4981
|
|
|
4982
|
+
var AddMembershipButton = memo(function (_ref) {
|
|
4983
|
+
var _ref$type = _ref.type,
|
|
4984
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
4985
|
+
_ref$setModalState = _ref.setModalState,
|
|
4986
|
+
setModalState = _ref$setModalState === void 0 ? function () {} : _ref$setModalState,
|
|
4987
|
+
modalState = _ref.modalState,
|
|
4988
|
+
_ref$list = _ref.list,
|
|
4989
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
4990
|
+
_ref$updateList = _ref.updateList,
|
|
4991
|
+
updateList = _ref$updateList === void 0 ? function () {} : _ref$updateList,
|
|
4992
|
+
_ref$handleEdit = _ref.handleEdit,
|
|
4993
|
+
handleEdit = _ref$handleEdit === void 0 ? function () {} : _ref$handleEdit;
|
|
4994
|
+
var handleAddMembership = function handleAddMembership(type) {
|
|
4995
|
+
var currentModalState = _extends({}, modalState);
|
|
4996
|
+
currentModalState.open = true;
|
|
4997
|
+
if (type === 'flight') {
|
|
4998
|
+
currentModalState.title = 'Add airline membership';
|
|
4999
|
+
currentModalState.subtitle = 'Earn points from your favorite airline by booking on ITILITE.';
|
|
5000
|
+
}
|
|
5001
|
+
if (type === 'hotel') {
|
|
5002
|
+
currentModalState.title = 'Add hotel membership';
|
|
5003
|
+
currentModalState.subtitle = 'Earn points from your favorite hotels by booking on ITILITE.';
|
|
5004
|
+
}
|
|
5005
|
+
if (type === 'rental_car') {
|
|
5006
|
+
currentModalState.title = 'Add rental car membership';
|
|
5007
|
+
currentModalState.subtitle = 'Earn points from your favorite rental car agency by booking on ITILITE.';
|
|
5008
|
+
}
|
|
5009
|
+
currentModalState.type = type;
|
|
5010
|
+
setModalState(currentModalState);
|
|
5011
|
+
};
|
|
5012
|
+
var label = 'Airline';
|
|
5013
|
+
if (type === 'hotel') {
|
|
5014
|
+
label = 'Hotel';
|
|
5015
|
+
}
|
|
5016
|
+
if (type === 'rental_car') {
|
|
5017
|
+
label = 'Rental car';
|
|
5018
|
+
}
|
|
5019
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IUILabel, {
|
|
5020
|
+
label: label,
|
|
5021
|
+
headerType: true
|
|
5022
|
+
}), /*#__PURE__*/React.createElement(SavedMemberships, {
|
|
5023
|
+
list: list,
|
|
5024
|
+
type: type,
|
|
5025
|
+
updateList: updateList,
|
|
5026
|
+
handleEdit: handleEdit
|
|
5027
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
5028
|
+
buttonText: "Add membership",
|
|
5029
|
+
type: "text",
|
|
5030
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
5031
|
+
width: "10",
|
|
5032
|
+
height: "10",
|
|
5033
|
+
color: "#EC5D25"
|
|
5034
|
+
}),
|
|
5035
|
+
onClick: function onClick() {
|
|
5036
|
+
handleAddMembership(type);
|
|
5037
|
+
}
|
|
5038
|
+
}));
|
|
5039
|
+
});
|
|
5040
|
+
|
|
5041
|
+
var IUIToastMessageService$5 = services.IUIToastMessageService;
|
|
5042
|
+
var api$7 = configs.api;
|
|
5043
|
+
var sixteenDigitNumber$1 = /^\d{16}$/;
|
|
5044
|
+
var Membership = function Membership(_ref) {
|
|
5045
|
+
var _clsx;
|
|
5046
|
+
var _ref$membershipInfoIn = _ref.membershipInfoInput,
|
|
5047
|
+
membershipInfoInput = _ref$membershipInfoIn === void 0 ? [] : _ref$membershipInfoIn,
|
|
5048
|
+
_ref$setMembershipInf = _ref.setMembershipInfoInput,
|
|
5049
|
+
setMembershipInfoInput = _ref$setMembershipInf === void 0 ? function () {} : _ref$setMembershipInf,
|
|
5050
|
+
_ref$isProfile = _ref.isProfile,
|
|
5051
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
5052
|
+
var _useParams = useParams(),
|
|
5053
|
+
editUserId = _useParams.userId;
|
|
5054
|
+
var _useSelector = useSelector(function (state) {
|
|
5055
|
+
return state.common;
|
|
5056
|
+
}),
|
|
5057
|
+
id = _useSelector.id;
|
|
5058
|
+
var userID = isProfile ? id : editUserId;
|
|
5059
|
+
var _useState = useState(membershipInfoInput),
|
|
5060
|
+
savedMemberships = _useState[0],
|
|
5061
|
+
setSavedMemberships = _useState[1];
|
|
5062
|
+
var groupedMembershipData = savedMemberships.reduce(function (acc, item) {
|
|
5063
|
+
var _acc$item$membership_;
|
|
5064
|
+
acc[item === null || item === void 0 ? void 0 : item.membership_type] = (acc === null || acc === void 0 ? void 0 : acc[item === null || item === void 0 ? void 0 : item.membership_type]) || [];
|
|
5065
|
+
acc === null || acc === void 0 ? void 0 : (_acc$item$membership_ = acc[item === null || item === void 0 ? void 0 : item.membership_type]) === null || _acc$item$membership_ === void 0 ? void 0 : _acc$item$membership_.push(item);
|
|
5066
|
+
return acc;
|
|
5067
|
+
}, {
|
|
5068
|
+
flight: [],
|
|
5069
|
+
hotel: [],
|
|
5070
|
+
rental_car: []
|
|
5071
|
+
});
|
|
5072
|
+
var _useState2 = useState({
|
|
5073
|
+
open: false,
|
|
5074
|
+
title: 'Add airline membership'
|
|
5075
|
+
}),
|
|
5076
|
+
modalState = _useState2[0],
|
|
5077
|
+
setModalState = _useState2[1];
|
|
5078
|
+
var _useState3 = useState(false),
|
|
5079
|
+
isUpdating = _useState3[0],
|
|
5080
|
+
setIsUpdating = _useState3[1];
|
|
5081
|
+
var _useState4 = useState(null),
|
|
5082
|
+
editIndex = _useState4[0],
|
|
5083
|
+
setEditIndex = _useState4[1];
|
|
5084
|
+
var _modalState$open = modalState.open,
|
|
5085
|
+
open = _modalState$open === void 0 ? false : _modalState$open,
|
|
5086
|
+
_modalState$title = modalState.title,
|
|
5087
|
+
title = _modalState$title === void 0 ? '' : _modalState$title,
|
|
5088
|
+
_modalState$subtitle = modalState.subtitle,
|
|
5089
|
+
subtitle = _modalState$subtitle === void 0 ? '' : _modalState$subtitle,
|
|
5090
|
+
_modalState$type = modalState.type,
|
|
5091
|
+
type = _modalState$type === void 0 ? '' : _modalState$type;
|
|
5092
|
+
var _useState5 = useState(false),
|
|
5093
|
+
isInputFocused = _useState5[0],
|
|
5094
|
+
setIsInputFocused = _useState5[1];
|
|
5095
|
+
var _useState6 = useState(''),
|
|
5096
|
+
searchQuery = _useState6[0],
|
|
5097
|
+
setSearchQuery = _useState6[1];
|
|
5098
|
+
var _useState7 = useState(''),
|
|
5099
|
+
debouncedQuery = _useState7[0],
|
|
5100
|
+
setDebouncedQuery = _useState7[1];
|
|
5101
|
+
var _useState8 = useState([]),
|
|
5102
|
+
items = _useState8[0],
|
|
5103
|
+
setItems = _useState8[1];
|
|
5104
|
+
var _useState9 = useState(1),
|
|
5105
|
+
page = _useState9[0],
|
|
5106
|
+
setPage = _useState9[1];
|
|
5107
|
+
var _useState10 = useState(false),
|
|
5108
|
+
loading = _useState10[0],
|
|
5109
|
+
setLoading = _useState10[1];
|
|
5110
|
+
var _useState11 = useState(false),
|
|
5111
|
+
isOtherMembership = _useState11[0],
|
|
5112
|
+
setIsOtherMembership = _useState11[1];
|
|
5113
|
+
var _useState12 = useState(null),
|
|
5114
|
+
selectedMembershipChain = _useState12[0],
|
|
5115
|
+
setSelectedMembershipChain = _useState12[1];
|
|
5116
|
+
var _useState13 = useState(''),
|
|
5117
|
+
membershipName = _useState13[0],
|
|
5118
|
+
setMembershipName = _useState13[1];
|
|
5119
|
+
var _useState14 = useState(''),
|
|
5120
|
+
membershipNumber = _useState14[0],
|
|
5121
|
+
setMembershipNumber = _useState14[1];
|
|
5122
|
+
var wrapperRef = useRef(null);
|
|
5123
|
+
var nextRef = useRef(null);
|
|
5124
|
+
var isAAAloyaltySelected = (selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.program_name) === 'AAA' || (selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_name) === 'AAA';
|
|
5125
|
+
var fetchItems = function fetchItems(query, reset) {
|
|
5126
|
+
if (query === void 0) {
|
|
5127
|
+
query = '';
|
|
5128
|
+
}
|
|
5129
|
+
if (reset === void 0) {
|
|
5130
|
+
reset = false;
|
|
5131
|
+
}
|
|
5132
|
+
try {
|
|
5133
|
+
nextRef.current = null;
|
|
5134
|
+
var pageNo = reset ? 1 : page + 1;
|
|
5135
|
+
setLoading(true);
|
|
5136
|
+
var url = 'api/v1/user-management/loyalty-program/' + ("?page=" + pageNo + "&travel_type=" + type);
|
|
5137
|
+
if (query) {
|
|
5138
|
+
url += "&search_term=" + query.toLowerCase();
|
|
5139
|
+
}
|
|
5140
|
+
if (reset) setPage(1);else setPage(function (prevPage) {
|
|
5141
|
+
return prevPage + 1;
|
|
5142
|
+
});
|
|
5143
|
+
var _temp = _catch(function () {
|
|
5144
|
+
return Promise.resolve(api$7.get(url).then(function (res) {
|
|
5145
|
+
return res;
|
|
5146
|
+
})).then(function (response) {
|
|
5147
|
+
var _response$data, _response$data2;
|
|
5148
|
+
var list = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.results;
|
|
5149
|
+
nextRef.current = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.next;
|
|
5150
|
+
setItems(function (prevItems) {
|
|
5151
|
+
return reset ? list : [].concat(prevItems, list);
|
|
5152
|
+
});
|
|
5153
|
+
setLoading(false);
|
|
5154
|
+
});
|
|
5155
|
+
}, function (error) {
|
|
5156
|
+
nextRef.current = null;
|
|
5157
|
+
IUIToastMessageService$5.warningNotify('Something went wrong');
|
|
5158
|
+
setIsInputFocused(false);
|
|
5159
|
+
setLoading(false);
|
|
5160
|
+
console.error('Error fetching data:', error);
|
|
5161
|
+
});
|
|
5162
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
5163
|
+
} catch (e) {
|
|
5164
|
+
return Promise.reject(e);
|
|
5165
|
+
}
|
|
5166
|
+
};
|
|
5167
|
+
var handleSelect = function handleSelect(item) {
|
|
5168
|
+
setSelectedMembershipChain(item);
|
|
5169
|
+
setIsInputFocused(false);
|
|
5170
|
+
};
|
|
5171
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
5172
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
5173
|
+
setIsInputFocused(false);
|
|
5174
|
+
}
|
|
5175
|
+
};
|
|
5176
|
+
useEffect(function () {
|
|
5177
|
+
setSavedMemberships(membershipInfoInput);
|
|
5178
|
+
}, [membershipInfoInput]);
|
|
5179
|
+
useEffect(function () {
|
|
5180
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
5181
|
+
return function () {
|
|
5182
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
5183
|
+
};
|
|
5184
|
+
}, []);
|
|
5185
|
+
useEffect(function () {
|
|
5186
|
+
var handler = setTimeout(function () {
|
|
5187
|
+
setDebouncedQuery(searchQuery);
|
|
5188
|
+
}, 750);
|
|
5189
|
+
return function () {
|
|
5190
|
+
clearTimeout(handler);
|
|
5191
|
+
};
|
|
5192
|
+
}, [searchQuery]);
|
|
5193
|
+
useEffect(function () {
|
|
5194
|
+
if (isInputFocused) fetchItems(debouncedQuery, true);else {
|
|
5195
|
+
setSearchQuery('');
|
|
5196
|
+
setItems([]);
|
|
5197
|
+
}
|
|
5198
|
+
}, [isInputFocused, debouncedQuery]);
|
|
5199
|
+
useEffect(function () {
|
|
5200
|
+
if (!(modalState !== null && modalState !== void 0 && modalState.open)) {
|
|
5201
|
+
setIsInputFocused(false);
|
|
5202
|
+
}
|
|
5203
|
+
}, [modalState]);
|
|
5204
|
+
var handleClose = function handleClose() {
|
|
5205
|
+
setIsUpdating(false);
|
|
5206
|
+
setIsOtherMembership(false);
|
|
5207
|
+
setMembershipName('');
|
|
5208
|
+
setMembershipNumber('');
|
|
5209
|
+
setModalState(_extends({}, modalState, {
|
|
5210
|
+
open: false
|
|
5211
|
+
}));
|
|
5212
|
+
setSelectedMembershipChain(null);
|
|
5213
|
+
setIsInputFocused(false);
|
|
5214
|
+
setItems([]);
|
|
5215
|
+
setEditIndex(null);
|
|
5216
|
+
setSearchQuery('');
|
|
5217
|
+
};
|
|
5218
|
+
var updateList = function updateList(type, index, item) {
|
|
5219
|
+
if (index === void 0) {
|
|
5220
|
+
index = null;
|
|
5221
|
+
}
|
|
5222
|
+
if (item === void 0) {
|
|
5223
|
+
item = null;
|
|
5224
|
+
}
|
|
5225
|
+
if (!groupedMembershipData[type]) {
|
|
5226
|
+
console.error("Invalid type: " + type);
|
|
5227
|
+
return;
|
|
5228
|
+
}
|
|
5229
|
+
if (item) {
|
|
5230
|
+
if (index) {
|
|
5231
|
+
groupedMembershipData[type][index] = _extends({}, groupedMembershipData[type][index], {
|
|
5232
|
+
number: item.number,
|
|
5233
|
+
name: item.name
|
|
5234
|
+
});
|
|
5235
|
+
} else groupedMembershipData[type] = [].concat(groupedMembershipData[type], [item]);
|
|
5236
|
+
}
|
|
5237
|
+
if (index !== null && !item) {
|
|
5238
|
+
var _groupedMembershipDat, _groupedMembershipDat2;
|
|
5239
|
+
if (index < 0 || index >= (groupedMembershipData === null || groupedMembershipData === void 0 ? void 0 : (_groupedMembershipDat = groupedMembershipData[type]) === null || _groupedMembershipDat === void 0 ? void 0 : _groupedMembershipDat.length)) {
|
|
5240
|
+
console.error("Invalid index: " + index);
|
|
5241
|
+
return;
|
|
5242
|
+
}
|
|
5243
|
+
groupedMembershipData[type] = [].concat(groupedMembershipData === null || groupedMembershipData === void 0 ? void 0 : (_groupedMembershipDat2 = groupedMembershipData[type]) === null || _groupedMembershipDat2 === void 0 ? void 0 : _groupedMembershipDat2.slice(0, index), groupedMembershipData[type].slice(index + 1));
|
|
5244
|
+
}
|
|
5245
|
+
var flight = groupedMembershipData.flight,
|
|
5246
|
+
hotel = groupedMembershipData.hotel,
|
|
5247
|
+
rental_car = groupedMembershipData.rental_car;
|
|
5248
|
+
var updatedMemberships = [].concat(flight, hotel, rental_car);
|
|
5249
|
+
setMembershipInfoInput(updatedMemberships);
|
|
5250
|
+
};
|
|
5251
|
+
var handleSubmit = function handleSubmit() {
|
|
5252
|
+
try {
|
|
5253
|
+
if (isAAAloyaltySelected && !sixteenDigitNumber$1.test(membershipNumber)) {
|
|
5254
|
+
IUIToastMessageService$5.warningNotify('Enter 16-digit AAA membership ID');
|
|
5255
|
+
return Promise.resolve();
|
|
5256
|
+
}
|
|
5257
|
+
var url = "/api/v1/user-management/users/" + userID + "/membership";
|
|
5258
|
+
var payload = editIndex ? _extends({}, selectedMembershipChain, {
|
|
5259
|
+
number: membershipNumber,
|
|
5260
|
+
name: membershipName || ''
|
|
5261
|
+
}) : {
|
|
5262
|
+
membership_type: type,
|
|
5263
|
+
number: membershipNumber,
|
|
5264
|
+
iata_code: null,
|
|
5265
|
+
user: userID,
|
|
5266
|
+
loyalty_program_id: selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_id,
|
|
5267
|
+
name: membershipName || ''
|
|
5268
|
+
};
|
|
5269
|
+
setIsUpdating(true);
|
|
5270
|
+
var _temp2 = _finallyRethrows(function () {
|
|
5271
|
+
return _catch(function () {
|
|
5272
|
+
return Promise.resolve(editIndex ? api$7.put(url, payload) : api$7.post(url, payload)).then(function (response) {
|
|
5273
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 201 || (response === null || response === void 0 ? void 0 : response.status) === 200) {
|
|
5274
|
+
var _response$data3;
|
|
5275
|
+
var updatedResponse = response === null || response === void 0 ? void 0 : response.data;
|
|
5276
|
+
updatedResponse.program_name = selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.program_name;
|
|
5277
|
+
updatedResponse.loyalty_program_image_url = selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_image_url;
|
|
5278
|
+
if (isOtherMembership) updatedResponse.loyalty_program_name = 'Other';
|
|
5279
|
+
updateList(response === null || response === void 0 ? void 0 : (_response$data3 = response.data) === null || _response$data3 === void 0 ? void 0 : _response$data3.membership_type, editIndex, updatedResponse);
|
|
5280
|
+
IUIToastMessageService$5.sNotify(editIndex ? "Membership updated." : "New membership added.");
|
|
5281
|
+
} else {
|
|
5282
|
+
IUIToastMessageService$5.warningNotify('Failed to save membership');
|
|
5283
|
+
}
|
|
5284
|
+
});
|
|
5285
|
+
}, function (error) {
|
|
5286
|
+
console.error(error);
|
|
5287
|
+
IUIToastMessageService$5.warningNotify('Something went wrong!');
|
|
5288
|
+
});
|
|
5289
|
+
}, function (_wasThrown, _result) {
|
|
5290
|
+
handleClose();
|
|
5291
|
+
if (_wasThrown) throw _result;
|
|
5292
|
+
return _result;
|
|
5293
|
+
});
|
|
5294
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
5295
|
+
} catch (e) {
|
|
5296
|
+
return Promise.reject(e);
|
|
5297
|
+
}
|
|
5298
|
+
};
|
|
5299
|
+
var handleEdit = function handleEdit(mem, index, isOther) {
|
|
5300
|
+
setEditIndex(index);
|
|
5301
|
+
setSelectedMembershipChain(mem);
|
|
5302
|
+
setMembershipName((mem === null || mem === void 0 ? void 0 : mem.name) || '');
|
|
5303
|
+
setMembershipNumber(mem === null || mem === void 0 ? void 0 : mem.number);
|
|
5304
|
+
setIsOtherMembership(isOther);
|
|
5305
|
+
var currentModalState = _extends({}, modalState);
|
|
5306
|
+
currentModalState.open = true;
|
|
5307
|
+
currentModalState.type = mem === null || mem === void 0 ? void 0 : mem.membership_type;
|
|
5308
|
+
setModalState(currentModalState);
|
|
5309
|
+
};
|
|
5310
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5311
|
+
style: {
|
|
5312
|
+
width: '100%'
|
|
5313
|
+
}
|
|
5314
|
+
}, /*#__PURE__*/React.createElement(IUIModal, {
|
|
5315
|
+
isOpen: open,
|
|
5316
|
+
closeHandler: handleClose,
|
|
5317
|
+
modalClass: clsx(styles$3.loyaltymodal, (_clsx = {}, _clsx[styles$3.loyaltyList] = !selectedMembershipChain, _clsx)),
|
|
5318
|
+
cancelLabel: selectedMembershipChain ? 'Cancel' : '',
|
|
5319
|
+
submitLabel: selectedMembershipChain ? isUpdating ? 'Saving...' : editIndex ? 'Save' : 'Add' : '',
|
|
5320
|
+
submitHandler: handleSubmit,
|
|
5321
|
+
isDisabledSubmitBtn: isUpdating || !membershipNumber || isOtherMembership && !membershipName || isAAAloyaltySelected && !sixteenDigitNumber$1.test(membershipNumber),
|
|
5322
|
+
width: selectedMembershipChain ? '480px' : '640px',
|
|
5323
|
+
headerText: selectedMembershipChain ? '' : title,
|
|
5324
|
+
subHanderText: selectedMembershipChain ? '' : subtitle,
|
|
5325
|
+
modalBodyStyle: {
|
|
5326
|
+
padding: selectedMembershipChain ? '0px 24px 25px' : '24px 24px 0px',
|
|
5327
|
+
minHeight: selectedMembershipChain ? 120 : 80,
|
|
5328
|
+
borderBottom: selectedMembershipChain && '1px solid #E5E7EB',
|
|
5329
|
+
marginBottom: selectedMembershipChain ? 0 : -18
|
|
5330
|
+
}
|
|
5331
|
+
}, /*#__PURE__*/React.createElement(Fragment$1, null, selectedMembershipChain ? /*#__PURE__*/React.createElement(MembershipForm, {
|
|
5332
|
+
selectedMembershipChain: selectedMembershipChain,
|
|
5333
|
+
isOtherMembership: isOtherMembership,
|
|
5334
|
+
membershipName: membershipName,
|
|
5335
|
+
membershipNumber: membershipNumber,
|
|
5336
|
+
setMembershipName: setMembershipName,
|
|
5337
|
+
setMembershipNumber: setMembershipNumber,
|
|
5338
|
+
type: type,
|
|
5339
|
+
isEdit: !!editIndex,
|
|
5340
|
+
isAAAloyaltySelected: isAAAloyaltySelected
|
|
5341
|
+
}) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
5342
|
+
style: {
|
|
5343
|
+
color: '#374151',
|
|
5344
|
+
fontWeight: 500
|
|
5345
|
+
}
|
|
5346
|
+
}, "Loyalty program"), ' ', /*#__PURE__*/React.createElement("span", {
|
|
5347
|
+
style: {
|
|
5348
|
+
color: '#6B7280'
|
|
5349
|
+
}
|
|
5350
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
5351
|
+
className: styles$3.selectWrapper,
|
|
5352
|
+
ref: wrapperRef
|
|
5353
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5354
|
+
className: styles$3.selectSearchBox
|
|
5355
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
5356
|
+
className: styles$3.searchInput,
|
|
5357
|
+
placeholder: "Select loyalty program",
|
|
5358
|
+
onFocus: function onFocus() {
|
|
5359
|
+
return setIsInputFocused(true);
|
|
5360
|
+
},
|
|
5361
|
+
onClick: function onClick() {
|
|
5362
|
+
return setIsInputFocused(true);
|
|
5363
|
+
},
|
|
5364
|
+
onChange: function onChange(e) {
|
|
5365
|
+
if (!isInputFocused) {
|
|
5366
|
+
setIsInputFocused(true);
|
|
5367
|
+
}
|
|
5368
|
+
setSearchQuery(e.target.value);
|
|
5369
|
+
},
|
|
5370
|
+
value: searchQuery
|
|
5371
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
5372
|
+
className: styles$3.chevronIcon
|
|
5373
|
+
}, /*#__PURE__*/React.createElement(ChevronNext, {
|
|
5374
|
+
color: "#6B7280"
|
|
5375
|
+
}))), isInputFocused && /*#__PURE__*/React.createElement("div", {
|
|
5376
|
+
className: styles$3.membershipList
|
|
5377
|
+
}, /*#__PURE__*/React.createElement(LoyaltyPrograms, {
|
|
5378
|
+
items: items,
|
|
5379
|
+
handleSelect: handleSelect,
|
|
5380
|
+
loading: loading,
|
|
5381
|
+
setIsOtherMembership: setIsOtherMembership,
|
|
5382
|
+
setSelectedMembershipChain: setSelectedMembershipChain,
|
|
5383
|
+
searchQuery: searchQuery,
|
|
5384
|
+
fetchItems: fetchItems,
|
|
5385
|
+
type: type,
|
|
5386
|
+
nextPageAvailable: nextRef === null || nextRef === void 0 ? void 0 : nextRef.current,
|
|
5387
|
+
page: page
|
|
5388
|
+
})))))), /*#__PURE__*/React.createElement("div", {
|
|
5389
|
+
style: {
|
|
5390
|
+
width: '100%'
|
|
5391
|
+
}
|
|
5392
|
+
}, Object.keys(groupedMembershipData).map(function (memType, ind) {
|
|
5393
|
+
return /*#__PURE__*/React.createElement(Fragment$1, {
|
|
5394
|
+
key: memType
|
|
5395
|
+
}, /*#__PURE__*/React.createElement(AddMembershipButton, {
|
|
5396
|
+
type: memType,
|
|
5397
|
+
setModalState: setModalState,
|
|
5398
|
+
modalState: modalState,
|
|
5399
|
+
list: groupedMembershipData[memType],
|
|
5400
|
+
updateList: updateList,
|
|
5401
|
+
handleEdit: handleEdit
|
|
5402
|
+
}), ind < 2 && /*#__PURE__*/React.createElement(IUIDivider, {
|
|
5403
|
+
className: styles$3.divider
|
|
5404
|
+
}));
|
|
5405
|
+
})));
|
|
5406
|
+
};
|
|
5407
|
+
|
|
4517
5408
|
var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
4518
5409
|
var _clsx;
|
|
4519
5410
|
var membershipInfoInput = _ref.membershipInfoInput,
|
|
4520
|
-
onMemInfoInputChange = _ref.onMemInfoInputChange,
|
|
4521
|
-
addMemInfoInput = _ref.addMemInfoInput,
|
|
4522
5411
|
travelPreferenceInfo = _ref.travelPreferenceInfo,
|
|
4523
5412
|
_ref$travelPreference = _ref.travelPreferenceOnChange,
|
|
4524
5413
|
travelPreferenceOnChange = _ref$travelPreference === void 0 ? function () {} : _ref$travelPreference,
|
|
@@ -4535,10 +5424,12 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4535
5424
|
dateFormat = _ref.dateFormat,
|
|
4536
5425
|
_ref$defaultExpand = _ref.defaultExpand,
|
|
4537
5426
|
defaultExpand = _ref$defaultExpand === void 0 ? false : _ref$defaultExpand,
|
|
4538
|
-
_ref$handleRemoveMemF = _ref.handleRemoveMemFields,
|
|
4539
|
-
handleRemoveMemFields = _ref$handleRemoveMemF === void 0 ? {} : _ref$handleRemoveMemF,
|
|
4540
5427
|
_ref$setAdditionalInf = _ref.setAdditionalInfoFlag,
|
|
4541
|
-
setAdditionalInfoFlag = _ref$setAdditionalInf === void 0 ? function () {} : _ref$setAdditionalInf
|
|
5428
|
+
setAdditionalInfoFlag = _ref$setAdditionalInf === void 0 ? function () {} : _ref$setAdditionalInf,
|
|
5429
|
+
_ref$setMembershipInf = _ref.setMembershipInfoInput,
|
|
5430
|
+
setMembershipInfoInput = _ref$setMembershipInf === void 0 ? function () {} : _ref$setMembershipInf,
|
|
5431
|
+
_ref$isProfile = _ref.isProfile,
|
|
5432
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
4542
5433
|
var handleChange = function handleChange(panel) {
|
|
4543
5434
|
return function (event, defaultExpand) {
|
|
4544
5435
|
setAdditionalInfoFlag(defaultExpand ? panel : false);
|
|
@@ -4550,57 +5441,9 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4550
5441
|
passportInfo = _useSelector.passportInfo,
|
|
4551
5442
|
secureTravelInfo = _useSelector.secureTravelInfo,
|
|
4552
5443
|
travelPreference = _useSelector.travelPreference;
|
|
4553
|
-
var _useSelector2 = useSelector(function (state) {
|
|
4554
|
-
return state.userAddEdit;
|
|
4555
|
-
}),
|
|
4556
|
-
maxMembershipInput = _useSelector2.maxMembershipInput;
|
|
4557
5444
|
var dropdownList = useSelector(function (state) {
|
|
4558
5445
|
return state.userAddEdit.dropdownList;
|
|
4559
5446
|
});
|
|
4560
|
-
var MembershipField = function MembershipField(_ref2) {
|
|
4561
|
-
var val = _ref2.val,
|
|
4562
|
-
index = _ref2.index;
|
|
4563
|
-
if (val.membership_type === 'flight') {
|
|
4564
|
-
return (
|
|
4565
|
-
/*#__PURE__*/
|
|
4566
|
-
React.createElement(IUIInput, {
|
|
4567
|
-
label: "Airline name",
|
|
4568
|
-
placeholder: "Enter airline name",
|
|
4569
|
-
fullwidth: false,
|
|
4570
|
-
defaultValue: val.name,
|
|
4571
|
-
onValueChange: function onValueChange(_ref3) {
|
|
4572
|
-
var _value = _ref3._value;
|
|
4573
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4574
|
-
}
|
|
4575
|
-
})
|
|
4576
|
-
);
|
|
4577
|
-
}
|
|
4578
|
-
if (val.membership_type === 'hotel') {
|
|
4579
|
-
return /*#__PURE__*/React.createElement(IUIInput, {
|
|
4580
|
-
label: "Hotel name",
|
|
4581
|
-
placeholder: "Enter hotel name",
|
|
4582
|
-
fullwidth: false,
|
|
4583
|
-
defaultValue: val.name,
|
|
4584
|
-
onValueChange: function onValueChange(_ref4) {
|
|
4585
|
-
var _value = _ref4._value;
|
|
4586
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4587
|
-
}
|
|
4588
|
-
});
|
|
4589
|
-
}
|
|
4590
|
-
if (val.membership_type === 'rental_car') {
|
|
4591
|
-
return /*#__PURE__*/React.createElement(IUIInput, {
|
|
4592
|
-
label: "Car provider name",
|
|
4593
|
-
placeholder: "Enter a car provider name",
|
|
4594
|
-
fullwidth: false,
|
|
4595
|
-
defaultValue: val.name,
|
|
4596
|
-
onValueChange: function onValueChange(_ref5) {
|
|
4597
|
-
var _value = _ref5._value;
|
|
4598
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4599
|
-
}
|
|
4600
|
-
});
|
|
4601
|
-
}
|
|
4602
|
-
return null;
|
|
4603
|
-
};
|
|
4604
5447
|
return /*#__PURE__*/React.createElement(IUIAccordion, {
|
|
4605
5448
|
expanded: defaultExpand === 'open',
|
|
4606
5449
|
onChange: handleChange('open'),
|
|
@@ -4682,8 +5525,7 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4682
5525
|
md: 4
|
|
4683
5526
|
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4684
5527
|
label: "Membership information",
|
|
4685
|
-
headerType: true
|
|
4686
|
-
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
5528
|
+
headerType: true
|
|
4687
5529
|
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4688
5530
|
item: true,
|
|
4689
5531
|
sm: 12,
|
|
@@ -4693,139 +5535,11 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4693
5535
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4694
5536
|
container: true,
|
|
4695
5537
|
className: styles.formFieldsWrapper
|
|
4696
|
-
},
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
}
|
|
4701
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4702
|
-
display: "flex"
|
|
4703
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4704
|
-
buttonText: "Add airline",
|
|
4705
|
-
type: "text",
|
|
4706
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4707
|
-
width: "10",
|
|
4708
|
-
height: "10",
|
|
4709
|
-
color: "#EC5D25"
|
|
4710
|
-
}),
|
|
4711
|
-
className: styles.paddingTop,
|
|
4712
|
-
onClick: function onClick(e) {
|
|
4713
|
-
return addMemInfoInput('flight');
|
|
4714
|
-
}
|
|
4715
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4716
|
-
buttonText: "Add hotel",
|
|
4717
|
-
type: "text",
|
|
4718
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4719
|
-
width: "10",
|
|
4720
|
-
height: "10",
|
|
4721
|
-
color: "#EC5D25"
|
|
4722
|
-
}),
|
|
4723
|
-
className: styles.paddingTop,
|
|
4724
|
-
onClick: function onClick(e) {
|
|
4725
|
-
return addMemInfoInput('hotel');
|
|
4726
|
-
}
|
|
4727
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4728
|
-
buttonText: "Add car rental",
|
|
4729
|
-
type: "text",
|
|
4730
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4731
|
-
width: "10",
|
|
4732
|
-
height: "10",
|
|
4733
|
-
color: "#EC5D25"
|
|
4734
|
-
}),
|
|
4735
|
-
className: styles.paddingTop,
|
|
4736
|
-
onClick: function onClick(e) {
|
|
4737
|
-
return addMemInfoInput('rental_car');
|
|
4738
|
-
}
|
|
4739
|
-
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4740
|
-
if (index >= maxMembershipInput) {
|
|
4741
|
-
return null;
|
|
4742
|
-
}
|
|
4743
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
4744
|
-
key: index.toString()
|
|
4745
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4746
|
-
item: true,
|
|
4747
|
-
md: 8,
|
|
4748
|
-
lg: 6,
|
|
4749
|
-
xl: 6
|
|
4750
|
-
}, /*#__PURE__*/React.createElement(MembershipField, {
|
|
4751
|
-
val: val,
|
|
4752
|
-
index: index,
|
|
4753
|
-
key: index.toString()
|
|
4754
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4755
|
-
item: true,
|
|
4756
|
-
md: 8,
|
|
4757
|
-
lg: 6,
|
|
4758
|
-
xl: 6
|
|
4759
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4760
|
-
component: "div",
|
|
4761
|
-
display: "flex"
|
|
4762
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4763
|
-
label: "Membership number",
|
|
4764
|
-
placeholder: "Enter membership number",
|
|
4765
|
-
fullwidth: false,
|
|
4766
|
-
defaultValue: val.number,
|
|
4767
|
-
onValueChange: function onValueChange(_ref6) {
|
|
4768
|
-
var _value = _ref6._value;
|
|
4769
|
-
return onMemInfoInputChange(index, 'number', _value);
|
|
4770
|
-
}
|
|
4771
|
-
}), /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
4772
|
-
style: {
|
|
4773
|
-
marginTop: '30px'
|
|
4774
|
-
},
|
|
4775
|
-
disableRipple: true,
|
|
4776
|
-
onClick: function onClick() {
|
|
4777
|
-
return handleRemoveMemFields(index);
|
|
4778
|
-
},
|
|
4779
|
-
className: styles.backGrdColorOnHover
|
|
4780
|
-
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
4781
|
-
width: "14",
|
|
4782
|
-
height: "14"
|
|
4783
|
-
})))));
|
|
4784
|
-
}), membershipInfoInput.length < maxMembershipInput && membershipInfoInput.length > 0 && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4785
|
-
item: true,
|
|
4786
|
-
md: 8,
|
|
4787
|
-
lg: 8,
|
|
4788
|
-
xl: 8
|
|
4789
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4790
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4791
|
-
display: "flex"
|
|
4792
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4793
|
-
buttonText: "Add airline",
|
|
4794
|
-
type: "text",
|
|
4795
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4796
|
-
width: "10",
|
|
4797
|
-
height: "10",
|
|
4798
|
-
color: "#EC5D25"
|
|
4799
|
-
}),
|
|
4800
|
-
className: styles.paddingTop,
|
|
4801
|
-
onClick: function onClick(e) {
|
|
4802
|
-
return addMemInfoInput('flight');
|
|
4803
|
-
}
|
|
4804
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4805
|
-
buttonText: "Add hotel",
|
|
4806
|
-
type: "text",
|
|
4807
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4808
|
-
width: "10",
|
|
4809
|
-
height: "10",
|
|
4810
|
-
color: "#EC5D25"
|
|
4811
|
-
}),
|
|
4812
|
-
className: styles.paddingTop,
|
|
4813
|
-
onClick: function onClick(e) {
|
|
4814
|
-
return addMemInfoInput('hotel');
|
|
4815
|
-
}
|
|
4816
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4817
|
-
buttonText: "Add car rental",
|
|
4818
|
-
type: "text",
|
|
4819
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4820
|
-
width: "10",
|
|
4821
|
-
height: "10",
|
|
4822
|
-
color: "#EC5D25"
|
|
4823
|
-
}),
|
|
4824
|
-
className: styles.paddingTop,
|
|
4825
|
-
onClick: function onClick(e) {
|
|
4826
|
-
return addMemInfoInput('rental_car');
|
|
4827
|
-
}
|
|
4828
|
-
})))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
5538
|
+
}, /*#__PURE__*/React.createElement(Membership, {
|
|
5539
|
+
membershipInfoInput: membershipInfoInput,
|
|
5540
|
+
setMembershipInfoInput: setMembershipInfoInput,
|
|
5541
|
+
isProfile: isProfile
|
|
5542
|
+
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4829
5543
|
className: styles.dividerColor
|
|
4830
5544
|
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4831
5545
|
container: true,
|
|
@@ -4909,7 +5623,7 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4909
5623
|
}))))));
|
|
4910
5624
|
};
|
|
4911
5625
|
|
|
4912
|
-
var styles$
|
|
5626
|
+
var styles$4 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF","actionCustom":"_3Kbfm"};
|
|
4913
5627
|
|
|
4914
5628
|
var VerificationError = function VerificationError(_ref) {
|
|
4915
5629
|
var config = _ref.config,
|
|
@@ -4920,18 +5634,18 @@ var VerificationError = function VerificationError(_ref) {
|
|
|
4920
5634
|
var history = useHistory();
|
|
4921
5635
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
4922
5636
|
component: "div",
|
|
4923
|
-
className: styles$
|
|
5637
|
+
className: styles$4.pageHeader
|
|
4924
5638
|
}, /*#__PURE__*/React.createElement(IUICard, {
|
|
4925
5639
|
headerComponentTitle: title,
|
|
4926
|
-
cardHeaderClassName: styles$
|
|
5640
|
+
cardHeaderClassName: styles$4.cardHeaderBackground,
|
|
4927
5641
|
headerComponent: /*#__PURE__*/React.createElement(IUITypography, {
|
|
4928
5642
|
gutterBottom: true,
|
|
4929
5643
|
variant: "h4",
|
|
4930
|
-
className: styles$
|
|
5644
|
+
className: styles$4.cardHeader
|
|
4931
5645
|
}, title),
|
|
4932
5646
|
description: errMsg,
|
|
4933
5647
|
actionComponent: /*#__PURE__*/React.createElement(IUIButton, {
|
|
4934
|
-
className: styles$
|
|
5648
|
+
className: styles$4.buttonHover,
|
|
4935
5649
|
buttonText: "BACK TO HOMEPAGE",
|
|
4936
5650
|
type: "outlined",
|
|
4937
5651
|
onClick: function onClick() {
|
|
@@ -5084,10 +5798,7 @@ var CardsField = function CardsField(props) {
|
|
|
5084
5798
|
}, editUserId ? "Only Card admin can change the Card role." : "Only Card admin can change card roles. By default this user will have Card Holder role.")))));
|
|
5085
5799
|
};
|
|
5086
5800
|
|
|
5087
|
-
var
|
|
5088
|
-
var searchParams = new URL(document.location).searchParams;
|
|
5089
|
-
var required = searchParams.get('required');
|
|
5090
|
-
var IUIToastMessageService$4 = services.IUIToastMessageService,
|
|
5801
|
+
var IUIToastMessageService$6 = services.IUIToastMessageService,
|
|
5091
5802
|
IUILocalStorageService$5 = services.IUILocalStorageService;
|
|
5092
5803
|
var env$4 = configs.env;
|
|
5093
5804
|
var UserAddEdit = function UserAddEdit(props) {
|
|
@@ -5238,9 +5949,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5238
5949
|
if (_loop()) break;
|
|
5239
5950
|
}
|
|
5240
5951
|
} else if (typeof err === 'string') {
|
|
5241
|
-
IUIToastMessageService$
|
|
5952
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
5242
5953
|
} else {
|
|
5243
|
-
IUIToastMessageService$
|
|
5954
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5244
5955
|
}
|
|
5245
5956
|
})["finally"](function () {
|
|
5246
5957
|
dispatch(stopLoader());
|
|
@@ -5291,9 +6002,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5291
6002
|
if (_loop2()) break;
|
|
5292
6003
|
}
|
|
5293
6004
|
} else if (typeof err === 'string') {
|
|
5294
|
-
IUIToastMessageService$
|
|
6005
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
5295
6006
|
} else {
|
|
5296
|
-
IUIToastMessageService$
|
|
6007
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5297
6008
|
}
|
|
5298
6009
|
})["finally"](function () {
|
|
5299
6010
|
dispatch(stopLoader());
|
|
@@ -5313,7 +6024,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5313
6024
|
if (res !== null && res !== void 0 && (_res$roles = res.roles) !== null && _res$roles !== void 0 && _res$roles.length) {
|
|
5314
6025
|
dispatch(setCardsDetails(res));
|
|
5315
6026
|
} else {
|
|
5316
|
-
IUIToastMessageService$
|
|
6027
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5317
6028
|
}
|
|
5318
6029
|
})["catch"](function (error) {
|
|
5319
6030
|
console.log("errorrr", error);
|
|
@@ -5333,7 +6044,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5333
6044
|
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
5334
6045
|
dispatch(setCardsDetails(res));
|
|
5335
6046
|
} else {
|
|
5336
|
-
IUIToastMessageService$
|
|
6047
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5337
6048
|
}
|
|
5338
6049
|
})["catch"](function (error) {
|
|
5339
6050
|
console.log("errorrr", error);
|
|
@@ -5564,8 +6275,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5564
6275
|
travel_docs: '',
|
|
5565
6276
|
products: '',
|
|
5566
6277
|
userTagType: '',
|
|
5567
|
-
profile_pic: ''
|
|
5568
|
-
cards: ''
|
|
6278
|
+
profile_pic: ''
|
|
5569
6279
|
}),
|
|
5570
6280
|
errorMsgs = _useState27[0],
|
|
5571
6281
|
setErrorMsgs = _useState27[1];
|
|
@@ -5682,7 +6392,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5682
6392
|
setAddModalData(_extends({}, addModalData, {
|
|
5683
6393
|
isOpen: false
|
|
5684
6394
|
}));
|
|
5685
|
-
IUIToastMessageService$
|
|
6395
|
+
IUIToastMessageService$6.sNotify(addModalData.title + " added successfully.");
|
|
5686
6396
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5687
6397
|
if (addModalData.id === 'department') {
|
|
5688
6398
|
var _extends2;
|
|
@@ -6082,32 +6792,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6082
6792
|
contact_country_code: res.personal_info.contact_country_code || '',
|
|
6083
6793
|
profile_pic: profilePic || []
|
|
6084
6794
|
}));
|
|
6085
|
-
if (isProfilePage) {
|
|
6086
|
-
if (required === 'dob') {
|
|
6087
|
-
if (!res.personal_info.dob) {
|
|
6088
|
-
setErrorArray([].concat(errorArray, ['dob']));
|
|
6089
|
-
setErrorMsgs(_extends({}, errorArray, {
|
|
6090
|
-
dob: 'Enter a valid date of birth'
|
|
6091
|
-
}));
|
|
6092
|
-
}
|
|
6093
|
-
}
|
|
6094
|
-
if (required === 'card') {
|
|
6095
|
-
var _res$payment_details;
|
|
6096
|
-
if ((res === null || res === void 0 ? void 0 : (_res$payment_details = res.payment_details) === null || _res$payment_details === void 0 ? void 0 : _res$payment_details.cards.length) === 0) {
|
|
6097
|
-
setErrorArray([].concat(errorArray, ['cards']));
|
|
6098
|
-
setErrorMsgs(_extends({}, errorArray, {
|
|
6099
|
-
cards: 'Please provide default card detail'
|
|
6100
|
-
}));
|
|
6101
|
-
setTimeout(function () {
|
|
6102
|
-
var cardElement = document.getElementById('card-details-scroll');
|
|
6103
|
-
if (cardElement) window.scrollTo({
|
|
6104
|
-
top: cardElement.offsetTop - 200,
|
|
6105
|
-
behavior: 'smooth'
|
|
6106
|
-
});
|
|
6107
|
-
}, 1500);
|
|
6108
|
-
}
|
|
6109
|
-
}
|
|
6110
|
-
}
|
|
6111
6795
|
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
6112
6796
|
emp_level: res.employee_info.emp_level ? {
|
|
6113
6797
|
value: res.employee_info.emp_level.id,
|
|
@@ -6392,9 +7076,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6392
7076
|
var formSubmitHandler = function formSubmitHandler() {
|
|
6393
7077
|
try {
|
|
6394
7078
|
var checkAnyError = doesFormHasError();
|
|
6395
|
-
console.log(checkAnyError);
|
|
6396
7079
|
if (checkAnyError) {
|
|
6397
|
-
IUIToastMessageService$
|
|
7080
|
+
IUIToastMessageService$6.warningNotify(checkAnyError);
|
|
6398
7081
|
return Promise.resolve();
|
|
6399
7082
|
}
|
|
6400
7083
|
if (employeeInfoInput.manager_id.value !== '') {
|
|
@@ -6596,7 +7279,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6596
7279
|
if (response.status === 200) {
|
|
6597
7280
|
updateUserApiCall(payload, inputChangeLog);
|
|
6598
7281
|
} else {
|
|
6599
|
-
IUIToastMessageService$
|
|
7282
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6600
7283
|
}
|
|
6601
7284
|
})["catch"](function (error) {
|
|
6602
7285
|
console.log("errorrr", error);
|
|
@@ -6621,7 +7304,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6621
7304
|
}
|
|
6622
7305
|
}).then(function (response) {
|
|
6623
7306
|
if (response.status !== 200) {
|
|
6624
|
-
IUIToastMessageService$
|
|
7307
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6625
7308
|
}
|
|
6626
7309
|
})["catch"](function (error) {
|
|
6627
7310
|
console.log("errorrr", error);
|
|
@@ -6665,9 +7348,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6665
7348
|
if (_loop4()) break;
|
|
6666
7349
|
}
|
|
6667
7350
|
} else if (typeof err === 'string') {
|
|
6668
|
-
IUIToastMessageService$
|
|
7351
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
6669
7352
|
} else {
|
|
6670
|
-
IUIToastMessageService$
|
|
7353
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6671
7354
|
}
|
|
6672
7355
|
})["finally"](function () {
|
|
6673
7356
|
dispatch(stopLoader());
|
|
@@ -6701,7 +7384,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6701
7384
|
};
|
|
6702
7385
|
var doesFormHasError = function doesFormHasError() {
|
|
6703
7386
|
for (var key in errorMsgs) {
|
|
6704
|
-
console.log(Object.hasOwnProperty.call(errorMsgs, key));
|
|
6705
7387
|
if (Object.hasOwnProperty.call(errorMsgs, key)) {
|
|
6706
7388
|
if (errorMsgs[key] !== '' && key !== 'passport_photo' && key !== 'travel_docs') {
|
|
6707
7389
|
return errorMsgs[key];
|
|
@@ -7061,8 +7743,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7061
7743
|
maxApprovers: maxTravelApprovers,
|
|
7062
7744
|
isProfile: isProfile,
|
|
7063
7745
|
editUserId: editUserId,
|
|
7064
|
-
roles: renderFields.travelRoles
|
|
7065
|
-
errorMsgs: errorMsgs
|
|
7746
|
+
roles: renderFields.travelRoles
|
|
7066
7747
|
}), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7067
7748
|
className: styles.dividerColor
|
|
7068
7749
|
}), /*#__PURE__*/React.createElement(AdditionalInfo, {
|
|
@@ -7080,7 +7761,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7080
7761
|
errorMsgs: errorMsgs,
|
|
7081
7762
|
dateFormat: dateFormat,
|
|
7082
7763
|
defaultExpand: isAdditionalInfoExpanded,
|
|
7083
|
-
setAdditionalInfoFlag: setAdditionalInfoFlag
|
|
7764
|
+
setAdditionalInfoFlag: setAdditionalInfoFlag,
|
|
7765
|
+
setMembershipInfoInput: setMembershipInfoInput,
|
|
7766
|
+
isProfile: isProfile
|
|
7084
7767
|
})), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7085
7768
|
className: styles.dividerColor
|
|
7086
7769
|
}), productAccess && productAccess.expense && /*#__PURE__*/React.createElement(TravelExpenseFields, {
|
|
@@ -7137,7 +7820,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7137
7820
|
};
|
|
7138
7821
|
var index = withStore(UserAddEdit);
|
|
7139
7822
|
|
|
7140
|
-
var styles$
|
|
7823
|
+
var styles$5 = {"UUIUserManagementImport":"_2LqsB","pageHeader":"_2e_3-","heading":"_3eU-2","headingLarge":"_2Att5","headingMedium":"_1V1WI","headingSmall":"_3K2if","dividerColor":"_2HV3a","container":"_1IhuU","customRadioEach":"_1SNqS","fileEmptyScreenClass":"_1oAZy","emptyScreenText":"_2Dr6Z","tablewrapper":"_3qvwi","rowText":"_2gGIL","textTransform":"_1wfQ7","lightColor":"_mB5T5","customRadio":"_Jgvba","radioLbl":"_3ymQp","connector":"_2wR5m","recordsDetails":"_1K8ye","rightBorder":"_2xf9y","mildText":"_GMJnw","buttonTopalignment":"_1yIRP","minWidth":"_2QJ1O","recordValue":"_2B4yV","validationLine":"_3wyl5","descText":"_3mh3L","divider":"_1FdXG","checkboxlabel":"_2Nf4P","disabledText":"_2fNvj","statusCircle":"_3LWGh","draftCircle":"_2sc-Y","colGap":"_7nyR0","infoText":"_1ktOg","infoLbl":"_3dfeW","importStatus":"_f2QaG","completedContainer":"_1bMg3","recordRow":"_3bzZL","numberText":"_33tc8","stepper":"_2qgQw","importProgressInfo":"_3L6ao","importProgressInfotext":"_yI1xw","lightLargeFont":"_evdHP","backdrop":"_1CjJP"};
|
|
7141
7824
|
|
|
7142
7825
|
var DownloadIcon = function DownloadIcon(props) {
|
|
7143
7826
|
return /*#__PURE__*/React.createElement("svg", {
|
|
@@ -7178,21 +7861,6 @@ var CheckCircleIcon = function CheckCircleIcon(props) {
|
|
|
7178
7861
|
}));
|
|
7179
7862
|
};
|
|
7180
7863
|
|
|
7181
|
-
var ChevronNext = function ChevronNext() {
|
|
7182
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
7183
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7184
|
-
width: "8",
|
|
7185
|
-
height: "16",
|
|
7186
|
-
fill: "none",
|
|
7187
|
-
viewBox: "0 0 8 16"
|
|
7188
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
7189
|
-
stroke: "#9CA3AF",
|
|
7190
|
-
strokeLinecap: "round",
|
|
7191
|
-
strokeLinejoin: "round",
|
|
7192
|
-
d: "M2 4l4 4-4 4"
|
|
7193
|
-
}));
|
|
7194
|
-
};
|
|
7195
|
-
|
|
7196
7864
|
var FileError = function FileError() {
|
|
7197
7865
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7198
7866
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7232,7 +7900,7 @@ var Progressicon = function Progressicon(props) {
|
|
|
7232
7900
|
}));
|
|
7233
7901
|
};
|
|
7234
7902
|
|
|
7235
|
-
var api$
|
|
7903
|
+
var api$8 = configs.api;
|
|
7236
7904
|
var showLoader$2 = function showLoader() {
|
|
7237
7905
|
return {
|
|
7238
7906
|
type: SHOW_LOADER$4
|
|
@@ -7258,7 +7926,7 @@ var setBulkActionHistoryFields = function setBulkActionHistoryFields(payload) {
|
|
|
7258
7926
|
var generateTemplate = function generateTemplate(payload) {
|
|
7259
7927
|
return function (dispatch) {
|
|
7260
7928
|
return new Promise(function (resolve, reject) {
|
|
7261
|
-
api$
|
|
7929
|
+
api$8.get("" + userBulkImport.generateTemplate()).then(function (res) {
|
|
7262
7930
|
resolve(res);
|
|
7263
7931
|
})["catch"](function (err) {
|
|
7264
7932
|
reject(err);
|
|
@@ -7269,7 +7937,7 @@ var generateTemplate = function generateTemplate(payload) {
|
|
|
7269
7937
|
var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
7270
7938
|
return function (dispatch) {
|
|
7271
7939
|
return new Promise(function (resolve, reject) {
|
|
7272
|
-
api$
|
|
7940
|
+
api$8.get(userBulkImport.uploadUrl() + "?action=upload_bulk_users&item_type=bulk_users&file_name=" + payload.fileName).then(function (res) {
|
|
7273
7941
|
var resolveResponse = {
|
|
7274
7942
|
file_type: 'bulk_users',
|
|
7275
7943
|
file_path: res.data.presigned_url.fields.key,
|
|
@@ -7308,7 +7976,7 @@ var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
|
7308
7976
|
var validateUploadedFile = function validateUploadedFile(fileName) {
|
|
7309
7977
|
return function (dispatch) {
|
|
7310
7978
|
return new Promise(function (resolve, reject) {
|
|
7311
|
-
api$
|
|
7979
|
+
api$8.post(userBulkImport.validateUploadedFile() + "?file_name=" + fileName).then(function (res) {
|
|
7312
7980
|
resolve(res);
|
|
7313
7981
|
})["catch"](function (err) {
|
|
7314
7982
|
reject(err);
|
|
@@ -7316,13 +7984,13 @@ var validateUploadedFile = function validateUploadedFile(fileName) {
|
|
|
7316
7984
|
});
|
|
7317
7985
|
};
|
|
7318
7986
|
};
|
|
7319
|
-
var
|
|
7987
|
+
var _executionJob = function executionJob(jobId, type) {
|
|
7320
7988
|
return function (dispatch) {
|
|
7321
7989
|
return new Promise(function (resolve, reject) {
|
|
7322
|
-
api$
|
|
7990
|
+
api$8.get(userBulkImport.executionResult() + "?job_id=" + jobId).then(function (res) {
|
|
7323
7991
|
if (!res.data[type]) {
|
|
7324
7992
|
setTimeout(function () {
|
|
7325
|
-
dispatch(
|
|
7993
|
+
dispatch(_executionJob(jobId, type)).then(function (res) {
|
|
7326
7994
|
return res.data[type] && resolve(res);
|
|
7327
7995
|
})["catch"](function (err) {
|
|
7328
7996
|
reject(err);
|
|
@@ -7339,13 +8007,13 @@ var executionJob = function executionJob(jobId, type) {
|
|
|
7339
8007
|
});
|
|
7340
8008
|
};
|
|
7341
8009
|
};
|
|
7342
|
-
var
|
|
8010
|
+
var _downloadExecutionJob = function downloadExecutionJob(auditId, type) {
|
|
7343
8011
|
return function (dispatch) {
|
|
7344
8012
|
return new Promise(function (resolve, reject) {
|
|
7345
|
-
api$
|
|
8013
|
+
api$8.get(userBulkImport.executionResult() + "?audit_id=" + auditId).then(function (res) {
|
|
7346
8014
|
if (!res.data[type]) {
|
|
7347
8015
|
setTimeout(function () {
|
|
7348
|
-
dispatch(
|
|
8016
|
+
dispatch(_downloadExecutionJob(auditId, type)).then(function (res) {
|
|
7349
8017
|
return res.data[type] && resolve(res);
|
|
7350
8018
|
})["catch"](function (err) {
|
|
7351
8019
|
reject(err);
|
|
@@ -7364,7 +8032,7 @@ var downloadExecutionJob = function downloadExecutionJob(auditId, type) {
|
|
|
7364
8032
|
var downloadUploadedRecords = function downloadUploadedRecords(type, jobId) {
|
|
7365
8033
|
return function (dispatch) {
|
|
7366
8034
|
return new Promise(function (resolve, reject) {
|
|
7367
|
-
api$
|
|
8035
|
+
api$8.get(userBulkImport.downloadUploadedRecords() + "?status=" + type + "&job_id=" + jobId).then(function (res) {
|
|
7368
8036
|
resolve(res);
|
|
7369
8037
|
})["catch"](function (err) {
|
|
7370
8038
|
reject(err);
|
|
@@ -7375,7 +8043,7 @@ var downloadUploadedRecords = function downloadUploadedRecords(type, jobId) {
|
|
|
7375
8043
|
var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExistingUsers) {
|
|
7376
8044
|
return function (dispatch) {
|
|
7377
8045
|
return new Promise(function (resolve, reject) {
|
|
7378
|
-
api$
|
|
8046
|
+
api$8.post(userBulkImport.importRecords() + "?job_id=" + jobId + "&update=" + canUpdateExistingUsers).then(function (res) {
|
|
7379
8047
|
resolve(res);
|
|
7380
8048
|
})["catch"](function (err) {
|
|
7381
8049
|
reject(err);
|
|
@@ -7386,7 +8054,7 @@ var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExist
|
|
|
7386
8054
|
var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
7387
8055
|
return function (dispatch) {
|
|
7388
8056
|
return new Promise(function (resolve, reject) {
|
|
7389
|
-
api$
|
|
8057
|
+
api$8.get(url).then(function (res) {
|
|
7390
8058
|
if (res.status === 204) {
|
|
7391
8059
|
dispatch(setBulkActionHistoryFields({
|
|
7392
8060
|
count: 0,
|
|
@@ -7410,7 +8078,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
7410
8078
|
};
|
|
7411
8079
|
};
|
|
7412
8080
|
|
|
7413
|
-
var styles$
|
|
8081
|
+
var styles$6 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltipTextDiv":"_1l4V-","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","warningSvg":"_2H6Bq","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn","deactivateSubmitBtn":"_1qxY-","deactivateCustomButtonClass":"_2YBWE"};
|
|
7414
8082
|
|
|
7415
8083
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
7416
8084
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7483,7 +8151,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7483
8151
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
7484
8152
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
7485
8153
|
if (validatedRes.data.status) {
|
|
7486
|
-
dispatch(
|
|
8154
|
+
dispatch(_executionJob(validatedRes.data.job_id, 'is_validation_completed')).then(function (response) {
|
|
7487
8155
|
data.push(res);
|
|
7488
8156
|
setFiles([].concat(data));
|
|
7489
8157
|
setIsFileUploading(false);
|
|
@@ -7526,7 +8194,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7526
8194
|
};
|
|
7527
8195
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
7528
8196
|
open: isFileUploading || isFileDownloading,
|
|
7529
|
-
className: styles$
|
|
8197
|
+
className: styles$6.backdrop
|
|
7530
8198
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
7531
8199
|
color: "inherit"
|
|
7532
8200
|
})), /*#__PURE__*/React.createElement(IUIModal, {
|
|
@@ -7543,7 +8211,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7543
8211
|
}
|
|
7544
8212
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7545
8213
|
container: true,
|
|
7546
|
-
className: styles$
|
|
8214
|
+
className: styles$6.importModalBodyContainer
|
|
7547
8215
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7548
8216
|
item: true,
|
|
7549
8217
|
md: 12,
|
|
@@ -7551,26 +8219,26 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7551
8219
|
xl: 12,
|
|
7552
8220
|
sm: 12,
|
|
7553
8221
|
xs: 12,
|
|
7554
|
-
className: styles$
|
|
8222
|
+
className: styles$6.downloadTemplateContainer
|
|
7555
8223
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7556
8224
|
display: "flex",
|
|
7557
8225
|
flexDirection: "column",
|
|
7558
8226
|
justifyContent: "space-between",
|
|
7559
|
-
className: styles$
|
|
8227
|
+
className: styles$6.downloadTemplateDescContainer
|
|
7560
8228
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7561
|
-
className: styles$
|
|
8229
|
+
className: styles$6.labelContainer
|
|
7562
8230
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7563
|
-
className: styles$
|
|
8231
|
+
className: styles$6.downlTempHeader
|
|
7564
8232
|
}, "1.\xA0\xA0 Download the template"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7565
|
-
className: styles$
|
|
8233
|
+
className: styles$6.downlTempDescription
|
|
7566
8234
|
}, "Use this template with predefined columns and add users to your team")), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUIButton, {
|
|
7567
8235
|
type: "outlined",
|
|
7568
8236
|
buttonText: "Download template",
|
|
7569
8237
|
onClick: downloadTemplate,
|
|
7570
|
-
className: styles$
|
|
8238
|
+
className: styles$6.downloadTemplateButton,
|
|
7571
8239
|
isLink: true
|
|
7572
8240
|
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7573
|
-
className: clsx(styles$
|
|
8241
|
+
className: clsx(styles$6.dividerColor, styles$6.w100)
|
|
7574
8242
|
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7575
8243
|
item: true,
|
|
7576
8244
|
md: 12,
|
|
@@ -7578,19 +8246,19 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7578
8246
|
xl: 12,
|
|
7579
8247
|
sm: 12,
|
|
7580
8248
|
xs: 12,
|
|
7581
|
-
className: styles$
|
|
8249
|
+
className: styles$6.downloadTemplateContainer
|
|
7582
8250
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7583
8251
|
display: "flex",
|
|
7584
8252
|
flexDirection: "column",
|
|
7585
|
-
className: clsx(styles$
|
|
8253
|
+
className: clsx(styles$6.downloadTemplateDescContainer, styles$6.colGap)
|
|
7586
8254
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7587
|
-
className: styles$
|
|
8255
|
+
className: styles$6.labelContainer
|
|
7588
8256
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7589
|
-
className: styles$
|
|
8257
|
+
className: styles$6.downlTempHeader
|
|
7590
8258
|
}, "2.\xA0\xA0 Upload XLSX"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7591
|
-
className: styles$
|
|
8259
|
+
className: styles$6.downlTempDescription
|
|
7592
8260
|
}, "Once you\u2019ve filled out the file, upload it here")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7593
|
-
className: styles$
|
|
8261
|
+
className: styles$6.fileUploaderContainer
|
|
7594
8262
|
}, /*#__PURE__*/React.createElement(IUIDropzone, {
|
|
7595
8263
|
handleDrop: handleDrop,
|
|
7596
8264
|
fileNames: fileNames,
|
|
@@ -7602,11 +8270,11 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7602
8270
|
gap: '10px'
|
|
7603
8271
|
}
|
|
7604
8272
|
}, /*#__PURE__*/React.createElement(ErrorIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7605
|
-
className: styles$
|
|
8273
|
+
className: styles$6.errorText
|
|
7606
8274
|
}, errorMessage)))))));
|
|
7607
8275
|
};
|
|
7608
8276
|
|
|
7609
|
-
var IUIToastMessageService$
|
|
8277
|
+
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
7610
8278
|
var env$5 = configs.env;
|
|
7611
8279
|
function getSteps() {
|
|
7612
8280
|
return ['Review and import', 'Summary'];
|
|
@@ -7654,7 +8322,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7654
8322
|
if (isTokenVerified === true) {
|
|
7655
8323
|
var getData = function getData() {
|
|
7656
8324
|
try {
|
|
7657
|
-
return Promise.resolve(dispatch(
|
|
8325
|
+
return Promise.resolve(dispatch(_executionJob(jobId, 'is_validation_completed')).then(function (res) {
|
|
7658
8326
|
setImportStatus(res.data.bulk_result);
|
|
7659
8327
|
setActiveStep(getActiveStep(res.data.is_job_completed));
|
|
7660
8328
|
setCanUpdateExistingUsers(res.data.exist_users > 0);
|
|
@@ -7700,12 +8368,12 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7700
8368
|
return Promise.resolve(dispatch(downloadUploadedRecords(type, jobId)).then(function (validatedRes) {
|
|
7701
8369
|
var _validatedRes$data;
|
|
7702
8370
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
7703
|
-
dispatch(
|
|
8371
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
7704
8372
|
window.open(res.data.presigned_url, '_self').focus();
|
|
7705
8373
|
})["catch"](function (reject) {
|
|
7706
8374
|
if (reject) {
|
|
7707
8375
|
if (!reject.response.data.status) {
|
|
7708
|
-
IUIToastMessageService$
|
|
8376
|
+
IUIToastMessageService$7.warningNotify(reject.response.data.message);
|
|
7709
8377
|
}
|
|
7710
8378
|
}
|
|
7711
8379
|
})["finally"](function () {
|
|
@@ -7715,7 +8383,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7715
8383
|
})["catch"](function (reject) {
|
|
7716
8384
|
if (reject) {
|
|
7717
8385
|
if (!reject.response.data.status) {
|
|
7718
|
-
IUIToastMessageService$
|
|
8386
|
+
IUIToastMessageService$7.warningNotify(reject.response.data.message);
|
|
7719
8387
|
setDownlStatus(false);
|
|
7720
8388
|
}
|
|
7721
8389
|
}
|
|
@@ -7741,7 +8409,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7741
8409
|
try {
|
|
7742
8410
|
if (userBulkImportInfo.success === 0 && userBulkImportInfo.exist_users > 0) {
|
|
7743
8411
|
if (!canUpdateExistingUsers) {
|
|
7744
|
-
IUIToastMessageService$
|
|
8412
|
+
IUIToastMessageService$7.warningNotify('Select update any existing users box');
|
|
7745
8413
|
return Promise.resolve(false);
|
|
7746
8414
|
}
|
|
7747
8415
|
}
|
|
@@ -7749,7 +8417,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7749
8417
|
return Promise.resolve(dispatch(importUploadedRecords(jobId, canUpdateExistingUsers ? 1 : 0))).then(function (res) {
|
|
7750
8418
|
var _temp = function () {
|
|
7751
8419
|
if (res.data.status) {
|
|
7752
|
-
return Promise.resolve(dispatch(
|
|
8420
|
+
return Promise.resolve(dispatch(_executionJob(jobId, 'is_job_completed')).then(function (resp) {
|
|
7753
8421
|
if (resp.data.status) {
|
|
7754
8422
|
setImportStatus(+resp.data.bulk_result);
|
|
7755
8423
|
setActiveStep(1);
|
|
@@ -7781,14 +8449,14 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7781
8449
|
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step === Number(activeStep)) {
|
|
7782
8450
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7783
8451
|
checked: true,
|
|
7784
|
-
className: clsx(styles$
|
|
8452
|
+
className: clsx(styles$5.customRadioEach),
|
|
7785
8453
|
size: "small",
|
|
7786
8454
|
disabled: true
|
|
7787
8455
|
});
|
|
7788
8456
|
}
|
|
7789
8457
|
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step !== Number(activeStep)) {
|
|
7790
8458
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7791
|
-
className: clsx(styles$
|
|
8459
|
+
className: clsx(styles$5.customRadioEach),
|
|
7792
8460
|
size: "small",
|
|
7793
8461
|
disabled: true
|
|
7794
8462
|
});
|
|
@@ -7796,7 +8464,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7796
8464
|
if (importStatus === 3 && step === Number(activeStep)) {
|
|
7797
8465
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7798
8466
|
checked: true,
|
|
7799
|
-
className: clsx(styles$
|
|
8467
|
+
className: clsx(styles$5.customRadioEach),
|
|
7800
8468
|
size: "small",
|
|
7801
8469
|
disabled: true
|
|
7802
8470
|
});
|
|
@@ -7813,11 +8481,11 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7813
8481
|
switch (importStatus) {
|
|
7814
8482
|
case 2:
|
|
7815
8483
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DraftIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7816
|
-
className: styles$
|
|
8484
|
+
className: styles$5.descText
|
|
7817
8485
|
}, "Draft"));
|
|
7818
8486
|
case 1:
|
|
7819
8487
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Progressicon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7820
|
-
className: styles$
|
|
8488
|
+
className: styles$5.descText
|
|
7821
8489
|
}, "In progress"));
|
|
7822
8490
|
case 3:
|
|
7823
8491
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
@@ -7825,28 +8493,28 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7825
8493
|
height: "16",
|
|
7826
8494
|
color: "#059669"
|
|
7827
8495
|
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7828
|
-
className: styles$
|
|
8496
|
+
className: styles$5.descText
|
|
7829
8497
|
}, "Completed"));
|
|
7830
8498
|
case 4:
|
|
7831
8499
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ErrorIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7832
|
-
className: styles$
|
|
8500
|
+
className: styles$5.descText
|
|
7833
8501
|
}, "Failed"));
|
|
7834
8502
|
}
|
|
7835
8503
|
};
|
|
7836
8504
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
7837
8505
|
component: "div",
|
|
7838
|
-
className: styles$
|
|
8506
|
+
className: styles$5.UUIUserManagementImport
|
|
7839
8507
|
}, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
7840
8508
|
open: importStatus === 1 || isFileDownloading,
|
|
7841
|
-
className: styles$
|
|
8509
|
+
className: styles$5.backdrop
|
|
7842
8510
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
7843
8511
|
color: "inherit"
|
|
7844
8512
|
})), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7845
8513
|
component: "div",
|
|
7846
|
-
className: clsx(styles$
|
|
8514
|
+
className: clsx(styles$5.pageHeader)
|
|
7847
8515
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7848
8516
|
component: "div",
|
|
7849
|
-
className: styles$
|
|
8517
|
+
className: styles$5.breadcrumb
|
|
7850
8518
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
7851
8519
|
breadCrumbs: [{
|
|
7852
8520
|
href: config.routes.users.list.path,
|
|
@@ -7869,23 +8537,23 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7869
8537
|
alignItems: "center"
|
|
7870
8538
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7871
8539
|
component: "div",
|
|
7872
|
-
className: styles$
|
|
8540
|
+
className: styles$5.headingWrapper
|
|
7873
8541
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7874
8542
|
variant: "h3",
|
|
7875
|
-
className: clsx(styles$
|
|
8543
|
+
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
7876
8544
|
}, "Import users"))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7877
|
-
className: styles$
|
|
8545
|
+
className: styles$5.dividerColor
|
|
7878
8546
|
}), canShowBlankScreen && /*#__PURE__*/React.createElement(IUIBox, {
|
|
7879
8547
|
display: "flex",
|
|
7880
8548
|
justifyContent: "center",
|
|
7881
8549
|
alignItems: "center",
|
|
7882
8550
|
flexDirection: "column",
|
|
7883
|
-
className: styles$
|
|
8551
|
+
className: styles$5.fileEmptyScreenClass
|
|
7884
8552
|
}, /*#__PURE__*/React.createElement(FileError, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7885
|
-
className: styles$
|
|
8553
|
+
className: styles$5.emptyScreenText
|
|
7886
8554
|
}, blankScreenMessage)), isApiProcessDone && !canShowBlankScreen && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7887
8555
|
container: true,
|
|
7888
|
-
className: styles$
|
|
8556
|
+
className: styles$5.container
|
|
7889
8557
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7890
8558
|
item: true,
|
|
7891
8559
|
lg: 9,
|
|
@@ -7900,7 +8568,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7900
8568
|
}, /*#__PURE__*/React.createElement(IUIStepper, {
|
|
7901
8569
|
activeStep: activeStep,
|
|
7902
8570
|
nonLinear: true,
|
|
7903
|
-
className: styles$
|
|
8571
|
+
className: styles$5.stepper,
|
|
7904
8572
|
CustomStepIcon: CustomStepIcon,
|
|
7905
8573
|
steps: steps
|
|
7906
8574
|
}), importStatus === 1 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -7909,21 +8577,21 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7909
8577
|
justifyContent: "center",
|
|
7910
8578
|
width: "800px",
|
|
7911
8579
|
borderRadius: "6px",
|
|
7912
|
-
className: styles$
|
|
8580
|
+
className: styles$5.importProgressInfo
|
|
7913
8581
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
7914
8582
|
width: "18",
|
|
7915
8583
|
height: "18",
|
|
7916
8584
|
color: "#7C2D12"
|
|
7917
8585
|
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7918
|
-
className: styles$
|
|
8586
|
+
className: styles$5.importProgressInfotext
|
|
7919
8587
|
}, "Import is in progress. This can take a few minutes. You can check the status from Bulk action history.")), importStatus !== 3 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
7920
8588
|
paddingLeft: "12px"
|
|
7921
8589
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7922
8590
|
container: true,
|
|
7923
|
-
className: styles$
|
|
8591
|
+
className: styles$5.recordsDetails
|
|
7924
8592
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7925
8593
|
item: true,
|
|
7926
|
-
className: styles$
|
|
8594
|
+
className: styles$5.rightBorder,
|
|
7927
8595
|
lg: 3,
|
|
7928
8596
|
md: 3,
|
|
7929
8597
|
xl: 3
|
|
@@ -7936,22 +8604,22 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7936
8604
|
gap: '45px'
|
|
7937
8605
|
}
|
|
7938
8606
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7939
|
-
className: clsx(styles$
|
|
8607
|
+
className: clsx(styles$5.mildText)
|
|
7940
8608
|
}, "Total \xA0 records"), +userBulkImportInfo.total_records > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7941
8609
|
onClick: function onClick() {
|
|
7942
8610
|
return handleDownloadRecords('total');
|
|
7943
8611
|
},
|
|
7944
|
-
className: styles$
|
|
8612
|
+
className: styles$5.buttonTopalignment
|
|
7945
8613
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7946
8614
|
width: "11",
|
|
7947
8615
|
height: "14"
|
|
7948
8616
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7949
8617
|
paddingLeft: "24px"
|
|
7950
8618
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7951
|
-
className: clsx(styles$
|
|
8619
|
+
className: clsx(styles$5.recordValue, (_clsx = {}, _clsx[styles$5.lightLargeFont] = +userBulkImportInfo.total_records === 0, _clsx))
|
|
7952
8620
|
}, userBulkImportInfo.total_records))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7953
8621
|
item: true,
|
|
7954
|
-
className: styles$
|
|
8622
|
+
className: styles$5.rightBorder,
|
|
7955
8623
|
lg: 3,
|
|
7956
8624
|
md: 3,
|
|
7957
8625
|
xl: 3
|
|
@@ -7964,22 +8632,22 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7964
8632
|
gap: '45px'
|
|
7965
8633
|
}
|
|
7966
8634
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7967
|
-
className: styles$
|
|
8635
|
+
className: styles$5.mildText
|
|
7968
8636
|
}, "Valid new records"), +userBulkImportInfo.success > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7969
8637
|
onClick: function onClick() {
|
|
7970
8638
|
return handleDownloadRecords('success');
|
|
7971
8639
|
},
|
|
7972
|
-
className: styles$
|
|
8640
|
+
className: styles$5.buttonTopalignment
|
|
7973
8641
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7974
8642
|
width: "11",
|
|
7975
8643
|
height: "14"
|
|
7976
8644
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7977
8645
|
paddingLeft: "24px"
|
|
7978
8646
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7979
|
-
className: clsx(styles$
|
|
8647
|
+
className: clsx(styles$5.recordValue, (_clsx2 = {}, _clsx2[styles$5.lightLargeFont] = +userBulkImportInfo.success === 0, _clsx2))
|
|
7980
8648
|
}, userBulkImportInfo.success))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7981
8649
|
item: true,
|
|
7982
|
-
className: styles$
|
|
8650
|
+
className: styles$5.rightBorder,
|
|
7983
8651
|
lg: 3,
|
|
7984
8652
|
md: 3,
|
|
7985
8653
|
xl: 3
|
|
@@ -7992,19 +8660,19 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7992
8660
|
gap: '45px'
|
|
7993
8661
|
}
|
|
7994
8662
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7995
|
-
className: styles$
|
|
8663
|
+
className: styles$5.mildText
|
|
7996
8664
|
}, "Valid existing records"), +userBulkImportInfo.exist_users > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7997
8665
|
onClick: function onClick() {
|
|
7998
8666
|
return handleDownloadRecords('exist');
|
|
7999
8667
|
},
|
|
8000
|
-
className: styles$
|
|
8668
|
+
className: styles$5.buttonTopalignment
|
|
8001
8669
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
8002
8670
|
width: "11",
|
|
8003
8671
|
height: "14"
|
|
8004
8672
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8005
8673
|
paddingLeft: "24px"
|
|
8006
8674
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8007
|
-
className: clsx(styles$
|
|
8675
|
+
className: clsx(styles$5.recordValue, (_clsx3 = {}, _clsx3[styles$5.lightLargeFont] = +userBulkImportInfo.exist_users === 0, _clsx3))
|
|
8008
8676
|
}, userBulkImportInfo.exist_users))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
8009
8677
|
item: true,
|
|
8010
8678
|
lg: 3,
|
|
@@ -8019,26 +8687,26 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8019
8687
|
gap: '45px'
|
|
8020
8688
|
}
|
|
8021
8689
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8022
|
-
className: styles$
|
|
8690
|
+
className: styles$5.mildText
|
|
8023
8691
|
}, "Invalid records"), +userBulkImportInfo.failure > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
8024
8692
|
onClick: function onClick() {
|
|
8025
8693
|
return handleDownloadRecords('failure');
|
|
8026
8694
|
},
|
|
8027
|
-
className: styles$
|
|
8695
|
+
className: styles$5.buttonTopalignment
|
|
8028
8696
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
8029
8697
|
width: "11",
|
|
8030
8698
|
height: "14"
|
|
8031
8699
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8032
8700
|
paddingLeft: "24px"
|
|
8033
8701
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8034
|
-
className: clsx(styles$
|
|
8702
|
+
className: clsx(styles$5.recordValue, (_clsx4 = {}, _clsx4[styles$5.lightLargeFont] = +userBulkImportInfo.failure === 0, _clsx4))
|
|
8035
8703
|
}, userBulkImportInfo.failure)))), +userBulkImportInfo.failure > 0 && /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8036
|
-
className: styles$
|
|
8704
|
+
className: styles$5.validationLine
|
|
8037
8705
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8038
8706
|
component: "span",
|
|
8039
8707
|
display: "inline-flex"
|
|
8040
8708
|
}, /*#__PURE__*/React.createElement(ErrorIcon, null)), +userBulkImportInfo.failure === 1 ? userBulkImportInfo.failure + ' record failed validation' : userBulkImportInfo.failure + ' records failed validation'), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8041
|
-
className: clsx(styles$
|
|
8709
|
+
className: clsx(styles$5.descText),
|
|
8042
8710
|
style: {
|
|
8043
8711
|
paddingLeft: '27px'
|
|
8044
8712
|
}
|
|
@@ -8058,9 +8726,9 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8058
8726
|
type: "text",
|
|
8059
8727
|
onClick: importUserHandler
|
|
8060
8728
|
}))), (+userBulkImportInfo.success > 0 || +userBulkImportInfo.exist_users > 0) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIDivider, {
|
|
8061
|
-
className: styles$
|
|
8729
|
+
className: styles$5.divider
|
|
8062
8730
|
}), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8063
|
-
className: styles$
|
|
8731
|
+
className: styles$5.validationLine
|
|
8064
8732
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8065
8733
|
component: "span",
|
|
8066
8734
|
display: "inline-flex"
|
|
@@ -8069,7 +8737,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8069
8737
|
height: "16",
|
|
8070
8738
|
color: "#059669"
|
|
8071
8739
|
})), handleSuccessTitle()), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8072
|
-
className: clsx(styles$
|
|
8740
|
+
className: clsx(styles$5.descText),
|
|
8073
8741
|
style: {
|
|
8074
8742
|
paddingLeft: '27px'
|
|
8075
8743
|
}
|
|
@@ -8084,7 +8752,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8084
8752
|
checked: canUpdateExistingUsers
|
|
8085
8753
|
}),
|
|
8086
8754
|
label: "Update any existing users",
|
|
8087
|
-
className: clsx(styles$
|
|
8755
|
+
className: clsx(styles$5.checkboxlabel, (_clsx5 = {}, _clsx5[styles$5.disabledText] = +userBulkImportInfo.exist_users === 0, _clsx5)),
|
|
8088
8756
|
disabled: +userBulkImportInfo.exist_users === 0
|
|
8089
8757
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8090
8758
|
display: "flex",
|
|
@@ -8098,17 +8766,17 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8098
8766
|
onClick: handleImportUploadRecords,
|
|
8099
8767
|
disabled: importStatus === 1
|
|
8100
8768
|
}))))), importStatus === 3 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8101
|
-
className: styles$
|
|
8769
|
+
className: styles$5.completedContainer
|
|
8102
8770
|
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8103
|
-
className: styles$
|
|
8771
|
+
className: styles$5.importStatus
|
|
8104
8772
|
}, "Import was successful")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8105
|
-
className: styles$
|
|
8773
|
+
className: styles$5.recordRow
|
|
8106
8774
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8107
8775
|
display: "flex",
|
|
8108
8776
|
justifyContent: "space-between",
|
|
8109
8777
|
alignItems: "center"
|
|
8110
8778
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8111
|
-
className: styles$
|
|
8779
|
+
className: styles$5.numberText
|
|
8112
8780
|
}, userBulkImportInfo.total_records, /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.total_records === 1 ? 'total record' : 'total records', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8113
8781
|
buttonText: "Download records",
|
|
8114
8782
|
type: "text",
|
|
@@ -8120,7 +8788,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8120
8788
|
justifyContent: "space-between",
|
|
8121
8789
|
alignItems: "center"
|
|
8122
8790
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8123
|
-
className: styles$
|
|
8791
|
+
className: styles$5.numberText
|
|
8124
8792
|
}, userBulkImportInfo.success, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.success === 1 ? 'new user added ' : 'new users added ', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8125
8793
|
buttonText: "Download records",
|
|
8126
8794
|
type: "text",
|
|
@@ -8132,7 +8800,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8132
8800
|
justifyContent: "space-between",
|
|
8133
8801
|
alignItems: "center"
|
|
8134
8802
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8135
|
-
className: styles$
|
|
8803
|
+
className: styles$5.numberText
|
|
8136
8804
|
}, userBulkImportInfo.exist_users, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.exist_users === 1 ? 'existing user updated' : 'existing users updated', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8137
8805
|
buttonText: "Download records",
|
|
8138
8806
|
type: "text",
|
|
@@ -8144,7 +8812,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8144
8812
|
justifyContent: "space-between",
|
|
8145
8813
|
alignItems: "center"
|
|
8146
8814
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8147
|
-
className: styles$
|
|
8815
|
+
className: styles$5.numberText
|
|
8148
8816
|
}, userBulkImportInfo.failure, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.failure === 1 ? 'invalid record' : 'invalid records', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8149
8817
|
buttonText: "Download records",
|
|
8150
8818
|
type: "text",
|
|
@@ -8164,7 +8832,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8164
8832
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8165
8833
|
display: "flex",
|
|
8166
8834
|
flexDirection: "column",
|
|
8167
|
-
className: styles$
|
|
8835
|
+
className: styles$5.colGap,
|
|
8168
8836
|
padding: "40px 0px"
|
|
8169
8837
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8170
8838
|
display: "flex",
|
|
@@ -8173,21 +8841,21 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8173
8841
|
},
|
|
8174
8842
|
alignItems: "center"
|
|
8175
8843
|
}, customStatus()), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8176
|
-
className: styles$
|
|
8844
|
+
className: styles$5.infoLbl
|
|
8177
8845
|
}, "Import ID"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8178
|
-
className: styles$
|
|
8846
|
+
className: styles$5.infoText
|
|
8179
8847
|
}, userBulkImportInfo.import_id)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8180
|
-
className: styles$
|
|
8848
|
+
className: styles$5.infoLbl
|
|
8181
8849
|
}, "File name"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8182
|
-
className: styles$
|
|
8850
|
+
className: styles$5.infoText
|
|
8183
8851
|
}, userBulkImportInfo.file_name)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8184
|
-
className: styles$
|
|
8852
|
+
className: styles$5.infoLbl
|
|
8185
8853
|
}, "File uploaded by"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8186
|
-
className: styles$
|
|
8854
|
+
className: styles$5.infoText
|
|
8187
8855
|
}, userBulkImportInfo.uploaded_by.first_name + ' ' + userBulkImportInfo.uploaded_by.last_name)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8188
|
-
className: styles$
|
|
8856
|
+
className: styles$5.infoLbl
|
|
8189
8857
|
}, "Import confirmed by"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8190
|
-
className: styles$
|
|
8858
|
+
className: styles$5.infoText
|
|
8191
8859
|
}, userBulkImportInfo.uploaded_by.first_name + ' ' + userBulkImportInfo.uploaded_by.last_name))))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
8192
8860
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
8193
8861
|
closeImportUsersModal: closeImportUsersModal,
|
|
@@ -8246,7 +8914,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8246
8914
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8247
8915
|
component: "div"
|
|
8248
8916
|
}, row.history_info.upload_id && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8249
|
-
className: clsx(styles$
|
|
8917
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8250
8918
|
}, row.history_info.upload_id));
|
|
8251
8919
|
}
|
|
8252
8920
|
}, {
|
|
@@ -8258,7 +8926,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8258
8926
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8259
8927
|
component: "div"
|
|
8260
8928
|
}, row.history_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8261
|
-
className: clsx(styles$
|
|
8929
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8262
8930
|
}, row.history_info.type));
|
|
8263
8931
|
}
|
|
8264
8932
|
}, {
|
|
@@ -8274,9 +8942,9 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8274
8942
|
gap: '8px'
|
|
8275
8943
|
}
|
|
8276
8944
|
}, row.history_info && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8277
|
-
className: clsx(styles$
|
|
8945
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8278
8946
|
}, getLocaleTime(row.history_info.date_of_upload + ' ' + row.history_info.time_of_upload, row.history_info.date_format)[0]), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8279
|
-
className: clsx(styles$
|
|
8947
|
+
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor)
|
|
8280
8948
|
}, getLocaleTime(row.history_info.date_of_upload + ' ' + row.history_info.time_of_upload, row.history_info.date_format)[1])));
|
|
8281
8949
|
}
|
|
8282
8950
|
}, {
|
|
@@ -8288,7 +8956,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8288
8956
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8289
8957
|
component: "div"
|
|
8290
8958
|
}, row.history_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8291
|
-
className: clsx(styles$
|
|
8959
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8292
8960
|
}, row.history_info.uploader_first_name, ' ', row.history_info.uploader_last_name));
|
|
8293
8961
|
}
|
|
8294
8962
|
}, {
|
|
@@ -8320,7 +8988,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8320
8988
|
width: "11",
|
|
8321
8989
|
height: "14"
|
|
8322
8990
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8323
|
-
className: clsx(styles$
|
|
8991
|
+
className: clsx(styles$5.rowText)
|
|
8324
8992
|
}, row.history_info.total_users, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +row.history_info.total_users === 1 ? ' total record' : ' total records '))), +row.history_info.valid_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8325
8993
|
component: "div",
|
|
8326
8994
|
display: "flex",
|
|
@@ -8337,7 +9005,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8337
9005
|
width: "11",
|
|
8338
9006
|
height: "14"
|
|
8339
9007
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8340
|
-
className: clsx(styles$
|
|
9008
|
+
className: clsx(styles$5.rowText)
|
|
8341
9009
|
}, row.history_info.valid_users, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +row.history_info.valid_users === 1 ? ' new user can be added ' : ' new users can be added '))), +row.history_info.exist_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8342
9010
|
component: "div",
|
|
8343
9011
|
display: "flex",
|
|
@@ -8354,7 +9022,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8354
9022
|
width: "11",
|
|
8355
9023
|
height: "14"
|
|
8356
9024
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8357
|
-
className: clsx(styles$
|
|
9025
|
+
className: clsx(styles$5.rowText)
|
|
8358
9026
|
}, row.history_info.exist_users, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +row.history_info.exist_users === 1 ? ' existing user can be updated ' : ' existing users can be updated '))), +row.history_info.invalid_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8359
9027
|
component: "div",
|
|
8360
9028
|
display: "flex",
|
|
@@ -8371,7 +9039,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8371
9039
|
width: "11",
|
|
8372
9040
|
height: "14"
|
|
8373
9041
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8374
|
-
className: clsx(styles$
|
|
9042
|
+
className: clsx(styles$5.rowText)
|
|
8375
9043
|
}, row.history_info.invalid_users + ' ', /*#__PURE__*/React.createElement("span", null, ' ', +row.history_info.invalid_users === 1 ? ' invalid record' : ' invalid records')))));
|
|
8376
9044
|
}
|
|
8377
9045
|
}, {
|
|
@@ -8388,7 +9056,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8388
9056
|
gap: '5px'
|
|
8389
9057
|
}
|
|
8390
9058
|
}, row.history_info && /*#__PURE__*/React.createElement(React.Fragment, null, getStatusIcon(row.history_info.status.toLowerCase()), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8391
|
-
className: clsx(styles$
|
|
9059
|
+
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor)
|
|
8392
9060
|
}, row.history_info.status)));
|
|
8393
9061
|
}
|
|
8394
9062
|
}];
|
|
@@ -8411,7 +9079,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8411
9079
|
});
|
|
8412
9080
|
};
|
|
8413
9081
|
|
|
8414
|
-
var styles$
|
|
9082
|
+
var styles$7 = {"UUICustomFields":"_tdVCY","pageHeader":"_8iQvL","buttonWrapper":"_2k_GJ","headingWrapper":"_1rYVz","heading":"_2nxXO","headingLarge":"_2auvl","headingMedium":"_Wjaw1","headingSmall":"_1UmTe","description":"_2BS2i","headerText":"_3SZ_X","letterImage":"_2AwAF","tablewrapper":"_3qSxj","rowText":"_2ZSw6","textTransform":"_1F6ss","lightColor":"_2Wjom","importModalBodyContainer":"_2JCWP","dividerColor":"_3EsJG","downloadTemplateContainer":"_2uRic","downloadTemplateDescContainer":"_55kg5","labelContainer":"_78mCn","downlTempHeader":"_lqUA2","downlTempDescription":"_1vT5l","colGap":"_1x_9W","tableHead":"_5SygC","actionButtons":"_3PeqN","emptyData":"_1bHs-","buttonWidth":"_2W2Jo","iconLayout":"_31IgO","baseAlert":"_342t1","iconStyle":"_3hgYk"};
|
|
8415
9083
|
|
|
8416
9084
|
function SkeletonLoader(_ref) {
|
|
8417
9085
|
var _ref$data = _ref.data,
|
|
@@ -8436,7 +9104,7 @@ function SkeletonLoader(_ref) {
|
|
|
8436
9104
|
}
|
|
8437
9105
|
}] : _ref$data;
|
|
8438
9106
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8439
|
-
className: styles$
|
|
9107
|
+
className: styles$7.tablewrapper,
|
|
8440
9108
|
style: {
|
|
8441
9109
|
margin: 20
|
|
8442
9110
|
}
|
|
@@ -8445,7 +9113,7 @@ function SkeletonLoader(_ref) {
|
|
|
8445
9113
|
}));
|
|
8446
9114
|
}
|
|
8447
9115
|
|
|
8448
|
-
var IUIToastMessageService$
|
|
9116
|
+
var IUIToastMessageService$8 = services.IUIToastMessageService;
|
|
8449
9117
|
var env$6 = configs.env;
|
|
8450
9118
|
var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
8451
9119
|
var config = _ref.config;
|
|
@@ -8532,12 +9200,12 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8532
9200
|
return Promise.resolve(dispatch(downloadUploadedRecords(type, jobId)).then(function (validatedRes) {
|
|
8533
9201
|
var _validatedRes$data;
|
|
8534
9202
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
8535
|
-
dispatch(
|
|
9203
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
8536
9204
|
window.open(res.data.presigned_url, '_self').focus();
|
|
8537
9205
|
})["catch"](function (reject) {
|
|
8538
9206
|
if (reject) {
|
|
8539
9207
|
if (!reject.response.data.status) {
|
|
8540
|
-
IUIToastMessageService$
|
|
9208
|
+
IUIToastMessageService$8.warningNotify(reject.response.data.message);
|
|
8541
9209
|
}
|
|
8542
9210
|
}
|
|
8543
9211
|
})["finally"](function () {
|
|
@@ -8547,7 +9215,7 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8547
9215
|
})["catch"](function (reject) {
|
|
8548
9216
|
if (reject) {
|
|
8549
9217
|
if (!reject.response.data.status) {
|
|
8550
|
-
IUIToastMessageService$
|
|
9218
|
+
IUIToastMessageService$8.warningNotify(reject.response.data.message);
|
|
8551
9219
|
setDownlStatus(false);
|
|
8552
9220
|
}
|
|
8553
9221
|
}
|
|
@@ -8598,18 +9266,18 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8598
9266
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp]);
|
|
8599
9267
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8600
9268
|
component: "div",
|
|
8601
|
-
className: styles$
|
|
9269
|
+
className: styles$5.UUIUserManagementImport
|
|
8602
9270
|
}, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8603
9271
|
open: isApiFetching || isFileDownloading,
|
|
8604
|
-
className: styles$
|
|
9272
|
+
className: styles$5.backdrop
|
|
8605
9273
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
8606
9274
|
color: "inherit"
|
|
8607
9275
|
})), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8608
9276
|
component: "div",
|
|
8609
|
-
className: clsx(styles$
|
|
9277
|
+
className: clsx(styles$5.pageHeader)
|
|
8610
9278
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8611
9279
|
component: "div",
|
|
8612
|
-
className: styles$
|
|
9280
|
+
className: styles$5.breadcrumb
|
|
8613
9281
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
8614
9282
|
breadCrumbs: [{
|
|
8615
9283
|
href: config.routes.users.list.path,
|
|
@@ -8628,14 +9296,14 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8628
9296
|
alignItems: "center"
|
|
8629
9297
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8630
9298
|
component: "div",
|
|
8631
|
-
className: styles$
|
|
9299
|
+
className: styles$5.headingWrapper
|
|
8632
9300
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8633
9301
|
variant: "h3",
|
|
8634
|
-
className: clsx(styles$
|
|
9302
|
+
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8635
9303
|
}, "Bulk action history"))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
8636
|
-
className: styles$
|
|
9304
|
+
className: styles$5.dividerColor
|
|
8637
9305
|
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8638
|
-
className: styles$
|
|
9306
|
+
className: styles$5.tablewrapper
|
|
8639
9307
|
}, /*#__PURE__*/React.createElement(BulkActionHistoryTable, {
|
|
8640
9308
|
data: bulkActionFields,
|
|
8641
9309
|
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
@@ -8884,7 +9552,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8884
9552
|
secondaryText: row.email,
|
|
8885
9553
|
letterAvatarTextColor: "black",
|
|
8886
9554
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
8887
|
-
avatarClassName: styles$
|
|
9555
|
+
avatarClassName: styles$6.avatarClassName,
|
|
8888
9556
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic = row.profile_pic) === null || _row$profile_pic === void 0 ? void 0 : _row$profile_pic.presigned_url
|
|
8889
9557
|
}));
|
|
8890
9558
|
}
|
|
@@ -8906,7 +9574,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8906
9574
|
},
|
|
8907
9575
|
placement: "top-start"
|
|
8908
9576
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8909
|
-
className: clsx(styles$
|
|
9577
|
+
className: clsx(styles$6.tooltipTextDiv)
|
|
8910
9578
|
}, "Invited")) : null);
|
|
8911
9579
|
}
|
|
8912
9580
|
}, {
|
|
@@ -8919,7 +9587,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8919
9587
|
component: "div",
|
|
8920
9588
|
width: 100
|
|
8921
9589
|
}, row.employee_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8922
|
-
className: clsx(styles$
|
|
9590
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
8923
9591
|
}, row.employee_info.department));
|
|
8924
9592
|
}
|
|
8925
9593
|
}, {
|
|
@@ -8934,12 +9602,12 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8934
9602
|
component: "div",
|
|
8935
9603
|
display: "flex"
|
|
8936
9604
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8937
|
-
className: clsx(styles$
|
|
9605
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8938
9606
|
style: {
|
|
8939
9607
|
whiteSpace: 'nowrap'
|
|
8940
9608
|
}
|
|
8941
9609
|
}, row.products[0].name + ' / ' + ' '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8942
|
-
className: clsx(styles$
|
|
9610
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8943
9611
|
style: {
|
|
8944
9612
|
whiteSpace: 'nowrap'
|
|
8945
9613
|
}
|
|
@@ -8947,12 +9615,12 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8947
9615
|
component: "div",
|
|
8948
9616
|
display: "flex"
|
|
8949
9617
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8950
|
-
className: clsx(styles$
|
|
9618
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8951
9619
|
style: {
|
|
8952
9620
|
whiteSpace: 'nowrap'
|
|
8953
9621
|
}
|
|
8954
9622
|
}, row.products[1].name + ' / '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8955
|
-
className: clsx(styles$
|
|
9623
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8956
9624
|
style: {
|
|
8957
9625
|
whiteSpace: 'nowrap'
|
|
8958
9626
|
}
|
|
@@ -8960,12 +9628,12 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8960
9628
|
component: "div",
|
|
8961
9629
|
display: "flex"
|
|
8962
9630
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8963
|
-
className: clsx(styles$
|
|
9631
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8964
9632
|
style: {
|
|
8965
9633
|
whiteSpace: 'nowrap'
|
|
8966
9634
|
}
|
|
8967
9635
|
}, row.products[2].name + ' / '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8968
|
-
className: clsx(styles$
|
|
9636
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8969
9637
|
style: {
|
|
8970
9638
|
whiteSpace: 'nowrap'
|
|
8971
9639
|
}
|
|
@@ -8978,7 +9646,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8978
9646
|
cell: function cell(row) {
|
|
8979
9647
|
return /*#__PURE__*/React.createElement(IUIFormGroup, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8980
9648
|
component: "div",
|
|
8981
|
-
className: clsx(styles$
|
|
9649
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
8982
9650
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
8983
9651
|
component: "label",
|
|
8984
9652
|
container: true,
|
|
@@ -9124,7 +9792,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9124
9792
|
secondaryText: row.email,
|
|
9125
9793
|
letterAvatarTextColor: "black",
|
|
9126
9794
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9127
|
-
avatarClassName: styles$
|
|
9795
|
+
avatarClassName: styles$6.avatarClassName,
|
|
9128
9796
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic2 = row.profile_pic) === null || _row$profile_pic2 === void 0 ? void 0 : _row$profile_pic2.presigned_url
|
|
9129
9797
|
}));
|
|
9130
9798
|
}
|
|
@@ -9138,7 +9806,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9138
9806
|
component: "div",
|
|
9139
9807
|
width: 100
|
|
9140
9808
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9141
|
-
className: clsx(styles$
|
|
9809
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
9142
9810
|
}, formatDate(row.created_at)));
|
|
9143
9811
|
}
|
|
9144
9812
|
}, {
|
|
@@ -9245,9 +9913,9 @@ function InviteInfoIcon() {
|
|
|
9245
9913
|
}));
|
|
9246
9914
|
}
|
|
9247
9915
|
|
|
9248
|
-
var IUIToastMessageService$
|
|
9916
|
+
var IUIToastMessageService$9 = services.IUIToastMessageService;
|
|
9249
9917
|
var env$7 = configs.env,
|
|
9250
|
-
api$
|
|
9918
|
+
api$9 = configs.api;
|
|
9251
9919
|
var UndoButton = function UndoButton(_ref) {
|
|
9252
9920
|
var onUndo = _ref.onUndo,
|
|
9253
9921
|
msg = _ref.msg;
|
|
@@ -9443,7 +10111,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9443
10111
|
};
|
|
9444
10112
|
var openDeactivateModal = function openDeactivateModal() {
|
|
9445
10113
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9446
|
-
IUIToastMessageService$
|
|
10114
|
+
IUIToastMessageService$9.warningNotify('Select at least one user to deactivate.');
|
|
9447
10115
|
return false;
|
|
9448
10116
|
}
|
|
9449
10117
|
if (selectedUsersApprover.length) {
|
|
@@ -9482,9 +10150,9 @@ var UserList = function UserList(_ref2) {
|
|
|
9482
10150
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
9483
10151
|
};
|
|
9484
10152
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
9485
|
-
IUIToastMessageService$
|
|
10153
|
+
IUIToastMessageService$9.undoNotify(/*#__PURE__*/React.createElement(UndoButton, {
|
|
9486
10154
|
onUndo: function onUndo() {
|
|
9487
|
-
return IUIToastMessageService$
|
|
10155
|
+
return IUIToastMessageService$9.setUndoClicked(true);
|
|
9488
10156
|
},
|
|
9489
10157
|
msg: "Sign-up request rejected"
|
|
9490
10158
|
}), function (res) {
|
|
@@ -9506,7 +10174,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9506
10174
|
console.log(err);
|
|
9507
10175
|
});
|
|
9508
10176
|
}
|
|
9509
|
-
IUIToastMessageService$
|
|
10177
|
+
IUIToastMessageService$9.setUndoClicked(false);
|
|
9510
10178
|
});
|
|
9511
10179
|
};
|
|
9512
10180
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9612,7 +10280,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9612
10280
|
setIsDisabledSubmitBtn(true);
|
|
9613
10281
|
setApproveeStatus(false);
|
|
9614
10282
|
if (deactivateSingle === true) {
|
|
9615
|
-
api$
|
|
10283
|
+
api$9.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9616
10284
|
if (response.data["default"].id) {
|
|
9617
10285
|
setDefaultId(response.data["default"].id);
|
|
9618
10286
|
setApproverRole({
|
|
@@ -9724,7 +10392,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9724
10392
|
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9725
10393
|
if (type === undefined) {
|
|
9726
10394
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9727
|
-
IUIToastMessageService$
|
|
10395
|
+
IUIToastMessageService$9.warningNotify('Select at least one user to invite.');
|
|
9728
10396
|
return false;
|
|
9729
10397
|
}
|
|
9730
10398
|
}
|
|
@@ -9759,12 +10427,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9759
10427
|
return Promise.resolve(dispatch(exportUsers()).then(function (validatedRes) {
|
|
9760
10428
|
var _validatedRes$data;
|
|
9761
10429
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
9762
|
-
dispatch(
|
|
10430
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
9763
10431
|
window.open(res.data.presigned_url, '_self').focus();
|
|
9764
10432
|
})["catch"](function (reject) {
|
|
9765
10433
|
if (reject) {
|
|
9766
10434
|
if (!reject.response.data.status) {
|
|
9767
|
-
IUIToastMessageService$
|
|
10435
|
+
IUIToastMessageService$9.warningNotify(reject.response.data.message);
|
|
9768
10436
|
}
|
|
9769
10437
|
}
|
|
9770
10438
|
})["finally"](function () {
|
|
@@ -9774,7 +10442,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9774
10442
|
})["catch"](function (reject) {
|
|
9775
10443
|
if (reject) {
|
|
9776
10444
|
if (!reject.response.data.status) {
|
|
9777
|
-
IUIToastMessageService$
|
|
10445
|
+
IUIToastMessageService$9.warningNotify(reject.response.data.message);
|
|
9778
10446
|
setDownlStatus(false);
|
|
9779
10447
|
}
|
|
9780
10448
|
}
|
|
@@ -9893,14 +10561,14 @@ var UserList = function UserList(_ref2) {
|
|
|
9893
10561
|
var topRightButtons = function topRightButtons() {
|
|
9894
10562
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9895
10563
|
component: "div",
|
|
9896
|
-
className: styles$
|
|
10564
|
+
className: styles$6.buttonWrapper,
|
|
9897
10565
|
display: "flex",
|
|
9898
10566
|
justifyContent: "space-between",
|
|
9899
10567
|
alignItems: "center",
|
|
9900
10568
|
alignSelf: "flex-start"
|
|
9901
10569
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9902
10570
|
component: "div",
|
|
9903
|
-
className: clsx(styles$
|
|
10571
|
+
className: clsx(styles$6.buttonSingle, styles$6.buttonLeft)
|
|
9904
10572
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9905
10573
|
buttonText: "Export all users",
|
|
9906
10574
|
type: "outlined",
|
|
@@ -9911,7 +10579,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9911
10579
|
onClick: handleExportUsers
|
|
9912
10580
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9913
10581
|
component: "div",
|
|
9914
|
-
className: clsx(styles$
|
|
10582
|
+
className: clsx(styles$6.buttonSingle, styles$6.buttonLeft)
|
|
9915
10583
|
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9916
10584
|
buttonText: "Bulk actions",
|
|
9917
10585
|
type: "outlined",
|
|
@@ -9932,12 +10600,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9932
10600
|
};
|
|
9933
10601
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9934
10602
|
component: "div",
|
|
9935
|
-
className: styles$
|
|
10603
|
+
className: styles$6.UUIUserManagementList
|
|
9936
10604
|
}, overlayMenu ? /*#__PURE__*/React.createElement(Box, {
|
|
9937
|
-
className: styles$
|
|
10605
|
+
className: styles$6.scrollOverlayMenu
|
|
9938
10606
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9939
10607
|
component: "div",
|
|
9940
|
-
className: clsx(styles$
|
|
10608
|
+
className: clsx(styles$6.pageHeader)
|
|
9941
10609
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9942
10610
|
component: "div",
|
|
9943
10611
|
display: "flex",
|
|
@@ -9960,7 +10628,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9960
10628
|
onChangeHandler: function onChangeHandler(e) {
|
|
9961
10629
|
return onSearchHandler(e.target.value);
|
|
9962
10630
|
},
|
|
9963
|
-
className: styles$
|
|
10631
|
+
className: styles$6.overlaysearch
|
|
9964
10632
|
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9965
10633
|
component: "div",
|
|
9966
10634
|
display: "flex",
|
|
@@ -9968,13 +10636,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9968
10636
|
alignItems: "center"
|
|
9969
10637
|
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9970
10638
|
open: isFileDownloading || isApiFetching,
|
|
9971
|
-
className: styles$
|
|
10639
|
+
className: styles$6.backdrop
|
|
9972
10640
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9973
10641
|
color: "inherit"
|
|
9974
10642
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9975
10643
|
id: "table-root",
|
|
9976
10644
|
component: "div",
|
|
9977
|
-
className: clsx(styles$
|
|
10645
|
+
className: clsx(styles$6.pageHeader)
|
|
9978
10646
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9979
10647
|
component: "div",
|
|
9980
10648
|
display: "flex",
|
|
@@ -9993,23 +10661,23 @@ var UserList = function UserList(_ref2) {
|
|
|
9993
10661
|
}
|
|
9994
10662
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9995
10663
|
component: "div",
|
|
9996
|
-
className: styles$
|
|
10664
|
+
className: styles$6.headingWrapper
|
|
9997
10665
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9998
10666
|
variant: "h3",
|
|
9999
|
-
className: clsx(styles$
|
|
10667
|
+
className: clsx(styles$6.heading, styles$6.headingLarge)
|
|
10000
10668
|
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10001
10669
|
component: "div",
|
|
10002
10670
|
display: "flex",
|
|
10003
10671
|
justifyContent: "space-between",
|
|
10004
10672
|
alignItems: "center"
|
|
10005
10673
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10006
|
-
className: styles$
|
|
10674
|
+
className: styles$6.tablewrapper
|
|
10007
10675
|
}, /*#__PURE__*/React.createElement(IUITabs, {
|
|
10008
10676
|
value: tabValue,
|
|
10009
10677
|
customTabHandler: function customTabHandler(value) {
|
|
10010
10678
|
return dispatch(updateTabValue(value));
|
|
10011
10679
|
},
|
|
10012
|
-
className: styles$
|
|
10680
|
+
className: styles$6.user_list_page_tabs,
|
|
10013
10681
|
tabs: [{
|
|
10014
10682
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Current users", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
10015
10683
|
count: userListInfo.count
|
|
@@ -10020,10 +10688,10 @@ var UserList = function UserList(_ref2) {
|
|
|
10020
10688
|
}
|
|
10021
10689
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10022
10690
|
component: "div",
|
|
10023
|
-
className: styles$
|
|
10691
|
+
className: styles$6.headingWrapper
|
|
10024
10692
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10025
10693
|
variant: "body2",
|
|
10026
|
-
className: clsx(styles$
|
|
10694
|
+
className: clsx(styles$6.description)
|
|
10027
10695
|
}, "Create new users, customize user permissions and manage user accounts")), /*#__PURE__*/React.createElement(StickyHeadTable, {
|
|
10028
10696
|
data: userListInfo,
|
|
10029
10697
|
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
@@ -10056,10 +10724,10 @@ var UserList = function UserList(_ref2) {
|
|
|
10056
10724
|
}
|
|
10057
10725
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10058
10726
|
component: "div",
|
|
10059
|
-
className: styles$
|
|
10727
|
+
className: styles$6.headingSignUpWrapper
|
|
10060
10728
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10061
10729
|
variant: "body2",
|
|
10062
|
-
className: clsx(styles$
|
|
10730
|
+
className: clsx(styles$6.description)
|
|
10063
10731
|
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement("span", {
|
|
10064
10732
|
onClick: redirectToNotifications,
|
|
10065
10733
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
@@ -10105,16 +10773,16 @@ var UserList = function UserList(_ref2) {
|
|
|
10105
10773
|
headerText: "Deactivate this user?",
|
|
10106
10774
|
width: "400px",
|
|
10107
10775
|
subHanderText: "",
|
|
10108
|
-
submitBtnClass: styles$
|
|
10776
|
+
submitBtnClass: styles$6.deactivateBtn,
|
|
10109
10777
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10110
10778
|
modalClass: "deactivateSingleModal",
|
|
10111
10779
|
modalBodyStyle: {
|
|
10112
10780
|
overflowY: 'unset'
|
|
10113
10781
|
}
|
|
10114
10782
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10115
|
-
className: clsx(styles$
|
|
10783
|
+
className: clsx(styles$6.deactivateSingle, 'iui__mb-16')
|
|
10116
10784
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10117
|
-
className: styles$
|
|
10785
|
+
className: styles$6.deactivateAlert
|
|
10118
10786
|
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
10119
10787
|
width: "9",
|
|
10120
10788
|
height: "9"
|
|
@@ -10163,29 +10831,29 @@ var UserList = function UserList(_ref2) {
|
|
|
10163
10831
|
alignItems: "center",
|
|
10164
10832
|
flexDirection: "column",
|
|
10165
10833
|
padding: "27px 16px 27px",
|
|
10166
|
-
className: styles$
|
|
10834
|
+
className: styles$6.deActivateModalContainer
|
|
10167
10835
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10168
|
-
className: styles$
|
|
10836
|
+
className: styles$6.headerText
|
|
10169
10837
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
10170
|
-
className: styles$
|
|
10838
|
+
className: styles$6.description
|
|
10171
10839
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
10172
10840
|
isOpen: isBulkDeactivateModalOpen,
|
|
10173
10841
|
closeHandler: closeDeActiveModal,
|
|
10174
10842
|
cancelLabel: "Cancel",
|
|
10175
10843
|
submitLabel: "Deactivate safe users",
|
|
10176
10844
|
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
10177
|
-
submitBtnClass: clsx(styles$
|
|
10845
|
+
submitBtnClass: clsx(styles$6.deactivateSubmitBtn),
|
|
10178
10846
|
customButtonLabel: "Deactivate all users",
|
|
10179
10847
|
customButtonHandler: handleDeactivateUsers,
|
|
10180
10848
|
submitHandler: handleDeactivateSafeUsers,
|
|
10181
10849
|
width: "640px",
|
|
10182
|
-
customButtonClass: clsx(styles$
|
|
10850
|
+
customButtonClass: clsx(styles$6.deactivateCustomButtonClass),
|
|
10183
10851
|
headerText: "Deactivate users?",
|
|
10184
10852
|
modalBodyStyle: {
|
|
10185
10853
|
maxHeight: 'calc(100vh - 50vh)'
|
|
10186
10854
|
}
|
|
10187
10855
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10188
|
-
className: clsx(styles$
|
|
10856
|
+
className: clsx(styles$6.deactivateAlert, styles$6.warningSvg)
|
|
10189
10857
|
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
10190
10858
|
color: "#9A6700",
|
|
10191
10859
|
size: "14"
|
|
@@ -10297,7 +10965,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10297
10965
|
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
10298
10966
|
var count = _ref5.count;
|
|
10299
10967
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10300
|
-
className: styles$
|
|
10968
|
+
className: styles$6.TabLabelCount
|
|
10301
10969
|
}, " ", count, " ");
|
|
10302
10970
|
};
|
|
10303
10971
|
var index$2 = withStore(UserList);
|
|
@@ -10318,7 +10986,7 @@ function Header(props) {
|
|
|
10318
10986
|
isILadmin = _useSelector.isILadmin;
|
|
10319
10987
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10320
10988
|
component: "div",
|
|
10321
|
-
className: clsx(styles$
|
|
10989
|
+
className: clsx(styles$6.pageHeader)
|
|
10322
10990
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10323
10991
|
component: "div",
|
|
10324
10992
|
display: "flex",
|
|
@@ -10337,19 +11005,19 @@ function Header(props) {
|
|
|
10337
11005
|
}
|
|
10338
11006
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10339
11007
|
component: "div",
|
|
10340
|
-
className: styles$
|
|
11008
|
+
className: styles$6.headingWrapper
|
|
10341
11009
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10342
11010
|
variant: "h3",
|
|
10343
|
-
className: clsx(styles$
|
|
11011
|
+
className: clsx(styles$6.heading, styles$6.headingLarge)
|
|
10344
11012
|
}, isILadmin === 1 && companyName !== null && companyName + " - ", ' ', headingName)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10345
11013
|
component: "div",
|
|
10346
|
-
className: styles$
|
|
11014
|
+
className: styles$6.headingWrapper
|
|
10347
11015
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10348
11016
|
variant: "body2",
|
|
10349
|
-
className: clsx(styles$
|
|
11017
|
+
className: clsx(styles$6.description)
|
|
10350
11018
|
}, subHeading))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10351
11019
|
component: "div",
|
|
10352
|
-
className: styles$
|
|
11020
|
+
className: styles$6.buttonWrapper,
|
|
10353
11021
|
display: "flex",
|
|
10354
11022
|
justifyContent: "space-between",
|
|
10355
11023
|
alignItems: "center",
|
|
@@ -10370,7 +11038,7 @@ function Header(props) {
|
|
|
10370
11038
|
})));
|
|
10371
11039
|
}
|
|
10372
11040
|
|
|
10373
|
-
var styles$
|
|
11041
|
+
var styles$8 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","rowText":"_2XKxl","lightColor":"_3uyfh","buttonWidth":"_13tv0","readOnlyInput":"_3yYuQ","addUserButton":"_1zbr_","alertDescContainer":"_3h8DM","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
10374
11042
|
|
|
10375
11043
|
function Listview(_ref) {
|
|
10376
11044
|
var data = _ref.data,
|
|
@@ -10423,19 +11091,19 @@ function Listview(_ref) {
|
|
|
10423
11091
|
display: "flex"
|
|
10424
11092
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
10425
11093
|
buttonText: "Edit",
|
|
10426
|
-
className: styles$
|
|
11094
|
+
className: styles$8.buttonWidth,
|
|
10427
11095
|
onClick: function onClick() {
|
|
10428
11096
|
return handleEditDialog(row);
|
|
10429
11097
|
}
|
|
10430
11098
|
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
10431
11099
|
buttonText: "Delete",
|
|
10432
|
-
className: styles$
|
|
11100
|
+
className: styles$8.buttonWidth,
|
|
10433
11101
|
onClick: function onClick() {
|
|
10434
11102
|
return handleDeleteDialog(row, true);
|
|
10435
11103
|
}
|
|
10436
11104
|
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
10437
11105
|
buttonText: "Delete",
|
|
10438
|
-
className: styles$
|
|
11106
|
+
className: styles$8.buttonWidth,
|
|
10439
11107
|
onClick: function onClick() {
|
|
10440
11108
|
return handleDeleteDialog(row, false);
|
|
10441
11109
|
}
|
|
@@ -10461,7 +11129,7 @@ function Listview(_ref) {
|
|
|
10461
11129
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10462
11130
|
component: "div"
|
|
10463
11131
|
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
10464
|
-
className: clsx(styles$
|
|
11132
|
+
className: clsx(styles$8.rowText, styles$8.textTransform, styles$8.lightColor)
|
|
10465
11133
|
}, "Assigned by default"));
|
|
10466
11134
|
}
|
|
10467
11135
|
}, {
|
|
@@ -10483,19 +11151,19 @@ function Listview(_ref) {
|
|
|
10483
11151
|
display: "flex"
|
|
10484
11152
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
10485
11153
|
buttonText: "Edit",
|
|
10486
|
-
className: styles$
|
|
11154
|
+
className: styles$8.buttonWidth,
|
|
10487
11155
|
onClick: function onClick() {
|
|
10488
11156
|
return handleEditDialog(row);
|
|
10489
11157
|
}
|
|
10490
11158
|
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
10491
11159
|
buttonText: "Delete",
|
|
10492
|
-
className: styles$
|
|
11160
|
+
className: styles$8.buttonWidth,
|
|
10493
11161
|
onClick: function onClick() {
|
|
10494
11162
|
return handleDeleteDialog(row, true);
|
|
10495
11163
|
}
|
|
10496
11164
|
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
10497
11165
|
buttonText: "Delete",
|
|
10498
|
-
className: styles$
|
|
11166
|
+
className: styles$8.buttonWidth,
|
|
10499
11167
|
onClick: function onClick() {
|
|
10500
11168
|
return handleDeleteDialog(row, false);
|
|
10501
11169
|
}
|
|
@@ -10504,7 +11172,7 @@ function Listview(_ref) {
|
|
|
10504
11172
|
}];
|
|
10505
11173
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10506
11174
|
p: 3,
|
|
10507
|
-
className: data !== null && data !== void 0 && data.results && data.results.length > 0 && data.results[0].code === UNASSIGNED_USERS ? styles$
|
|
11175
|
+
className: data !== null && data !== void 0 && data.results && data.results.length > 0 && data.results[0].code === UNASSIGNED_USERS ? styles$8.tableContainer : ''
|
|
10508
11176
|
}, /*#__PURE__*/React.createElement(IUITable, {
|
|
10509
11177
|
searchHide: true,
|
|
10510
11178
|
hasFilter: true,
|
|
@@ -10635,11 +11303,11 @@ function EditPanelDialog(_ref) {
|
|
|
10635
11303
|
justifyContent: "center",
|
|
10636
11304
|
alignItems: "center",
|
|
10637
11305
|
flexDirection: "column",
|
|
10638
|
-
className: styles$
|
|
11306
|
+
className: styles$8.baseAlert
|
|
10639
11307
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10640
|
-
className: styles$
|
|
11308
|
+
className: styles$8.alertDescContainer
|
|
10641
11309
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10642
|
-
className: styles$
|
|
11310
|
+
className: styles$8.iconLayout,
|
|
10643
11311
|
style: {
|
|
10644
11312
|
paddingTop: '4px'
|
|
10645
11313
|
}
|
|
@@ -10647,7 +11315,7 @@ function EditPanelDialog(_ref) {
|
|
|
10647
11315
|
color: "#CA8A04",
|
|
10648
11316
|
width: "25",
|
|
10649
11317
|
height: "20",
|
|
10650
|
-
className: styles$
|
|
11318
|
+
className: styles$8.iconStyle
|
|
10651
11319
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10652
11320
|
label: "By default, the primary admin gets assigned as the department head. This department has no users, so to change department head, add a new user.",
|
|
10653
11321
|
style: {
|
|
@@ -10662,7 +11330,7 @@ function EditPanelDialog(_ref) {
|
|
|
10662
11330
|
color: "#EC5D25"
|
|
10663
11331
|
}),
|
|
10664
11332
|
onClick: handleAddPageNavigation,
|
|
10665
|
-
className: styles$
|
|
11333
|
+
className: styles$8.addUserButton
|
|
10666
11334
|
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
10667
11335
|
label: name + " name",
|
|
10668
11336
|
name: "name",
|
|
@@ -10759,14 +11427,14 @@ function MoveUserDialog(_ref) {
|
|
|
10759
11427
|
flexDirection: "column"
|
|
10760
11428
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10761
11429
|
display: "flex",
|
|
10762
|
-
className: styles$
|
|
11430
|
+
className: styles$8.baseAlert
|
|
10763
11431
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10764
|
-
className: styles$
|
|
11432
|
+
className: styles$8.iconLayout
|
|
10765
11433
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10766
11434
|
color: "#CA8A04",
|
|
10767
11435
|
width: "25",
|
|
10768
11436
|
height: "20",
|
|
10769
|
-
className: styles$
|
|
11437
|
+
className: styles$8.iconStyle
|
|
10770
11438
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10771
11439
|
label: data.name + " cannot be deleted as it is linked with some users. You can delete this " + ((_labelData$module = labelData.module) === null || _labelData$module === void 0 ? void 0 : _labelData$module.toLowerCase()) + " only once you move the users to a different " + ((_labelData$module2 = labelData.module) === null || _labelData$module2 === void 0 ? void 0 : _labelData$module2.toLowerCase()) + ".",
|
|
10772
11440
|
style: {
|
|
@@ -10835,11 +11503,11 @@ function DeletePanelModal$1(_ref) {
|
|
|
10835
11503
|
alignItems: "center",
|
|
10836
11504
|
flexDirection: "column"
|
|
10837
11505
|
}, /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("span", {
|
|
10838
|
-
className: styles$
|
|
11506
|
+
className: styles$8.onBoardText
|
|
10839
11507
|
}, data.name), " cannot be deleted as it is linked with some users. To delete this", ' ', labelData.module, ", you must add a new ", labelData.module, " and then move the users to the new ", labelData.module, "."))));
|
|
10840
11508
|
}
|
|
10841
11509
|
|
|
10842
|
-
var IUIToastMessageService$
|
|
11510
|
+
var IUIToastMessageService$a = services.IUIToastMessageService;
|
|
10843
11511
|
var UserPanel = function UserPanel(_ref) {
|
|
10844
11512
|
var title = _ref.title,
|
|
10845
11513
|
headingName = _ref.headingName,
|
|
@@ -11045,7 +11713,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11045
11713
|
}
|
|
11046
11714
|
dispatch(userPanelShowLoader());
|
|
11047
11715
|
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
11048
|
-
IUIToastMessageService$
|
|
11716
|
+
IUIToastMessageService$a.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
11049
11717
|
dispatch(userPanelStopLoader());
|
|
11050
11718
|
if (type === 'delete') {
|
|
11051
11719
|
closeDeleteModal();
|
|
@@ -11133,7 +11801,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11133
11801
|
};
|
|
11134
11802
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11135
11803
|
component: "div",
|
|
11136
|
-
className: styles$
|
|
11804
|
+
className: styles$6.UUIUserManagementList
|
|
11137
11805
|
}, hasVerificationError === false ? /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Header, {
|
|
11138
11806
|
name: title,
|
|
11139
11807
|
headingName: headingName,
|
|
@@ -11298,14 +11966,14 @@ var DeleteCustomFieldModal = function DeleteCustomFieldModal(_ref) {
|
|
|
11298
11966
|
flexDirection: "column"
|
|
11299
11967
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11300
11968
|
display: "flex",
|
|
11301
|
-
className: styles$
|
|
11969
|
+
className: styles$7.baseAlert
|
|
11302
11970
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11303
|
-
className: styles$
|
|
11971
|
+
className: styles$7.iconLayout
|
|
11304
11972
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
11305
11973
|
color: "#CA8A04",
|
|
11306
11974
|
width: "25",
|
|
11307
11975
|
height: "20",
|
|
11308
|
-
className: styles$
|
|
11976
|
+
className: styles$7.iconStyle
|
|
11309
11977
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
11310
11978
|
label: "User data associated with the custom field \"" + data.field_name + "\" will get lost. It may also affect the reporting and rules associated with the field.",
|
|
11311
11979
|
style: {
|
|
@@ -11333,7 +12001,7 @@ var PageHeader = function PageHeader() {
|
|
|
11333
12001
|
};
|
|
11334
12002
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11335
12003
|
component: "div",
|
|
11336
|
-
className: clsx(styles$
|
|
12004
|
+
className: clsx(styles$7.pageHeader)
|
|
11337
12005
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11338
12006
|
component: "div",
|
|
11339
12007
|
display: "flex",
|
|
@@ -11341,13 +12009,13 @@ var PageHeader = function PageHeader() {
|
|
|
11341
12009
|
alignItems: "center"
|
|
11342
12010
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11343
12011
|
component: "div",
|
|
11344
|
-
className: styles$
|
|
12012
|
+
className: styles$7.headingWrapper
|
|
11345
12013
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
11346
12014
|
variant: "h3",
|
|
11347
|
-
className: clsx(styles$
|
|
12015
|
+
className: clsx(styles$7.heading, styles$7.headingLarge)
|
|
11348
12016
|
}, isILadmin && companyName ? companyName + " - " : '', "Custom fields")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
11349
12017
|
component: "div",
|
|
11350
|
-
className: styles$
|
|
12018
|
+
className: styles$7.buttonWrapper,
|
|
11351
12019
|
display: "flex",
|
|
11352
12020
|
justifyContent: "space-between",
|
|
11353
12021
|
alignItems: "center"
|
|
@@ -11370,10 +12038,10 @@ var PageHeader = function PageHeader() {
|
|
|
11370
12038
|
alignItems: "center"
|
|
11371
12039
|
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
11372
12040
|
component: "div",
|
|
11373
|
-
className: styles$
|
|
12041
|
+
className: styles$7.headingWrapper
|
|
11374
12042
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
11375
12043
|
variant: "body2",
|
|
11376
|
-
className: clsx(styles$
|
|
12044
|
+
className: clsx(styles$7.description)
|
|
11377
12045
|
}, "Configure fields based on the information you require from your employees in their profile")), /*#__PURE__*/React.createElement(AddCustomFieldModal, {
|
|
11378
12046
|
isOpenModal: isOpenModal,
|
|
11379
12047
|
closeModalHandler: function closeModalHandler() {
|
|
@@ -11435,13 +12103,13 @@ function Table() {
|
|
|
11435
12103
|
display: "flex"
|
|
11436
12104
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
11437
12105
|
buttonText: "Edit",
|
|
11438
|
-
className: styles$
|
|
12106
|
+
className: styles$7.buttonWidth,
|
|
11439
12107
|
onClick: function onClick() {
|
|
11440
12108
|
return handleEdit(row);
|
|
11441
12109
|
}
|
|
11442
12110
|
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
11443
12111
|
buttonText: "Delete",
|
|
11444
|
-
className: styles$
|
|
12112
|
+
className: styles$7.buttonWidth,
|
|
11445
12113
|
onClick: function onClick() {
|
|
11446
12114
|
return handleDelete(row);
|
|
11447
12115
|
}
|
|
@@ -11449,7 +12117,7 @@ function Table() {
|
|
|
11449
12117
|
}
|
|
11450
12118
|
}];
|
|
11451
12119
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11452
|
-
className: styles$
|
|
12120
|
+
className: styles$7.tablewrapper
|
|
11453
12121
|
}, /*#__PURE__*/React.createElement(IUITable, {
|
|
11454
12122
|
hasFilter: false,
|
|
11455
12123
|
isCheckboxTable: false,
|
|
@@ -11488,7 +12156,7 @@ var CustomFields$1 = function CustomFields(_ref) {
|
|
|
11488
12156
|
}, [isTokenVerified]);
|
|
11489
12157
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11490
12158
|
component: "div",
|
|
11491
|
-
className: styles$
|
|
12159
|
+
className: styles$7.UUICustomFields
|
|
11492
12160
|
}, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
|
|
11493
12161
|
data: [{
|
|
11494
12162
|
variant: 'rect',
|