@itilite/iui-user-management 1.4.60 → 1.4.71
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 +249 -2
- package/dist/index.js +1325 -585
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1325 -585
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
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
|
|
|
@@ -422,10 +435,10 @@ var userAddEditUrl = {
|
|
|
422
435
|
return "api/v1/onboarding/user-signup-reject/" + userId + "?action=undo";
|
|
423
436
|
},
|
|
424
437
|
cardsEditUserDetails: function cardsEditUserDetails(userId) {
|
|
425
|
-
return env.getCardsapiURL() + "/
|
|
438
|
+
return env.getCardsapiURL() + "/authorization/user/" + userId;
|
|
426
439
|
},
|
|
427
440
|
cardsAddUsersDetails: function cardsAddUsersDetails() {
|
|
428
|
-
return env.getCardsapiURL() + "/
|
|
441
|
+
return env.getCardsapiURL() + "/authorization/company/" + IUILocalStorageService.getCompanyId() + "/roles";
|
|
429
442
|
}
|
|
430
443
|
};
|
|
431
444
|
var userListUrl = {
|
|
@@ -873,10 +886,10 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
873
886
|
if (payload.productAccess.expense) {
|
|
874
887
|
product.expense = payload.expenseRole || null;
|
|
875
888
|
}
|
|
876
|
-
if (payload.productAccess.
|
|
889
|
+
if (payload.productAccess.card) {
|
|
877
890
|
var splitRole = payload.cardsRole.split(":");
|
|
878
891
|
var cardsUsmRole = splitRole[2];
|
|
879
|
-
product.
|
|
892
|
+
product.card = cardsUsmRole || null;
|
|
880
893
|
}
|
|
881
894
|
return product;
|
|
882
895
|
}(),
|
|
@@ -979,14 +992,14 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
979
992
|
};
|
|
980
993
|
if (!env$1.isProfilePage()) {
|
|
981
994
|
res.fields.product = function () {
|
|
982
|
-
if (payload.productAccess.travel && payload.productAccess.expense && payload.productAccess.
|
|
983
|
-
return 'expense+travel+
|
|
995
|
+
if (payload.productAccess.travel && payload.productAccess.expense && payload.productAccess.card) {
|
|
996
|
+
return 'expense+travel+card';
|
|
984
997
|
} else if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
985
998
|
return 'expense+travel';
|
|
986
|
-
} else if (payload.productAccess.expense && payload.productAccess.
|
|
987
|
-
return 'expense+
|
|
988
|
-
} else if (payload.productAccess.travel && payload.productAccess.
|
|
989
|
-
return 'travel+
|
|
999
|
+
} else if (payload.productAccess.expense && payload.productAccess.card) {
|
|
1000
|
+
return 'expense+card';
|
|
1001
|
+
} else if (payload.productAccess.travel && payload.productAccess.card) {
|
|
1002
|
+
return 'travel+card';
|
|
990
1003
|
} else if (payload.productAccess.travel) {
|
|
991
1004
|
return 'travel';
|
|
992
1005
|
} else {
|
|
@@ -1001,10 +1014,10 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1001
1014
|
if (payload.productAccess.expense) {
|
|
1002
1015
|
roles.expense = payload.expenseRole;
|
|
1003
1016
|
}
|
|
1004
|
-
if (payload.productAccess.
|
|
1017
|
+
if (payload.productAccess.card) {
|
|
1005
1018
|
var splitRole = payload.cardsRole.split(":");
|
|
1006
1019
|
var cardsUsmRole = splitRole[2];
|
|
1007
|
-
roles.
|
|
1020
|
+
roles.card = cardsUsmRole;
|
|
1008
1021
|
}
|
|
1009
1022
|
return roles;
|
|
1010
1023
|
}();
|
|
@@ -2256,7 +2269,7 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2256
2269
|
}, /*#__PURE__*/React.createElement("button", {
|
|
2257
2270
|
type: "button",
|
|
2258
2271
|
onClick: handleCardDelete
|
|
2259
|
-
}, /*#__PURE__*/React.createElement(DeleteIcon, {
|
|
2272
|
+
}, /*#__PURE__*/React.createElement(DeleteIcon$1, {
|
|
2260
2273
|
width: "10",
|
|
2261
2274
|
height: "10"
|
|
2262
2275
|
}))), /*#__PURE__*/React.createElement("div", {
|
|
@@ -2327,7 +2340,7 @@ var PaymentCards = function PaymentCards(_ref3) {
|
|
|
2327
2340
|
isDefaultCard: !!+card.metadata.default_card,
|
|
2328
2341
|
pg: paymentDetails.pg
|
|
2329
2342
|
});
|
|
2330
|
-
}), (!paymentDetails.cards || paymentDetails.cards.length <
|
|
2343
|
+
}), (!paymentDetails.cards || paymentDetails.cards.length < 10) && paymentDetails.pg.gateway.toLowerCase() === 'stripe' && paymentDetails.pg.save_card_enable === 1 && /*#__PURE__*/React.createElement(AddCard, {
|
|
2331
2344
|
pg: paymentDetails.pg
|
|
2332
2345
|
}))))));
|
|
2333
2346
|
};
|
|
@@ -3254,8 +3267,8 @@ var products = [{
|
|
|
3254
3267
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3255
3268
|
}, {
|
|
3256
3269
|
id: 3,
|
|
3257
|
-
label: '
|
|
3258
|
-
name: '
|
|
3270
|
+
label: 'Card',
|
|
3271
|
+
name: 'card',
|
|
3259
3272
|
type: 'checkbox',
|
|
3260
3273
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3261
3274
|
}];
|
|
@@ -3435,7 +3448,7 @@ var cardsConstants = {
|
|
|
3435
3448
|
roles: [{
|
|
3436
3449
|
id: 1,
|
|
3437
3450
|
label: 'Card holder',
|
|
3438
|
-
description: 'Can own
|
|
3451
|
+
description: 'Can view own cards and transactions.',
|
|
3439
3452
|
value: '',
|
|
3440
3453
|
name: '',
|
|
3441
3454
|
type: 'radio',
|
|
@@ -3446,7 +3459,7 @@ var cardsConstants = {
|
|
|
3446
3459
|
}, {
|
|
3447
3460
|
id: 2,
|
|
3448
3461
|
label: 'Card admin',
|
|
3449
|
-
description: 'Can issue cards
|
|
3462
|
+
description: 'Has full administrative access to the card program. Can issue cards, set card limits, add users, has visibility into all transactions, statements and balances.',
|
|
3450
3463
|
value: '',
|
|
3451
3464
|
name: '',
|
|
3452
3465
|
type: 'radio',
|
|
@@ -4472,26 +4485,938 @@ var ExpandLessIcon = function ExpandLessIcon(props) {
|
|
|
4472
4485
|
}));
|
|
4473
4486
|
};
|
|
4474
4487
|
|
|
4475
|
-
var
|
|
4476
|
-
|
|
4477
|
-
|
|
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;
|
|
4478
4493
|
return /*#__PURE__*/React.createElement("svg", {
|
|
4479
4494
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4480
|
-
width:
|
|
4481
|
-
height:
|
|
4495
|
+
width: "8",
|
|
4496
|
+
height: "16",
|
|
4482
4497
|
fill: "none",
|
|
4483
|
-
viewBox: "0 0
|
|
4498
|
+
viewBox: "0 0 8 16"
|
|
4484
4499
|
}, /*#__PURE__*/React.createElement("path", {
|
|
4485
|
-
|
|
4486
|
-
|
|
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
|
+
_ref$isProfile = _ref.isProfile,
|
|
4817
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
4818
|
+
var _useState = useState(false),
|
|
4819
|
+
open = _useState[0],
|
|
4820
|
+
setOpen = _useState[1];
|
|
4821
|
+
var _useState2 = useState(false),
|
|
4822
|
+
isDeleting = _useState2[0],
|
|
4823
|
+
setIsDeleting = _useState2[1];
|
|
4824
|
+
var _useState3 = useState(null),
|
|
4825
|
+
deleteItemData = _useState3[0],
|
|
4826
|
+
setDeleteItemData = _useState3[1];
|
|
4827
|
+
var _useSelector = useSelector(function (state) {
|
|
4828
|
+
return state.common;
|
|
4829
|
+
}),
|
|
4830
|
+
id = _useSelector.id;
|
|
4831
|
+
var _useParams = useParams(),
|
|
4832
|
+
editUserId = _useParams.userId;
|
|
4833
|
+
var userID = isProfile ? id : editUserId;
|
|
4834
|
+
var handleClose = function handleClose() {
|
|
4835
|
+
setOpen(false);
|
|
4836
|
+
setDeleteItemData(null);
|
|
4837
|
+
};
|
|
4838
|
+
var handleSubmit = function handleSubmit() {
|
|
4839
|
+
try {
|
|
4840
|
+
var url = "/api/v1/user-management/users/" + userID + "/membership";
|
|
4841
|
+
var index = deleteItemData.ind,
|
|
4842
|
+
rest = _objectWithoutPropertiesLoose(deleteItemData, _excluded);
|
|
4843
|
+
var payload = _extends({}, rest, {
|
|
4844
|
+
user: userID
|
|
4845
|
+
});
|
|
4846
|
+
setIsDeleting(true);
|
|
4847
|
+
var _temp = _catch(function () {
|
|
4848
|
+
return Promise.resolve(api$6["delete"](url, {
|
|
4849
|
+
data: payload
|
|
4850
|
+
})).then(function (response) {
|
|
4851
|
+
var _response$data;
|
|
4852
|
+
if (response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.status) {
|
|
4853
|
+
updateList(type, index);
|
|
4854
|
+
setOpen(false);
|
|
4855
|
+
IUIToastMessageService$4.notify("Membership deleted.");
|
|
4856
|
+
} else {
|
|
4857
|
+
IUIToastMessageService$4.warningNotify('Something went wrong!!');
|
|
4858
|
+
}
|
|
4859
|
+
setIsDeleting(false);
|
|
4860
|
+
});
|
|
4861
|
+
}, function (error) {
|
|
4862
|
+
console.error('Error occurred while deleting membership:', error);
|
|
4863
|
+
IUIToastMessageService$4.errorNotify('Failed to delete membership. Please try again.');
|
|
4864
|
+
setIsDeleting(false);
|
|
4865
|
+
});
|
|
4866
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
4867
|
+
} catch (e) {
|
|
4868
|
+
return Promise.reject(e);
|
|
4869
|
+
}
|
|
4870
|
+
};
|
|
4871
|
+
var handleDelete = function handleDelete(mem) {
|
|
4872
|
+
setOpen(true);
|
|
4873
|
+
setDeleteItemData(mem);
|
|
4874
|
+
};
|
|
4875
|
+
var onEdit = function onEdit(mem, index, isOther) {
|
|
4876
|
+
handleEdit(mem, index, isOther);
|
|
4877
|
+
};
|
|
4878
|
+
var FallbackIcon = function FallbackIcon(_ref2) {
|
|
4879
|
+
var type = _ref2.type;
|
|
4880
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4881
|
+
className: styles$3.newMembershipIcon
|
|
4882
|
+
}, /*#__PURE__*/React.createElement(TravelModeIcon, {
|
|
4883
|
+
type: type
|
|
4884
|
+
}));
|
|
4885
|
+
};
|
|
4886
|
+
var _ref3 = deleteItemData || {},
|
|
4887
|
+
_ref3$name = _ref3.name,
|
|
4888
|
+
name = _ref3$name === void 0 ? '' : _ref3$name,
|
|
4889
|
+
_ref3$program_name = _ref3.program_name,
|
|
4890
|
+
program_name = _ref3$program_name === void 0 ? '' : _ref3$program_name,
|
|
4891
|
+
_ref3$loyalty_program = _ref3.loyalty_program_name,
|
|
4892
|
+
loyalty_program_name = _ref3$loyalty_program === void 0 ? '' : _ref3$loyalty_program;
|
|
4893
|
+
var deleteMembershipName = loyalty_program_name === 'Other' ? name || loyalty_program_name || program_name : loyalty_program_name || program_name || name;
|
|
4894
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IUIModal, {
|
|
4895
|
+
isOpen: open,
|
|
4896
|
+
closeHandler: handleClose,
|
|
4897
|
+
cancelLabel: "Cancel",
|
|
4898
|
+
submitLabel: isDeleting ? 'Deleting...' : 'Delete',
|
|
4899
|
+
submitHandler: handleSubmit,
|
|
4900
|
+
modalBodyStyle: {
|
|
4901
|
+
padding: '0px 24px',
|
|
4902
|
+
minHeight: 50,
|
|
4903
|
+
borderBottom: '1px solid #E5E7EB'
|
|
4904
|
+
},
|
|
4905
|
+
isDisabledSubmitBtn: isDeleting,
|
|
4906
|
+
headerText: "Delete " + deleteMembershipName,
|
|
4907
|
+
width: "640px",
|
|
4908
|
+
modalClass: styles$3.membershipDeleteModal
|
|
4909
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
4910
|
+
style: {
|
|
4911
|
+
marginTop: 0,
|
|
4912
|
+
color: '#6B7280'
|
|
4913
|
+
}
|
|
4914
|
+
}, "Are you sure you want to delete ", deleteMembershipName, "? This change is not reversible.")), list.map(function (mem, ind) {
|
|
4915
|
+
var _ref4 = mem || {},
|
|
4916
|
+
_ref4$name = _ref4.name,
|
|
4917
|
+
name = _ref4$name === void 0 ? '' : _ref4$name,
|
|
4918
|
+
_ref4$number = _ref4.number,
|
|
4919
|
+
number = _ref4$number === void 0 ? '' : _ref4$number,
|
|
4920
|
+
_ref4$program_name = _ref4.program_name,
|
|
4921
|
+
program_name = _ref4$program_name === void 0 ? '' : _ref4$program_name,
|
|
4922
|
+
_ref4$loyalty_program = _ref4.loyalty_program_image_url,
|
|
4923
|
+
loyalty_program_image_url = _ref4$loyalty_program === void 0 ? null : _ref4$loyalty_program,
|
|
4924
|
+
_ref4$loyalty_program2 = _ref4.loyalty_program_name,
|
|
4925
|
+
loyalty_program_name = _ref4$loyalty_program2 === void 0 ? '' : _ref4$loyalty_program2;
|
|
4926
|
+
var isOther = (loyalty_program_name || program_name) === 'Other';
|
|
4927
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
4928
|
+
className: styles$3.savedMembership,
|
|
4929
|
+
key: ind
|
|
4930
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4931
|
+
className: styles$3.iconWrapper
|
|
4932
|
+
}, loyalty_program_image_url ? /*#__PURE__*/React.createElement("div", {
|
|
4933
|
+
className: styles$3.iconPar,
|
|
4934
|
+
style: {
|
|
4935
|
+
background: "url(" + loyalty_program_image_url + ")",
|
|
4936
|
+
backgroundSize: 600,
|
|
4937
|
+
borderRadius: 6,
|
|
4938
|
+
border: '1px solid #F1F3F5',
|
|
4939
|
+
backgroundPosition: 'top'
|
|
4940
|
+
}
|
|
4941
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
4942
|
+
src: loyalty_program_image_url,
|
|
4943
|
+
alt: name,
|
|
4944
|
+
className: styles$3.icon,
|
|
4945
|
+
onError: function onError(e) {
|
|
4946
|
+
e.target.style.display = 'none';
|
|
4947
|
+
var fallbackContainer = e.target.nextElementSibling;
|
|
4948
|
+
if (fallbackContainer) fallbackContainer.style.display = 'block';
|
|
4949
|
+
}
|
|
4950
|
+
})) : /*#__PURE__*/React.createElement(FallbackIcon, {
|
|
4951
|
+
type: type
|
|
4952
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
4953
|
+
className: styles$3.newMembershipIcon,
|
|
4954
|
+
style: {
|
|
4955
|
+
display: 'none'
|
|
4956
|
+
}
|
|
4957
|
+
}, /*#__PURE__*/React.createElement(FallbackIcon, {
|
|
4958
|
+
type: type
|
|
4959
|
+
})), /*#__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", {
|
|
4960
|
+
className: styles$3.number
|
|
4961
|
+
}, number), /*#__PURE__*/React.createElement("div", {
|
|
4962
|
+
className: styles$3.actions
|
|
4963
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
4964
|
+
onClick: function onClick() {
|
|
4965
|
+
onEdit(mem, ind, isOther);
|
|
4966
|
+
},
|
|
4967
|
+
style: {
|
|
4968
|
+
marginTop: 1
|
|
4969
|
+
}
|
|
4970
|
+
}, /*#__PURE__*/React.createElement(EditIcon, {
|
|
4971
|
+
width: "14",
|
|
4972
|
+
height: "14",
|
|
4973
|
+
color: "#EC5D25"
|
|
4974
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
4975
|
+
onClick: function onClick() {
|
|
4976
|
+
handleDelete(_extends({}, mem, {
|
|
4977
|
+
ind: ind
|
|
4978
|
+
}));
|
|
4979
|
+
},
|
|
4980
|
+
style: {
|
|
4981
|
+
marginLeft: 10
|
|
4982
|
+
}
|
|
4983
|
+
}, /*#__PURE__*/React.createElement(DeleteIcon, null))));
|
|
4487
4984
|
}));
|
|
4488
4985
|
};
|
|
4489
4986
|
|
|
4987
|
+
var AddMembershipButton = memo(function (_ref) {
|
|
4988
|
+
var _ref$type = _ref.type,
|
|
4989
|
+
type = _ref$type === void 0 ? '' : _ref$type,
|
|
4990
|
+
_ref$setModalState = _ref.setModalState,
|
|
4991
|
+
setModalState = _ref$setModalState === void 0 ? function () {} : _ref$setModalState,
|
|
4992
|
+
modalState = _ref.modalState,
|
|
4993
|
+
_ref$list = _ref.list,
|
|
4994
|
+
list = _ref$list === void 0 ? [] : _ref$list,
|
|
4995
|
+
_ref$updateList = _ref.updateList,
|
|
4996
|
+
updateList = _ref$updateList === void 0 ? function () {} : _ref$updateList,
|
|
4997
|
+
_ref$handleEdit = _ref.handleEdit,
|
|
4998
|
+
handleEdit = _ref$handleEdit === void 0 ? function () {} : _ref$handleEdit,
|
|
4999
|
+
_ref$isProfile = _ref.isProfile,
|
|
5000
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
5001
|
+
var handleAddMembership = function handleAddMembership(type) {
|
|
5002
|
+
var currentModalState = _extends({}, modalState);
|
|
5003
|
+
currentModalState.open = true;
|
|
5004
|
+
if (type === 'flight') {
|
|
5005
|
+
currentModalState.title = 'Add airline membership';
|
|
5006
|
+
currentModalState.subtitle = 'Earn points from your favorite airline by booking on ITILITE.';
|
|
5007
|
+
}
|
|
5008
|
+
if (type === 'hotel') {
|
|
5009
|
+
currentModalState.title = 'Add hotel membership';
|
|
5010
|
+
currentModalState.subtitle = 'Earn points from your favorite hotels by booking on ITILITE.';
|
|
5011
|
+
}
|
|
5012
|
+
if (type === 'rental_car') {
|
|
5013
|
+
currentModalState.title = 'Add rental car membership';
|
|
5014
|
+
currentModalState.subtitle = 'Earn points from your favorite rental car agency by booking on ITILITE.';
|
|
5015
|
+
}
|
|
5016
|
+
currentModalState.type = type;
|
|
5017
|
+
setModalState(currentModalState);
|
|
5018
|
+
};
|
|
5019
|
+
var label = 'Airline';
|
|
5020
|
+
if (type === 'hotel') {
|
|
5021
|
+
label = 'Hotel';
|
|
5022
|
+
}
|
|
5023
|
+
if (type === 'rental_car') {
|
|
5024
|
+
label = 'Rental car';
|
|
5025
|
+
}
|
|
5026
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IUILabel, {
|
|
5027
|
+
label: label,
|
|
5028
|
+
headerType: true
|
|
5029
|
+
}), /*#__PURE__*/React.createElement(SavedMemberships, {
|
|
5030
|
+
list: list,
|
|
5031
|
+
type: type,
|
|
5032
|
+
updateList: updateList,
|
|
5033
|
+
handleEdit: handleEdit,
|
|
5034
|
+
isProfile: isProfile
|
|
5035
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
5036
|
+
buttonText: "Add membership",
|
|
5037
|
+
type: "text",
|
|
5038
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
5039
|
+
width: "10",
|
|
5040
|
+
height: "10",
|
|
5041
|
+
color: "#EC5D25"
|
|
5042
|
+
}),
|
|
5043
|
+
onClick: function onClick() {
|
|
5044
|
+
handleAddMembership(type);
|
|
5045
|
+
}
|
|
5046
|
+
}));
|
|
5047
|
+
});
|
|
5048
|
+
|
|
5049
|
+
var IUIToastMessageService$5 = services.IUIToastMessageService;
|
|
5050
|
+
var api$7 = configs.api;
|
|
5051
|
+
var sixteenDigitNumber$1 = /^\d{16}$/;
|
|
5052
|
+
var Membership = function Membership(_ref) {
|
|
5053
|
+
var _clsx;
|
|
5054
|
+
var _ref$membershipInfoIn = _ref.membershipInfoInput,
|
|
5055
|
+
membershipInfoInput = _ref$membershipInfoIn === void 0 ? [] : _ref$membershipInfoIn,
|
|
5056
|
+
_ref$setMembershipInf = _ref.setMembershipInfoInput,
|
|
5057
|
+
setMembershipInfoInput = _ref$setMembershipInf === void 0 ? function () {} : _ref$setMembershipInf,
|
|
5058
|
+
_ref$isProfile = _ref.isProfile,
|
|
5059
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
5060
|
+
var _useParams = useParams(),
|
|
5061
|
+
editUserId = _useParams.userId;
|
|
5062
|
+
var _useSelector = useSelector(function (state) {
|
|
5063
|
+
return state.common;
|
|
5064
|
+
}),
|
|
5065
|
+
id = _useSelector.id;
|
|
5066
|
+
var userID = isProfile ? id : editUserId;
|
|
5067
|
+
var _useState = useState(membershipInfoInput),
|
|
5068
|
+
savedMemberships = _useState[0],
|
|
5069
|
+
setSavedMemberships = _useState[1];
|
|
5070
|
+
var groupedMembershipData = savedMemberships.reduce(function (acc, item) {
|
|
5071
|
+
var _acc$item$membership_;
|
|
5072
|
+
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]) || [];
|
|
5073
|
+
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);
|
|
5074
|
+
return acc;
|
|
5075
|
+
}, {
|
|
5076
|
+
flight: [],
|
|
5077
|
+
hotel: [],
|
|
5078
|
+
rental_car: []
|
|
5079
|
+
});
|
|
5080
|
+
var _useState2 = useState({
|
|
5081
|
+
open: false,
|
|
5082
|
+
title: 'Add airline membership'
|
|
5083
|
+
}),
|
|
5084
|
+
modalState = _useState2[0],
|
|
5085
|
+
setModalState = _useState2[1];
|
|
5086
|
+
var _useState3 = useState(false),
|
|
5087
|
+
isUpdating = _useState3[0],
|
|
5088
|
+
setIsUpdating = _useState3[1];
|
|
5089
|
+
var _useState4 = useState(null),
|
|
5090
|
+
editIndex = _useState4[0],
|
|
5091
|
+
setEditIndex = _useState4[1];
|
|
5092
|
+
var _modalState$open = modalState.open,
|
|
5093
|
+
open = _modalState$open === void 0 ? false : _modalState$open,
|
|
5094
|
+
_modalState$title = modalState.title,
|
|
5095
|
+
title = _modalState$title === void 0 ? '' : _modalState$title,
|
|
5096
|
+
_modalState$subtitle = modalState.subtitle,
|
|
5097
|
+
subtitle = _modalState$subtitle === void 0 ? '' : _modalState$subtitle,
|
|
5098
|
+
_modalState$type = modalState.type,
|
|
5099
|
+
type = _modalState$type === void 0 ? '' : _modalState$type;
|
|
5100
|
+
var _useState5 = useState(false),
|
|
5101
|
+
isInputFocused = _useState5[0],
|
|
5102
|
+
setIsInputFocused = _useState5[1];
|
|
5103
|
+
var _useState6 = useState(''),
|
|
5104
|
+
searchQuery = _useState6[0],
|
|
5105
|
+
setSearchQuery = _useState6[1];
|
|
5106
|
+
var _useState7 = useState(''),
|
|
5107
|
+
debouncedQuery = _useState7[0],
|
|
5108
|
+
setDebouncedQuery = _useState7[1];
|
|
5109
|
+
var _useState8 = useState([]),
|
|
5110
|
+
items = _useState8[0],
|
|
5111
|
+
setItems = _useState8[1];
|
|
5112
|
+
var _useState9 = useState(1),
|
|
5113
|
+
page = _useState9[0],
|
|
5114
|
+
setPage = _useState9[1];
|
|
5115
|
+
var _useState10 = useState(false),
|
|
5116
|
+
loading = _useState10[0],
|
|
5117
|
+
setLoading = _useState10[1];
|
|
5118
|
+
var _useState11 = useState(false),
|
|
5119
|
+
isOtherMembership = _useState11[0],
|
|
5120
|
+
setIsOtherMembership = _useState11[1];
|
|
5121
|
+
var _useState12 = useState(null),
|
|
5122
|
+
selectedMembershipChain = _useState12[0],
|
|
5123
|
+
setSelectedMembershipChain = _useState12[1];
|
|
5124
|
+
var _useState13 = useState(''),
|
|
5125
|
+
membershipName = _useState13[0],
|
|
5126
|
+
setMembershipName = _useState13[1];
|
|
5127
|
+
var _useState14 = useState(''),
|
|
5128
|
+
membershipNumber = _useState14[0],
|
|
5129
|
+
setMembershipNumber = _useState14[1];
|
|
5130
|
+
var wrapperRef = useRef(null);
|
|
5131
|
+
var nextRef = useRef(null);
|
|
5132
|
+
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';
|
|
5133
|
+
var fetchItems = function fetchItems(query, reset) {
|
|
5134
|
+
if (query === void 0) {
|
|
5135
|
+
query = '';
|
|
5136
|
+
}
|
|
5137
|
+
if (reset === void 0) {
|
|
5138
|
+
reset = false;
|
|
5139
|
+
}
|
|
5140
|
+
try {
|
|
5141
|
+
nextRef.current = null;
|
|
5142
|
+
var pageNo = reset ? 1 : page + 1;
|
|
5143
|
+
setLoading(true);
|
|
5144
|
+
var url = 'api/v1/user-management/loyalty-program/' + ("?page=" + pageNo + "&travel_type=" + type);
|
|
5145
|
+
if (query) {
|
|
5146
|
+
url += "&search_term=" + query.toLowerCase();
|
|
5147
|
+
}
|
|
5148
|
+
if (reset) setPage(1);else setPage(function (prevPage) {
|
|
5149
|
+
return prevPage + 1;
|
|
5150
|
+
});
|
|
5151
|
+
var _temp = _catch(function () {
|
|
5152
|
+
return Promise.resolve(api$7.get(url).then(function (res) {
|
|
5153
|
+
return res;
|
|
5154
|
+
})).then(function (response) {
|
|
5155
|
+
var _response$data, _response$data2;
|
|
5156
|
+
var list = response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.results;
|
|
5157
|
+
nextRef.current = response === null || response === void 0 ? void 0 : (_response$data2 = response.data) === null || _response$data2 === void 0 ? void 0 : _response$data2.next;
|
|
5158
|
+
setItems(function (prevItems) {
|
|
5159
|
+
return reset ? list : [].concat(prevItems, list);
|
|
5160
|
+
});
|
|
5161
|
+
setLoading(false);
|
|
5162
|
+
});
|
|
5163
|
+
}, function (error) {
|
|
5164
|
+
nextRef.current = null;
|
|
5165
|
+
IUIToastMessageService$5.warningNotify('Something went wrong');
|
|
5166
|
+
setIsInputFocused(false);
|
|
5167
|
+
setLoading(false);
|
|
5168
|
+
console.error('Error fetching data:', error);
|
|
5169
|
+
});
|
|
5170
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
5171
|
+
} catch (e) {
|
|
5172
|
+
return Promise.reject(e);
|
|
5173
|
+
}
|
|
5174
|
+
};
|
|
5175
|
+
var handleSelect = function handleSelect(item) {
|
|
5176
|
+
setSelectedMembershipChain(item);
|
|
5177
|
+
setIsInputFocused(false);
|
|
5178
|
+
};
|
|
5179
|
+
var handleClickOutside = function handleClickOutside(event) {
|
|
5180
|
+
if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {
|
|
5181
|
+
setIsInputFocused(false);
|
|
5182
|
+
}
|
|
5183
|
+
};
|
|
5184
|
+
useEffect(function () {
|
|
5185
|
+
setSavedMemberships(membershipInfoInput);
|
|
5186
|
+
}, [membershipInfoInput]);
|
|
5187
|
+
useEffect(function () {
|
|
5188
|
+
document.addEventListener('mousedown', handleClickOutside);
|
|
5189
|
+
return function () {
|
|
5190
|
+
document.removeEventListener('mousedown', handleClickOutside);
|
|
5191
|
+
};
|
|
5192
|
+
}, []);
|
|
5193
|
+
useEffect(function () {
|
|
5194
|
+
var handler = setTimeout(function () {
|
|
5195
|
+
setDebouncedQuery(searchQuery);
|
|
5196
|
+
}, 750);
|
|
5197
|
+
return function () {
|
|
5198
|
+
clearTimeout(handler);
|
|
5199
|
+
};
|
|
5200
|
+
}, [searchQuery]);
|
|
5201
|
+
useEffect(function () {
|
|
5202
|
+
if (isInputFocused) fetchItems(debouncedQuery, true);else {
|
|
5203
|
+
setSearchQuery('');
|
|
5204
|
+
setItems([]);
|
|
5205
|
+
}
|
|
5206
|
+
}, [isInputFocused, debouncedQuery]);
|
|
5207
|
+
useEffect(function () {
|
|
5208
|
+
if (!(modalState !== null && modalState !== void 0 && modalState.open)) {
|
|
5209
|
+
setIsInputFocused(false);
|
|
5210
|
+
}
|
|
5211
|
+
}, [modalState]);
|
|
5212
|
+
var handleClose = function handleClose() {
|
|
5213
|
+
setIsUpdating(false);
|
|
5214
|
+
setIsOtherMembership(false);
|
|
5215
|
+
setMembershipName('');
|
|
5216
|
+
setMembershipNumber('');
|
|
5217
|
+
setModalState(_extends({}, modalState, {
|
|
5218
|
+
open: false
|
|
5219
|
+
}));
|
|
5220
|
+
setSelectedMembershipChain(null);
|
|
5221
|
+
setIsInputFocused(false);
|
|
5222
|
+
setItems([]);
|
|
5223
|
+
setEditIndex(null);
|
|
5224
|
+
setSearchQuery('');
|
|
5225
|
+
};
|
|
5226
|
+
var updateList = function updateList(type, index, item) {
|
|
5227
|
+
if (index === void 0) {
|
|
5228
|
+
index = null;
|
|
5229
|
+
}
|
|
5230
|
+
if (item === void 0) {
|
|
5231
|
+
item = null;
|
|
5232
|
+
}
|
|
5233
|
+
if (!groupedMembershipData[type]) {
|
|
5234
|
+
console.error("Invalid type: " + type);
|
|
5235
|
+
return;
|
|
5236
|
+
}
|
|
5237
|
+
if (item) {
|
|
5238
|
+
if (index) {
|
|
5239
|
+
groupedMembershipData[type][index] = _extends({}, groupedMembershipData[type][index], {
|
|
5240
|
+
number: item.number,
|
|
5241
|
+
name: item.name
|
|
5242
|
+
});
|
|
5243
|
+
} else groupedMembershipData[type] = [].concat(groupedMembershipData[type], [item]);
|
|
5244
|
+
}
|
|
5245
|
+
if (index !== null && !item) {
|
|
5246
|
+
var _groupedMembershipDat, _groupedMembershipDat2;
|
|
5247
|
+
if (index < 0 || index >= (groupedMembershipData === null || groupedMembershipData === void 0 ? void 0 : (_groupedMembershipDat = groupedMembershipData[type]) === null || _groupedMembershipDat === void 0 ? void 0 : _groupedMembershipDat.length)) {
|
|
5248
|
+
console.error("Invalid index: " + index);
|
|
5249
|
+
return;
|
|
5250
|
+
}
|
|
5251
|
+
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));
|
|
5252
|
+
}
|
|
5253
|
+
var flight = groupedMembershipData.flight,
|
|
5254
|
+
hotel = groupedMembershipData.hotel,
|
|
5255
|
+
rental_car = groupedMembershipData.rental_car;
|
|
5256
|
+
var updatedMemberships = [].concat(flight, hotel, rental_car);
|
|
5257
|
+
setMembershipInfoInput(updatedMemberships);
|
|
5258
|
+
};
|
|
5259
|
+
var handleSubmit = function handleSubmit() {
|
|
5260
|
+
try {
|
|
5261
|
+
if (isAAAloyaltySelected && !sixteenDigitNumber$1.test(membershipNumber)) {
|
|
5262
|
+
IUIToastMessageService$5.warningNotify('Enter 16-digit AAA membership ID');
|
|
5263
|
+
return Promise.resolve();
|
|
5264
|
+
}
|
|
5265
|
+
var url = "/api/v1/user-management/users/" + userID + "/membership";
|
|
5266
|
+
var payload = editIndex ? _extends({}, selectedMembershipChain, {
|
|
5267
|
+
number: membershipNumber,
|
|
5268
|
+
name: membershipName || ''
|
|
5269
|
+
}) : {
|
|
5270
|
+
membership_type: type,
|
|
5271
|
+
number: membershipNumber,
|
|
5272
|
+
iata_code: null,
|
|
5273
|
+
user: userID,
|
|
5274
|
+
loyalty_program_id: selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_id,
|
|
5275
|
+
name: membershipName || ''
|
|
5276
|
+
};
|
|
5277
|
+
setIsUpdating(true);
|
|
5278
|
+
var _temp2 = _finallyRethrows(function () {
|
|
5279
|
+
return _catch(function () {
|
|
5280
|
+
return Promise.resolve(editIndex ? api$7.put(url, payload) : api$7.post(url, payload)).then(function (response) {
|
|
5281
|
+
if ((response === null || response === void 0 ? void 0 : response.status) === 201 || (response === null || response === void 0 ? void 0 : response.status) === 200) {
|
|
5282
|
+
var _response$data3;
|
|
5283
|
+
var updatedResponse = response === null || response === void 0 ? void 0 : response.data;
|
|
5284
|
+
updatedResponse.program_name = selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.program_name;
|
|
5285
|
+
updatedResponse.loyalty_program_image_url = selectedMembershipChain === null || selectedMembershipChain === void 0 ? void 0 : selectedMembershipChain.loyalty_program_image_url;
|
|
5286
|
+
if (isOtherMembership) updatedResponse.loyalty_program_name = 'Other';
|
|
5287
|
+
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);
|
|
5288
|
+
IUIToastMessageService$5.sNotify(editIndex ? "Membership updated." : "New membership added.");
|
|
5289
|
+
} else {
|
|
5290
|
+
IUIToastMessageService$5.warningNotify('Failed to save membership');
|
|
5291
|
+
}
|
|
5292
|
+
});
|
|
5293
|
+
}, function (error) {
|
|
5294
|
+
console.error(error);
|
|
5295
|
+
IUIToastMessageService$5.warningNotify('Something went wrong!');
|
|
5296
|
+
});
|
|
5297
|
+
}, function (_wasThrown, _result) {
|
|
5298
|
+
handleClose();
|
|
5299
|
+
if (_wasThrown) throw _result;
|
|
5300
|
+
return _result;
|
|
5301
|
+
});
|
|
5302
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
5303
|
+
} catch (e) {
|
|
5304
|
+
return Promise.reject(e);
|
|
5305
|
+
}
|
|
5306
|
+
};
|
|
5307
|
+
var handleEdit = function handleEdit(mem, index, isOther) {
|
|
5308
|
+
setEditIndex(index);
|
|
5309
|
+
setSelectedMembershipChain(mem);
|
|
5310
|
+
setMembershipName((mem === null || mem === void 0 ? void 0 : mem.name) || '');
|
|
5311
|
+
setMembershipNumber(mem === null || mem === void 0 ? void 0 : mem.number);
|
|
5312
|
+
setIsOtherMembership(isOther);
|
|
5313
|
+
var currentModalState = _extends({}, modalState);
|
|
5314
|
+
currentModalState.open = true;
|
|
5315
|
+
currentModalState.type = mem === null || mem === void 0 ? void 0 : mem.membership_type;
|
|
5316
|
+
setModalState(currentModalState);
|
|
5317
|
+
};
|
|
5318
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5319
|
+
style: {
|
|
5320
|
+
width: '100%'
|
|
5321
|
+
}
|
|
5322
|
+
}, /*#__PURE__*/React.createElement(IUIModal, {
|
|
5323
|
+
isOpen: open,
|
|
5324
|
+
closeHandler: handleClose,
|
|
5325
|
+
modalClass: clsx(styles$3.loyaltymodal, (_clsx = {}, _clsx[styles$3.loyaltyList] = !selectedMembershipChain, _clsx)),
|
|
5326
|
+
cancelLabel: selectedMembershipChain ? 'Cancel' : '',
|
|
5327
|
+
submitLabel: selectedMembershipChain ? isUpdating ? 'Saving...' : editIndex ? 'Save' : 'Add' : '',
|
|
5328
|
+
submitHandler: handleSubmit,
|
|
5329
|
+
isDisabledSubmitBtn: isUpdating || !membershipNumber || isOtherMembership && !membershipName || isAAAloyaltySelected && !sixteenDigitNumber$1.test(membershipNumber),
|
|
5330
|
+
width: selectedMembershipChain ? '480px' : '640px',
|
|
5331
|
+
headerText: selectedMembershipChain ? '' : title,
|
|
5332
|
+
subHanderText: selectedMembershipChain ? '' : subtitle,
|
|
5333
|
+
modalBodyStyle: {
|
|
5334
|
+
padding: selectedMembershipChain ? '0px 24px 25px' : '24px 24px 0px',
|
|
5335
|
+
minHeight: selectedMembershipChain ? 120 : 80,
|
|
5336
|
+
borderBottom: selectedMembershipChain && '1px solid #E5E7EB',
|
|
5337
|
+
marginBottom: selectedMembershipChain ? 0 : -18
|
|
5338
|
+
}
|
|
5339
|
+
}, /*#__PURE__*/React.createElement(Fragment$1, null, selectedMembershipChain ? /*#__PURE__*/React.createElement(MembershipForm, {
|
|
5340
|
+
selectedMembershipChain: selectedMembershipChain,
|
|
5341
|
+
isOtherMembership: isOtherMembership,
|
|
5342
|
+
membershipName: membershipName,
|
|
5343
|
+
membershipNumber: membershipNumber,
|
|
5344
|
+
setMembershipName: setMembershipName,
|
|
5345
|
+
setMembershipNumber: setMembershipNumber,
|
|
5346
|
+
type: type,
|
|
5347
|
+
isEdit: !!editIndex,
|
|
5348
|
+
isAAAloyaltySelected: isAAAloyaltySelected
|
|
5349
|
+
}) : /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
5350
|
+
style: {
|
|
5351
|
+
color: '#374151',
|
|
5352
|
+
fontWeight: 500
|
|
5353
|
+
}
|
|
5354
|
+
}, "Loyalty program"), ' ', /*#__PURE__*/React.createElement("span", {
|
|
5355
|
+
style: {
|
|
5356
|
+
color: '#6B7280'
|
|
5357
|
+
}
|
|
5358
|
+
}, "*")), /*#__PURE__*/React.createElement("div", {
|
|
5359
|
+
className: styles$3.selectWrapper,
|
|
5360
|
+
ref: wrapperRef
|
|
5361
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
5362
|
+
className: styles$3.selectSearchBox
|
|
5363
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
5364
|
+
className: styles$3.searchInput,
|
|
5365
|
+
placeholder: "Select loyalty program",
|
|
5366
|
+
onFocus: function onFocus() {
|
|
5367
|
+
return setIsInputFocused(true);
|
|
5368
|
+
},
|
|
5369
|
+
onClick: function onClick() {
|
|
5370
|
+
return setIsInputFocused(true);
|
|
5371
|
+
},
|
|
5372
|
+
onChange: function onChange(e) {
|
|
5373
|
+
if (!isInputFocused) {
|
|
5374
|
+
setIsInputFocused(true);
|
|
5375
|
+
}
|
|
5376
|
+
setSearchQuery(e.target.value);
|
|
5377
|
+
},
|
|
5378
|
+
value: searchQuery
|
|
5379
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
5380
|
+
className: styles$3.chevronIcon
|
|
5381
|
+
}, /*#__PURE__*/React.createElement(ChevronNext, {
|
|
5382
|
+
color: "#6B7280"
|
|
5383
|
+
}))), isInputFocused && /*#__PURE__*/React.createElement("div", {
|
|
5384
|
+
className: styles$3.membershipList
|
|
5385
|
+
}, /*#__PURE__*/React.createElement(LoyaltyPrograms, {
|
|
5386
|
+
items: items,
|
|
5387
|
+
handleSelect: handleSelect,
|
|
5388
|
+
loading: loading,
|
|
5389
|
+
setIsOtherMembership: setIsOtherMembership,
|
|
5390
|
+
setSelectedMembershipChain: setSelectedMembershipChain,
|
|
5391
|
+
searchQuery: searchQuery,
|
|
5392
|
+
fetchItems: fetchItems,
|
|
5393
|
+
type: type,
|
|
5394
|
+
nextPageAvailable: nextRef === null || nextRef === void 0 ? void 0 : nextRef.current,
|
|
5395
|
+
page: page
|
|
5396
|
+
})))))), /*#__PURE__*/React.createElement("div", {
|
|
5397
|
+
style: {
|
|
5398
|
+
width: '100%'
|
|
5399
|
+
}
|
|
5400
|
+
}, Object.keys(groupedMembershipData).map(function (memType, ind) {
|
|
5401
|
+
return /*#__PURE__*/React.createElement(Fragment$1, {
|
|
5402
|
+
key: memType
|
|
5403
|
+
}, /*#__PURE__*/React.createElement(AddMembershipButton, {
|
|
5404
|
+
type: memType,
|
|
5405
|
+
setModalState: setModalState,
|
|
5406
|
+
modalState: modalState,
|
|
5407
|
+
list: groupedMembershipData[memType],
|
|
5408
|
+
updateList: updateList,
|
|
5409
|
+
handleEdit: handleEdit,
|
|
5410
|
+
isProfile: isProfile
|
|
5411
|
+
}), ind < 2 && /*#__PURE__*/React.createElement(IUIDivider, {
|
|
5412
|
+
className: styles$3.divider
|
|
5413
|
+
}));
|
|
5414
|
+
})));
|
|
5415
|
+
};
|
|
5416
|
+
|
|
4490
5417
|
var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
4491
5418
|
var _clsx;
|
|
4492
5419
|
var membershipInfoInput = _ref.membershipInfoInput,
|
|
4493
|
-
onMemInfoInputChange = _ref.onMemInfoInputChange,
|
|
4494
|
-
addMemInfoInput = _ref.addMemInfoInput,
|
|
4495
5420
|
travelPreferenceInfo = _ref.travelPreferenceInfo,
|
|
4496
5421
|
_ref$travelPreference = _ref.travelPreferenceOnChange,
|
|
4497
5422
|
travelPreferenceOnChange = _ref$travelPreference === void 0 ? function () {} : _ref$travelPreference,
|
|
@@ -4508,10 +5433,12 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4508
5433
|
dateFormat = _ref.dateFormat,
|
|
4509
5434
|
_ref$defaultExpand = _ref.defaultExpand,
|
|
4510
5435
|
defaultExpand = _ref$defaultExpand === void 0 ? false : _ref$defaultExpand,
|
|
4511
|
-
_ref$handleRemoveMemF = _ref.handleRemoveMemFields,
|
|
4512
|
-
handleRemoveMemFields = _ref$handleRemoveMemF === void 0 ? {} : _ref$handleRemoveMemF,
|
|
4513
5436
|
_ref$setAdditionalInf = _ref.setAdditionalInfoFlag,
|
|
4514
|
-
setAdditionalInfoFlag = _ref$setAdditionalInf === void 0 ? function () {} : _ref$setAdditionalInf
|
|
5437
|
+
setAdditionalInfoFlag = _ref$setAdditionalInf === void 0 ? function () {} : _ref$setAdditionalInf,
|
|
5438
|
+
_ref$setMembershipInf = _ref.setMembershipInfoInput,
|
|
5439
|
+
setMembershipInfoInput = _ref$setMembershipInf === void 0 ? function () {} : _ref$setMembershipInf,
|
|
5440
|
+
_ref$isProfile = _ref.isProfile,
|
|
5441
|
+
isProfile = _ref$isProfile === void 0 ? false : _ref$isProfile;
|
|
4515
5442
|
var handleChange = function handleChange(panel) {
|
|
4516
5443
|
return function (event, defaultExpand) {
|
|
4517
5444
|
setAdditionalInfoFlag(defaultExpand ? panel : false);
|
|
@@ -4523,57 +5450,9 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4523
5450
|
passportInfo = _useSelector.passportInfo,
|
|
4524
5451
|
secureTravelInfo = _useSelector.secureTravelInfo,
|
|
4525
5452
|
travelPreference = _useSelector.travelPreference;
|
|
4526
|
-
var _useSelector2 = useSelector(function (state) {
|
|
4527
|
-
return state.userAddEdit;
|
|
4528
|
-
}),
|
|
4529
|
-
maxMembershipInput = _useSelector2.maxMembershipInput;
|
|
4530
5453
|
var dropdownList = useSelector(function (state) {
|
|
4531
5454
|
return state.userAddEdit.dropdownList;
|
|
4532
5455
|
});
|
|
4533
|
-
var MembershipField = function MembershipField(_ref2) {
|
|
4534
|
-
var val = _ref2.val,
|
|
4535
|
-
index = _ref2.index;
|
|
4536
|
-
if (val.membership_type === 'flight') {
|
|
4537
|
-
return (
|
|
4538
|
-
/*#__PURE__*/
|
|
4539
|
-
React.createElement(IUIInput, {
|
|
4540
|
-
label: "Airline name",
|
|
4541
|
-
placeholder: "Enter airline name",
|
|
4542
|
-
fullwidth: false,
|
|
4543
|
-
defaultValue: val.name,
|
|
4544
|
-
onValueChange: function onValueChange(_ref3) {
|
|
4545
|
-
var _value = _ref3._value;
|
|
4546
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4547
|
-
}
|
|
4548
|
-
})
|
|
4549
|
-
);
|
|
4550
|
-
}
|
|
4551
|
-
if (val.membership_type === 'hotel') {
|
|
4552
|
-
return /*#__PURE__*/React.createElement(IUIInput, {
|
|
4553
|
-
label: "Hotel name",
|
|
4554
|
-
placeholder: "Enter hotel name",
|
|
4555
|
-
fullwidth: false,
|
|
4556
|
-
defaultValue: val.name,
|
|
4557
|
-
onValueChange: function onValueChange(_ref4) {
|
|
4558
|
-
var _value = _ref4._value;
|
|
4559
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4560
|
-
}
|
|
4561
|
-
});
|
|
4562
|
-
}
|
|
4563
|
-
if (val.membership_type === 'rental_car') {
|
|
4564
|
-
return /*#__PURE__*/React.createElement(IUIInput, {
|
|
4565
|
-
label: "Car provider name",
|
|
4566
|
-
placeholder: "Enter a car provider name",
|
|
4567
|
-
fullwidth: false,
|
|
4568
|
-
defaultValue: val.name,
|
|
4569
|
-
onValueChange: function onValueChange(_ref5) {
|
|
4570
|
-
var _value = _ref5._value;
|
|
4571
|
-
return onMemInfoInputChange(index, 'name', _value);
|
|
4572
|
-
}
|
|
4573
|
-
});
|
|
4574
|
-
}
|
|
4575
|
-
return null;
|
|
4576
|
-
};
|
|
4577
5456
|
return /*#__PURE__*/React.createElement(IUIAccordion, {
|
|
4578
5457
|
expanded: defaultExpand === 'open',
|
|
4579
5458
|
onChange: handleChange('open'),
|
|
@@ -4655,8 +5534,7 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4655
5534
|
md: 4
|
|
4656
5535
|
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4657
5536
|
label: "Membership information",
|
|
4658
|
-
headerType: true
|
|
4659
|
-
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
5537
|
+
headerType: true
|
|
4660
5538
|
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4661
5539
|
item: true,
|
|
4662
5540
|
sm: 12,
|
|
@@ -4666,139 +5544,11 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4666
5544
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4667
5545
|
container: true,
|
|
4668
5546
|
className: styles.formFieldsWrapper
|
|
4669
|
-
},
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
|
|
4673
|
-
}
|
|
4674
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4675
|
-
display: "flex"
|
|
4676
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4677
|
-
buttonText: "Add airline",
|
|
4678
|
-
type: "text",
|
|
4679
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4680
|
-
width: "10",
|
|
4681
|
-
height: "10",
|
|
4682
|
-
color: "#EC5D25"
|
|
4683
|
-
}),
|
|
4684
|
-
className: styles.paddingTop,
|
|
4685
|
-
onClick: function onClick(e) {
|
|
4686
|
-
return addMemInfoInput('flight');
|
|
4687
|
-
}
|
|
4688
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4689
|
-
buttonText: "Add hotel",
|
|
4690
|
-
type: "text",
|
|
4691
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4692
|
-
width: "10",
|
|
4693
|
-
height: "10",
|
|
4694
|
-
color: "#EC5D25"
|
|
4695
|
-
}),
|
|
4696
|
-
className: styles.paddingTop,
|
|
4697
|
-
onClick: function onClick(e) {
|
|
4698
|
-
return addMemInfoInput('hotel');
|
|
4699
|
-
}
|
|
4700
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4701
|
-
buttonText: "Add car rental",
|
|
4702
|
-
type: "text",
|
|
4703
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4704
|
-
width: "10",
|
|
4705
|
-
height: "10",
|
|
4706
|
-
color: "#EC5D25"
|
|
4707
|
-
}),
|
|
4708
|
-
className: styles.paddingTop,
|
|
4709
|
-
onClick: function onClick(e) {
|
|
4710
|
-
return addMemInfoInput('rental_car');
|
|
4711
|
-
}
|
|
4712
|
-
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4713
|
-
if (index >= maxMembershipInput) {
|
|
4714
|
-
return null;
|
|
4715
|
-
}
|
|
4716
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
4717
|
-
key: index.toString()
|
|
4718
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4719
|
-
item: true,
|
|
4720
|
-
md: 8,
|
|
4721
|
-
lg: 6,
|
|
4722
|
-
xl: 6
|
|
4723
|
-
}, /*#__PURE__*/React.createElement(MembershipField, {
|
|
4724
|
-
val: val,
|
|
4725
|
-
index: index,
|
|
4726
|
-
key: index.toString()
|
|
4727
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4728
|
-
item: true,
|
|
4729
|
-
md: 8,
|
|
4730
|
-
lg: 6,
|
|
4731
|
-
xl: 6
|
|
4732
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4733
|
-
component: "div",
|
|
4734
|
-
display: "flex"
|
|
4735
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4736
|
-
label: "Membership number",
|
|
4737
|
-
placeholder: "Enter membership number",
|
|
4738
|
-
fullwidth: false,
|
|
4739
|
-
defaultValue: val.number,
|
|
4740
|
-
onValueChange: function onValueChange(_ref6) {
|
|
4741
|
-
var _value = _ref6._value;
|
|
4742
|
-
return onMemInfoInputChange(index, 'number', _value);
|
|
4743
|
-
}
|
|
4744
|
-
}), /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
4745
|
-
style: {
|
|
4746
|
-
marginTop: '30px'
|
|
4747
|
-
},
|
|
4748
|
-
disableRipple: true,
|
|
4749
|
-
onClick: function onClick() {
|
|
4750
|
-
return handleRemoveMemFields(index);
|
|
4751
|
-
},
|
|
4752
|
-
className: styles.backGrdColorOnHover
|
|
4753
|
-
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
4754
|
-
width: "14",
|
|
4755
|
-
height: "14"
|
|
4756
|
-
})))));
|
|
4757
|
-
}), membershipInfoInput.length < maxMembershipInput && membershipInfoInput.length > 0 && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4758
|
-
item: true,
|
|
4759
|
-
md: 8,
|
|
4760
|
-
lg: 8,
|
|
4761
|
-
xl: 8
|
|
4762
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4763
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4764
|
-
display: "flex"
|
|
4765
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4766
|
-
buttonText: "Add airline",
|
|
4767
|
-
type: "text",
|
|
4768
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4769
|
-
width: "10",
|
|
4770
|
-
height: "10",
|
|
4771
|
-
color: "#EC5D25"
|
|
4772
|
-
}),
|
|
4773
|
-
className: styles.paddingTop,
|
|
4774
|
-
onClick: function onClick(e) {
|
|
4775
|
-
return addMemInfoInput('flight');
|
|
4776
|
-
}
|
|
4777
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4778
|
-
buttonText: "Add hotel",
|
|
4779
|
-
type: "text",
|
|
4780
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4781
|
-
width: "10",
|
|
4782
|
-
height: "10",
|
|
4783
|
-
color: "#EC5D25"
|
|
4784
|
-
}),
|
|
4785
|
-
className: styles.paddingTop,
|
|
4786
|
-
onClick: function onClick(e) {
|
|
4787
|
-
return addMemInfoInput('hotel');
|
|
4788
|
-
}
|
|
4789
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4790
|
-
buttonText: "Add car rental",
|
|
4791
|
-
type: "text",
|
|
4792
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4793
|
-
width: "10",
|
|
4794
|
-
height: "10",
|
|
4795
|
-
color: "#EC5D25"
|
|
4796
|
-
}),
|
|
4797
|
-
className: styles.paddingTop,
|
|
4798
|
-
onClick: function onClick(e) {
|
|
4799
|
-
return addMemInfoInput('rental_car');
|
|
4800
|
-
}
|
|
4801
|
-
})))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
5547
|
+
}, /*#__PURE__*/React.createElement(Membership, {
|
|
5548
|
+
membershipInfoInput: membershipInfoInput,
|
|
5549
|
+
setMembershipInfoInput: setMembershipInfoInput,
|
|
5550
|
+
isProfile: isProfile
|
|
5551
|
+
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4802
5552
|
className: styles.dividerColor
|
|
4803
5553
|
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4804
5554
|
container: true,
|
|
@@ -4882,7 +5632,7 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4882
5632
|
}))))));
|
|
4883
5633
|
};
|
|
4884
5634
|
|
|
4885
|
-
var styles$
|
|
5635
|
+
var styles$4 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF","actionCustom":"_3Kbfm"};
|
|
4886
5636
|
|
|
4887
5637
|
var VerificationError = function VerificationError(_ref) {
|
|
4888
5638
|
var config = _ref.config,
|
|
@@ -4893,18 +5643,18 @@ var VerificationError = function VerificationError(_ref) {
|
|
|
4893
5643
|
var history = useHistory();
|
|
4894
5644
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
4895
5645
|
component: "div",
|
|
4896
|
-
className: styles$
|
|
5646
|
+
className: styles$4.pageHeader
|
|
4897
5647
|
}, /*#__PURE__*/React.createElement(IUICard, {
|
|
4898
5648
|
headerComponentTitle: title,
|
|
4899
|
-
cardHeaderClassName: styles$
|
|
5649
|
+
cardHeaderClassName: styles$4.cardHeaderBackground,
|
|
4900
5650
|
headerComponent: /*#__PURE__*/React.createElement(IUITypography, {
|
|
4901
5651
|
gutterBottom: true,
|
|
4902
5652
|
variant: "h4",
|
|
4903
|
-
className: styles$
|
|
5653
|
+
className: styles$4.cardHeader
|
|
4904
5654
|
}, title),
|
|
4905
5655
|
description: errMsg,
|
|
4906
5656
|
actionComponent: /*#__PURE__*/React.createElement(IUIButton, {
|
|
4907
|
-
className: styles$
|
|
5657
|
+
className: styles$4.buttonHover,
|
|
4908
5658
|
buttonText: "BACK TO HOMEPAGE",
|
|
4909
5659
|
type: "outlined",
|
|
4910
5660
|
onClick: function onClick() {
|
|
@@ -4941,8 +5691,8 @@ var ErrorMessages = {
|
|
|
4941
5691
|
passport_photo: 'Please attach passport photo.',
|
|
4942
5692
|
travel_docs: 'Please attach travel docs.',
|
|
4943
5693
|
products: 'Please select atleast one product access.',
|
|
4944
|
-
only_cards_products: '
|
|
4945
|
-
none_products: 'Select at least one product. If opting for
|
|
5694
|
+
only_cards_products: 'Currently, Card cannot be selected as a standalone option. Please add at least one more product.',
|
|
5695
|
+
none_products: 'Select at least one product. If opting for card, please choose at least one additional product.'
|
|
4946
5696
|
};
|
|
4947
5697
|
|
|
4948
5698
|
function AddPanelDialog(_ref) {
|
|
@@ -5001,7 +5751,11 @@ var CardsField = function CardsField(props) {
|
|
|
5001
5751
|
_props$isProfile = props.isProfile,
|
|
5002
5752
|
isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
|
|
5003
5753
|
_props$roles = props.roles,
|
|
5004
|
-
roles = _props$roles === void 0 ? [] : _props$roles
|
|
5754
|
+
roles = _props$roles === void 0 ? [] : _props$roles,
|
|
5755
|
+
_props$cardsAdmin = props.cardsAdmin,
|
|
5756
|
+
cardsAdmin = _props$cardsAdmin === void 0 ? false : _props$cardsAdmin,
|
|
5757
|
+
editUserId = props.editUserId,
|
|
5758
|
+
loggedInUserId = props.loggedInUserId;
|
|
5005
5759
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5006
5760
|
container: true,
|
|
5007
5761
|
className: (styles.headingPadding)
|
|
@@ -5030,17 +5784,30 @@ var CardsField = function CardsField(props) {
|
|
|
5030
5784
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5031
5785
|
container: true,
|
|
5032
5786
|
className: styles.formFieldsWrapper
|
|
5033
|
-
}, isProfile ? /*#__PURE__*/React.createElement(UserRole, {
|
|
5787
|
+
}, isProfile || loggedInUserId === editUserId ? /*#__PURE__*/React.createElement(UserRole, {
|
|
5034
5788
|
list: roles,
|
|
5035
5789
|
value: roleValue
|
|
5036
5790
|
}) : /*#__PURE__*/React.createElement(IUIRadio, {
|
|
5037
5791
|
list: roles,
|
|
5038
5792
|
value: roleValue,
|
|
5039
|
-
onValueChange: onRoleChange
|
|
5040
|
-
|
|
5793
|
+
onValueChange: onRoleChange,
|
|
5794
|
+
disabled: cardsAdmin ? false : true
|
|
5795
|
+
})), !cardsAdmin && !isProfile && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5796
|
+
item: true,
|
|
5797
|
+
sm: 12,
|
|
5798
|
+
md: 12,
|
|
5799
|
+
lg: 12,
|
|
5800
|
+
style: {
|
|
5801
|
+
marginTop: "24px"
|
|
5802
|
+
}
|
|
5803
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
5804
|
+
variant: "body2",
|
|
5805
|
+
component: "span",
|
|
5806
|
+
className: styles.errorTextCls
|
|
5807
|
+
}, 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.")))));
|
|
5041
5808
|
};
|
|
5042
5809
|
|
|
5043
|
-
var IUIToastMessageService$
|
|
5810
|
+
var IUIToastMessageService$6 = services.IUIToastMessageService,
|
|
5044
5811
|
IUILocalStorageService$5 = services.IUILocalStorageService;
|
|
5045
5812
|
var env$4 = configs.env;
|
|
5046
5813
|
var UserAddEdit = function UserAddEdit(props) {
|
|
@@ -5049,8 +5816,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5049
5816
|
config = props.config,
|
|
5050
5817
|
_props$isProfile = props.isProfile,
|
|
5051
5818
|
isProfile = _props$isProfile === void 0 ? false : _props$isProfile;
|
|
5052
|
-
console.log("isProfile", isProfile);
|
|
5053
|
-
console.log("isEditMode", isEditMode);
|
|
5054
5819
|
env$4.init(config, isProfile);
|
|
5055
5820
|
var queryParams = new URLSearchParams(window.location.search);
|
|
5056
5821
|
var verifyUserId = Number(queryParams.get(config.routes.users.add.queryParamKeys.verifyUserId));
|
|
@@ -5087,7 +5852,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5087
5852
|
var _useState = useState({
|
|
5088
5853
|
travel: false,
|
|
5089
5854
|
expense: false,
|
|
5090
|
-
|
|
5855
|
+
card: false
|
|
5091
5856
|
}),
|
|
5092
5857
|
productAccess = _useState[0],
|
|
5093
5858
|
setProductAccess = _useState[1];
|
|
@@ -5098,7 +5863,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5098
5863
|
errorMsgs.products = '';
|
|
5099
5864
|
var _productAccess = _extends({}, productAccess);
|
|
5100
5865
|
_productAccess[value] = !_productAccess[value];
|
|
5101
|
-
if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.
|
|
5866
|
+
if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.card === true) {
|
|
5102
5867
|
var _errorArray = [].concat(errorArray);
|
|
5103
5868
|
var _errorMsgs = _extends({}, errorMsgs);
|
|
5104
5869
|
if (_errorArray.indexOf('products') === -1) {
|
|
@@ -5114,7 +5879,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5114
5879
|
block: 'center'
|
|
5115
5880
|
});
|
|
5116
5881
|
}
|
|
5117
|
-
} else if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.
|
|
5882
|
+
} else if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.card === false) {
|
|
5118
5883
|
var _errorArray2 = [].concat(errorArray);
|
|
5119
5884
|
var _errorMsgs2 = _extends({}, errorMsgs);
|
|
5120
5885
|
if (_errorArray2.indexOf('products') === -1) {
|
|
@@ -5193,9 +5958,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5193
5958
|
if (_loop()) break;
|
|
5194
5959
|
}
|
|
5195
5960
|
} else if (typeof err === 'string') {
|
|
5196
|
-
IUIToastMessageService$
|
|
5961
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
5197
5962
|
} else {
|
|
5198
|
-
IUIToastMessageService$
|
|
5963
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5199
5964
|
}
|
|
5200
5965
|
})["finally"](function () {
|
|
5201
5966
|
dispatch(stopLoader());
|
|
@@ -5246,9 +6011,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5246
6011
|
if (_loop2()) break;
|
|
5247
6012
|
}
|
|
5248
6013
|
} else if (typeof err === 'string') {
|
|
5249
|
-
IUIToastMessageService$
|
|
6014
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
5250
6015
|
} else {
|
|
5251
|
-
IUIToastMessageService$
|
|
6016
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5252
6017
|
}
|
|
5253
6018
|
})["finally"](function () {
|
|
5254
6019
|
dispatch(stopLoader());
|
|
@@ -5268,7 +6033,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5268
6033
|
if (res !== null && res !== void 0 && (_res$roles = res.roles) !== null && _res$roles !== void 0 && _res$roles.length) {
|
|
5269
6034
|
dispatch(setCardsDetails(res));
|
|
5270
6035
|
} else {
|
|
5271
|
-
IUIToastMessageService$
|
|
6036
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5272
6037
|
}
|
|
5273
6038
|
})["catch"](function (error) {
|
|
5274
6039
|
console.log("errorrr", error);
|
|
@@ -5288,7 +6053,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5288
6053
|
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
5289
6054
|
dispatch(setCardsDetails(res));
|
|
5290
6055
|
} else {
|
|
5291
|
-
IUIToastMessageService$
|
|
6056
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
5292
6057
|
}
|
|
5293
6058
|
})["catch"](function (error) {
|
|
5294
6059
|
console.log("errorrr", error);
|
|
@@ -5448,68 +6213,50 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5448
6213
|
var _useState25 = useState(''),
|
|
5449
6214
|
cardsRole = _useState25[0],
|
|
5450
6215
|
setCardsRole = _useState25[1];
|
|
5451
|
-
var _useState26 = useState(false),
|
|
5452
|
-
cardsErrorMsg = _useState26[0],
|
|
5453
|
-
setCardsErrorMsg = _useState26[1];
|
|
5454
|
-
console.log("cardsRole123", cardsRole);
|
|
5455
|
-
console.log("cardsErrorMsg", cardsErrorMsg);
|
|
5456
6216
|
useEffect(function () {
|
|
5457
|
-
if (
|
|
5458
|
-
|
|
5459
|
-
IUIToastMessageService$4.warningNotify("You are not authorized person to make someone admin");
|
|
5460
|
-
} else {
|
|
5461
|
-
setCardsErrorMsg(false);
|
|
6217
|
+
if (productAccess.card === false) {
|
|
6218
|
+
setCardsRole('');
|
|
5462
6219
|
}
|
|
5463
|
-
}, [
|
|
6220
|
+
}, [productAccess.card]);
|
|
5464
6221
|
useEffect(function () {
|
|
5465
|
-
if (productAccess.
|
|
5466
|
-
|
|
5467
|
-
|
|
6222
|
+
if (isCardsDetailsRendered && !isProfile && productAccess.card) {
|
|
6223
|
+
var selectedRole = cardsDetails.cardsRoles.find(function (role) {
|
|
6224
|
+
return role.isAssigned;
|
|
6225
|
+
});
|
|
6226
|
+
if (selectedRole) {
|
|
6227
|
+
setCardsRole(selectedRole.value);
|
|
6228
|
+
} else {
|
|
6229
|
+
var defaultRole = cardsDetails.cardsRoles.find(function (role) {
|
|
6230
|
+
var splitRoleVal = role.value.split(':');
|
|
6231
|
+
return splitRoleVal[2] === 'card-holder';
|
|
6232
|
+
});
|
|
6233
|
+
if (defaultRole) {
|
|
6234
|
+
setCardsRole(defaultRole.value);
|
|
6235
|
+
}
|
|
6236
|
+
}
|
|
6237
|
+
} else if (isCardsDetailsRendered && isProfile && productAccess.card) {
|
|
6238
|
+
var targetRole = isCardsAdmin ? 'card-admin' : 'card-holder';
|
|
5468
6239
|
for (var _iterator = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step; !(_step = _iterator()).done;) {
|
|
5469
6240
|
var role = _step.value;
|
|
5470
|
-
var
|
|
5471
|
-
var
|
|
5472
|
-
if (
|
|
6241
|
+
var splitRoleVal = role.value.split(':');
|
|
6242
|
+
var profileRole = splitRoleVal[2];
|
|
6243
|
+
if (profileRole === targetRole) {
|
|
5473
6244
|
setCardsRole(role.value);
|
|
5474
6245
|
break;
|
|
5475
6246
|
}
|
|
5476
6247
|
}
|
|
5477
6248
|
}
|
|
5478
|
-
}, [productAccess.
|
|
5479
|
-
useEffect(function () {
|
|
5480
|
-
if (isCardsDetailsRendered) {
|
|
5481
|
-
var selectedRole = null;
|
|
5482
|
-
for (var _iterator2 = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step2; !(_step2 = _iterator2()).done;) {
|
|
5483
|
-
var _role = _step2.value;
|
|
5484
|
-
if (_role.isAssigned) {
|
|
5485
|
-
setCardsRole(_role.value);
|
|
5486
|
-
selectedRole = _role.value;
|
|
5487
|
-
break;
|
|
5488
|
-
}
|
|
5489
|
-
}
|
|
5490
|
-
if (selectedRole === null) {
|
|
5491
|
-
for (var _iterator3 = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step3; !(_step3 = _iterator3()).done;) {
|
|
5492
|
-
var role = _step3.value;
|
|
5493
|
-
var splitRoleval = role.value.split(":");
|
|
5494
|
-
var defaultRole = splitRoleval[2];
|
|
5495
|
-
if (defaultRole === 'card-holder') {
|
|
5496
|
-
setCardsRole(role.value);
|
|
5497
|
-
break;
|
|
5498
|
-
}
|
|
5499
|
-
}
|
|
5500
|
-
}
|
|
5501
|
-
}
|
|
5502
|
-
}, [isCardsDetailsRendered, cardsDetails]);
|
|
6249
|
+
}, [isCardsDetailsRendered, cardsDetails, isProfile, productAccess.card, isCardsAdmin]);
|
|
5503
6250
|
var asyncSelectRefs = useRef({
|
|
5504
6251
|
emp_level: useRef(null),
|
|
5505
6252
|
entity: useRef(null),
|
|
5506
6253
|
business_unit: useRef(null),
|
|
5507
6254
|
department: useRef(null)
|
|
5508
6255
|
});
|
|
5509
|
-
var
|
|
5510
|
-
errorArray =
|
|
5511
|
-
setErrorArray =
|
|
5512
|
-
var
|
|
6256
|
+
var _useState26 = useState([]),
|
|
6257
|
+
errorArray = _useState26[0],
|
|
6258
|
+
setErrorArray = _useState26[1];
|
|
6259
|
+
var _useState27 = useState({
|
|
5513
6260
|
first_name: '',
|
|
5514
6261
|
last_name: '',
|
|
5515
6262
|
email: '',
|
|
@@ -5539,9 +6286,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5539
6286
|
userTagType: '',
|
|
5540
6287
|
profile_pic: ''
|
|
5541
6288
|
}),
|
|
5542
|
-
errorMsgs =
|
|
5543
|
-
setErrorMsgs =
|
|
5544
|
-
var
|
|
6289
|
+
errorMsgs = _useState27[0],
|
|
6290
|
+
setErrorMsgs = _useState27[1];
|
|
6291
|
+
var _useState28 = useState({
|
|
5545
6292
|
first_name: false,
|
|
5546
6293
|
last_name: false,
|
|
5547
6294
|
email: false,
|
|
@@ -5568,14 +6315,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5568
6315
|
userTagType: false,
|
|
5569
6316
|
profile_pic: false
|
|
5570
6317
|
}),
|
|
5571
|
-
inputChangeLog =
|
|
5572
|
-
updateInputChangeLog =
|
|
5573
|
-
var
|
|
5574
|
-
uploadedFiles =
|
|
5575
|
-
setUploadedFiles =
|
|
5576
|
-
var
|
|
5577
|
-
maxLengthForModal =
|
|
5578
|
-
setMaxLengthForModal =
|
|
6318
|
+
inputChangeLog = _useState28[0],
|
|
6319
|
+
updateInputChangeLog = _useState28[1];
|
|
6320
|
+
var _useState29 = useState([]),
|
|
6321
|
+
uploadedFiles = _useState29[0],
|
|
6322
|
+
setUploadedFiles = _useState29[1];
|
|
6323
|
+
var _useState30 = useState(70),
|
|
6324
|
+
maxLengthForModal = _useState30[0],
|
|
6325
|
+
setMaxLengthForModal = _useState30[1];
|
|
5579
6326
|
var defaultAddModalData = {
|
|
5580
6327
|
isOpen: false,
|
|
5581
6328
|
isError: false,
|
|
@@ -5591,9 +6338,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5591
6338
|
maxLength: maxLengthForModal,
|
|
5592
6339
|
minLength: 0
|
|
5593
6340
|
};
|
|
5594
|
-
var
|
|
5595
|
-
addModalData =
|
|
5596
|
-
setAddModalData =
|
|
6341
|
+
var _useState31 = useState(defaultAddModalData),
|
|
6342
|
+
addModalData = _useState31[0],
|
|
6343
|
+
setAddModalData = _useState31[1];
|
|
5597
6344
|
var onAddModalClose = function onAddModalClose() {
|
|
5598
6345
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5599
6346
|
};
|
|
@@ -5654,7 +6401,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5654
6401
|
setAddModalData(_extends({}, addModalData, {
|
|
5655
6402
|
isOpen: false
|
|
5656
6403
|
}));
|
|
5657
|
-
IUIToastMessageService$
|
|
6404
|
+
IUIToastMessageService$6.sNotify(addModalData.title + " added successfully.");
|
|
5658
6405
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5659
6406
|
if (addModalData.id === 'department') {
|
|
5660
6407
|
var _extends2;
|
|
@@ -6005,7 +6752,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6005
6752
|
useEffect(function () {
|
|
6006
6753
|
if (isRendered === true) {
|
|
6007
6754
|
renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
|
|
6008
|
-
if ((prod === null || prod === void 0 ? void 0 : prod.name) === '
|
|
6755
|
+
if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
|
|
6009
6756
|
editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
|
|
6010
6757
|
}
|
|
6011
6758
|
});
|
|
@@ -6131,7 +6878,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6131
6878
|
setProductAccess({
|
|
6132
6879
|
travel: products.includes('travel'),
|
|
6133
6880
|
expense: products.includes('expense'),
|
|
6134
|
-
|
|
6881
|
+
card: products.includes('card')
|
|
6135
6882
|
});
|
|
6136
6883
|
if (products.includes('travel')) {
|
|
6137
6884
|
var _res$travel_info, _res$travel_info2, _res$travel_info3, _res$travel_info4, _res$travel_info5, _res$travel_info6;
|
|
@@ -6339,7 +7086,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6339
7086
|
try {
|
|
6340
7087
|
var checkAnyError = doesFormHasError();
|
|
6341
7088
|
if (checkAnyError) {
|
|
6342
|
-
IUIToastMessageService$
|
|
7089
|
+
IUIToastMessageService$6.warningNotify(checkAnyError);
|
|
6343
7090
|
return Promise.resolve();
|
|
6344
7091
|
}
|
|
6345
7092
|
if (employeeInfoInput.manager_id.value !== '') {
|
|
@@ -6383,9 +7130,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6383
7130
|
employeeInfo = optionalFields.employee_info,
|
|
6384
7131
|
userTravelInfo = optionalFields.user_travel_info;
|
|
6385
7132
|
var allMandatoryFields = ['first_name', 'last_name', 'email'];
|
|
6386
|
-
if (cardsErrorMsg) {
|
|
6387
|
-
_isError = true;
|
|
6388
|
-
}
|
|
6389
7133
|
allMandatoryFields.forEach(function (key, index) {
|
|
6390
7134
|
if (personalInfoInput[key] === '') {
|
|
6391
7135
|
_isError = true;
|
|
@@ -6524,7 +7268,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6524
7268
|
}
|
|
6525
7269
|
}
|
|
6526
7270
|
var cardApiflag = false;
|
|
6527
|
-
if (productAccess.
|
|
7271
|
+
if (productAccess.card === false || isCardsAdmin === false) {
|
|
6528
7272
|
cardApiflag = false;
|
|
6529
7273
|
} else {
|
|
6530
7274
|
cardApiflag = true;
|
|
@@ -6532,7 +7276,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6532
7276
|
if (!_isError) {
|
|
6533
7277
|
if (isEditMode && editUserId || isProfile) {
|
|
6534
7278
|
dispatch(showLoader());
|
|
6535
|
-
if (cardApiflag) {
|
|
7279
|
+
if (cardApiflag && !isProfile && editUserId !== (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
6536
7280
|
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
6537
7281
|
method: 'POST',
|
|
6538
7282
|
body: JSON.stringify(cardsPayload),
|
|
@@ -6544,7 +7288,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6544
7288
|
if (response.status === 200) {
|
|
6545
7289
|
updateUserApiCall(payload, inputChangeLog);
|
|
6546
7290
|
} else {
|
|
6547
|
-
IUIToastMessageService$
|
|
7291
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6548
7292
|
}
|
|
6549
7293
|
})["catch"](function (error) {
|
|
6550
7294
|
console.log("errorrr", error);
|
|
@@ -6569,7 +7313,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6569
7313
|
}
|
|
6570
7314
|
}).then(function (response) {
|
|
6571
7315
|
if (response.status !== 200) {
|
|
6572
|
-
IUIToastMessageService$
|
|
7316
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6573
7317
|
}
|
|
6574
7318
|
})["catch"](function (error) {
|
|
6575
7319
|
console.log("errorrr", error);
|
|
@@ -6613,9 +7357,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6613
7357
|
if (_loop4()) break;
|
|
6614
7358
|
}
|
|
6615
7359
|
} else if (typeof err === 'string') {
|
|
6616
|
-
IUIToastMessageService$
|
|
7360
|
+
IUIToastMessageService$6.warningNotify(err);
|
|
6617
7361
|
} else {
|
|
6618
|
-
IUIToastMessageService$
|
|
7362
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6619
7363
|
}
|
|
6620
7364
|
})["finally"](function () {
|
|
6621
7365
|
dispatch(stopLoader());
|
|
@@ -6954,6 +7698,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6954
7698
|
className: styles.productContainerGap
|
|
6955
7699
|
}, renderFields.products.map(function (p, i) {
|
|
6956
7700
|
p.readOnly = isProfile;
|
|
7701
|
+
if (p.id === 3 && !isCardsAdmin && !isProfile) {
|
|
7702
|
+
p.readOnly = true;
|
|
7703
|
+
p.disableText = "Only card admin can change this access.";
|
|
7704
|
+
} else if (p.id === 3 && editUserId === (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
7705
|
+
p.readOnly = true;
|
|
7706
|
+
p.disableText = "You cannot update your own Card product";
|
|
7707
|
+
}
|
|
6957
7708
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6958
7709
|
item: true,
|
|
6959
7710
|
sm: 12,
|
|
@@ -7019,7 +7770,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7019
7770
|
errorMsgs: errorMsgs,
|
|
7020
7771
|
dateFormat: dateFormat,
|
|
7021
7772
|
defaultExpand: isAdditionalInfoExpanded,
|
|
7022
|
-
setAdditionalInfoFlag: setAdditionalInfoFlag
|
|
7773
|
+
setAdditionalInfoFlag: setAdditionalInfoFlag,
|
|
7774
|
+
setMembershipInfoInput: setMembershipInfoInput,
|
|
7775
|
+
isProfile: isProfile
|
|
7023
7776
|
})), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7024
7777
|
className: styles.dividerColor
|
|
7025
7778
|
}), productAccess && productAccess.expense && /*#__PURE__*/React.createElement(TravelExpenseFields, {
|
|
@@ -7048,9 +7801,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7048
7801
|
roles: renderFields.expenseRoles
|
|
7049
7802
|
}), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7050
7803
|
className: styles.dividerColor
|
|
7051
|
-
}), isCardsDetailsRendered && productAccess && productAccess.
|
|
7804
|
+
}), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React.createElement(CardsField, {
|
|
7052
7805
|
cardsConstants: cardsDetails.cardsConstants,
|
|
7053
|
-
type: "
|
|
7806
|
+
type: "card",
|
|
7054
7807
|
isProfile: isProfile,
|
|
7055
7808
|
onRoleChange: function onRoleChange(_ref7) {
|
|
7056
7809
|
var _value = _ref7._value;
|
|
@@ -7058,7 +7811,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7058
7811
|
},
|
|
7059
7812
|
roleValue: cardsRole,
|
|
7060
7813
|
roles: cardsDetails.cardsRoles,
|
|
7061
|
-
cardsAdmin: isCardsAdmin
|
|
7814
|
+
cardsAdmin: isCardsAdmin,
|
|
7815
|
+
editUserId: editUserId,
|
|
7816
|
+
loggedInUserId: id === null || id === void 0 ? void 0 : id.toString()
|
|
7062
7817
|
}))) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
7063
7818
|
config: config,
|
|
7064
7819
|
errMsg: hasVerificationError
|
|
@@ -7074,7 +7829,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7074
7829
|
};
|
|
7075
7830
|
var index = withStore(UserAddEdit);
|
|
7076
7831
|
|
|
7077
|
-
var styles$
|
|
7832
|
+
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"};
|
|
7078
7833
|
|
|
7079
7834
|
var DownloadIcon = function DownloadIcon(props) {
|
|
7080
7835
|
return /*#__PURE__*/React.createElement("svg", {
|
|
@@ -7115,21 +7870,6 @@ var CheckCircleIcon = function CheckCircleIcon(props) {
|
|
|
7115
7870
|
}));
|
|
7116
7871
|
};
|
|
7117
7872
|
|
|
7118
|
-
var ChevronNext = function ChevronNext() {
|
|
7119
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
7120
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
7121
|
-
width: "8",
|
|
7122
|
-
height: "16",
|
|
7123
|
-
fill: "none",
|
|
7124
|
-
viewBox: "0 0 8 16"
|
|
7125
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
7126
|
-
stroke: "#9CA3AF",
|
|
7127
|
-
strokeLinecap: "round",
|
|
7128
|
-
strokeLinejoin: "round",
|
|
7129
|
-
d: "M2 4l4 4-4 4"
|
|
7130
|
-
}));
|
|
7131
|
-
};
|
|
7132
|
-
|
|
7133
7873
|
var FileError = function FileError() {
|
|
7134
7874
|
return /*#__PURE__*/React.createElement("svg", {
|
|
7135
7875
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7169,7 +7909,7 @@ var Progressicon = function Progressicon(props) {
|
|
|
7169
7909
|
}));
|
|
7170
7910
|
};
|
|
7171
7911
|
|
|
7172
|
-
var api$
|
|
7912
|
+
var api$8 = configs.api;
|
|
7173
7913
|
var showLoader$2 = function showLoader() {
|
|
7174
7914
|
return {
|
|
7175
7915
|
type: SHOW_LOADER$4
|
|
@@ -7195,7 +7935,7 @@ var setBulkActionHistoryFields = function setBulkActionHistoryFields(payload) {
|
|
|
7195
7935
|
var generateTemplate = function generateTemplate(payload) {
|
|
7196
7936
|
return function (dispatch) {
|
|
7197
7937
|
return new Promise(function (resolve, reject) {
|
|
7198
|
-
api$
|
|
7938
|
+
api$8.get("" + userBulkImport.generateTemplate()).then(function (res) {
|
|
7199
7939
|
resolve(res);
|
|
7200
7940
|
})["catch"](function (err) {
|
|
7201
7941
|
reject(err);
|
|
@@ -7206,7 +7946,7 @@ var generateTemplate = function generateTemplate(payload) {
|
|
|
7206
7946
|
var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
7207
7947
|
return function (dispatch) {
|
|
7208
7948
|
return new Promise(function (resolve, reject) {
|
|
7209
|
-
api$
|
|
7949
|
+
api$8.get(userBulkImport.uploadUrl() + "?action=upload_bulk_users&item_type=bulk_users&file_name=" + payload.fileName).then(function (res) {
|
|
7210
7950
|
var resolveResponse = {
|
|
7211
7951
|
file_type: 'bulk_users',
|
|
7212
7952
|
file_path: res.data.presigned_url.fields.key,
|
|
@@ -7245,7 +7985,7 @@ var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
|
7245
7985
|
var validateUploadedFile = function validateUploadedFile(fileName) {
|
|
7246
7986
|
return function (dispatch) {
|
|
7247
7987
|
return new Promise(function (resolve, reject) {
|
|
7248
|
-
api$
|
|
7988
|
+
api$8.post(userBulkImport.validateUploadedFile() + "?file_name=" + fileName).then(function (res) {
|
|
7249
7989
|
resolve(res);
|
|
7250
7990
|
})["catch"](function (err) {
|
|
7251
7991
|
reject(err);
|
|
@@ -7253,13 +7993,13 @@ var validateUploadedFile = function validateUploadedFile(fileName) {
|
|
|
7253
7993
|
});
|
|
7254
7994
|
};
|
|
7255
7995
|
};
|
|
7256
|
-
var
|
|
7996
|
+
var _executionJob = function executionJob(jobId, type) {
|
|
7257
7997
|
return function (dispatch) {
|
|
7258
7998
|
return new Promise(function (resolve, reject) {
|
|
7259
|
-
api$
|
|
7999
|
+
api$8.get(userBulkImport.executionResult() + "?job_id=" + jobId).then(function (res) {
|
|
7260
8000
|
if (!res.data[type]) {
|
|
7261
8001
|
setTimeout(function () {
|
|
7262
|
-
dispatch(
|
|
8002
|
+
dispatch(_executionJob(jobId, type)).then(function (res) {
|
|
7263
8003
|
return res.data[type] && resolve(res);
|
|
7264
8004
|
})["catch"](function (err) {
|
|
7265
8005
|
reject(err);
|
|
@@ -7276,13 +8016,13 @@ var executionJob = function executionJob(jobId, type) {
|
|
|
7276
8016
|
});
|
|
7277
8017
|
};
|
|
7278
8018
|
};
|
|
7279
|
-
var
|
|
8019
|
+
var _downloadExecutionJob = function downloadExecutionJob(auditId, type) {
|
|
7280
8020
|
return function (dispatch) {
|
|
7281
8021
|
return new Promise(function (resolve, reject) {
|
|
7282
|
-
api$
|
|
8022
|
+
api$8.get(userBulkImport.executionResult() + "?audit_id=" + auditId).then(function (res) {
|
|
7283
8023
|
if (!res.data[type]) {
|
|
7284
8024
|
setTimeout(function () {
|
|
7285
|
-
dispatch(
|
|
8025
|
+
dispatch(_downloadExecutionJob(auditId, type)).then(function (res) {
|
|
7286
8026
|
return res.data[type] && resolve(res);
|
|
7287
8027
|
})["catch"](function (err) {
|
|
7288
8028
|
reject(err);
|
|
@@ -7301,7 +8041,7 @@ var downloadExecutionJob = function downloadExecutionJob(auditId, type) {
|
|
|
7301
8041
|
var downloadUploadedRecords = function downloadUploadedRecords(type, jobId) {
|
|
7302
8042
|
return function (dispatch) {
|
|
7303
8043
|
return new Promise(function (resolve, reject) {
|
|
7304
|
-
api$
|
|
8044
|
+
api$8.get(userBulkImport.downloadUploadedRecords() + "?status=" + type + "&job_id=" + jobId).then(function (res) {
|
|
7305
8045
|
resolve(res);
|
|
7306
8046
|
})["catch"](function (err) {
|
|
7307
8047
|
reject(err);
|
|
@@ -7312,7 +8052,7 @@ var downloadUploadedRecords = function downloadUploadedRecords(type, jobId) {
|
|
|
7312
8052
|
var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExistingUsers) {
|
|
7313
8053
|
return function (dispatch) {
|
|
7314
8054
|
return new Promise(function (resolve, reject) {
|
|
7315
|
-
api$
|
|
8055
|
+
api$8.post(userBulkImport.importRecords() + "?job_id=" + jobId + "&update=" + canUpdateExistingUsers).then(function (res) {
|
|
7316
8056
|
resolve(res);
|
|
7317
8057
|
})["catch"](function (err) {
|
|
7318
8058
|
reject(err);
|
|
@@ -7323,7 +8063,7 @@ var importUploadedRecords = function importUploadedRecords(jobId, canUpdateExist
|
|
|
7323
8063
|
var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
7324
8064
|
return function (dispatch) {
|
|
7325
8065
|
return new Promise(function (resolve, reject) {
|
|
7326
|
-
api$
|
|
8066
|
+
api$8.get(url).then(function (res) {
|
|
7327
8067
|
if (res.status === 204) {
|
|
7328
8068
|
dispatch(setBulkActionHistoryFields({
|
|
7329
8069
|
count: 0,
|
|
@@ -7347,7 +8087,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
7347
8087
|
};
|
|
7348
8088
|
};
|
|
7349
8089
|
|
|
7350
|
-
var styles$
|
|
8090
|
+
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"};
|
|
7351
8091
|
|
|
7352
8092
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
7353
8093
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7420,7 +8160,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7420
8160
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
7421
8161
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
7422
8162
|
if (validatedRes.data.status) {
|
|
7423
|
-
dispatch(
|
|
8163
|
+
dispatch(_executionJob(validatedRes.data.job_id, 'is_validation_completed')).then(function (response) {
|
|
7424
8164
|
data.push(res);
|
|
7425
8165
|
setFiles([].concat(data));
|
|
7426
8166
|
setIsFileUploading(false);
|
|
@@ -7463,7 +8203,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7463
8203
|
};
|
|
7464
8204
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
7465
8205
|
open: isFileUploading || isFileDownloading,
|
|
7466
|
-
className: styles$
|
|
8206
|
+
className: styles$6.backdrop
|
|
7467
8207
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
7468
8208
|
color: "inherit"
|
|
7469
8209
|
})), /*#__PURE__*/React.createElement(IUIModal, {
|
|
@@ -7480,7 +8220,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7480
8220
|
}
|
|
7481
8221
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7482
8222
|
container: true,
|
|
7483
|
-
className: styles$
|
|
8223
|
+
className: styles$6.importModalBodyContainer
|
|
7484
8224
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7485
8225
|
item: true,
|
|
7486
8226
|
md: 12,
|
|
@@ -7488,26 +8228,26 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7488
8228
|
xl: 12,
|
|
7489
8229
|
sm: 12,
|
|
7490
8230
|
xs: 12,
|
|
7491
|
-
className: styles$
|
|
8231
|
+
className: styles$6.downloadTemplateContainer
|
|
7492
8232
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7493
8233
|
display: "flex",
|
|
7494
8234
|
flexDirection: "column",
|
|
7495
8235
|
justifyContent: "space-between",
|
|
7496
|
-
className: styles$
|
|
8236
|
+
className: styles$6.downloadTemplateDescContainer
|
|
7497
8237
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7498
|
-
className: styles$
|
|
8238
|
+
className: styles$6.labelContainer
|
|
7499
8239
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7500
|
-
className: styles$
|
|
8240
|
+
className: styles$6.downlTempHeader
|
|
7501
8241
|
}, "1.\xA0\xA0 Download the template"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7502
|
-
className: styles$
|
|
8242
|
+
className: styles$6.downlTempDescription
|
|
7503
8243
|
}, "Use this template with predefined columns and add users to your team")), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUIButton, {
|
|
7504
8244
|
type: "outlined",
|
|
7505
8245
|
buttonText: "Download template",
|
|
7506
8246
|
onClick: downloadTemplate,
|
|
7507
|
-
className: styles$
|
|
8247
|
+
className: styles$6.downloadTemplateButton,
|
|
7508
8248
|
isLink: true
|
|
7509
8249
|
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7510
|
-
className: clsx(styles$
|
|
8250
|
+
className: clsx(styles$6.dividerColor, styles$6.w100)
|
|
7511
8251
|
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7512
8252
|
item: true,
|
|
7513
8253
|
md: 12,
|
|
@@ -7515,19 +8255,19 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7515
8255
|
xl: 12,
|
|
7516
8256
|
sm: 12,
|
|
7517
8257
|
xs: 12,
|
|
7518
|
-
className: styles$
|
|
8258
|
+
className: styles$6.downloadTemplateContainer
|
|
7519
8259
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7520
8260
|
display: "flex",
|
|
7521
8261
|
flexDirection: "column",
|
|
7522
|
-
className: clsx(styles$
|
|
8262
|
+
className: clsx(styles$6.downloadTemplateDescContainer, styles$6.colGap)
|
|
7523
8263
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7524
|
-
className: styles$
|
|
8264
|
+
className: styles$6.labelContainer
|
|
7525
8265
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7526
|
-
className: styles$
|
|
8266
|
+
className: styles$6.downlTempHeader
|
|
7527
8267
|
}, "2.\xA0\xA0 Upload XLSX"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7528
|
-
className: styles$
|
|
8268
|
+
className: styles$6.downlTempDescription
|
|
7529
8269
|
}, "Once you\u2019ve filled out the file, upload it here")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7530
|
-
className: styles$
|
|
8270
|
+
className: styles$6.fileUploaderContainer
|
|
7531
8271
|
}, /*#__PURE__*/React.createElement(IUIDropzone, {
|
|
7532
8272
|
handleDrop: handleDrop,
|
|
7533
8273
|
fileNames: fileNames,
|
|
@@ -7539,11 +8279,11 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7539
8279
|
gap: '10px'
|
|
7540
8280
|
}
|
|
7541
8281
|
}, /*#__PURE__*/React.createElement(ErrorIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7542
|
-
className: styles$
|
|
8282
|
+
className: styles$6.errorText
|
|
7543
8283
|
}, errorMessage)))))));
|
|
7544
8284
|
};
|
|
7545
8285
|
|
|
7546
|
-
var IUIToastMessageService$
|
|
8286
|
+
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
7547
8287
|
var env$5 = configs.env;
|
|
7548
8288
|
function getSteps() {
|
|
7549
8289
|
return ['Review and import', 'Summary'];
|
|
@@ -7591,7 +8331,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7591
8331
|
if (isTokenVerified === true) {
|
|
7592
8332
|
var getData = function getData() {
|
|
7593
8333
|
try {
|
|
7594
|
-
return Promise.resolve(dispatch(
|
|
8334
|
+
return Promise.resolve(dispatch(_executionJob(jobId, 'is_validation_completed')).then(function (res) {
|
|
7595
8335
|
setImportStatus(res.data.bulk_result);
|
|
7596
8336
|
setActiveStep(getActiveStep(res.data.is_job_completed));
|
|
7597
8337
|
setCanUpdateExistingUsers(res.data.exist_users > 0);
|
|
@@ -7637,12 +8377,12 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7637
8377
|
return Promise.resolve(dispatch(downloadUploadedRecords(type, jobId)).then(function (validatedRes) {
|
|
7638
8378
|
var _validatedRes$data;
|
|
7639
8379
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
7640
|
-
dispatch(
|
|
8380
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
7641
8381
|
window.open(res.data.presigned_url, '_self').focus();
|
|
7642
8382
|
})["catch"](function (reject) {
|
|
7643
8383
|
if (reject) {
|
|
7644
8384
|
if (!reject.response.data.status) {
|
|
7645
|
-
IUIToastMessageService$
|
|
8385
|
+
IUIToastMessageService$7.warningNotify(reject.response.data.message);
|
|
7646
8386
|
}
|
|
7647
8387
|
}
|
|
7648
8388
|
})["finally"](function () {
|
|
@@ -7652,7 +8392,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7652
8392
|
})["catch"](function (reject) {
|
|
7653
8393
|
if (reject) {
|
|
7654
8394
|
if (!reject.response.data.status) {
|
|
7655
|
-
IUIToastMessageService$
|
|
8395
|
+
IUIToastMessageService$7.warningNotify(reject.response.data.message);
|
|
7656
8396
|
setDownlStatus(false);
|
|
7657
8397
|
}
|
|
7658
8398
|
}
|
|
@@ -7678,7 +8418,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7678
8418
|
try {
|
|
7679
8419
|
if (userBulkImportInfo.success === 0 && userBulkImportInfo.exist_users > 0) {
|
|
7680
8420
|
if (!canUpdateExistingUsers) {
|
|
7681
|
-
IUIToastMessageService$
|
|
8421
|
+
IUIToastMessageService$7.warningNotify('Select update any existing users box');
|
|
7682
8422
|
return Promise.resolve(false);
|
|
7683
8423
|
}
|
|
7684
8424
|
}
|
|
@@ -7686,7 +8426,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7686
8426
|
return Promise.resolve(dispatch(importUploadedRecords(jobId, canUpdateExistingUsers ? 1 : 0))).then(function (res) {
|
|
7687
8427
|
var _temp = function () {
|
|
7688
8428
|
if (res.data.status) {
|
|
7689
|
-
return Promise.resolve(dispatch(
|
|
8429
|
+
return Promise.resolve(dispatch(_executionJob(jobId, 'is_job_completed')).then(function (resp) {
|
|
7690
8430
|
if (resp.data.status) {
|
|
7691
8431
|
setImportStatus(+resp.data.bulk_result);
|
|
7692
8432
|
setActiveStep(1);
|
|
@@ -7718,14 +8458,14 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7718
8458
|
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step === Number(activeStep)) {
|
|
7719
8459
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7720
8460
|
checked: true,
|
|
7721
|
-
className: clsx(styles$
|
|
8461
|
+
className: clsx(styles$5.customRadioEach),
|
|
7722
8462
|
size: "small",
|
|
7723
8463
|
disabled: true
|
|
7724
8464
|
});
|
|
7725
8465
|
}
|
|
7726
8466
|
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step !== Number(activeStep)) {
|
|
7727
8467
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7728
|
-
className: clsx(styles$
|
|
8468
|
+
className: clsx(styles$5.customRadioEach),
|
|
7729
8469
|
size: "small",
|
|
7730
8470
|
disabled: true
|
|
7731
8471
|
});
|
|
@@ -7733,7 +8473,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7733
8473
|
if (importStatus === 3 && step === Number(activeStep)) {
|
|
7734
8474
|
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
7735
8475
|
checked: true,
|
|
7736
|
-
className: clsx(styles$
|
|
8476
|
+
className: clsx(styles$5.customRadioEach),
|
|
7737
8477
|
size: "small",
|
|
7738
8478
|
disabled: true
|
|
7739
8479
|
});
|
|
@@ -7750,11 +8490,11 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7750
8490
|
switch (importStatus) {
|
|
7751
8491
|
case 2:
|
|
7752
8492
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DraftIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7753
|
-
className: styles$
|
|
8493
|
+
className: styles$5.descText
|
|
7754
8494
|
}, "Draft"));
|
|
7755
8495
|
case 1:
|
|
7756
8496
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Progressicon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7757
|
-
className: styles$
|
|
8497
|
+
className: styles$5.descText
|
|
7758
8498
|
}, "In progress"));
|
|
7759
8499
|
case 3:
|
|
7760
8500
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
@@ -7762,28 +8502,28 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7762
8502
|
height: "16",
|
|
7763
8503
|
color: "#059669"
|
|
7764
8504
|
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7765
|
-
className: styles$
|
|
8505
|
+
className: styles$5.descText
|
|
7766
8506
|
}, "Completed"));
|
|
7767
8507
|
case 4:
|
|
7768
8508
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ErrorIcon, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7769
|
-
className: styles$
|
|
8509
|
+
className: styles$5.descText
|
|
7770
8510
|
}, "Failed"));
|
|
7771
8511
|
}
|
|
7772
8512
|
};
|
|
7773
8513
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
7774
8514
|
component: "div",
|
|
7775
|
-
className: styles$
|
|
8515
|
+
className: styles$5.UUIUserManagementImport
|
|
7776
8516
|
}, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
7777
8517
|
open: importStatus === 1 || isFileDownloading,
|
|
7778
|
-
className: styles$
|
|
8518
|
+
className: styles$5.backdrop
|
|
7779
8519
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
7780
8520
|
color: "inherit"
|
|
7781
8521
|
})), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7782
8522
|
component: "div",
|
|
7783
|
-
className: clsx(styles$
|
|
8523
|
+
className: clsx(styles$5.pageHeader)
|
|
7784
8524
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7785
8525
|
component: "div",
|
|
7786
|
-
className: styles$
|
|
8526
|
+
className: styles$5.breadcrumb
|
|
7787
8527
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
7788
8528
|
breadCrumbs: [{
|
|
7789
8529
|
href: config.routes.users.list.path,
|
|
@@ -7806,23 +8546,23 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7806
8546
|
alignItems: "center"
|
|
7807
8547
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7808
8548
|
component: "div",
|
|
7809
|
-
className: styles$
|
|
8549
|
+
className: styles$5.headingWrapper
|
|
7810
8550
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7811
8551
|
variant: "h3",
|
|
7812
|
-
className: clsx(styles$
|
|
8552
|
+
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
7813
8553
|
}, "Import users"))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7814
|
-
className: styles$
|
|
8554
|
+
className: styles$5.dividerColor
|
|
7815
8555
|
}), canShowBlankScreen && /*#__PURE__*/React.createElement(IUIBox, {
|
|
7816
8556
|
display: "flex",
|
|
7817
8557
|
justifyContent: "center",
|
|
7818
8558
|
alignItems: "center",
|
|
7819
8559
|
flexDirection: "column",
|
|
7820
|
-
className: styles$
|
|
8560
|
+
className: styles$5.fileEmptyScreenClass
|
|
7821
8561
|
}, /*#__PURE__*/React.createElement(FileError, null), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7822
|
-
className: styles$
|
|
8562
|
+
className: styles$5.emptyScreenText
|
|
7823
8563
|
}, blankScreenMessage)), isApiProcessDone && !canShowBlankScreen && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7824
8564
|
container: true,
|
|
7825
|
-
className: styles$
|
|
8565
|
+
className: styles$5.container
|
|
7826
8566
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7827
8567
|
item: true,
|
|
7828
8568
|
lg: 9,
|
|
@@ -7837,7 +8577,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7837
8577
|
}, /*#__PURE__*/React.createElement(IUIStepper, {
|
|
7838
8578
|
activeStep: activeStep,
|
|
7839
8579
|
nonLinear: true,
|
|
7840
|
-
className: styles$
|
|
8580
|
+
className: styles$5.stepper,
|
|
7841
8581
|
CustomStepIcon: CustomStepIcon,
|
|
7842
8582
|
steps: steps
|
|
7843
8583
|
}), importStatus === 1 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -7846,21 +8586,21 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7846
8586
|
justifyContent: "center",
|
|
7847
8587
|
width: "800px",
|
|
7848
8588
|
borderRadius: "6px",
|
|
7849
|
-
className: styles$
|
|
8589
|
+
className: styles$5.importProgressInfo
|
|
7850
8590
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
7851
8591
|
width: "18",
|
|
7852
8592
|
height: "18",
|
|
7853
8593
|
color: "#7C2D12"
|
|
7854
8594
|
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7855
|
-
className: styles$
|
|
8595
|
+
className: styles$5.importProgressInfotext
|
|
7856
8596
|
}, "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, {
|
|
7857
8597
|
paddingLeft: "12px"
|
|
7858
8598
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7859
8599
|
container: true,
|
|
7860
|
-
className: styles$
|
|
8600
|
+
className: styles$5.recordsDetails
|
|
7861
8601
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7862
8602
|
item: true,
|
|
7863
|
-
className: styles$
|
|
8603
|
+
className: styles$5.rightBorder,
|
|
7864
8604
|
lg: 3,
|
|
7865
8605
|
md: 3,
|
|
7866
8606
|
xl: 3
|
|
@@ -7873,22 +8613,22 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7873
8613
|
gap: '45px'
|
|
7874
8614
|
}
|
|
7875
8615
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7876
|
-
className: clsx(styles$
|
|
8616
|
+
className: clsx(styles$5.mildText)
|
|
7877
8617
|
}, "Total \xA0 records"), +userBulkImportInfo.total_records > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7878
8618
|
onClick: function onClick() {
|
|
7879
8619
|
return handleDownloadRecords('total');
|
|
7880
8620
|
},
|
|
7881
|
-
className: styles$
|
|
8621
|
+
className: styles$5.buttonTopalignment
|
|
7882
8622
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7883
8623
|
width: "11",
|
|
7884
8624
|
height: "14"
|
|
7885
8625
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7886
8626
|
paddingLeft: "24px"
|
|
7887
8627
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7888
|
-
className: clsx(styles$
|
|
8628
|
+
className: clsx(styles$5.recordValue, (_clsx = {}, _clsx[styles$5.lightLargeFont] = +userBulkImportInfo.total_records === 0, _clsx))
|
|
7889
8629
|
}, userBulkImportInfo.total_records))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7890
8630
|
item: true,
|
|
7891
|
-
className: styles$
|
|
8631
|
+
className: styles$5.rightBorder,
|
|
7892
8632
|
lg: 3,
|
|
7893
8633
|
md: 3,
|
|
7894
8634
|
xl: 3
|
|
@@ -7901,22 +8641,22 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7901
8641
|
gap: '45px'
|
|
7902
8642
|
}
|
|
7903
8643
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7904
|
-
className: styles$
|
|
8644
|
+
className: styles$5.mildText
|
|
7905
8645
|
}, "Valid new records"), +userBulkImportInfo.success > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7906
8646
|
onClick: function onClick() {
|
|
7907
8647
|
return handleDownloadRecords('success');
|
|
7908
8648
|
},
|
|
7909
|
-
className: styles$
|
|
8649
|
+
className: styles$5.buttonTopalignment
|
|
7910
8650
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7911
8651
|
width: "11",
|
|
7912
8652
|
height: "14"
|
|
7913
8653
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7914
8654
|
paddingLeft: "24px"
|
|
7915
8655
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7916
|
-
className: clsx(styles$
|
|
8656
|
+
className: clsx(styles$5.recordValue, (_clsx2 = {}, _clsx2[styles$5.lightLargeFont] = +userBulkImportInfo.success === 0, _clsx2))
|
|
7917
8657
|
}, userBulkImportInfo.success))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7918
8658
|
item: true,
|
|
7919
|
-
className: styles$
|
|
8659
|
+
className: styles$5.rightBorder,
|
|
7920
8660
|
lg: 3,
|
|
7921
8661
|
md: 3,
|
|
7922
8662
|
xl: 3
|
|
@@ -7929,19 +8669,19 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7929
8669
|
gap: '45px'
|
|
7930
8670
|
}
|
|
7931
8671
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7932
|
-
className: styles$
|
|
8672
|
+
className: styles$5.mildText
|
|
7933
8673
|
}, "Valid existing records"), +userBulkImportInfo.exist_users > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7934
8674
|
onClick: function onClick() {
|
|
7935
8675
|
return handleDownloadRecords('exist');
|
|
7936
8676
|
},
|
|
7937
|
-
className: styles$
|
|
8677
|
+
className: styles$5.buttonTopalignment
|
|
7938
8678
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7939
8679
|
width: "11",
|
|
7940
8680
|
height: "14"
|
|
7941
8681
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7942
8682
|
paddingLeft: "24px"
|
|
7943
8683
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7944
|
-
className: clsx(styles$
|
|
8684
|
+
className: clsx(styles$5.recordValue, (_clsx3 = {}, _clsx3[styles$5.lightLargeFont] = +userBulkImportInfo.exist_users === 0, _clsx3))
|
|
7945
8685
|
}, userBulkImportInfo.exist_users))), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
7946
8686
|
item: true,
|
|
7947
8687
|
lg: 3,
|
|
@@ -7956,26 +8696,26 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7956
8696
|
gap: '45px'
|
|
7957
8697
|
}
|
|
7958
8698
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7959
|
-
className: styles$
|
|
8699
|
+
className: styles$5.mildText
|
|
7960
8700
|
}, "Invalid records"), +userBulkImportInfo.failure > 0 && /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
7961
8701
|
onClick: function onClick() {
|
|
7962
8702
|
return handleDownloadRecords('failure');
|
|
7963
8703
|
},
|
|
7964
|
-
className: styles$
|
|
8704
|
+
className: styles$5.buttonTopalignment
|
|
7965
8705
|
}, /*#__PURE__*/React.createElement(DownloadIcon, {
|
|
7966
8706
|
width: "11",
|
|
7967
8707
|
height: "14"
|
|
7968
8708
|
}))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
7969
8709
|
paddingLeft: "24px"
|
|
7970
8710
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7971
|
-
className: clsx(styles$
|
|
8711
|
+
className: clsx(styles$5.recordValue, (_clsx4 = {}, _clsx4[styles$5.lightLargeFont] = +userBulkImportInfo.failure === 0, _clsx4))
|
|
7972
8712
|
}, userBulkImportInfo.failure)))), +userBulkImportInfo.failure > 0 && /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
7973
|
-
className: styles$
|
|
8713
|
+
className: styles$5.validationLine
|
|
7974
8714
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
7975
8715
|
component: "span",
|
|
7976
8716
|
display: "inline-flex"
|
|
7977
8717
|
}, /*#__PURE__*/React.createElement(ErrorIcon, null)), +userBulkImportInfo.failure === 1 ? userBulkImportInfo.failure + ' record failed validation' : userBulkImportInfo.failure + ' records failed validation'), /*#__PURE__*/React.createElement(IUITypography, {
|
|
7978
|
-
className: clsx(styles$
|
|
8718
|
+
className: clsx(styles$5.descText),
|
|
7979
8719
|
style: {
|
|
7980
8720
|
paddingLeft: '27px'
|
|
7981
8721
|
}
|
|
@@ -7995,9 +8735,9 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7995
8735
|
type: "text",
|
|
7996
8736
|
onClick: importUserHandler
|
|
7997
8737
|
}))), (+userBulkImportInfo.success > 0 || +userBulkImportInfo.exist_users > 0) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7998
|
-
className: styles$
|
|
8738
|
+
className: styles$5.divider
|
|
7999
8739
|
}), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8000
|
-
className: styles$
|
|
8740
|
+
className: styles$5.validationLine
|
|
8001
8741
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8002
8742
|
component: "span",
|
|
8003
8743
|
display: "inline-flex"
|
|
@@ -8006,7 +8746,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8006
8746
|
height: "16",
|
|
8007
8747
|
color: "#059669"
|
|
8008
8748
|
})), handleSuccessTitle()), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8009
|
-
className: clsx(styles$
|
|
8749
|
+
className: clsx(styles$5.descText),
|
|
8010
8750
|
style: {
|
|
8011
8751
|
paddingLeft: '27px'
|
|
8012
8752
|
}
|
|
@@ -8021,7 +8761,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8021
8761
|
checked: canUpdateExistingUsers
|
|
8022
8762
|
}),
|
|
8023
8763
|
label: "Update any existing users",
|
|
8024
|
-
className: clsx(styles$
|
|
8764
|
+
className: clsx(styles$5.checkboxlabel, (_clsx5 = {}, _clsx5[styles$5.disabledText] = +userBulkImportInfo.exist_users === 0, _clsx5)),
|
|
8025
8765
|
disabled: +userBulkImportInfo.exist_users === 0
|
|
8026
8766
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8027
8767
|
display: "flex",
|
|
@@ -8035,17 +8775,17 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8035
8775
|
onClick: handleImportUploadRecords,
|
|
8036
8776
|
disabled: importStatus === 1
|
|
8037
8777
|
}))))), importStatus === 3 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8038
|
-
className: styles$
|
|
8778
|
+
className: styles$5.completedContainer
|
|
8039
8779
|
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8040
|
-
className: styles$
|
|
8780
|
+
className: styles$5.importStatus
|
|
8041
8781
|
}, "Import was successful")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8042
|
-
className: styles$
|
|
8782
|
+
className: styles$5.recordRow
|
|
8043
8783
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8044
8784
|
display: "flex",
|
|
8045
8785
|
justifyContent: "space-between",
|
|
8046
8786
|
alignItems: "center"
|
|
8047
8787
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8048
|
-
className: styles$
|
|
8788
|
+
className: styles$5.numberText
|
|
8049
8789
|
}, userBulkImportInfo.total_records, /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.total_records === 1 ? 'total record' : 'total records', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8050
8790
|
buttonText: "Download records",
|
|
8051
8791
|
type: "text",
|
|
@@ -8057,7 +8797,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8057
8797
|
justifyContent: "space-between",
|
|
8058
8798
|
alignItems: "center"
|
|
8059
8799
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8060
|
-
className: styles$
|
|
8800
|
+
className: styles$5.numberText
|
|
8061
8801
|
}, userBulkImportInfo.success, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.success === 1 ? 'new user added ' : 'new users added ', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8062
8802
|
buttonText: "Download records",
|
|
8063
8803
|
type: "text",
|
|
@@ -8069,7 +8809,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8069
8809
|
justifyContent: "space-between",
|
|
8070
8810
|
alignItems: "center"
|
|
8071
8811
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8072
|
-
className: styles$
|
|
8812
|
+
className: styles$5.numberText
|
|
8073
8813
|
}, userBulkImportInfo.exist_users, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.exist_users === 1 ? 'existing user updated' : 'existing users updated', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8074
8814
|
buttonText: "Download records",
|
|
8075
8815
|
type: "text",
|
|
@@ -8081,7 +8821,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8081
8821
|
justifyContent: "space-between",
|
|
8082
8822
|
alignItems: "center"
|
|
8083
8823
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8084
|
-
className: styles$
|
|
8824
|
+
className: styles$5.numberText
|
|
8085
8825
|
}, userBulkImportInfo.failure, ' ', /*#__PURE__*/React.createElement("span", null, ' ', +userBulkImportInfo.failure === 1 ? 'invalid record' : 'invalid records', ' ')), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8086
8826
|
buttonText: "Download records",
|
|
8087
8827
|
type: "text",
|
|
@@ -8101,7 +8841,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8101
8841
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8102
8842
|
display: "flex",
|
|
8103
8843
|
flexDirection: "column",
|
|
8104
|
-
className: styles$
|
|
8844
|
+
className: styles$5.colGap,
|
|
8105
8845
|
padding: "40px 0px"
|
|
8106
8846
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8107
8847
|
display: "flex",
|
|
@@ -8110,21 +8850,21 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
8110
8850
|
},
|
|
8111
8851
|
alignItems: "center"
|
|
8112
8852
|
}, customStatus()), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8113
|
-
className: styles$
|
|
8853
|
+
className: styles$5.infoLbl
|
|
8114
8854
|
}, "Import ID"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8115
|
-
className: styles$
|
|
8855
|
+
className: styles$5.infoText
|
|
8116
8856
|
}, userBulkImportInfo.import_id)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8117
|
-
className: styles$
|
|
8857
|
+
className: styles$5.infoLbl
|
|
8118
8858
|
}, "File name"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8119
|
-
className: styles$
|
|
8859
|
+
className: styles$5.infoText
|
|
8120
8860
|
}, userBulkImportInfo.file_name)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8121
|
-
className: styles$
|
|
8861
|
+
className: styles$5.infoLbl
|
|
8122
8862
|
}, "File uploaded by"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8123
|
-
className: styles$
|
|
8863
|
+
className: styles$5.infoText
|
|
8124
8864
|
}, userBulkImportInfo.uploaded_by.first_name + ' ' + userBulkImportInfo.uploaded_by.last_name)), /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8125
|
-
className: styles$
|
|
8865
|
+
className: styles$5.infoLbl
|
|
8126
8866
|
}, "Import confirmed by"), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8127
|
-
className: styles$
|
|
8867
|
+
className: styles$5.infoText
|
|
8128
8868
|
}, userBulkImportInfo.uploaded_by.first_name + ' ' + userBulkImportInfo.uploaded_by.last_name))))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
8129
8869
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
8130
8870
|
closeImportUsersModal: closeImportUsersModal,
|
|
@@ -8183,7 +8923,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8183
8923
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8184
8924
|
component: "div"
|
|
8185
8925
|
}, row.history_info.upload_id && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8186
|
-
className: clsx(styles$
|
|
8926
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8187
8927
|
}, row.history_info.upload_id));
|
|
8188
8928
|
}
|
|
8189
8929
|
}, {
|
|
@@ -8195,7 +8935,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8195
8935
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8196
8936
|
component: "div"
|
|
8197
8937
|
}, row.history_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8198
|
-
className: clsx(styles$
|
|
8938
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8199
8939
|
}, row.history_info.type));
|
|
8200
8940
|
}
|
|
8201
8941
|
}, {
|
|
@@ -8211,9 +8951,9 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8211
8951
|
gap: '8px'
|
|
8212
8952
|
}
|
|
8213
8953
|
}, row.history_info && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8214
|
-
className: clsx(styles$
|
|
8954
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8215
8955
|
}, getLocaleTime(row.history_info.date_of_upload + ' ' + row.history_info.time_of_upload, row.history_info.date_format)[0]), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8216
|
-
className: clsx(styles$
|
|
8956
|
+
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor)
|
|
8217
8957
|
}, getLocaleTime(row.history_info.date_of_upload + ' ' + row.history_info.time_of_upload, row.history_info.date_format)[1])));
|
|
8218
8958
|
}
|
|
8219
8959
|
}, {
|
|
@@ -8225,7 +8965,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8225
8965
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8226
8966
|
component: "div"
|
|
8227
8967
|
}, row.history_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8228
|
-
className: clsx(styles$
|
|
8968
|
+
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8229
8969
|
}, row.history_info.uploader_first_name, ' ', row.history_info.uploader_last_name));
|
|
8230
8970
|
}
|
|
8231
8971
|
}, {
|
|
@@ -8257,7 +8997,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8257
8997
|
width: "11",
|
|
8258
8998
|
height: "14"
|
|
8259
8999
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8260
|
-
className: clsx(styles$
|
|
9000
|
+
className: clsx(styles$5.rowText)
|
|
8261
9001
|
}, 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, {
|
|
8262
9002
|
component: "div",
|
|
8263
9003
|
display: "flex",
|
|
@@ -8274,7 +9014,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8274
9014
|
width: "11",
|
|
8275
9015
|
height: "14"
|
|
8276
9016
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8277
|
-
className: clsx(styles$
|
|
9017
|
+
className: clsx(styles$5.rowText)
|
|
8278
9018
|
}, 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, {
|
|
8279
9019
|
component: "div",
|
|
8280
9020
|
display: "flex",
|
|
@@ -8291,7 +9031,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8291
9031
|
width: "11",
|
|
8292
9032
|
height: "14"
|
|
8293
9033
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8294
|
-
className: clsx(styles$
|
|
9034
|
+
className: clsx(styles$5.rowText)
|
|
8295
9035
|
}, 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, {
|
|
8296
9036
|
component: "div",
|
|
8297
9037
|
display: "flex",
|
|
@@ -8308,7 +9048,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8308
9048
|
width: "11",
|
|
8309
9049
|
height: "14"
|
|
8310
9050
|
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8311
|
-
className: clsx(styles$
|
|
9051
|
+
className: clsx(styles$5.rowText)
|
|
8312
9052
|
}, row.history_info.invalid_users + ' ', /*#__PURE__*/React.createElement("span", null, ' ', +row.history_info.invalid_users === 1 ? ' invalid record' : ' invalid records')))));
|
|
8313
9053
|
}
|
|
8314
9054
|
}, {
|
|
@@ -8325,7 +9065,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8325
9065
|
gap: '5px'
|
|
8326
9066
|
}
|
|
8327
9067
|
}, row.history_info && /*#__PURE__*/React.createElement(React.Fragment, null, getStatusIcon(row.history_info.status.toLowerCase()), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8328
|
-
className: clsx(styles$
|
|
9068
|
+
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor)
|
|
8329
9069
|
}, row.history_info.status)));
|
|
8330
9070
|
}
|
|
8331
9071
|
}];
|
|
@@ -8348,7 +9088,7 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
8348
9088
|
});
|
|
8349
9089
|
};
|
|
8350
9090
|
|
|
8351
|
-
var styles$
|
|
9091
|
+
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"};
|
|
8352
9092
|
|
|
8353
9093
|
function SkeletonLoader(_ref) {
|
|
8354
9094
|
var _ref$data = _ref.data,
|
|
@@ -8373,7 +9113,7 @@ function SkeletonLoader(_ref) {
|
|
|
8373
9113
|
}
|
|
8374
9114
|
}] : _ref$data;
|
|
8375
9115
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8376
|
-
className: styles$
|
|
9116
|
+
className: styles$7.tablewrapper,
|
|
8377
9117
|
style: {
|
|
8378
9118
|
margin: 20
|
|
8379
9119
|
}
|
|
@@ -8382,7 +9122,7 @@ function SkeletonLoader(_ref) {
|
|
|
8382
9122
|
}));
|
|
8383
9123
|
}
|
|
8384
9124
|
|
|
8385
|
-
var IUIToastMessageService$
|
|
9125
|
+
var IUIToastMessageService$8 = services.IUIToastMessageService;
|
|
8386
9126
|
var env$6 = configs.env;
|
|
8387
9127
|
var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
8388
9128
|
var config = _ref.config;
|
|
@@ -8469,12 +9209,12 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8469
9209
|
return Promise.resolve(dispatch(downloadUploadedRecords(type, jobId)).then(function (validatedRes) {
|
|
8470
9210
|
var _validatedRes$data;
|
|
8471
9211
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
8472
|
-
dispatch(
|
|
9212
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
8473
9213
|
window.open(res.data.presigned_url, '_self').focus();
|
|
8474
9214
|
})["catch"](function (reject) {
|
|
8475
9215
|
if (reject) {
|
|
8476
9216
|
if (!reject.response.data.status) {
|
|
8477
|
-
IUIToastMessageService$
|
|
9217
|
+
IUIToastMessageService$8.warningNotify(reject.response.data.message);
|
|
8478
9218
|
}
|
|
8479
9219
|
}
|
|
8480
9220
|
})["finally"](function () {
|
|
@@ -8484,7 +9224,7 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8484
9224
|
})["catch"](function (reject) {
|
|
8485
9225
|
if (reject) {
|
|
8486
9226
|
if (!reject.response.data.status) {
|
|
8487
|
-
IUIToastMessageService$
|
|
9227
|
+
IUIToastMessageService$8.warningNotify(reject.response.data.message);
|
|
8488
9228
|
setDownlStatus(false);
|
|
8489
9229
|
}
|
|
8490
9230
|
}
|
|
@@ -8535,18 +9275,18 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8535
9275
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp]);
|
|
8536
9276
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8537
9277
|
component: "div",
|
|
8538
|
-
className: styles$
|
|
9278
|
+
className: styles$5.UUIUserManagementImport
|
|
8539
9279
|
}, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8540
9280
|
open: isApiFetching || isFileDownloading,
|
|
8541
|
-
className: styles$
|
|
9281
|
+
className: styles$5.backdrop
|
|
8542
9282
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
8543
9283
|
color: "inherit"
|
|
8544
9284
|
})), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8545
9285
|
component: "div",
|
|
8546
|
-
className: clsx(styles$
|
|
9286
|
+
className: clsx(styles$5.pageHeader)
|
|
8547
9287
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8548
9288
|
component: "div",
|
|
8549
|
-
className: styles$
|
|
9289
|
+
className: styles$5.breadcrumb
|
|
8550
9290
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
8551
9291
|
breadCrumbs: [{
|
|
8552
9292
|
href: config.routes.users.list.path,
|
|
@@ -8565,14 +9305,14 @@ var BulkActionHistory = function BulkActionHistory(_ref) {
|
|
|
8565
9305
|
alignItems: "center"
|
|
8566
9306
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8567
9307
|
component: "div",
|
|
8568
|
-
className: styles$
|
|
9308
|
+
className: styles$5.headingWrapper
|
|
8569
9309
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8570
9310
|
variant: "h3",
|
|
8571
|
-
className: clsx(styles$
|
|
9311
|
+
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8572
9312
|
}, "Bulk action history"))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
8573
|
-
className: styles$
|
|
9313
|
+
className: styles$5.dividerColor
|
|
8574
9314
|
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8575
|
-
className: styles$
|
|
9315
|
+
className: styles$5.tablewrapper
|
|
8576
9316
|
}, /*#__PURE__*/React.createElement(BulkActionHistoryTable, {
|
|
8577
9317
|
data: bulkActionFields,
|
|
8578
9318
|
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
@@ -8821,7 +9561,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8821
9561
|
secondaryText: row.email,
|
|
8822
9562
|
letterAvatarTextColor: "black",
|
|
8823
9563
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
8824
|
-
avatarClassName: styles$
|
|
9564
|
+
avatarClassName: styles$6.avatarClassName,
|
|
8825
9565
|
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
|
|
8826
9566
|
}));
|
|
8827
9567
|
}
|
|
@@ -8843,7 +9583,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8843
9583
|
},
|
|
8844
9584
|
placement: "top-start"
|
|
8845
9585
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8846
|
-
className: clsx(styles$
|
|
9586
|
+
className: clsx(styles$6.tooltipTextDiv)
|
|
8847
9587
|
}, "Invited")) : null);
|
|
8848
9588
|
}
|
|
8849
9589
|
}, {
|
|
@@ -8856,7 +9596,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8856
9596
|
component: "div",
|
|
8857
9597
|
width: 100
|
|
8858
9598
|
}, row.employee_info && /*#__PURE__*/React.createElement(IUITypography, {
|
|
8859
|
-
className: clsx(styles$
|
|
9599
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
8860
9600
|
}, row.employee_info.department));
|
|
8861
9601
|
}
|
|
8862
9602
|
}, {
|
|
@@ -8867,42 +9607,42 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8867
9607
|
cell: function cell(row) {
|
|
8868
9608
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8869
9609
|
component: "div"
|
|
8870
|
-
}, row.products.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, row.products[0].role
|
|
9610
|
+
}, row.products.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, !row.products[0].role.toLowerCase().includes("holder") ? /*#__PURE__*/React.createElement(IUIBox, {
|
|
8871
9611
|
component: "div",
|
|
8872
9612
|
display: "flex"
|
|
8873
9613
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8874
|
-
className: clsx(styles$
|
|
9614
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8875
9615
|
style: {
|
|
8876
9616
|
whiteSpace: 'nowrap'
|
|
8877
9617
|
}
|
|
8878
9618
|
}, row.products[0].name + ' / ' + ' '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8879
|
-
className: clsx(styles$
|
|
9619
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8880
9620
|
style: {
|
|
8881
9621
|
whiteSpace: 'nowrap'
|
|
8882
9622
|
}
|
|
8883
|
-
}, "\xA0" + row.products[0].role)) : "", row.products[1] && row.products[1].role
|
|
9623
|
+
}, "\xA0" + row.products[0].role)) : "", row.products[1] && !row.products[1].role.toLowerCase().includes("holder") && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8884
9624
|
component: "div",
|
|
8885
9625
|
display: "flex"
|
|
8886
9626
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8887
|
-
className: clsx(styles$
|
|
9627
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8888
9628
|
style: {
|
|
8889
9629
|
whiteSpace: 'nowrap'
|
|
8890
9630
|
}
|
|
8891
9631
|
}, row.products[1].name + ' / '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8892
|
-
className: clsx(styles$
|
|
9632
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8893
9633
|
style: {
|
|
8894
9634
|
whiteSpace: 'nowrap'
|
|
8895
9635
|
}
|
|
8896
|
-
}, "\xA0" + row.products[1].role)), row.products[2] && row.products[2].role
|
|
9636
|
+
}, "\xA0" + row.products[1].role)), row.products[2] && !row.products[2].role.toLowerCase().includes("holder") && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8897
9637
|
component: "div",
|
|
8898
9638
|
display: "flex"
|
|
8899
9639
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8900
|
-
className: clsx(styles$
|
|
9640
|
+
className: clsx(styles$6.rowText, styles$6.textTransform, styles$6.lightColor),
|
|
8901
9641
|
style: {
|
|
8902
9642
|
whiteSpace: 'nowrap'
|
|
8903
9643
|
}
|
|
8904
9644
|
}, row.products[2].name + ' / '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8905
|
-
className: clsx(styles$
|
|
9645
|
+
className: clsx(styles$6.rowText, styles$6.textTransform),
|
|
8906
9646
|
style: {
|
|
8907
9647
|
whiteSpace: 'nowrap'
|
|
8908
9648
|
}
|
|
@@ -8915,7 +9655,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8915
9655
|
cell: function cell(row) {
|
|
8916
9656
|
return /*#__PURE__*/React.createElement(IUIFormGroup, null, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8917
9657
|
component: "div",
|
|
8918
|
-
className: clsx(styles$
|
|
9658
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
8919
9659
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
8920
9660
|
component: "label",
|
|
8921
9661
|
container: true,
|
|
@@ -9061,7 +9801,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9061
9801
|
secondaryText: row.email,
|
|
9062
9802
|
letterAvatarTextColor: "black",
|
|
9063
9803
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9064
|
-
avatarClassName: styles$
|
|
9804
|
+
avatarClassName: styles$6.avatarClassName,
|
|
9065
9805
|
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
|
|
9066
9806
|
}));
|
|
9067
9807
|
}
|
|
@@ -9075,7 +9815,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9075
9815
|
component: "div",
|
|
9076
9816
|
width: 100
|
|
9077
9817
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9078
|
-
className: clsx(styles$
|
|
9818
|
+
className: clsx(styles$6.rowText, styles$6.textTransform)
|
|
9079
9819
|
}, formatDate(row.created_at)));
|
|
9080
9820
|
}
|
|
9081
9821
|
}, {
|
|
@@ -9182,9 +9922,9 @@ function InviteInfoIcon() {
|
|
|
9182
9922
|
}));
|
|
9183
9923
|
}
|
|
9184
9924
|
|
|
9185
|
-
var IUIToastMessageService$
|
|
9925
|
+
var IUIToastMessageService$9 = services.IUIToastMessageService;
|
|
9186
9926
|
var env$7 = configs.env,
|
|
9187
|
-
api$
|
|
9927
|
+
api$9 = configs.api;
|
|
9188
9928
|
var UndoButton = function UndoButton(_ref) {
|
|
9189
9929
|
var onUndo = _ref.onUndo,
|
|
9190
9930
|
msg = _ref.msg;
|
|
@@ -9380,7 +10120,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9380
10120
|
};
|
|
9381
10121
|
var openDeactivateModal = function openDeactivateModal() {
|
|
9382
10122
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9383
|
-
IUIToastMessageService$
|
|
10123
|
+
IUIToastMessageService$9.warningNotify('Select at least one user to deactivate.');
|
|
9384
10124
|
return false;
|
|
9385
10125
|
}
|
|
9386
10126
|
if (selectedUsersApprover.length) {
|
|
@@ -9419,9 +10159,9 @@ var UserList = function UserList(_ref2) {
|
|
|
9419
10159
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
9420
10160
|
};
|
|
9421
10161
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
9422
|
-
IUIToastMessageService$
|
|
10162
|
+
IUIToastMessageService$9.undoNotify(/*#__PURE__*/React.createElement(UndoButton, {
|
|
9423
10163
|
onUndo: function onUndo() {
|
|
9424
|
-
return IUIToastMessageService$
|
|
10164
|
+
return IUIToastMessageService$9.setUndoClicked(true);
|
|
9425
10165
|
},
|
|
9426
10166
|
msg: "Sign-up request rejected"
|
|
9427
10167
|
}), function (res) {
|
|
@@ -9443,7 +10183,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9443
10183
|
console.log(err);
|
|
9444
10184
|
});
|
|
9445
10185
|
}
|
|
9446
|
-
IUIToastMessageService$
|
|
10186
|
+
IUIToastMessageService$9.setUndoClicked(false);
|
|
9447
10187
|
});
|
|
9448
10188
|
};
|
|
9449
10189
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9549,7 +10289,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9549
10289
|
setIsDisabledSubmitBtn(true);
|
|
9550
10290
|
setApproveeStatus(false);
|
|
9551
10291
|
if (deactivateSingle === true) {
|
|
9552
|
-
api$
|
|
10292
|
+
api$9.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9553
10293
|
if (response.data["default"].id) {
|
|
9554
10294
|
setDefaultId(response.data["default"].id);
|
|
9555
10295
|
setApproverRole({
|
|
@@ -9661,7 +10401,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9661
10401
|
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9662
10402
|
if (type === undefined) {
|
|
9663
10403
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9664
|
-
IUIToastMessageService$
|
|
10404
|
+
IUIToastMessageService$9.warningNotify('Select at least one user to invite.');
|
|
9665
10405
|
return false;
|
|
9666
10406
|
}
|
|
9667
10407
|
}
|
|
@@ -9696,12 +10436,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9696
10436
|
return Promise.resolve(dispatch(exportUsers()).then(function (validatedRes) {
|
|
9697
10437
|
var _validatedRes$data;
|
|
9698
10438
|
if ((_validatedRes$data = validatedRes.data) !== null && _validatedRes$data !== void 0 && _validatedRes$data.status) {
|
|
9699
|
-
dispatch(
|
|
10439
|
+
dispatch(_downloadExecutionJob(validatedRes.data.audit_id, 'status')).then(function (res) {
|
|
9700
10440
|
window.open(res.data.presigned_url, '_self').focus();
|
|
9701
10441
|
})["catch"](function (reject) {
|
|
9702
10442
|
if (reject) {
|
|
9703
10443
|
if (!reject.response.data.status) {
|
|
9704
|
-
IUIToastMessageService$
|
|
10444
|
+
IUIToastMessageService$9.warningNotify(reject.response.data.message);
|
|
9705
10445
|
}
|
|
9706
10446
|
}
|
|
9707
10447
|
})["finally"](function () {
|
|
@@ -9711,7 +10451,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9711
10451
|
})["catch"](function (reject) {
|
|
9712
10452
|
if (reject) {
|
|
9713
10453
|
if (!reject.response.data.status) {
|
|
9714
|
-
IUIToastMessageService$
|
|
10454
|
+
IUIToastMessageService$9.warningNotify(reject.response.data.message);
|
|
9715
10455
|
setDownlStatus(false);
|
|
9716
10456
|
}
|
|
9717
10457
|
}
|
|
@@ -9830,14 +10570,14 @@ var UserList = function UserList(_ref2) {
|
|
|
9830
10570
|
var topRightButtons = function topRightButtons() {
|
|
9831
10571
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9832
10572
|
component: "div",
|
|
9833
|
-
className: styles$
|
|
10573
|
+
className: styles$6.buttonWrapper,
|
|
9834
10574
|
display: "flex",
|
|
9835
10575
|
justifyContent: "space-between",
|
|
9836
10576
|
alignItems: "center",
|
|
9837
10577
|
alignSelf: "flex-start"
|
|
9838
10578
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9839
10579
|
component: "div",
|
|
9840
|
-
className: clsx(styles$
|
|
10580
|
+
className: clsx(styles$6.buttonSingle, styles$6.buttonLeft)
|
|
9841
10581
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9842
10582
|
buttonText: "Export all users",
|
|
9843
10583
|
type: "outlined",
|
|
@@ -9848,7 +10588,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9848
10588
|
onClick: handleExportUsers
|
|
9849
10589
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9850
10590
|
component: "div",
|
|
9851
|
-
className: clsx(styles$
|
|
10591
|
+
className: clsx(styles$6.buttonSingle, styles$6.buttonLeft)
|
|
9852
10592
|
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9853
10593
|
buttonText: "Bulk actions",
|
|
9854
10594
|
type: "outlined",
|
|
@@ -9869,12 +10609,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9869
10609
|
};
|
|
9870
10610
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9871
10611
|
component: "div",
|
|
9872
|
-
className: styles$
|
|
10612
|
+
className: styles$6.UUIUserManagementList
|
|
9873
10613
|
}, overlayMenu ? /*#__PURE__*/React.createElement(Box, {
|
|
9874
|
-
className: styles$
|
|
10614
|
+
className: styles$6.scrollOverlayMenu
|
|
9875
10615
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9876
10616
|
component: "div",
|
|
9877
|
-
className: clsx(styles$
|
|
10617
|
+
className: clsx(styles$6.pageHeader)
|
|
9878
10618
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9879
10619
|
component: "div",
|
|
9880
10620
|
display: "flex",
|
|
@@ -9897,7 +10637,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9897
10637
|
onChangeHandler: function onChangeHandler(e) {
|
|
9898
10638
|
return onSearchHandler(e.target.value);
|
|
9899
10639
|
},
|
|
9900
|
-
className: styles$
|
|
10640
|
+
className: styles$6.overlaysearch
|
|
9901
10641
|
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9902
10642
|
component: "div",
|
|
9903
10643
|
display: "flex",
|
|
@@ -9905,13 +10645,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9905
10645
|
alignItems: "center"
|
|
9906
10646
|
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9907
10647
|
open: isFileDownloading || isApiFetching,
|
|
9908
|
-
className: styles$
|
|
10648
|
+
className: styles$6.backdrop
|
|
9909
10649
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9910
10650
|
color: "inherit"
|
|
9911
10651
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9912
10652
|
id: "table-root",
|
|
9913
10653
|
component: "div",
|
|
9914
|
-
className: clsx(styles$
|
|
10654
|
+
className: clsx(styles$6.pageHeader)
|
|
9915
10655
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9916
10656
|
component: "div",
|
|
9917
10657
|
display: "flex",
|
|
@@ -9930,23 +10670,23 @@ var UserList = function UserList(_ref2) {
|
|
|
9930
10670
|
}
|
|
9931
10671
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9932
10672
|
component: "div",
|
|
9933
|
-
className: styles$
|
|
10673
|
+
className: styles$6.headingWrapper
|
|
9934
10674
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9935
10675
|
variant: "h3",
|
|
9936
|
-
className: clsx(styles$
|
|
10676
|
+
className: clsx(styles$6.heading, styles$6.headingLarge)
|
|
9937
10677
|
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9938
10678
|
component: "div",
|
|
9939
10679
|
display: "flex",
|
|
9940
10680
|
justifyContent: "space-between",
|
|
9941
10681
|
alignItems: "center"
|
|
9942
10682
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9943
|
-
className: styles$
|
|
10683
|
+
className: styles$6.tablewrapper
|
|
9944
10684
|
}, /*#__PURE__*/React.createElement(IUITabs, {
|
|
9945
10685
|
value: tabValue,
|
|
9946
10686
|
customTabHandler: function customTabHandler(value) {
|
|
9947
10687
|
return dispatch(updateTabValue(value));
|
|
9948
10688
|
},
|
|
9949
|
-
className: styles$
|
|
10689
|
+
className: styles$6.user_list_page_tabs,
|
|
9950
10690
|
tabs: [{
|
|
9951
10691
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Current users", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
9952
10692
|
count: userListInfo.count
|
|
@@ -9957,10 +10697,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9957
10697
|
}
|
|
9958
10698
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9959
10699
|
component: "div",
|
|
9960
|
-
className: styles$
|
|
10700
|
+
className: styles$6.headingWrapper
|
|
9961
10701
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9962
10702
|
variant: "body2",
|
|
9963
|
-
className: clsx(styles$
|
|
10703
|
+
className: clsx(styles$6.description)
|
|
9964
10704
|
}, "Create new users, customize user permissions and manage user accounts")), /*#__PURE__*/React.createElement(StickyHeadTable, {
|
|
9965
10705
|
data: userListInfo,
|
|
9966
10706
|
handleChangeRowsPerPage: handleChangeRowsPerPage,
|
|
@@ -9993,10 +10733,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9993
10733
|
}
|
|
9994
10734
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9995
10735
|
component: "div",
|
|
9996
|
-
className: styles$
|
|
10736
|
+
className: styles$6.headingSignUpWrapper
|
|
9997
10737
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9998
10738
|
variant: "body2",
|
|
9999
|
-
className: clsx(styles$
|
|
10739
|
+
className: clsx(styles$6.description)
|
|
10000
10740
|
}, "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", {
|
|
10001
10741
|
onClick: redirectToNotifications,
|
|
10002
10742
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
@@ -10042,16 +10782,16 @@ var UserList = function UserList(_ref2) {
|
|
|
10042
10782
|
headerText: "Deactivate this user?",
|
|
10043
10783
|
width: "400px",
|
|
10044
10784
|
subHanderText: "",
|
|
10045
|
-
submitBtnClass: styles$
|
|
10785
|
+
submitBtnClass: styles$6.deactivateBtn,
|
|
10046
10786
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10047
10787
|
modalClass: "deactivateSingleModal",
|
|
10048
10788
|
modalBodyStyle: {
|
|
10049
10789
|
overflowY: 'unset'
|
|
10050
10790
|
}
|
|
10051
10791
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10052
|
-
className: clsx(styles$
|
|
10792
|
+
className: clsx(styles$6.deactivateSingle, 'iui__mb-16')
|
|
10053
10793
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10054
|
-
className: styles$
|
|
10794
|
+
className: styles$6.deactivateAlert
|
|
10055
10795
|
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
10056
10796
|
width: "9",
|
|
10057
10797
|
height: "9"
|
|
@@ -10100,29 +10840,29 @@ var UserList = function UserList(_ref2) {
|
|
|
10100
10840
|
alignItems: "center",
|
|
10101
10841
|
flexDirection: "column",
|
|
10102
10842
|
padding: "27px 16px 27px",
|
|
10103
|
-
className: styles$
|
|
10843
|
+
className: styles$6.deActivateModalContainer
|
|
10104
10844
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10105
|
-
className: styles$
|
|
10845
|
+
className: styles$6.headerText
|
|
10106
10846
|
}, '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, {
|
|
10107
|
-
className: styles$
|
|
10847
|
+
className: styles$6.description
|
|
10108
10848
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
10109
10849
|
isOpen: isBulkDeactivateModalOpen,
|
|
10110
10850
|
closeHandler: closeDeActiveModal,
|
|
10111
10851
|
cancelLabel: "Cancel",
|
|
10112
10852
|
submitLabel: "Deactivate safe users",
|
|
10113
10853
|
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
10114
|
-
submitBtnClass: clsx(styles$
|
|
10854
|
+
submitBtnClass: clsx(styles$6.deactivateSubmitBtn),
|
|
10115
10855
|
customButtonLabel: "Deactivate all users",
|
|
10116
10856
|
customButtonHandler: handleDeactivateUsers,
|
|
10117
10857
|
submitHandler: handleDeactivateSafeUsers,
|
|
10118
10858
|
width: "640px",
|
|
10119
|
-
customButtonClass: clsx(styles$
|
|
10859
|
+
customButtonClass: clsx(styles$6.deactivateCustomButtonClass),
|
|
10120
10860
|
headerText: "Deactivate users?",
|
|
10121
10861
|
modalBodyStyle: {
|
|
10122
10862
|
maxHeight: 'calc(100vh - 50vh)'
|
|
10123
10863
|
}
|
|
10124
10864
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10125
|
-
className: clsx(styles$
|
|
10865
|
+
className: clsx(styles$6.deactivateAlert, styles$6.warningSvg)
|
|
10126
10866
|
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
10127
10867
|
color: "#9A6700",
|
|
10128
10868
|
size: "14"
|
|
@@ -10234,7 +10974,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10234
10974
|
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
10235
10975
|
var count = _ref5.count;
|
|
10236
10976
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10237
|
-
className: styles$
|
|
10977
|
+
className: styles$6.TabLabelCount
|
|
10238
10978
|
}, " ", count, " ");
|
|
10239
10979
|
};
|
|
10240
10980
|
var index$2 = withStore(UserList);
|
|
@@ -10255,7 +10995,7 @@ function Header(props) {
|
|
|
10255
10995
|
isILadmin = _useSelector.isILadmin;
|
|
10256
10996
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10257
10997
|
component: "div",
|
|
10258
|
-
className: clsx(styles$
|
|
10998
|
+
className: clsx(styles$6.pageHeader)
|
|
10259
10999
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10260
11000
|
component: "div",
|
|
10261
11001
|
display: "flex",
|
|
@@ -10274,19 +11014,19 @@ function Header(props) {
|
|
|
10274
11014
|
}
|
|
10275
11015
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10276
11016
|
component: "div",
|
|
10277
|
-
className: styles$
|
|
11017
|
+
className: styles$6.headingWrapper
|
|
10278
11018
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10279
11019
|
variant: "h3",
|
|
10280
|
-
className: clsx(styles$
|
|
11020
|
+
className: clsx(styles$6.heading, styles$6.headingLarge)
|
|
10281
11021
|
}, isILadmin === 1 && companyName !== null && companyName + " - ", ' ', headingName)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10282
11022
|
component: "div",
|
|
10283
|
-
className: styles$
|
|
11023
|
+
className: styles$6.headingWrapper
|
|
10284
11024
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10285
11025
|
variant: "body2",
|
|
10286
|
-
className: clsx(styles$
|
|
11026
|
+
className: clsx(styles$6.description)
|
|
10287
11027
|
}, subHeading))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10288
11028
|
component: "div",
|
|
10289
|
-
className: styles$
|
|
11029
|
+
className: styles$6.buttonWrapper,
|
|
10290
11030
|
display: "flex",
|
|
10291
11031
|
justifyContent: "space-between",
|
|
10292
11032
|
alignItems: "center",
|
|
@@ -10307,7 +11047,7 @@ function Header(props) {
|
|
|
10307
11047
|
})));
|
|
10308
11048
|
}
|
|
10309
11049
|
|
|
10310
|
-
var styles$
|
|
11050
|
+
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"};
|
|
10311
11051
|
|
|
10312
11052
|
function Listview(_ref) {
|
|
10313
11053
|
var data = _ref.data,
|
|
@@ -10360,19 +11100,19 @@ function Listview(_ref) {
|
|
|
10360
11100
|
display: "flex"
|
|
10361
11101
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
10362
11102
|
buttonText: "Edit",
|
|
10363
|
-
className: styles$
|
|
11103
|
+
className: styles$8.buttonWidth,
|
|
10364
11104
|
onClick: function onClick() {
|
|
10365
11105
|
return handleEditDialog(row);
|
|
10366
11106
|
}
|
|
10367
11107
|
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
10368
11108
|
buttonText: "Delete",
|
|
10369
|
-
className: styles$
|
|
11109
|
+
className: styles$8.buttonWidth,
|
|
10370
11110
|
onClick: function onClick() {
|
|
10371
11111
|
return handleDeleteDialog(row, true);
|
|
10372
11112
|
}
|
|
10373
11113
|
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
10374
11114
|
buttonText: "Delete",
|
|
10375
|
-
className: styles$
|
|
11115
|
+
className: styles$8.buttonWidth,
|
|
10376
11116
|
onClick: function onClick() {
|
|
10377
11117
|
return handleDeleteDialog(row, false);
|
|
10378
11118
|
}
|
|
@@ -10398,7 +11138,7 @@ function Listview(_ref) {
|
|
|
10398
11138
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10399
11139
|
component: "div"
|
|
10400
11140
|
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
10401
|
-
className: clsx(styles$
|
|
11141
|
+
className: clsx(styles$8.rowText, styles$8.textTransform, styles$8.lightColor)
|
|
10402
11142
|
}, "Assigned by default"));
|
|
10403
11143
|
}
|
|
10404
11144
|
}, {
|
|
@@ -10420,19 +11160,19 @@ function Listview(_ref) {
|
|
|
10420
11160
|
display: "flex"
|
|
10421
11161
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
10422
11162
|
buttonText: "Edit",
|
|
10423
|
-
className: styles$
|
|
11163
|
+
className: styles$8.buttonWidth,
|
|
10424
11164
|
onClick: function onClick() {
|
|
10425
11165
|
return handleEditDialog(row);
|
|
10426
11166
|
}
|
|
10427
11167
|
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
10428
11168
|
buttonText: "Delete",
|
|
10429
|
-
className: styles$
|
|
11169
|
+
className: styles$8.buttonWidth,
|
|
10430
11170
|
onClick: function onClick() {
|
|
10431
11171
|
return handleDeleteDialog(row, true);
|
|
10432
11172
|
}
|
|
10433
11173
|
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
10434
11174
|
buttonText: "Delete",
|
|
10435
|
-
className: styles$
|
|
11175
|
+
className: styles$8.buttonWidth,
|
|
10436
11176
|
onClick: function onClick() {
|
|
10437
11177
|
return handleDeleteDialog(row, false);
|
|
10438
11178
|
}
|
|
@@ -10441,7 +11181,7 @@ function Listview(_ref) {
|
|
|
10441
11181
|
}];
|
|
10442
11182
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10443
11183
|
p: 3,
|
|
10444
|
-
className: data !== null && data !== void 0 && data.results && data.results.length > 0 && data.results[0].code === UNASSIGNED_USERS ? styles$
|
|
11184
|
+
className: data !== null && data !== void 0 && data.results && data.results.length > 0 && data.results[0].code === UNASSIGNED_USERS ? styles$8.tableContainer : ''
|
|
10445
11185
|
}, /*#__PURE__*/React.createElement(IUITable, {
|
|
10446
11186
|
searchHide: true,
|
|
10447
11187
|
hasFilter: true,
|
|
@@ -10572,11 +11312,11 @@ function EditPanelDialog(_ref) {
|
|
|
10572
11312
|
justifyContent: "center",
|
|
10573
11313
|
alignItems: "center",
|
|
10574
11314
|
flexDirection: "column",
|
|
10575
|
-
className: styles$
|
|
11315
|
+
className: styles$8.baseAlert
|
|
10576
11316
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10577
|
-
className: styles$
|
|
11317
|
+
className: styles$8.alertDescContainer
|
|
10578
11318
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10579
|
-
className: styles$
|
|
11319
|
+
className: styles$8.iconLayout,
|
|
10580
11320
|
style: {
|
|
10581
11321
|
paddingTop: '4px'
|
|
10582
11322
|
}
|
|
@@ -10584,7 +11324,7 @@ function EditPanelDialog(_ref) {
|
|
|
10584
11324
|
color: "#CA8A04",
|
|
10585
11325
|
width: "25",
|
|
10586
11326
|
height: "20",
|
|
10587
|
-
className: styles$
|
|
11327
|
+
className: styles$8.iconStyle
|
|
10588
11328
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10589
11329
|
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.",
|
|
10590
11330
|
style: {
|
|
@@ -10599,7 +11339,7 @@ function EditPanelDialog(_ref) {
|
|
|
10599
11339
|
color: "#EC5D25"
|
|
10600
11340
|
}),
|
|
10601
11341
|
onClick: handleAddPageNavigation,
|
|
10602
|
-
className: styles$
|
|
11342
|
+
className: styles$8.addUserButton
|
|
10603
11343
|
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
10604
11344
|
label: name + " name",
|
|
10605
11345
|
name: "name",
|
|
@@ -10696,14 +11436,14 @@ function MoveUserDialog(_ref) {
|
|
|
10696
11436
|
flexDirection: "column"
|
|
10697
11437
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10698
11438
|
display: "flex",
|
|
10699
|
-
className: styles$
|
|
11439
|
+
className: styles$8.baseAlert
|
|
10700
11440
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10701
|
-
className: styles$
|
|
11441
|
+
className: styles$8.iconLayout
|
|
10702
11442
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10703
11443
|
color: "#CA8A04",
|
|
10704
11444
|
width: "25",
|
|
10705
11445
|
height: "20",
|
|
10706
|
-
className: styles$
|
|
11446
|
+
className: styles$8.iconStyle
|
|
10707
11447
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10708
11448
|
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()) + ".",
|
|
10709
11449
|
style: {
|
|
@@ -10772,11 +11512,11 @@ function DeletePanelModal$1(_ref) {
|
|
|
10772
11512
|
alignItems: "center",
|
|
10773
11513
|
flexDirection: "column"
|
|
10774
11514
|
}, /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("span", {
|
|
10775
|
-
className: styles$
|
|
11515
|
+
className: styles$8.onBoardText
|
|
10776
11516
|
}, 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, "."))));
|
|
10777
11517
|
}
|
|
10778
11518
|
|
|
10779
|
-
var IUIToastMessageService$
|
|
11519
|
+
var IUIToastMessageService$a = services.IUIToastMessageService;
|
|
10780
11520
|
var UserPanel = function UserPanel(_ref) {
|
|
10781
11521
|
var title = _ref.title,
|
|
10782
11522
|
headingName = _ref.headingName,
|
|
@@ -10982,7 +11722,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10982
11722
|
}
|
|
10983
11723
|
dispatch(userPanelShowLoader());
|
|
10984
11724
|
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
10985
|
-
IUIToastMessageService$
|
|
11725
|
+
IUIToastMessageService$a.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10986
11726
|
dispatch(userPanelStopLoader());
|
|
10987
11727
|
if (type === 'delete') {
|
|
10988
11728
|
closeDeleteModal();
|
|
@@ -11070,7 +11810,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11070
11810
|
};
|
|
11071
11811
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11072
11812
|
component: "div",
|
|
11073
|
-
className: styles$
|
|
11813
|
+
className: styles$6.UUIUserManagementList
|
|
11074
11814
|
}, hasVerificationError === false ? /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Header, {
|
|
11075
11815
|
name: title,
|
|
11076
11816
|
headingName: headingName,
|
|
@@ -11235,14 +11975,14 @@ var DeleteCustomFieldModal = function DeleteCustomFieldModal(_ref) {
|
|
|
11235
11975
|
flexDirection: "column"
|
|
11236
11976
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11237
11977
|
display: "flex",
|
|
11238
|
-
className: styles$
|
|
11978
|
+
className: styles$7.baseAlert
|
|
11239
11979
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11240
|
-
className: styles$
|
|
11980
|
+
className: styles$7.iconLayout
|
|
11241
11981
|
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
11242
11982
|
color: "#CA8A04",
|
|
11243
11983
|
width: "25",
|
|
11244
11984
|
height: "20",
|
|
11245
|
-
className: styles$
|
|
11985
|
+
className: styles$7.iconStyle
|
|
11246
11986
|
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
11247
11987
|
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.",
|
|
11248
11988
|
style: {
|
|
@@ -11270,7 +12010,7 @@ var PageHeader = function PageHeader() {
|
|
|
11270
12010
|
};
|
|
11271
12011
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11272
12012
|
component: "div",
|
|
11273
|
-
className: clsx(styles$
|
|
12013
|
+
className: clsx(styles$7.pageHeader)
|
|
11274
12014
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11275
12015
|
component: "div",
|
|
11276
12016
|
display: "flex",
|
|
@@ -11278,13 +12018,13 @@ var PageHeader = function PageHeader() {
|
|
|
11278
12018
|
alignItems: "center"
|
|
11279
12019
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
11280
12020
|
component: "div",
|
|
11281
|
-
className: styles$
|
|
12021
|
+
className: styles$7.headingWrapper
|
|
11282
12022
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
11283
12023
|
variant: "h3",
|
|
11284
|
-
className: clsx(styles$
|
|
12024
|
+
className: clsx(styles$7.heading, styles$7.headingLarge)
|
|
11285
12025
|
}, isILadmin && companyName ? companyName + " - " : '', "Custom fields")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
11286
12026
|
component: "div",
|
|
11287
|
-
className: styles$
|
|
12027
|
+
className: styles$7.buttonWrapper,
|
|
11288
12028
|
display: "flex",
|
|
11289
12029
|
justifyContent: "space-between",
|
|
11290
12030
|
alignItems: "center"
|
|
@@ -11307,10 +12047,10 @@ var PageHeader = function PageHeader() {
|
|
|
11307
12047
|
alignItems: "center"
|
|
11308
12048
|
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
11309
12049
|
component: "div",
|
|
11310
|
-
className: styles$
|
|
12050
|
+
className: styles$7.headingWrapper
|
|
11311
12051
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
11312
12052
|
variant: "body2",
|
|
11313
|
-
className: clsx(styles$
|
|
12053
|
+
className: clsx(styles$7.description)
|
|
11314
12054
|
}, "Configure fields based on the information you require from your employees in their profile")), /*#__PURE__*/React.createElement(AddCustomFieldModal, {
|
|
11315
12055
|
isOpenModal: isOpenModal,
|
|
11316
12056
|
closeModalHandler: function closeModalHandler() {
|
|
@@ -11372,13 +12112,13 @@ function Table() {
|
|
|
11372
12112
|
display: "flex"
|
|
11373
12113
|
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
11374
12114
|
buttonText: "Edit",
|
|
11375
|
-
className: styles$
|
|
12115
|
+
className: styles$7.buttonWidth,
|
|
11376
12116
|
onClick: function onClick() {
|
|
11377
12117
|
return handleEdit(row);
|
|
11378
12118
|
}
|
|
11379
12119
|
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
11380
12120
|
buttonText: "Delete",
|
|
11381
|
-
className: styles$
|
|
12121
|
+
className: styles$7.buttonWidth,
|
|
11382
12122
|
onClick: function onClick() {
|
|
11383
12123
|
return handleDelete(row);
|
|
11384
12124
|
}
|
|
@@ -11386,7 +12126,7 @@ function Table() {
|
|
|
11386
12126
|
}
|
|
11387
12127
|
}];
|
|
11388
12128
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11389
|
-
className: styles$
|
|
12129
|
+
className: styles$7.tablewrapper
|
|
11390
12130
|
}, /*#__PURE__*/React.createElement(IUITable, {
|
|
11391
12131
|
hasFilter: false,
|
|
11392
12132
|
isCheckboxTable: false,
|
|
@@ -11425,7 +12165,7 @@ var CustomFields$1 = function CustomFields(_ref) {
|
|
|
11425
12165
|
}, [isTokenVerified]);
|
|
11426
12166
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
11427
12167
|
component: "div",
|
|
11428
|
-
className: styles$
|
|
12168
|
+
className: styles$7.UUICustomFields
|
|
11429
12169
|
}, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
|
|
11430
12170
|
data: [{
|
|
11431
12171
|
variant: 'rect',
|