@itilite/iui-user-management 0.5.11 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +7 -111
- package/dist/index.js +476 -1474
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +480 -1478
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -4
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup,
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUIDropdownButton, IUITabs } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -9,14 +9,12 @@ 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
|
|
13
|
-
import { withStyles
|
|
14
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
12
|
+
import { useHistory } from 'react-router-dom';
|
|
13
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
15
14
|
import Switch from '@material-ui/core/Switch';
|
|
16
15
|
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
17
16
|
import Button from '@material-ui/core/Button';
|
|
18
|
-
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography
|
|
19
|
-
import { useScrollPosition } from '@n8tb1t/use-scroll-position';
|
|
17
|
+
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography } from '@material-ui/core';
|
|
20
18
|
|
|
21
19
|
function _extends() {
|
|
22
20
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -146,11 +144,17 @@ function r(e) {
|
|
|
146
144
|
var t,
|
|
147
145
|
f,
|
|
148
146
|
n = "";
|
|
149
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
147
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) {
|
|
148
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
149
|
+
} else for (t in e) {
|
|
150
|
+
e[t] && (n && (n += " "), n += t);
|
|
151
|
+
}
|
|
150
152
|
return n;
|
|
151
153
|
}
|
|
152
154
|
function clsx() {
|
|
153
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
155
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
156
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
157
|
+
}
|
|
154
158
|
return n;
|
|
155
159
|
}
|
|
156
160
|
|
|
@@ -354,9 +358,6 @@ var userAddEditUrl = {
|
|
|
354
358
|
approversSearch: function approversSearch() {
|
|
355
359
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
356
360
|
},
|
|
357
|
-
transferAppover: function transferAppover() {
|
|
358
|
-
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
-
},
|
|
360
361
|
preSignedUrl: function preSignedUrl() {
|
|
361
362
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
362
363
|
},
|
|
@@ -444,23 +445,15 @@ var userPanelUrl = {
|
|
|
444
445
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
445
446
|
},
|
|
446
447
|
getUnit: function getUnit(tableName, length, sort) {
|
|
447
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
448
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&order=" + sort;
|
|
448
449
|
},
|
|
449
450
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
450
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
451
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&order=" + sort;
|
|
451
452
|
},
|
|
452
453
|
moveUnit: function moveUnit() {
|
|
453
454
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
454
455
|
}
|
|
455
456
|
};
|
|
456
|
-
var departmentUrl = {
|
|
457
|
-
departmentUrl: function departmentUrl() {
|
|
458
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
459
|
-
},
|
|
460
|
-
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
461
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
457
|
|
|
465
458
|
var api = configs.api;
|
|
466
459
|
var NAoptionConfig = {
|
|
@@ -602,53 +595,11 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
602
595
|
return Promise.reject(e);
|
|
603
596
|
}
|
|
604
597
|
};
|
|
605
|
-
var
|
|
598
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
606
599
|
var page = _ref4.page,
|
|
607
600
|
product = _ref4.product,
|
|
608
|
-
userId = _ref4.userId
|
|
609
|
-
|
|
610
|
-
return Promise.resolve(_catch(function () {
|
|
611
|
-
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
612
|
-
return res.data;
|
|
613
|
-
})).then(function (response) {
|
|
614
|
-
var mappedValue = response.results.map(function (item) {
|
|
615
|
-
return {
|
|
616
|
-
value: item.email,
|
|
617
|
-
label: item.email,
|
|
618
|
-
type: 'detailed',
|
|
619
|
-
data: item
|
|
620
|
-
};
|
|
621
|
-
});
|
|
622
|
-
return {
|
|
623
|
-
options: mappedValue,
|
|
624
|
-
hasMore: !!response.next,
|
|
625
|
-
additional: {
|
|
626
|
-
page: page + 1,
|
|
627
|
-
product: product,
|
|
628
|
-
userId: userId
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
});
|
|
632
|
-
}, function () {
|
|
633
|
-
return {
|
|
634
|
-
options: [],
|
|
635
|
-
hasMore: false,
|
|
636
|
-
additional: {
|
|
637
|
-
page: 1,
|
|
638
|
-
product: product,
|
|
639
|
-
userId: userId
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
}));
|
|
643
|
-
} catch (e) {
|
|
644
|
-
return Promise.reject(e);
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
648
|
-
var page = _ref5.page,
|
|
649
|
-
product = _ref5.product,
|
|
650
|
-
userId = _ref5.userId,
|
|
651
|
-
placeholder = _ref5.placeholder;
|
|
601
|
+
userId = _ref4.userId,
|
|
602
|
+
placeholder = _ref4.placeholder;
|
|
652
603
|
try {
|
|
653
604
|
return Promise.resolve(_catch(function () {
|
|
654
605
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -694,9 +645,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
|
694
645
|
return Promise.reject(e);
|
|
695
646
|
}
|
|
696
647
|
};
|
|
697
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
698
|
-
var page =
|
|
699
|
-
tabelName =
|
|
648
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
649
|
+
var page = _ref5.page,
|
|
650
|
+
tabelName = _ref5.tabelName;
|
|
700
651
|
try {
|
|
701
652
|
return Promise.resolve(_catch(function () {
|
|
702
653
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -731,45 +682,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
731
682
|
return Promise.reject(e);
|
|
732
683
|
}
|
|
733
684
|
};
|
|
734
|
-
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
735
|
-
var page = _ref7.page,
|
|
736
|
-
departmentId = _ref7.departmentId;
|
|
737
|
-
try {
|
|
738
|
-
return Promise.resolve(_catch(function () {
|
|
739
|
-
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
740
|
-
return res.data;
|
|
741
|
-
})).then(function (response) {
|
|
742
|
-
var mappedValue = response.results.map(function (item) {
|
|
743
|
-
return {
|
|
744
|
-
value: item.id,
|
|
745
|
-
label: item.first_name + ' ' + item.last_name,
|
|
746
|
-
type: 'detailed',
|
|
747
|
-
data: item
|
|
748
|
-
};
|
|
749
|
-
});
|
|
750
|
-
return {
|
|
751
|
-
options: mappedValue,
|
|
752
|
-
hasMore: !!response.next,
|
|
753
|
-
additional: {
|
|
754
|
-
page: page + 1,
|
|
755
|
-
departmentId: departmentId
|
|
756
|
-
}
|
|
757
|
-
};
|
|
758
|
-
});
|
|
759
|
-
}, function () {
|
|
760
|
-
return {
|
|
761
|
-
options: [],
|
|
762
|
-
hasMore: false,
|
|
763
|
-
additional: {
|
|
764
|
-
page: 1,
|
|
765
|
-
departmentId: departmentId
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
}));
|
|
769
|
-
} catch (e) {
|
|
770
|
-
return Promise.reject(e);
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
685
|
|
|
774
686
|
var UserRole = function UserRole(_ref) {
|
|
775
687
|
var _ref$list = _ref.list,
|
|
@@ -1238,19 +1150,10 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1238
1150
|
payload: tabId
|
|
1239
1151
|
};
|
|
1240
1152
|
};
|
|
1241
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1242
|
-
if (roleTransfer === void 0) {
|
|
1243
|
-
roleTransfer = false;
|
|
1244
|
-
}
|
|
1245
|
-
var _payload = {
|
|
1246
|
-
role_transfer: roleTransfer
|
|
1247
|
-
};
|
|
1248
|
-
if (roleTransfer) {
|
|
1249
|
-
_payload.new_approver_user_id = newApproverUserId;
|
|
1250
|
-
}
|
|
1153
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1251
1154
|
return function (dispatch) {
|
|
1252
1155
|
return new Promise(function (resolve, reject) {
|
|
1253
|
-
api$1.
|
|
1156
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1254
1157
|
dispatch(setUserActiveStatus({
|
|
1255
1158
|
is_active: activateVal !== 0,
|
|
1256
1159
|
id: id
|
|
@@ -1347,6 +1250,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1347
1250
|
var _res$data;
|
|
1348
1251
|
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1349
1252
|
dispatch(stopLoader());
|
|
1253
|
+
reject();
|
|
1350
1254
|
}
|
|
1351
1255
|
})["catch"](function (err) {
|
|
1352
1256
|
reject(err);
|
|
@@ -1359,7 +1263,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1359
1263
|
return new Promise(function (resolve, reject) {
|
|
1360
1264
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1361
1265
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1362
|
-
resolve(
|
|
1266
|
+
resolve('success');
|
|
1363
1267
|
})["catch"](function (err) {
|
|
1364
1268
|
reject(err);
|
|
1365
1269
|
})["finally"](function () {});
|
|
@@ -1518,9 +1422,11 @@ var createUser = function createUser(payload) {
|
|
|
1518
1422
|
} else {
|
|
1519
1423
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1520
1424
|
reject(res.data.errors);
|
|
1425
|
+
return;
|
|
1521
1426
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1522
1427
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1523
1428
|
}
|
|
1429
|
+
reject();
|
|
1524
1430
|
}
|
|
1525
1431
|
})["catch"](function (err) {
|
|
1526
1432
|
var _err$response6;
|
|
@@ -1617,43 +1523,20 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1617
1523
|
});
|
|
1618
1524
|
};
|
|
1619
1525
|
};
|
|
1620
|
-
var
|
|
1621
|
-
return function (dispatch) {
|
|
1622
|
-
return new Promise(function (resolve, reject) {
|
|
1623
|
-
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1624
|
-
email: data.email
|
|
1625
|
-
}).then(function (res) {
|
|
1626
|
-
IUIToastMessageService$1.sNotify("The link to reset the password has been sent to the user's email address. Check your \"junk mail\" or \"spam\" folders in case it's not received.");
|
|
1627
|
-
resolve();
|
|
1628
|
-
})["catch"](function (err) {
|
|
1629
|
-
var _err$response9, _err$response9$data;
|
|
1630
|
-
if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
|
|
1631
|
-
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1632
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : (_err$response10$data$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
|
|
1633
|
-
reject(err);
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
reject(err);
|
|
1637
|
-
});
|
|
1638
|
-
});
|
|
1639
|
-
};
|
|
1640
|
-
};
|
|
1641
|
-
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1526
|
+
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1642
1527
|
return function (dispatch) {
|
|
1643
1528
|
return new Promise(function (resolve, reject) {
|
|
1644
|
-
api$2.
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1529
|
+
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1530
|
+
dispatch(fetchUserSignupRequests({
|
|
1531
|
+
ordering: 'asc',
|
|
1532
|
+
length: 5,
|
|
1533
|
+
page: 1,
|
|
1534
|
+
search: ''
|
|
1535
|
+
}));
|
|
1648
1536
|
resolve();
|
|
1649
1537
|
})["catch"](function (err) {
|
|
1650
|
-
var _err$
|
|
1651
|
-
|
|
1652
|
-
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1653
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : (_err$response12$data$ = _err$response12$data.message) === null || _err$response12$data$ === void 0 ? void 0 : _err$response12$data$.email[0]);
|
|
1654
|
-
reject(err);
|
|
1655
|
-
return;
|
|
1656
|
-
}
|
|
1538
|
+
var _err$response8, _err$response8$data;
|
|
1539
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
|
|
1657
1540
|
reject(err);
|
|
1658
1541
|
});
|
|
1659
1542
|
});
|
|
@@ -1795,7 +1678,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1795
1678
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1796
1679
|
return function (dispatch) {
|
|
1797
1680
|
return new Promise(function (resolve, reject) {
|
|
1798
|
-
api$2.post(
|
|
1681
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1799
1682
|
resolve(res);
|
|
1800
1683
|
})["catch"](function (err) {
|
|
1801
1684
|
var _err$response17, _err$response17$data;
|
|
@@ -1831,7 +1714,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1831
1714
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1832
1715
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1833
1716
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1834
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1835
1717
|
|
|
1836
1718
|
var api$3 = configs.api;
|
|
1837
1719
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1881,14 +1763,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1881
1763
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1882
1764
|
return function (dispatch) {
|
|
1883
1765
|
return new Promise(function (resolve, reject) {
|
|
1884
|
-
api$3.post(
|
|
1766
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1885
1767
|
dispatch(getUserPanalData(getParam));
|
|
1886
1768
|
dispatch(closeDialog());
|
|
1887
1769
|
resolve(res);
|
|
1888
1770
|
})["catch"](function (err) {
|
|
1889
|
-
var _err$
|
|
1771
|
+
var _err$response2, _err$response2$data;
|
|
1890
1772
|
dispatch(userPanelStopLoader());
|
|
1891
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1773
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.message) || 'Opps, Something went wrong.');
|
|
1892
1774
|
});
|
|
1893
1775
|
});
|
|
1894
1776
|
};
|
|
@@ -1902,37 +1784,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1902
1784
|
dispatch(userPanelStopLoader());
|
|
1903
1785
|
resolve();
|
|
1904
1786
|
})["catch"](function (err) {
|
|
1905
|
-
var _err$
|
|
1906
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1787
|
+
var _err$response3, _err$response3$data;
|
|
1788
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1907
1789
|
dispatch(userPanelStopLoader());
|
|
1908
1790
|
});
|
|
1909
1791
|
});
|
|
1910
1792
|
};
|
|
1911
1793
|
};
|
|
1912
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1794
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1913
1795
|
return function (dispatch) {
|
|
1914
1796
|
return new Promise(function (resolve, reject) {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
});
|
|
1925
|
-
} else {
|
|
1926
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1927
|
-
dispatch(getUserPanalData(getParam));
|
|
1928
|
-
dispatch(closeDialog());
|
|
1929
|
-
resolve();
|
|
1930
|
-
})["catch"](function (err) {
|
|
1931
|
-
var _err$response6, _err$response6$data;
|
|
1932
|
-
dispatch(userPanelStopLoader());
|
|
1933
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1797
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1798
|
+
dispatch(getUserPanalData(getParam));
|
|
1799
|
+
dispatch(closeDialog());
|
|
1800
|
+
resolve();
|
|
1801
|
+
})["catch"](function (err) {
|
|
1802
|
+
var _err$response4, _err$response4$data;
|
|
1803
|
+
dispatch(userPanelStopLoader());
|
|
1804
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
1805
|
+
});
|
|
1936
1806
|
});
|
|
1937
1807
|
};
|
|
1938
1808
|
};
|
|
@@ -1944,8 +1814,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1944
1814
|
dispatch(closeDialog());
|
|
1945
1815
|
resolve(res);
|
|
1946
1816
|
})["catch"](function (err) {
|
|
1947
|
-
var _err$
|
|
1948
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1817
|
+
var _err$response5, _err$response5$data;
|
|
1818
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
1949
1819
|
});
|
|
1950
1820
|
});
|
|
1951
1821
|
};
|
|
@@ -3034,8 +2904,8 @@ var workInfo = [{
|
|
|
3034
2904
|
validation: {
|
|
3035
2905
|
regexOnChange: null,
|
|
3036
2906
|
regexOnBlur: [{
|
|
3037
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
3038
|
-
message: "Only alphabets, numbers
|
|
2907
|
+
regex: /^[(A-Z)(a-z)(0-9)\-& ]*$/,
|
|
2908
|
+
message: "Only alphabets, numbers and - & are allowed."
|
|
3039
2909
|
}],
|
|
3040
2910
|
maxLimit: '',
|
|
3041
2911
|
minLimit: '',
|
|
@@ -3123,8 +2993,8 @@ var workInfo = [{
|
|
|
3123
2993
|
validation: {
|
|
3124
2994
|
regexOnChange: null,
|
|
3125
2995
|
regexOnBlur: [{
|
|
3126
|
-
regex: /^[A-Za-z0-9
|
|
3127
|
-
message: "Only alphabets, numbers & special characters . & ' ( )
|
|
2996
|
+
regex: /^[A-Za-z0-9 \-.,&'()\/]*$/,
|
|
2997
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3128
2998
|
}, {
|
|
3129
2999
|
regex: /^[a-zA-Z]/,
|
|
3130
3000
|
message: 'Designation should start with alphabets'
|
|
@@ -4045,7 +3915,6 @@ var initialState$2 = {
|
|
|
4045
3915
|
previous: null,
|
|
4046
3916
|
results: []
|
|
4047
3917
|
},
|
|
4048
|
-
deptUsers: [],
|
|
4049
3918
|
loading: false
|
|
4050
3919
|
};
|
|
4051
3920
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4115,12 +3984,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4115
3984
|
loading: false
|
|
4116
3985
|
});
|
|
4117
3986
|
}
|
|
4118
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4119
|
-
{
|
|
4120
|
-
return _extends({}, state, {
|
|
4121
|
-
deptUsers: action.payload
|
|
4122
|
-
});
|
|
4123
|
-
}
|
|
4124
3987
|
default:
|
|
4125
3988
|
return state;
|
|
4126
3989
|
}
|
|
@@ -4899,7 +4762,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4899
4762
|
isILadmin = _useSelector2.isILadmin,
|
|
4900
4763
|
companyName = _useSelector2.companyName;
|
|
4901
4764
|
var history = useHistory();
|
|
4902
|
-
var location = useLocation();
|
|
4903
4765
|
var _useState = useState({
|
|
4904
4766
|
travel: false,
|
|
4905
4767
|
expense: false
|
|
@@ -4935,31 +4797,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4935
4797
|
}
|
|
4936
4798
|
setProductAccess(_productAccess);
|
|
4937
4799
|
};
|
|
4938
|
-
var _useState2 = useState(
|
|
4939
|
-
newCountryCode = _useState2[0],
|
|
4940
|
-
setNewCountryCode = _useState2[1];
|
|
4941
|
-
var _useState3 = useState(),
|
|
4942
|
-
countryDialCode = _useState3[0],
|
|
4943
|
-
setCountryDialCode = _useState3[1];
|
|
4944
|
-
var _useState4 = useState([]),
|
|
4945
|
-
countryContactCode = _useState4[0],
|
|
4946
|
-
setCountryContactCode = _useState4[1];
|
|
4947
|
-
useEffect(function () {
|
|
4948
|
-
var countryObject = countryContactCode.find(function (t) {
|
|
4949
|
-
return t.dial_code === countryDialCode;
|
|
4950
|
-
});
|
|
4951
|
-
if (countryObject) {
|
|
4952
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
4953
|
-
country_code: countryObject.code
|
|
4954
|
-
}));
|
|
4955
|
-
}
|
|
4956
|
-
}, [countryDialCode]);
|
|
4957
|
-
useEffect(function () {
|
|
4958
|
-
var extractedNumber = newCountryCode.substring(1);
|
|
4959
|
-
var convertedNumber = parseInt(extractedNumber);
|
|
4960
|
-
setCountryDialCode(convertedNumber);
|
|
4961
|
-
}, [newCountryCode]);
|
|
4962
|
-
var _useState5 = useState({
|
|
4800
|
+
var _useState2 = useState({
|
|
4963
4801
|
first_name: '',
|
|
4964
4802
|
last_name: '',
|
|
4965
4803
|
email: '',
|
|
@@ -4970,9 +4808,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4970
4808
|
contact_country_code: '',
|
|
4971
4809
|
profile_pic: []
|
|
4972
4810
|
}),
|
|
4973
|
-
personalInfoInput =
|
|
4974
|
-
setPersonalInfoInput =
|
|
4975
|
-
var
|
|
4811
|
+
personalInfoInput = _useState2[0],
|
|
4812
|
+
setPersonalInfoInput = _useState2[1];
|
|
4813
|
+
var _useState3 = useState({
|
|
4976
4814
|
emp_level: {
|
|
4977
4815
|
value: '',
|
|
4978
4816
|
label: 'Select employee level'
|
|
@@ -4992,72 +4830,62 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4992
4830
|
},
|
|
4993
4831
|
designation: '',
|
|
4994
4832
|
base_location: '',
|
|
4995
|
-
manager_id: {
|
|
4996
|
-
value: '',
|
|
4997
|
-
label: 'Select Manager'
|
|
4998
|
-
},
|
|
4999
|
-
skip_manager_id: {
|
|
5000
|
-
value: '',
|
|
5001
|
-
label: 'Select Manager'
|
|
5002
|
-
},
|
|
5003
4833
|
currency: {
|
|
5004
4834
|
value: defaultCurrency,
|
|
5005
4835
|
label: defaultCurrency
|
|
5006
4836
|
}
|
|
5007
4837
|
}),
|
|
5008
|
-
employeeInfoInput =
|
|
5009
|
-
setEmployeeInfoInput =
|
|
5010
|
-
var
|
|
4838
|
+
employeeInfoInput = _useState3[0],
|
|
4839
|
+
setEmployeeInfoInput = _useState3[1];
|
|
4840
|
+
var _useState4 = useState({
|
|
5011
4841
|
emp_level: 0,
|
|
5012
4842
|
entity: 0,
|
|
5013
4843
|
business_unit: 0,
|
|
5014
4844
|
department: 0,
|
|
5015
|
-
currency: 0
|
|
5016
|
-
manager_id: 0,
|
|
5017
|
-
skip_manager_id: 0
|
|
4845
|
+
currency: 0
|
|
5018
4846
|
}),
|
|
5019
|
-
cacheForAsyncDropdown =
|
|
5020
|
-
clearCacheForAsyncDropdown =
|
|
5021
|
-
var
|
|
5022
|
-
userTagType =
|
|
5023
|
-
setUserTagType =
|
|
5024
|
-
var
|
|
5025
|
-
scroll =
|
|
5026
|
-
setScroll =
|
|
5027
|
-
var
|
|
5028
|
-
customFieldsInput =
|
|
5029
|
-
setCustomFieldsInput =
|
|
5030
|
-
var
|
|
5031
|
-
travelRole =
|
|
5032
|
-
setTravelRole =
|
|
5033
|
-
var
|
|
5034
|
-
travelApproversInput =
|
|
5035
|
-
setTravelApproversInput =
|
|
5036
|
-
var
|
|
4847
|
+
cacheForAsyncDropdown = _useState4[0],
|
|
4848
|
+
clearCacheForAsyncDropdown = _useState4[1];
|
|
4849
|
+
var _useState5 = useState({}),
|
|
4850
|
+
userTagType = _useState5[0],
|
|
4851
|
+
setUserTagType = _useState5[1];
|
|
4852
|
+
var _useState6 = useState(false),
|
|
4853
|
+
scroll = _useState6[0],
|
|
4854
|
+
setScroll = _useState6[1];
|
|
4855
|
+
var _useState7 = useState({}),
|
|
4856
|
+
customFieldsInput = _useState7[0],
|
|
4857
|
+
setCustomFieldsInput = _useState7[1];
|
|
4858
|
+
var _useState8 = useState('traveler'),
|
|
4859
|
+
travelRole = _useState8[0],
|
|
4860
|
+
setTravelRole = _useState8[1];
|
|
4861
|
+
var _useState9 = useState({}),
|
|
4862
|
+
travelApproversInput = _useState9[0],
|
|
4863
|
+
setTravelApproversInput = _useState9[1];
|
|
4864
|
+
var _useState10 = useState({
|
|
5037
4865
|
value: '',
|
|
5038
4866
|
label: 'Select approver'
|
|
5039
4867
|
}),
|
|
5040
|
-
travelFYI =
|
|
5041
|
-
setTravelFYI =
|
|
5042
|
-
var
|
|
5043
|
-
membershipInfoInput =
|
|
5044
|
-
setMembershipInfoInput =
|
|
5045
|
-
var
|
|
5046
|
-
removedMembershipInfoInput =
|
|
5047
|
-
setRemovedMembershipInfoInput =
|
|
5048
|
-
var
|
|
4868
|
+
travelFYI = _useState10[0],
|
|
4869
|
+
setTravelFYI = _useState10[1];
|
|
4870
|
+
var _useState11 = useState([]),
|
|
4871
|
+
membershipInfoInput = _useState11[0],
|
|
4872
|
+
setMembershipInfoInput = _useState11[1];
|
|
4873
|
+
var _useState12 = useState([]),
|
|
4874
|
+
removedMembershipInfoInput = _useState12[0],
|
|
4875
|
+
setRemovedMembershipInfoInput = _useState12[1];
|
|
4876
|
+
var _useState13 = useState({
|
|
5049
4877
|
flight_seat_preference: '',
|
|
5050
4878
|
meal_preference: ''
|
|
5051
4879
|
}),
|
|
5052
|
-
travelPreferenceInfo =
|
|
5053
|
-
settravelPreferenceInfo =
|
|
5054
|
-
var
|
|
4880
|
+
travelPreferenceInfo = _useState13[0],
|
|
4881
|
+
settravelPreferenceInfo = _useState13[1];
|
|
4882
|
+
var _useState14 = useState({
|
|
5055
4883
|
trusted_traveller: '',
|
|
5056
4884
|
redress_number: ''
|
|
5057
4885
|
}),
|
|
5058
|
-
secureTravelInputInfo =
|
|
5059
|
-
setSecureTravelInputInfo =
|
|
5060
|
-
var
|
|
4886
|
+
secureTravelInputInfo = _useState14[0],
|
|
4887
|
+
setSecureTravelInputInfo = _useState14[1];
|
|
4888
|
+
var _useState15 = useState({
|
|
5061
4889
|
passport_issue_country: {
|
|
5062
4890
|
value: '',
|
|
5063
4891
|
label: 'Select country'
|
|
@@ -5072,39 +4900,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5072
4900
|
passport_photo: [],
|
|
5073
4901
|
travel_docs: []
|
|
5074
4902
|
}),
|
|
5075
|
-
passportInfoInput =
|
|
5076
|
-
setPassportInfoInput =
|
|
5077
|
-
var
|
|
5078
|
-
filesForDelete =
|
|
5079
|
-
setFilesForDelete =
|
|
5080
|
-
var
|
|
5081
|
-
profilePicDelete =
|
|
5082
|
-
setProfilePicDelete =
|
|
5083
|
-
var
|
|
5084
|
-
isAdditionalInfoExpanded =
|
|
5085
|
-
setAdditionalInfoFlag =
|
|
5086
|
-
var
|
|
5087
|
-
expenseRole =
|
|
5088
|
-
setExpenseRole =
|
|
5089
|
-
var
|
|
5090
|
-
expenseApproversInput =
|
|
5091
|
-
setExpenseApproversInput =
|
|
5092
|
-
var
|
|
4903
|
+
passportInfoInput = _useState15[0],
|
|
4904
|
+
setPassportInfoInput = _useState15[1];
|
|
4905
|
+
var _useState16 = useState([]),
|
|
4906
|
+
filesForDelete = _useState16[0],
|
|
4907
|
+
setFilesForDelete = _useState16[1];
|
|
4908
|
+
var _useState17 = useState([]),
|
|
4909
|
+
profilePicDelete = _useState17[0],
|
|
4910
|
+
setProfilePicDelete = _useState17[1];
|
|
4911
|
+
var _useState18 = useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
4912
|
+
isAdditionalInfoExpanded = _useState18[0],
|
|
4913
|
+
setAdditionalInfoFlag = _useState18[1];
|
|
4914
|
+
var _useState19 = useState('submitter'),
|
|
4915
|
+
expenseRole = _useState19[0],
|
|
4916
|
+
setExpenseRole = _useState19[1];
|
|
4917
|
+
var _useState20 = useState({}),
|
|
4918
|
+
expenseApproversInput = _useState20[0],
|
|
4919
|
+
setExpenseApproversInput = _useState20[1];
|
|
4920
|
+
var _useState21 = useState({
|
|
5093
4921
|
value: '',
|
|
5094
4922
|
label: 'Select approver'
|
|
5095
4923
|
}),
|
|
5096
|
-
expenseFYI =
|
|
5097
|
-
setExpenseFYI =
|
|
4924
|
+
expenseFYI = _useState21[0],
|
|
4925
|
+
setExpenseFYI = _useState21[1];
|
|
5098
4926
|
var asyncSelectRefs = useRef({
|
|
5099
4927
|
emp_level: useRef(null),
|
|
5100
4928
|
entity: useRef(null),
|
|
5101
4929
|
business_unit: useRef(null),
|
|
5102
4930
|
department: useRef(null)
|
|
5103
4931
|
});
|
|
5104
|
-
var
|
|
5105
|
-
errorArray =
|
|
5106
|
-
setErrorArray =
|
|
5107
|
-
var
|
|
4932
|
+
var _useState22 = useState([]),
|
|
4933
|
+
errorArray = _useState22[0],
|
|
4934
|
+
setErrorArray = _useState22[1];
|
|
4935
|
+
var _useState23 = useState({
|
|
5108
4936
|
first_name: '',
|
|
5109
4937
|
last_name: '',
|
|
5110
4938
|
email: '',
|
|
@@ -5134,9 +4962,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5134
4962
|
userTagType: '',
|
|
5135
4963
|
profile_pic: ''
|
|
5136
4964
|
}),
|
|
5137
|
-
errorMsgs =
|
|
5138
|
-
setErrorMsgs =
|
|
5139
|
-
var
|
|
4965
|
+
errorMsgs = _useState23[0],
|
|
4966
|
+
setErrorMsgs = _useState23[1];
|
|
4967
|
+
var _useState24 = useState({
|
|
5140
4968
|
first_name: false,
|
|
5141
4969
|
last_name: false,
|
|
5142
4970
|
email: false,
|
|
@@ -5163,14 +4991,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5163
4991
|
userTagType: false,
|
|
5164
4992
|
profile_pic: false
|
|
5165
4993
|
}),
|
|
5166
|
-
inputChangeLog =
|
|
5167
|
-
updateInputChangeLog =
|
|
5168
|
-
var
|
|
5169
|
-
uploadedFiles =
|
|
5170
|
-
setUploadedFiles =
|
|
5171
|
-
var _useState29 = useState(70),
|
|
5172
|
-
maxLengthForModal = _useState29[0],
|
|
5173
|
-
setMaxLengthForModal = _useState29[1];
|
|
4994
|
+
inputChangeLog = _useState24[0],
|
|
4995
|
+
updateInputChangeLog = _useState24[1];
|
|
4996
|
+
var _useState25 = useState([]),
|
|
4997
|
+
uploadedFiles = _useState25[0],
|
|
4998
|
+
setUploadedFiles = _useState25[1];
|
|
5174
4999
|
var defaultAddModalData = {
|
|
5175
5000
|
isOpen: false,
|
|
5176
5001
|
isError: false,
|
|
@@ -5183,41 +5008,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5183
5008
|
regexOnBlur: null,
|
|
5184
5009
|
maxLimit: '',
|
|
5185
5010
|
minLimit: '',
|
|
5186
|
-
maxLength:
|
|
5011
|
+
maxLength: 70,
|
|
5187
5012
|
minLength: 0
|
|
5188
5013
|
};
|
|
5189
|
-
var
|
|
5190
|
-
addModalData =
|
|
5191
|
-
setAddModalData =
|
|
5014
|
+
var _useState26 = useState(defaultAddModalData),
|
|
5015
|
+
addModalData = _useState26[0],
|
|
5016
|
+
setAddModalData = _useState26[1];
|
|
5192
5017
|
var onAddModalClose = function onAddModalClose() {
|
|
5193
5018
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5194
5019
|
};
|
|
5195
|
-
useEffect(function () {
|
|
5196
|
-
var _location$state, _location$state2;
|
|
5197
|
-
if (location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.id && location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.name) {
|
|
5198
|
-
var _location$state3, _location$state4;
|
|
5199
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5200
|
-
department: {
|
|
5201
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5202
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5203
|
-
}
|
|
5204
|
-
}));
|
|
5205
|
-
}
|
|
5206
|
-
}, []);
|
|
5207
5020
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5208
5021
|
var title = '';
|
|
5209
5022
|
if (id === 'entity') {
|
|
5210
5023
|
title = 'Entity';
|
|
5211
|
-
setMaxLengthForModal(70);
|
|
5212
5024
|
} else if (id === 'department') {
|
|
5213
5025
|
title = 'Department';
|
|
5214
|
-
setMaxLengthForModal(70);
|
|
5215
5026
|
} else if (id === 'business_unit') {
|
|
5216
|
-
setMaxLengthForModal(150);
|
|
5217
5027
|
title = 'Business unit';
|
|
5218
5028
|
} else if (id === 'employee_level') {
|
|
5219
5029
|
title = 'Employee level';
|
|
5220
|
-
setMaxLengthForModal(70);
|
|
5221
5030
|
}
|
|
5222
5031
|
setAddModalData(_extends({}, addModalData, {
|
|
5223
5032
|
isOpen: true,
|
|
@@ -5233,42 +5042,24 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5233
5042
|
}));
|
|
5234
5043
|
} else {
|
|
5235
5044
|
dispatch(showLoader());
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
department_head_id: null
|
|
5241
|
-
};
|
|
5242
|
-
} else {
|
|
5243
|
-
dataObj = {
|
|
5244
|
-
names: [validatedValue]
|
|
5245
|
-
};
|
|
5246
|
-
}
|
|
5247
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5248
|
-
var _extends4;
|
|
5045
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5046
|
+
names: [validatedValue]
|
|
5047
|
+
})).then(function (res) {
|
|
5048
|
+
var _extends2, _extends3;
|
|
5249
5049
|
setAddModalData(_extends({}, addModalData, {
|
|
5250
5050
|
isOpen: false
|
|
5251
5051
|
}));
|
|
5252
5052
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5253
5053
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
}, _extends2)));
|
|
5260
|
-
} else {
|
|
5261
|
-
var _extends3;
|
|
5262
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5263
|
-
value: res.data.value,
|
|
5264
|
-
label: res.data.label
|
|
5265
|
-
}, _extends3)));
|
|
5266
|
-
}
|
|
5267
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5054
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5055
|
+
value: res.data.value,
|
|
5056
|
+
label: res.data.label
|
|
5057
|
+
}, _extends2)));
|
|
5058
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends3 = {}, _extends3[tempKey] = true, _extends3)));
|
|
5268
5059
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5269
5060
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5270
|
-
var
|
|
5271
|
-
return _extends({}, prevState, (
|
|
5061
|
+
var _extends4;
|
|
5062
|
+
return _extends({}, prevState, (_extends4 = {}, _extends4[tempKey] = prevState[tempKey] + 1, _extends4));
|
|
5272
5063
|
});
|
|
5273
5064
|
dispatch(stopLoader());
|
|
5274
5065
|
});
|
|
@@ -5285,10 +5076,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5285
5076
|
};
|
|
5286
5077
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5287
5078
|
try {
|
|
5288
|
-
var
|
|
5079
|
+
var _temp6 = function _temp6() {
|
|
5289
5080
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5290
|
-
var
|
|
5291
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5081
|
+
var _extends5;
|
|
5082
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends5 = {}, _extends5[_name] = true, _extends5)));
|
|
5292
5083
|
}
|
|
5293
5084
|
};
|
|
5294
5085
|
var _name = args._name,
|
|
@@ -5299,7 +5090,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5299
5090
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5300
5091
|
_args$_obj = args._obj,
|
|
5301
5092
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5302
|
-
var
|
|
5093
|
+
var _temp7 = function () {
|
|
5303
5094
|
if (_name === 'contact_number') {
|
|
5304
5095
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5305
5096
|
contact_number: _value.trim(),
|
|
@@ -5310,14 +5101,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5310
5101
|
updateError('country_code', _isError, _errorMsg);
|
|
5311
5102
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5312
5103
|
} else {
|
|
5313
|
-
var
|
|
5314
|
-
var
|
|
5315
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5104
|
+
var _temp8 = function _temp8() {
|
|
5105
|
+
var _extends6;
|
|
5106
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5316
5107
|
updateError(_name, _isError, _errorMsg);
|
|
5317
5108
|
};
|
|
5318
|
-
var
|
|
5109
|
+
var _temp9 = function () {
|
|
5319
5110
|
if (_name === 'profile_pic') {
|
|
5320
|
-
var
|
|
5111
|
+
var _temp10 = function () {
|
|
5321
5112
|
if (_obj.isUpload) {
|
|
5322
5113
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5323
5114
|
_value = _value.map(function (_val) {
|
|
@@ -5348,28 +5139,32 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5348
5139
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5349
5140
|
}
|
|
5350
5141
|
}();
|
|
5351
|
-
if (
|
|
5142
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5352
5143
|
}
|
|
5353
5144
|
}();
|
|
5354
|
-
return
|
|
5145
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5355
5146
|
}
|
|
5356
5147
|
}();
|
|
5357
|
-
return Promise.resolve(
|
|
5148
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5358
5149
|
} catch (e) {
|
|
5359
5150
|
return Promise.reject(e);
|
|
5360
5151
|
}
|
|
5361
5152
|
};
|
|
5362
5153
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5363
|
-
var
|
|
5154
|
+
var _extends7;
|
|
5364
5155
|
var _name = args._name,
|
|
5365
5156
|
_value = args._value,
|
|
5366
5157
|
_isError = args._isError,
|
|
5367
5158
|
_errorMsg = args._errorMsg;
|
|
5368
|
-
|
|
5159
|
+
console.log({
|
|
5160
|
+
_name: _name,
|
|
5161
|
+
_value: _value
|
|
5162
|
+
});
|
|
5163
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5369
5164
|
updateError(_name, _isError, _errorMsg);
|
|
5370
5165
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5371
|
-
var
|
|
5372
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5166
|
+
var _extends8;
|
|
5167
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends8 = {}, _extends8[_name] = true, _extends8)));
|
|
5373
5168
|
}
|
|
5374
5169
|
};
|
|
5375
5170
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5379,9 +5174,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5379
5174
|
return tag.id;
|
|
5380
5175
|
};
|
|
5381
5176
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5382
|
-
var
|
|
5177
|
+
var _extends9;
|
|
5383
5178
|
var e = args._event;
|
|
5384
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5179
|
+
setUserTagType(_extends({}, userTagType, (_extends9 = {}, _extends9[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends9)));
|
|
5385
5180
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5386
5181
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5387
5182
|
userTagType: true
|
|
@@ -5389,22 +5184,22 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5389
5184
|
}
|
|
5390
5185
|
};
|
|
5391
5186
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5392
|
-
var
|
|
5187
|
+
var _extends10;
|
|
5393
5188
|
var _name = _ref2._name,
|
|
5394
5189
|
_value = _ref2._value;
|
|
5395
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5190
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5396
5191
|
};
|
|
5397
5192
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5398
|
-
var
|
|
5193
|
+
var _extends11;
|
|
5399
5194
|
var _name = _ref3._name,
|
|
5400
5195
|
_value = _ref3._value;
|
|
5401
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (
|
|
5196
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5402
5197
|
};
|
|
5403
5198
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5404
|
-
var
|
|
5199
|
+
var _extends12;
|
|
5405
5200
|
var _name = _ref4._name,
|
|
5406
5201
|
_value = _ref4._value;
|
|
5407
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5202
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5408
5203
|
};
|
|
5409
5204
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5410
5205
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5438,39 +5233,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5438
5233
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5439
5234
|
};
|
|
5440
5235
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5441
|
-
var
|
|
5236
|
+
var _extends13;
|
|
5442
5237
|
var _name = args._name,
|
|
5443
5238
|
_value = args._value,
|
|
5444
5239
|
_isError = args._isError,
|
|
5445
5240
|
_errorMsg = args._errorMsg;
|
|
5446
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5241
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5447
5242
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5448
|
-
var
|
|
5449
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5243
|
+
var _extends14;
|
|
5244
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends14 = {}, _extends14[_name] = true, _extends14)));
|
|
5450
5245
|
}
|
|
5451
5246
|
updateError(_name, _isError, _errorMsg);
|
|
5452
5247
|
};
|
|
5453
5248
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5454
|
-
var
|
|
5249
|
+
var _extends15;
|
|
5455
5250
|
var _name = args._name,
|
|
5456
5251
|
_value = args._value,
|
|
5457
5252
|
_isError = args._isError,
|
|
5458
5253
|
_errorMsg = args._errorMsg;
|
|
5459
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5254
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends15 = {}, _extends15[_name] = _value, _extends15)));
|
|
5460
5255
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5461
|
-
var
|
|
5462
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5256
|
+
var _extends16;
|
|
5257
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends16 = {}, _extends16[_name] = true, _extends16)));
|
|
5463
5258
|
}
|
|
5464
5259
|
updateError(_name, _isError, _errorMsg);
|
|
5465
5260
|
};
|
|
5466
5261
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5467
5262
|
try {
|
|
5468
|
-
var
|
|
5469
|
-
var
|
|
5470
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5263
|
+
var _temp14 = function _temp14() {
|
|
5264
|
+
var _extends17;
|
|
5265
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends17 = {}, _extends17[_name] = _value, _extends17)));
|
|
5471
5266
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5472
|
-
var
|
|
5473
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5267
|
+
var _extends18;
|
|
5268
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends18 = {}, _extends18[_name] = true, _extends18)));
|
|
5474
5269
|
}
|
|
5475
5270
|
updateError(_name, _isError, _errorMsg);
|
|
5476
5271
|
};
|
|
@@ -5508,9 +5303,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5508
5303
|
}
|
|
5509
5304
|
return Promise.resolve();
|
|
5510
5305
|
}
|
|
5511
|
-
var
|
|
5306
|
+
var _temp15 = function () {
|
|
5512
5307
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5513
|
-
var
|
|
5308
|
+
var _temp16 = function () {
|
|
5514
5309
|
if (_obj.isUpload) {
|
|
5515
5310
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5516
5311
|
if (_name === 'passport_photo') {
|
|
@@ -5554,10 +5349,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5554
5349
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5555
5350
|
}
|
|
5556
5351
|
}();
|
|
5557
|
-
if (
|
|
5352
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5558
5353
|
}
|
|
5559
5354
|
}();
|
|
5560
|
-
return Promise.resolve(
|
|
5355
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5561
5356
|
} catch (e) {
|
|
5562
5357
|
return Promise.reject(e);
|
|
5563
5358
|
}
|
|
@@ -5576,8 +5371,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5576
5371
|
return _errorArray;
|
|
5577
5372
|
});
|
|
5578
5373
|
setErrorMsgs(function (prevState) {
|
|
5579
|
-
var
|
|
5580
|
-
return _extends({}, prevState, (
|
|
5374
|
+
var _extends19;
|
|
5375
|
+
return _extends({}, prevState, (_extends19 = {}, _extends19[_name] = _errorMsg, _extends19));
|
|
5581
5376
|
});
|
|
5582
5377
|
};
|
|
5583
5378
|
var dispatch = useDispatch();
|
|
@@ -5609,7 +5404,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5609
5404
|
}
|
|
5610
5405
|
}));
|
|
5611
5406
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
5612
|
-
setCountryContactCode(_res);
|
|
5613
5407
|
if (isEditMode) {
|
|
5614
5408
|
if (!isProfile && !editUserId) return false;
|
|
5615
5409
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -5652,20 +5446,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5652
5446
|
value: '',
|
|
5653
5447
|
label: 'Select employee level'
|
|
5654
5448
|
},
|
|
5655
|
-
manager_id: res.employee_info.manager ? {
|
|
5656
|
-
value: res.employee_info.manager,
|
|
5657
|
-
label: res.employee_info.manager
|
|
5658
|
-
} : {
|
|
5659
|
-
value: '',
|
|
5660
|
-
label: 'Select Manager'
|
|
5661
|
-
},
|
|
5662
|
-
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5663
|
-
value: res.employee_info.skip_manager,
|
|
5664
|
-
label: res.employee_info.skip_manager
|
|
5665
|
-
} : {
|
|
5666
|
-
value: '',
|
|
5667
|
-
label: 'Select Manager'
|
|
5668
|
-
},
|
|
5669
5449
|
employee_id: res.employee_info.employee_id || '',
|
|
5670
5450
|
entity: res.employee_info.entity ? {
|
|
5671
5451
|
value: res.employee_info.entity.id,
|
|
@@ -5898,7 +5678,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5898
5678
|
}, [renderFields.expenseApprovers]);
|
|
5899
5679
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5900
5680
|
try {
|
|
5901
|
-
var
|
|
5681
|
+
var _temp19 = function _temp19() {
|
|
5902
5682
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5903
5683
|
dispatch(stopLoader());
|
|
5904
5684
|
return data;
|
|
@@ -5914,12 +5694,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5914
5694
|
userID: editUserId
|
|
5915
5695
|
});
|
|
5916
5696
|
});
|
|
5917
|
-
var
|
|
5697
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
5918
5698
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5919
5699
|
data.push(res);
|
|
5920
5700
|
});
|
|
5921
5701
|
});
|
|
5922
|
-
return Promise.resolve(
|
|
5702
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
5923
5703
|
} catch (e) {
|
|
5924
5704
|
return Promise.reject(e);
|
|
5925
5705
|
}
|
|
@@ -5931,12 +5711,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5931
5711
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5932
5712
|
return Promise.resolve();
|
|
5933
5713
|
}
|
|
5934
|
-
if (employeeInfoInput.manager_id.value !== '') {
|
|
5935
|
-
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5936
|
-
}
|
|
5937
|
-
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5938
|
-
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5939
|
-
}
|
|
5940
5714
|
var payload = {
|
|
5941
5715
|
personalInfoInput: personalInfoInput,
|
|
5942
5716
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6081,59 +5855,60 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6081
5855
|
if (_isError) {
|
|
6082
5856
|
setErrorArray(_errorArray);
|
|
6083
5857
|
setErrorMsgs(_errorMsgs);
|
|
6084
|
-
var
|
|
5858
|
+
for (var _key3 in _errorMsgs) {
|
|
6085
5859
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6086
5860
|
if (_errorMsgs[_key3]) {
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
5861
|
+
var _ret = function () {
|
|
5862
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5863
|
+
setAdditionalInfoFlag('open');
|
|
5864
|
+
}
|
|
5865
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5866
|
+
if (el) {
|
|
5867
|
+
setTimeout(function () {
|
|
5868
|
+
el.scrollIntoView({
|
|
5869
|
+
behavior: 'smooth',
|
|
5870
|
+
block: 'center'
|
|
5871
|
+
});
|
|
5872
|
+
}, 500);
|
|
5873
|
+
return "break";
|
|
5874
|
+
}
|
|
5875
|
+
}();
|
|
5876
|
+
if (_ret === "break") break;
|
|
6100
5877
|
}
|
|
6101
5878
|
}
|
|
6102
|
-
};
|
|
6103
|
-
for (var _key3 in _errorMsgs) {
|
|
6104
|
-
if (_loop()) break;
|
|
6105
5879
|
}
|
|
5880
|
+
return Promise.resolve();
|
|
6106
5881
|
}
|
|
6107
|
-
if (
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
5882
|
+
if (isEditMode && editUserId || isProfile) {
|
|
5883
|
+
dispatch(showLoader());
|
|
5884
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5885
|
+
if (isProfile) {
|
|
5886
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5887
|
+
(config === null || config === void 0 ? void 0 : (_config$routes = config.routes) === null || _config$routes === void 0 ? void 0 : (_config$routes$profil = _config$routes.profile) === null || _config$routes$profil === void 0 ? void 0 : (_config$routes$profil2 = _config$routes$profil.redirectUrl) === null || _config$routes$profil2 === void 0 ? void 0 : _config$routes$profil2.submit) && history.push(config.routes.profile.redirectUrl.submit);
|
|
5888
|
+
} else {
|
|
5889
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5890
|
+
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
5891
|
+
}
|
|
5892
|
+
setFilesForDelete([]);
|
|
5893
|
+
setProfilePicDelete([]);
|
|
5894
|
+
})["catch"](function (err) {
|
|
5895
|
+
if (typeof err === 'object') {
|
|
5896
|
+
if (err.country_code) {
|
|
5897
|
+
err.contact_number = err.country_code;
|
|
6117
5898
|
}
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
if (
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
if (err
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
}
|
|
6132
|
-
setErrorArray(Object.keys(err));
|
|
6133
|
-
setErrorMsgs(err);
|
|
6134
|
-
var _loop2 = function _loop2() {
|
|
6135
|
-
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6136
|
-
if (err[_key4]) {
|
|
5899
|
+
if (err.contact_country_code) {
|
|
5900
|
+
err.contact_number = err.contact_country_code;
|
|
5901
|
+
}
|
|
5902
|
+
if (err.passport) {
|
|
5903
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5904
|
+
delete err.passport;
|
|
5905
|
+
}
|
|
5906
|
+
setErrorArray(Object.keys(err));
|
|
5907
|
+
setErrorMsgs(err);
|
|
5908
|
+
for (var _key4 in err) {
|
|
5909
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5910
|
+
if (err[_key4]) {
|
|
5911
|
+
var _ret2 = function () {
|
|
6137
5912
|
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6138
5913
|
setAdditionalInfoFlag('open');
|
|
6139
5914
|
}
|
|
@@ -6145,44 +5920,44 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6145
5920
|
block: 'center'
|
|
6146
5921
|
});
|
|
6147
5922
|
}, 500);
|
|
6148
|
-
return
|
|
5923
|
+
return "break";
|
|
6149
5924
|
}
|
|
6150
|
-
}
|
|
5925
|
+
}();
|
|
5926
|
+
if (_ret2 === "break") break;
|
|
6151
5927
|
}
|
|
6152
|
-
};
|
|
6153
|
-
for (var _key4 in err) {
|
|
6154
|
-
if (_loop2()) break;
|
|
6155
5928
|
}
|
|
6156
|
-
} else if (typeof err === 'string') {
|
|
6157
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6158
|
-
} else {
|
|
6159
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6160
5929
|
}
|
|
6161
|
-
}
|
|
6162
|
-
|
|
6163
|
-
}
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
5930
|
+
} else if (typeof err === 'string') {
|
|
5931
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5932
|
+
} else {
|
|
5933
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5934
|
+
}
|
|
5935
|
+
})["finally"](function () {
|
|
5936
|
+
dispatch(stopLoader());
|
|
5937
|
+
});
|
|
5938
|
+
} else {
|
|
5939
|
+
dispatch(showLoader());
|
|
5940
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
5941
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5942
|
+
(config === null || config === void 0 ? void 0 : (_config$routes3 = config.routes) === null || _config$routes3 === void 0 ? void 0 : (_config$routes3$users = _config$routes3.users) === null || _config$routes3$users === void 0 ? void 0 : (_config$routes3$users2 = _config$routes3$users.list) === null || _config$routes3$users2 === void 0 ? void 0 : _config$routes3$users2.path) && history.push(config.routes.users.list.path);
|
|
5943
|
+
})["catch"](function (err) {
|
|
5944
|
+
if (typeof err === 'object') {
|
|
5945
|
+
if (err.country_code) {
|
|
5946
|
+
err.contact_number = err.country_code;
|
|
5947
|
+
}
|
|
5948
|
+
if (err.contact_country_code) {
|
|
5949
|
+
err.contact_number = err.contact_country_code;
|
|
5950
|
+
}
|
|
5951
|
+
if (err.passport) {
|
|
5952
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5953
|
+
delete err.passport;
|
|
5954
|
+
}
|
|
5955
|
+
setErrorArray(Object.keys(err));
|
|
5956
|
+
setErrorMsgs(err);
|
|
5957
|
+
for (var _key5 in err) {
|
|
5958
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
5959
|
+
if (err[_key5]) {
|
|
5960
|
+
var _ret3 = function () {
|
|
6186
5961
|
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6187
5962
|
setAdditionalInfoFlag('open');
|
|
6188
5963
|
}
|
|
@@ -6194,23 +5969,21 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6194
5969
|
block: 'center'
|
|
6195
5970
|
});
|
|
6196
5971
|
}, 500);
|
|
6197
|
-
return
|
|
5972
|
+
return "break";
|
|
6198
5973
|
}
|
|
6199
|
-
}
|
|
5974
|
+
}();
|
|
5975
|
+
if (_ret3 === "break") break;
|
|
6200
5976
|
}
|
|
6201
|
-
};
|
|
6202
|
-
for (var _key5 in err) {
|
|
6203
|
-
if (_loop3()) break;
|
|
6204
5977
|
}
|
|
6205
|
-
} else if (typeof err === 'string') {
|
|
6206
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6207
|
-
} else {
|
|
6208
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6209
5978
|
}
|
|
6210
|
-
}
|
|
6211
|
-
|
|
6212
|
-
}
|
|
6213
|
-
|
|
5979
|
+
} else if (typeof err === 'string') {
|
|
5980
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5981
|
+
} else {
|
|
5982
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5983
|
+
}
|
|
5984
|
+
})["finally"](function () {
|
|
5985
|
+
dispatch(stopLoader());
|
|
5986
|
+
});
|
|
6214
5987
|
}
|
|
6215
5988
|
return Promise.resolve();
|
|
6216
5989
|
} catch (e) {
|
|
@@ -6248,13 +6021,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6248
6021
|
if (verifyUserId) {
|
|
6249
6022
|
dispatch(showLoader());
|
|
6250
6023
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6251
|
-
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6252
6024
|
setPersonalInfoInput(function (prevState) {
|
|
6253
6025
|
return _extends({}, prevState, {
|
|
6254
|
-
first_name: res.
|
|
6255
|
-
last_name: res.
|
|
6026
|
+
first_name: res.fname,
|
|
6027
|
+
last_name: res.lname,
|
|
6256
6028
|
email: res.email,
|
|
6257
|
-
contact_number: res
|
|
6029
|
+
contact_number: res.phone,
|
|
6030
|
+
dob: function () {
|
|
6031
|
+
var dt = new Date(res.dob);
|
|
6032
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6033
|
+
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6034
|
+
}(),
|
|
6258
6035
|
gender: function () {
|
|
6259
6036
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6260
6037
|
}()
|
|
@@ -6921,7 +6698,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6921
6698
|
};
|
|
6922
6699
|
};
|
|
6923
6700
|
|
|
6924
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","
|
|
6701
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","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_","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","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6925
6702
|
|
|
6926
6703
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6927
6704
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6990,7 +6767,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6990
6767
|
file: doc
|
|
6991
6768
|
});
|
|
6992
6769
|
});
|
|
6993
|
-
var
|
|
6770
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
6994
6771
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6995
6772
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6996
6773
|
if (validatedRes.data.status) {
|
|
@@ -7030,7 +6807,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7030
6807
|
})).then(function () {});
|
|
7031
6808
|
});
|
|
7032
6809
|
});
|
|
7033
|
-
return Promise.resolve(
|
|
6810
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7034
6811
|
} catch (e) {
|
|
7035
6812
|
return Promise.reject(e);
|
|
7036
6813
|
}
|
|
@@ -8344,10 +8121,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8344
8121
|
selected = props.selected,
|
|
8345
8122
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8346
8123
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8347
|
-
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8348
|
-
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8349
|
-
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8350
|
-
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8351
8124
|
orderBy = props.orderBy,
|
|
8352
8125
|
order = props.order,
|
|
8353
8126
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8365,21 +8138,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8365
8138
|
searchValue = props.searchValue,
|
|
8366
8139
|
_props$isILadmin = props.isILadmin,
|
|
8367
8140
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8368
|
-
var useStyles = makeStyles(function (theme) {
|
|
8369
|
-
return {
|
|
8370
|
-
tooltip: {
|
|
8371
|
-
background: '#1F2937',
|
|
8372
|
-
fontSize: '14px',
|
|
8373
|
-
color: '#ffffff',
|
|
8374
|
-
padding: '12px 16px',
|
|
8375
|
-
borderRadius: '6px'
|
|
8376
|
-
},
|
|
8377
|
-
arrow: {
|
|
8378
|
-
color: '#1F2937'
|
|
8379
|
-
}
|
|
8380
|
-
};
|
|
8381
|
-
});
|
|
8382
|
-
var classes = useStyles();
|
|
8383
8141
|
var columns = [{
|
|
8384
8142
|
id: 'first_name',
|
|
8385
8143
|
label: 'Name',
|
|
@@ -8399,27 +8157,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8399
8157
|
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
|
|
8400
8158
|
}));
|
|
8401
8159
|
}
|
|
8402
|
-
}, {
|
|
8403
|
-
id: 'first_name',
|
|
8404
|
-
label: '',
|
|
8405
|
-
minWidth: 60,
|
|
8406
|
-
sortable: false,
|
|
8407
|
-
cell: function cell(row) {
|
|
8408
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8409
|
-
component: "div",
|
|
8410
|
-
width: 80
|
|
8411
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8412
|
-
title: "This user hasn't logged in to the platform yet",
|
|
8413
|
-
arrow: true,
|
|
8414
|
-
classes: {
|
|
8415
|
-
arrow: classes.arrow,
|
|
8416
|
-
tooltip: classes.tooltip
|
|
8417
|
-
},
|
|
8418
|
-
placement: "top-start"
|
|
8419
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
8420
|
-
className: clsx(styles$5.tooltipTextDiv)
|
|
8421
|
-
}, "Invited")) : null);
|
|
8422
|
-
}
|
|
8423
8160
|
}, {
|
|
8424
8161
|
id: 'emp_info__department__name',
|
|
8425
8162
|
label: 'Department',
|
|
@@ -8507,21 +8244,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8507
8244
|
return onEditHandler(row.id);
|
|
8508
8245
|
}
|
|
8509
8246
|
}];
|
|
8510
|
-
if (row && row.has_visited && row.is_active) {
|
|
8511
|
-
options.push({
|
|
8512
|
-
label: 'Reset password',
|
|
8513
|
-
handler: function handler() {
|
|
8514
|
-
return onResetPasswordHandler(row.email);
|
|
8515
|
-
}
|
|
8516
|
-
});
|
|
8517
|
-
} else if (row && row.is_active) {
|
|
8518
|
-
options.push({
|
|
8519
|
-
label: 'Resend invite',
|
|
8520
|
-
handler: function handler() {
|
|
8521
|
-
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8522
|
-
}
|
|
8523
|
-
});
|
|
8524
|
-
}
|
|
8525
8247
|
if (isILadmin) {
|
|
8526
8248
|
options.push({
|
|
8527
8249
|
label: 'Make primary admin',
|
|
@@ -8545,7 +8267,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8545
8267
|
endIcon: null,
|
|
8546
8268
|
outlinedBtn: false,
|
|
8547
8269
|
className: "threedotMenuBtn",
|
|
8548
|
-
MoreHorizIcon: true,
|
|
8549
8270
|
placement: "bottom-end"
|
|
8550
8271
|
}));
|
|
8551
8272
|
},
|
|
@@ -8575,8 +8296,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8575
8296
|
isDataFetching: isDataFetching,
|
|
8576
8297
|
disableRowCheckbox: disableRowCheckbox,
|
|
8577
8298
|
searchBoxWidth: "400px",
|
|
8578
|
-
searchValue: searchValue
|
|
8579
|
-
hideTopPagination: false
|
|
8299
|
+
searchValue: searchValue
|
|
8580
8300
|
});
|
|
8581
8301
|
};
|
|
8582
8302
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8608,17 +8328,17 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8608
8328
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8609
8329
|
};
|
|
8610
8330
|
var columns = [{
|
|
8611
|
-
id: '
|
|
8331
|
+
id: 'fname',
|
|
8612
8332
|
label: 'Name',
|
|
8613
8333
|
minWidth: 250,
|
|
8614
8334
|
sortable: true,
|
|
8615
8335
|
cell: function cell(row) {
|
|
8616
8336
|
var _row$profile_pic2;
|
|
8617
8337
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8618
|
-
firstName: row.
|
|
8619
|
-
lastName: row.
|
|
8338
|
+
firstName: row.fname,
|
|
8339
|
+
lastName: row.lname,
|
|
8620
8340
|
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8621
|
-
primaryText: row.
|
|
8341
|
+
primaryText: row.fname + ' ' + row.lname,
|
|
8622
8342
|
secondaryText: row.email,
|
|
8623
8343
|
letterAvatarTextColor: "black",
|
|
8624
8344
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -8627,7 +8347,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8627
8347
|
}));
|
|
8628
8348
|
}
|
|
8629
8349
|
}, {
|
|
8630
|
-
id: '
|
|
8350
|
+
id: 'created',
|
|
8631
8351
|
label: 'Requested on',
|
|
8632
8352
|
minWidth: 100,
|
|
8633
8353
|
sortable: true,
|
|
@@ -8637,7 +8357,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8637
8357
|
width: 100
|
|
8638
8358
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8639
8359
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8640
|
-
}, formatDate(row.
|
|
8360
|
+
}, formatDate(row.created)));
|
|
8641
8361
|
}
|
|
8642
8362
|
}, {
|
|
8643
8363
|
id: 'actions',
|
|
@@ -8691,61 +8411,8 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8691
8411
|
});
|
|
8692
8412
|
};
|
|
8693
8413
|
|
|
8694
|
-
function InfoYellowIcon(props) {
|
|
8695
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8696
|
-
width: props.width,
|
|
8697
|
-
height: props.height,
|
|
8698
|
-
viewBox: "0 0 20 20",
|
|
8699
|
-
fill: "none",
|
|
8700
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8701
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8702
|
-
d: "M11 4.99951C11 5.5518 10.5523 5.99951 10 5.99951C9.44771 5.99951 9 5.5518 9 4.99951C9 4.44723 9.44771 3.99951 10 3.99951C10.5523 3.99951 11 4.44723 11 4.99951Z",
|
|
8703
|
-
fill: "#CA8A04"
|
|
8704
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8705
|
-
d: "M8 7.99951C7.44772 7.99951 7 8.44723 7 8.99951C7 9.5518 7.44772 9.99951 8 9.99951H9V12.9995H8C7.44772 12.9995 7 13.4472 7 13.9995C7 14.5518 7.44772 14.9995 8 14.9995H12C12.5523 14.9995 13 14.5518 13 13.9995C13 13.4472 12.5523 12.9995 12 12.9995H11V8.99951C11 8.44723 10.5523 7.99951 10 7.99951H8Z",
|
|
8706
|
-
fill: "#CA8A04"
|
|
8707
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8708
|
-
d: "M0 9.99951C0 15.5224 4.47715 19.9995 10 19.9995C15.5228 19.9995 20 15.5224 20 9.99951C20 4.47666 15.5228 -0.000488281 10 -0.000488281C4.47715 -0.000488281 0 4.47666 0 9.99951ZM10 1.99951C14.4183 1.99951 18 5.58123 18 9.99951C18 14.4178 14.4183 17.9995 10 17.9995C5.58172 17.9995 2 14.4178 2 9.99951C2 5.58123 5.58172 1.99951 10 1.99951Z",
|
|
8709
|
-
fill: "#CA8A04"
|
|
8710
|
-
}));
|
|
8711
|
-
}
|
|
8712
|
-
|
|
8713
|
-
function RedWarningIcon(props) {
|
|
8714
|
-
var _props$color = props.color,
|
|
8715
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8716
|
-
_props$size = props.size,
|
|
8717
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
8718
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8719
|
-
width: size,
|
|
8720
|
-
height: size,
|
|
8721
|
-
viewBox: "0 0 14 14",
|
|
8722
|
-
fill: color,
|
|
8723
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8724
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8725
|
-
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM6 4C6 3.44772 6.44772 3 7 3C7.55229 3 8 3.44772 8 4V6C8 6.55229 7.55229 7 7 7C6.44772 7 6 6.55229 6 6V4ZM6 10C6 9.44771 6.44772 9 7 9C7.55229 9 8 9.44771 8 10C8 10.5523 7.55229 11 7 11C6.44772 11 6 10.5523 6 10Z",
|
|
8726
|
-
fill: color
|
|
8727
|
-
}));
|
|
8728
|
-
}
|
|
8729
|
-
|
|
8730
|
-
function InviteInfoIcon() {
|
|
8731
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8732
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8733
|
-
width: "20",
|
|
8734
|
-
height: "20",
|
|
8735
|
-
fill: "none",
|
|
8736
|
-
viewBox: "0 0 20 20"
|
|
8737
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8738
|
-
fill: "#CA8A04",
|
|
8739
|
-
d: "M11 5a1 1 0 11-2 0 1 1 0 012 0zM8 8a1 1 0 000 2h1v3H8a1 1 0 100 2h4a1 1 0 100-2h-1V9a1 1 0 00-1-1H8z"
|
|
8740
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8741
|
-
fill: "#CA8A04",
|
|
8742
|
-
d: "M0 10c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10S0 4.477 0 10zm10-8a8 8 0 110 16 8 8 0 010-16z"
|
|
8743
|
-
}));
|
|
8744
|
-
}
|
|
8745
|
-
|
|
8746
8414
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8747
|
-
var env$7 = configs.env
|
|
8748
|
-
api$7 = configs.api;
|
|
8415
|
+
var env$7 = configs.env;
|
|
8749
8416
|
var UndoButton = function UndoButton(_ref) {
|
|
8750
8417
|
var onUndo = _ref.onUndo,
|
|
8751
8418
|
msg = _ref.msg;
|
|
@@ -8783,49 +8450,27 @@ var UserList = function UserList(_ref2) {
|
|
|
8783
8450
|
isDataFetching = _useSelector.isDataFetching,
|
|
8784
8451
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8785
8452
|
tabValue = _useSelector.tabValue;
|
|
8786
|
-
var
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8453
|
+
var _React$useState = React.useState(1),
|
|
8454
|
+
page = _React$useState[0],
|
|
8455
|
+
setPage = _React$useState[1];
|
|
8456
|
+
var _useState = useState(5),
|
|
8457
|
+
rowsPerPage = _useState[0],
|
|
8458
|
+
setRowsPerPage = _useState[1];
|
|
8459
|
+
var _React$useState2 = React.useState({}),
|
|
8460
|
+
selected = _React$useState2[0],
|
|
8461
|
+
setSelected = _React$useState2[1];
|
|
8462
|
+
var _React$useState3 = React.useState('asc'),
|
|
8463
|
+
order = _React$useState3[0],
|
|
8464
|
+
setOrder = _React$useState3[1];
|
|
8465
|
+
var _React$useState4 = React.useState('first_name'),
|
|
8466
|
+
orderBy = _React$useState4[0],
|
|
8467
|
+
setOrderBy = _React$useState4[1];
|
|
8468
|
+
var _useState2 = useState(''),
|
|
8469
|
+
searchValue = _useState2[0],
|
|
8470
|
+
setSearchValue = _useState2[1];
|
|
8802
8471
|
var _useState3 = useState(false),
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
var _React$useState4 = React.useState(''),
|
|
8806
|
-
user = _React$useState4[0],
|
|
8807
|
-
setUser = _React$useState4[1];
|
|
8808
|
-
var _useState4 = useState(10),
|
|
8809
|
-
rowsPerPage = _useState4[0],
|
|
8810
|
-
setRowsPerPage = _useState4[1];
|
|
8811
|
-
var _React$useState5 = React.useState({}),
|
|
8812
|
-
selected = _React$useState5[0],
|
|
8813
|
-
setSelected = _React$useState5[1];
|
|
8814
|
-
var _React$useState6 = React.useState('asc'),
|
|
8815
|
-
order = _React$useState6[0],
|
|
8816
|
-
setOrder = _React$useState6[1];
|
|
8817
|
-
var _React$useState7 = React.useState(false),
|
|
8818
|
-
deactivateSingle = _React$useState7[0],
|
|
8819
|
-
setDeactivateSingle = _React$useState7[1];
|
|
8820
|
-
var _React$useState8 = React.useState('first_name'),
|
|
8821
|
-
orderBy = _React$useState8[0],
|
|
8822
|
-
setOrderBy = _React$useState8[1];
|
|
8823
|
-
var _useState5 = useState(''),
|
|
8824
|
-
searchValue = _useState5[0],
|
|
8825
|
-
setSearchValue = _useState5[1];
|
|
8826
|
-
var _useState6 = useState(false),
|
|
8827
|
-
isOpenDeActivateModal = _useState6[0],
|
|
8828
|
-
setOpenDeActivateModalFlag = _useState6[1];
|
|
8472
|
+
isOpenDeActivateModal = _useState3[0],
|
|
8473
|
+
setOpenDeActivateModalFlag = _useState3[1];
|
|
8829
8474
|
var _useSelector2 = useSelector(function (state) {
|
|
8830
8475
|
return state.common;
|
|
8831
8476
|
}),
|
|
@@ -8833,140 +8478,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8833
8478
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8834
8479
|
isILadmin = _useSelector2.isILadmin,
|
|
8835
8480
|
companyName = _useSelector2.companyName;
|
|
8481
|
+
var _useState4 = useState(false),
|
|
8482
|
+
isOpenImportUsersModal = _useState4[0],
|
|
8483
|
+
setOpenImportUsersModal = _useState4[1];
|
|
8484
|
+
var _useState5 = useState(false),
|
|
8485
|
+
isFileDownloading = _useState5[0],
|
|
8486
|
+
setDownlStatus = _useState5[1];
|
|
8487
|
+
var _useState6 = useState(false),
|
|
8488
|
+
isSortingChange = _useState6[0],
|
|
8489
|
+
setSortingChange = _useState6[1];
|
|
8836
8490
|
var _useState7 = useState(false),
|
|
8837
|
-
|
|
8838
|
-
|
|
8491
|
+
isSearchingChange = _useState7[0],
|
|
8492
|
+
setSearchingChange = _useState7[1];
|
|
8839
8493
|
var _useState8 = useState(false),
|
|
8840
|
-
|
|
8841
|
-
|
|
8494
|
+
isSortingChangeTemp = _useState8[0],
|
|
8495
|
+
setSortingChangeTemp = _useState8[1];
|
|
8842
8496
|
var _useState9 = useState(false),
|
|
8843
|
-
|
|
8844
|
-
|
|
8497
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8498
|
+
setSearchingChangeTemp = _useState9[1];
|
|
8845
8499
|
var _useState10 = useState(false),
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
var
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
var
|
|
8852
|
-
|
|
8853
|
-
|
|
8500
|
+
isApiFetching = _useState10[0],
|
|
8501
|
+
setisApiFetching = _useState10[1];
|
|
8502
|
+
var _React$useState5 = React.useState(1),
|
|
8503
|
+
signup_page = _React$useState5[0],
|
|
8504
|
+
setSignUpPage = _React$useState5[1];
|
|
8505
|
+
var _useState11 = useState(5),
|
|
8506
|
+
signup_rowsPerPage = _useState11[0],
|
|
8507
|
+
setSignUpRowsPerPage = _useState11[1];
|
|
8508
|
+
var _React$useState6 = React.useState('asc'),
|
|
8509
|
+
signup_order = _React$useState6[0],
|
|
8510
|
+
setSignUpOrder = _React$useState6[1];
|
|
8511
|
+
var _React$useState7 = React.useState('fname'),
|
|
8512
|
+
signup_orderBy = _React$useState7[0],
|
|
8513
|
+
setSignUpOrderBy = _React$useState7[1];
|
|
8514
|
+
var _useState12 = useState(''),
|
|
8515
|
+
signup_searchValue = _useState12[0],
|
|
8516
|
+
set_signup_SearchValue = _useState12[1];
|
|
8854
8517
|
var _useState13 = useState(false),
|
|
8855
|
-
|
|
8856
|
-
|
|
8518
|
+
isSignUpSortingChange = _useState13[0],
|
|
8519
|
+
setSignUpSortingChange = _useState13[1];
|
|
8857
8520
|
var _useState14 = useState(false),
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
var _useState15 = useState(
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
}),
|
|
8864
|
-
approverRole = _useState15[0],
|
|
8865
|
-
setApproverRole = _useState15[1];
|
|
8521
|
+
isSignUpSearchingChange = _useState14[0],
|
|
8522
|
+
setSignUpSearchingChange = _useState14[1];
|
|
8523
|
+
var _useState15 = useState(false),
|
|
8524
|
+
isSignUpSortingChangeTemp = _useState15[0],
|
|
8525
|
+
setSignUpSortingChangeTemp = _useState15[1];
|
|
8866
8526
|
var _useState16 = useState(false),
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
var _useState17 = useState(''),
|
|
8870
|
-
userIds = _useState17[0],
|
|
8871
|
-
setUserIds = _useState17[1];
|
|
8872
|
-
var _React$useState9 = React.useState(false),
|
|
8873
|
-
overlayMenu = _React$useState9[0],
|
|
8874
|
-
setOverlayMenu = _React$useState9[1];
|
|
8875
|
-
var _useState18 = useState(''),
|
|
8876
|
-
userFirstName = _useState18[0],
|
|
8877
|
-
setUserFirstName = _useState18[1];
|
|
8878
|
-
var _useState19 = useState(''),
|
|
8879
|
-
userLastName = _useState19[0],
|
|
8880
|
-
setUserLastName = _useState19[1];
|
|
8881
|
-
var _useState20 = useState(true),
|
|
8882
|
-
isDisabledSubmitBtn = _useState20[0],
|
|
8883
|
-
setIsDisabledSubmitBtn = _useState20[1];
|
|
8884
|
-
useScrollPosition(function (_ref3) {
|
|
8885
|
-
var prevPos = _ref3.prevPos,
|
|
8886
|
-
currPos = _ref3.currPos;
|
|
8887
|
-
if (prevPos.y - currPos.y > 0) {
|
|
8888
|
-
if (currPos.y <= -275) {
|
|
8889
|
-
setOverlayMenu(true);
|
|
8890
|
-
}
|
|
8891
|
-
} else {
|
|
8892
|
-
if (currPos.y > -295) {
|
|
8893
|
-
setOverlayMenu(false);
|
|
8894
|
-
}
|
|
8895
|
-
}
|
|
8896
|
-
}, [overlayMenu]);
|
|
8897
|
-
var scrollTo = function scrollTo(id) {
|
|
8898
|
-
var el = document.getElementById(id);
|
|
8899
|
-
window.scrollTo({
|
|
8900
|
-
top: el.offsetTop,
|
|
8901
|
-
behavior: 'smooth'
|
|
8902
|
-
});
|
|
8903
|
-
};
|
|
8904
|
-
var _React$useState10 = React.useState(1),
|
|
8905
|
-
signup_page = _React$useState10[0],
|
|
8906
|
-
setSignUpPage = _React$useState10[1];
|
|
8907
|
-
var _useState21 = useState(5),
|
|
8908
|
-
signup_rowsPerPage = _useState21[0],
|
|
8909
|
-
setSignUpRowsPerPage = _useState21[1];
|
|
8910
|
-
var _React$useState11 = React.useState('asc'),
|
|
8911
|
-
signup_order = _React$useState11[0],
|
|
8912
|
-
setSignUpOrder = _React$useState11[1];
|
|
8913
|
-
var _React$useState12 = React.useState('first_name'),
|
|
8914
|
-
signup_orderBy = _React$useState12[0],
|
|
8915
|
-
setSignUpOrderBy = _React$useState12[1];
|
|
8916
|
-
var _useState22 = useState(''),
|
|
8917
|
-
signup_searchValue = _useState22[0],
|
|
8918
|
-
set_signup_SearchValue = _useState22[1];
|
|
8919
|
-
var _useState23 = useState(false),
|
|
8920
|
-
isSignUpSortingChange = _useState23[0],
|
|
8921
|
-
setSignUpSortingChange = _useState23[1];
|
|
8922
|
-
var _useState24 = useState(false),
|
|
8923
|
-
isSignUpSearchingChange = _useState24[0],
|
|
8924
|
-
setSignUpSearchingChange = _useState24[1];
|
|
8925
|
-
var _useState25 = useState(false),
|
|
8926
|
-
isSignUpSortingChangeTemp = _useState25[0],
|
|
8927
|
-
setSignUpSortingChangeTemp = _useState25[1];
|
|
8928
|
-
var _useState26 = useState(false),
|
|
8929
|
-
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8930
|
-
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8527
|
+
isSignUpSearchingChangeTemp = _useState16[0],
|
|
8528
|
+
setSignUpSearchingChangeTemp = _useState16[1];
|
|
8931
8529
|
var _useSelector3 = useSelector(function (state) {
|
|
8932
8530
|
return state.userList;
|
|
8933
8531
|
}),
|
|
8934
8532
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8935
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
8936
|
-
if (config.routes.notification) {
|
|
8937
|
-
history.push({
|
|
8938
|
-
pathname: config.routes.notification.path
|
|
8939
|
-
});
|
|
8940
|
-
}
|
|
8941
|
-
};
|
|
8942
8533
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8943
8534
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8944
8535
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8945
8536
|
return false;
|
|
8946
8537
|
}
|
|
8947
|
-
|
|
8948
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8949
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8950
|
-
var _selected = Object.values(selected).flat();
|
|
8951
|
-
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8952
|
-
return _selected.includes(item.id.toString());
|
|
8953
|
-
});
|
|
8954
|
-
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8955
|
-
return _selected.includes(item.id.toString());
|
|
8956
|
-
});
|
|
8957
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8958
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8959
|
-
setIsBulkDeactivateModalOpen(true);
|
|
8960
|
-
} else {
|
|
8961
|
-
setOpenDeActivateModalFlag(true);
|
|
8962
|
-
}
|
|
8538
|
+
setOpenDeActivateModalFlag(true);
|
|
8963
8539
|
};
|
|
8964
8540
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8965
8541
|
setOpenDeActivateModalFlag(false);
|
|
8966
8542
|
};
|
|
8967
|
-
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8968
|
-
setIsBulkDeactivateModalOpen(false);
|
|
8969
|
-
};
|
|
8970
8543
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8971
8544
|
history.push(config.routes.users.add.path);
|
|
8972
8545
|
};
|
|
@@ -8980,31 +8553,27 @@ var UserList = function UserList(_ref2) {
|
|
|
8980
8553
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8981
8554
|
};
|
|
8982
8555
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
return dispatch(stopDataFetchingStatus());
|
|
9001
|
-
});
|
|
9002
|
-
}
|
|
9003
|
-
})["catch"](function (err) {
|
|
9004
|
-
console.log(err);
|
|
8556
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8557
|
+
if (res.status === true) {
|
|
8558
|
+
var _res$data;
|
|
8559
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
8560
|
+
onUndo: function onUndo() {
|
|
8561
|
+
return dispatch(undoneSignUpRejection(userId));
|
|
8562
|
+
},
|
|
8563
|
+
msg: (res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Sign-up request rejected'
|
|
8564
|
+
}));
|
|
8565
|
+
dispatch(showDataFetchingStatus());
|
|
8566
|
+
dispatch(fetchUserSignupRequests({
|
|
8567
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8568
|
+
length: signup_rowsPerPage,
|
|
8569
|
+
page: signup_page,
|
|
8570
|
+
search: signup_searchValue.trim()
|
|
8571
|
+
})).then(function () {
|
|
8572
|
+
return dispatch(stopDataFetchingStatus());
|
|
9005
8573
|
});
|
|
9006
8574
|
}
|
|
9007
|
-
|
|
8575
|
+
})["catch"](function (err) {
|
|
8576
|
+
console.log(err);
|
|
9008
8577
|
});
|
|
9009
8578
|
};
|
|
9010
8579
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9017,25 +8586,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9017
8586
|
};
|
|
9018
8587
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
9019
8588
|
var _extends2;
|
|
9020
|
-
var
|
|
9021
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9022
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9023
|
-
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8589
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
9024
8590
|
return n.is_active;
|
|
8591
|
+
}).map(function (obj) {
|
|
8592
|
+
return obj.id.toString();
|
|
9025
8593
|
});
|
|
9026
|
-
|
|
9027
|
-
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9028
|
-
if (obj.roles.is_approver === true) {
|
|
9029
|
-
_selectedUsersApprover.push(obj);
|
|
9030
|
-
} else if (obj.roles.is_approver === false) {
|
|
9031
|
-
_selectedUsersNotApprover.push(obj);
|
|
9032
|
-
}
|
|
9033
|
-
}
|
|
9034
|
-
selectedId.push(obj.id.toString());
|
|
9035
|
-
});
|
|
9036
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9037
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9038
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8594
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
9039
8595
|
};
|
|
9040
8596
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
9041
8597
|
var _extends3;
|
|
@@ -9053,156 +8609,58 @@ var UserList = function UserList(_ref2) {
|
|
|
9053
8609
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9054
8610
|
};
|
|
9055
8611
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9056
|
-
setPage(1);
|
|
9057
8612
|
setSearchValue(value);
|
|
9058
8613
|
setSearchingChange(true);
|
|
9059
8614
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
9060
8615
|
};
|
|
9061
8616
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9062
|
-
setPage(1);
|
|
9063
8617
|
set_signup_SearchValue(value);
|
|
9064
8618
|
setSignUpSearchingChange(true);
|
|
9065
8619
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9066
8620
|
};
|
|
9067
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page
|
|
8621
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9068
8622
|
var _extends4;
|
|
9069
8623
|
var selectedTemp = _extends({}, selected);
|
|
9070
8624
|
if (!(page in selectedTemp)) {
|
|
9071
8625
|
selectedTemp[page] = [];
|
|
9072
8626
|
}
|
|
9073
8627
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
9074
|
-
var
|
|
8628
|
+
var newSelected = [];
|
|
9075
8629
|
if (selectedIndex === -1) {
|
|
9076
|
-
|
|
8630
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
9077
8631
|
} else if (selectedIndex === 0) {
|
|
9078
|
-
|
|
8632
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
9079
8633
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
9080
|
-
|
|
8634
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
9081
8635
|
} else if (selectedIndex > 0) {
|
|
9082
|
-
|
|
8636
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9083
8637
|
}
|
|
9084
|
-
|
|
9085
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9086
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9087
|
-
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9088
|
-
return id !== item.id.toString();
|
|
9089
|
-
});
|
|
9090
|
-
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9091
|
-
return item.id.toString() !== id;
|
|
9092
|
-
});
|
|
9093
|
-
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9094
|
-
if (data.roles.is_approver === true) {
|
|
9095
|
-
_SelectedUsersApprover.push(data);
|
|
9096
|
-
} else if (data.roles.is_approver === false) {
|
|
9097
|
-
_SelectedUsersNotApprover.push(data);
|
|
9098
|
-
}
|
|
9099
|
-
}
|
|
9100
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9101
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9102
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8638
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
9103
8639
|
};
|
|
9104
|
-
useEffect(function () {
|
|
9105
|
-
setApproverRole({
|
|
9106
|
-
value: '',
|
|
9107
|
-
label: 'Select approver'
|
|
9108
|
-
});
|
|
9109
|
-
setDefaultId(null);
|
|
9110
|
-
setIsDisabledSubmitBtn(true);
|
|
9111
|
-
setApproveeStatus(false);
|
|
9112
|
-
if (deactivateSingle === true) {
|
|
9113
|
-
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9114
|
-
if (response.data["default"].id) {
|
|
9115
|
-
setDefaultId(response.data["default"].id);
|
|
9116
|
-
setApproverRole({
|
|
9117
|
-
value: '',
|
|
9118
|
-
label: response.data["default"].email
|
|
9119
|
-
});
|
|
9120
|
-
setIsDisabledSubmitBtn(false);
|
|
9121
|
-
setApproveeStatus(response.data["default"].approvee_status);
|
|
9122
|
-
}
|
|
9123
|
-
});
|
|
9124
|
-
}
|
|
9125
|
-
}, [deactivateSingle]);
|
|
9126
8640
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9127
8641
|
setRowsPerPage(+event.target.value);
|
|
9128
8642
|
setPage(1);
|
|
9129
8643
|
setSelected({});
|
|
9130
|
-
setSelectedUsersNotApprover([]);
|
|
9131
|
-
setSelectedUsersApprover([]);
|
|
9132
8644
|
setSortingChange(true);
|
|
9133
8645
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9134
8646
|
};
|
|
9135
8647
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
9136
8648
|
var isActive = e.target.checked;
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
setUser(item);
|
|
9145
|
-
} else {
|
|
9146
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9147
|
-
if (!isActive) {
|
|
9148
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9149
|
-
var _extends5;
|
|
9150
|
-
var selectedTemp = _extends({}, selected);
|
|
9151
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9152
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9153
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9154
|
-
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9155
|
-
return item.id != id;
|
|
9156
|
-
});
|
|
9157
|
-
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9158
|
-
return item.id != id;
|
|
9159
|
-
});
|
|
9160
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9161
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9162
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9163
|
-
}
|
|
9164
|
-
}
|
|
9165
|
-
});
|
|
8649
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8650
|
+
if (!isActive) {
|
|
8651
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8652
|
+
var _extends5;
|
|
8653
|
+
var selectedTemp = _extends({}, selected);
|
|
8654
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8655
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9166
8656
|
}
|
|
9167
8657
|
}
|
|
9168
8658
|
});
|
|
9169
8659
|
};
|
|
9170
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
9171
|
-
var _value = _ref4._value;
|
|
9172
|
-
if (_value.data.approvee_status) {
|
|
9173
|
-
setApproveeStatus(true);
|
|
9174
|
-
} else {
|
|
9175
|
-
setApproveeStatus(false);
|
|
9176
|
-
}
|
|
9177
|
-
setDefaultId(_value.data.id);
|
|
9178
|
-
setApproverRole(_value);
|
|
9179
|
-
setIsDisabledSubmitBtn(false);
|
|
9180
|
-
};
|
|
9181
|
-
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9182
|
-
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9183
|
-
setOpenDeActivateModalFlag(false);
|
|
9184
|
-
setDeactivateSingle(false);
|
|
9185
|
-
setSelected({});
|
|
9186
|
-
setSelectedUsersNotApprover([]);
|
|
9187
|
-
setSelectedUsersApprover([]);
|
|
9188
|
-
};
|
|
9189
8660
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
9190
8661
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
9191
8662
|
setOpenDeActivateModalFlag(false);
|
|
9192
8663
|
setSelected({});
|
|
9193
|
-
setSelectedUsersNotApprover([]);
|
|
9194
|
-
setSelectedUsersApprover([]);
|
|
9195
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9196
|
-
};
|
|
9197
|
-
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9198
|
-
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9199
|
-
return item.id;
|
|
9200
|
-
});
|
|
9201
|
-
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9202
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9203
|
-
setSelected({});
|
|
9204
|
-
setSelectedUsersNotApprover([]);
|
|
9205
|
-
setSelectedUsersApprover([]);
|
|
9206
8664
|
};
|
|
9207
8665
|
var importUserHandler = function importUserHandler() {
|
|
9208
8666
|
setOpenImportUsersModal(true);
|
|
@@ -9214,43 +8672,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9214
8672
|
setOpenImportUsersModal(false);
|
|
9215
8673
|
handleImportPagenavigation(jobId);
|
|
9216
8674
|
};
|
|
9217
|
-
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9218
|
-
dispatch(resetPasswordForUser({
|
|
9219
|
-
email: email
|
|
9220
|
-
}));
|
|
9221
|
-
};
|
|
9222
|
-
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9223
|
-
if (type === undefined) {
|
|
9224
|
-
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9225
|
-
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9226
|
-
return false;
|
|
9227
|
-
}
|
|
9228
|
-
}
|
|
9229
|
-
setUserIds(ids);
|
|
9230
|
-
setUserFirstName(firstName);
|
|
9231
|
-
setUserLastName(lastName);
|
|
9232
|
-
setToggleInviteModal(!showInviteModal);
|
|
9233
|
-
};
|
|
9234
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9235
|
-
setToggleInviteModal(!showInviteModal);
|
|
9236
|
-
};
|
|
9237
|
-
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9238
|
-
var userIdArr = [];
|
|
9239
|
-
if (userIds && !isNaN(userIds)) {
|
|
9240
|
-
userIdArr = [userIds];
|
|
9241
|
-
} else if (Object.keys(selected).length) {
|
|
9242
|
-
Object.values(selected).map(function (val, i) {
|
|
9243
|
-
if (val.length) {
|
|
9244
|
-
val.map(function (idx, i) {
|
|
9245
|
-
userIdArr.push(idx);
|
|
9246
|
-
});
|
|
9247
|
-
}
|
|
9248
|
-
});
|
|
9249
|
-
}
|
|
9250
|
-
setUserIds('');
|
|
9251
|
-
dispatch(resendInviteForUser(userIdArr));
|
|
9252
|
-
setToggleInviteModal(!showInviteModal);
|
|
9253
|
-
};
|
|
9254
8675
|
var handleExportUsers = function handleExportUsers() {
|
|
9255
8676
|
try {
|
|
9256
8677
|
setDownlStatus(true);
|
|
@@ -9290,9 +8711,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9290
8711
|
}, {
|
|
9291
8712
|
label: 'Bulk action history',
|
|
9292
8713
|
handler: handleBulkActionHistoryClick
|
|
9293
|
-
}, {
|
|
9294
|
-
label: 'Resend invite',
|
|
9295
|
-
handler: toggleInviteModal
|
|
9296
8714
|
}];
|
|
9297
8715
|
useEffect(function () {
|
|
9298
8716
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -9304,9 +8722,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9304
8722
|
userId: userId
|
|
9305
8723
|
}));
|
|
9306
8724
|
};
|
|
9307
|
-
var knowMore = function knowMore() {
|
|
9308
|
-
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9309
|
-
};
|
|
9310
8725
|
var dispatch = useDispatch();
|
|
9311
8726
|
useEffect(function () {
|
|
9312
8727
|
if (isTokenVerified === true) {
|
|
@@ -9320,7 +8735,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9320
8735
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9321
8736
|
setSearchingChange(false);
|
|
9322
8737
|
setisApiFetching(false);
|
|
9323
|
-
scrollTo('table-root');
|
|
9324
8738
|
});
|
|
9325
8739
|
}, 1000);
|
|
9326
8740
|
return function () {
|
|
@@ -9334,8 +8748,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9334
8748
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9335
8749
|
length: signup_rowsPerPage,
|
|
9336
8750
|
page: signup_page,
|
|
9337
|
-
search: signup_searchValue.trim()
|
|
9338
|
-
pagename: 'company'
|
|
8751
|
+
search: signup_searchValue.trim()
|
|
9339
8752
|
})).then(function () {
|
|
9340
8753
|
setSignUpSearchingChange(false);
|
|
9341
8754
|
setisApiFetching(false);
|
|
@@ -9347,7 +8760,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9347
8760
|
}
|
|
9348
8761
|
if (isSortingChange) {
|
|
9349
8762
|
setisApiFetching(true);
|
|
9350
|
-
scrollTo('table-root');
|
|
9351
8763
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9352
8764
|
setisApiFetching(false);
|
|
9353
8765
|
setSortingChange(false);
|
|
@@ -9362,8 +8774,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9362
8774
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9363
8775
|
length: signup_rowsPerPage,
|
|
9364
8776
|
page: signup_page,
|
|
9365
|
-
search: signup_searchValue.trim()
|
|
9366
|
-
pagename: 'company'
|
|
8777
|
+
search: signup_searchValue.trim()
|
|
9367
8778
|
})).then(function () {
|
|
9368
8779
|
setisApiFetching(false);
|
|
9369
8780
|
setSignUpSortingChange(false);
|
|
@@ -9379,8 +8790,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9379
8790
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9380
8791
|
length: signup_rowsPerPage,
|
|
9381
8792
|
page: signup_page,
|
|
9382
|
-
search: signup_searchValue.trim()
|
|
9383
|
-
pagename: 'company'
|
|
8793
|
+
search: signup_searchValue.trim()
|
|
9384
8794
|
})).then(function () {
|
|
9385
8795
|
return dispatch(stopDataFetchingStatus());
|
|
9386
8796
|
});
|
|
@@ -9388,89 +8798,15 @@ var UserList = function UserList(_ref2) {
|
|
|
9388
8798
|
}
|
|
9389
8799
|
}
|
|
9390
8800
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9391
|
-
var topRightButtons = function topRightButtons() {
|
|
9392
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9393
|
-
component: "div",
|
|
9394
|
-
className: styles$5.buttonWrapper,
|
|
9395
|
-
display: "flex",
|
|
9396
|
-
justifyContent: "space-between",
|
|
9397
|
-
alignItems: "center",
|
|
9398
|
-
alignSelf: "flex-start"
|
|
9399
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9400
|
-
component: "div",
|
|
9401
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9402
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9403
|
-
buttonText: "Export all users",
|
|
9404
|
-
type: "outlined",
|
|
9405
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9406
|
-
width: "22",
|
|
9407
|
-
height: "22"
|
|
9408
|
-
}),
|
|
9409
|
-
onClick: handleExportUsers
|
|
9410
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9411
|
-
component: "div",
|
|
9412
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9413
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9414
|
-
buttonText: "Bulk actions",
|
|
9415
|
-
type: "outlined",
|
|
9416
|
-
menuListInfo: BulkUploadInfo
|
|
9417
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9418
|
-
component: "div",
|
|
9419
|
-
className: "pageHeader--button-single button-right"
|
|
9420
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9421
|
-
buttonText: "Add user",
|
|
9422
|
-
type: "contained",
|
|
9423
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9424
|
-
width: "9",
|
|
9425
|
-
height: "9",
|
|
9426
|
-
color: "white"
|
|
9427
|
-
}),
|
|
9428
|
-
onClick: handleAddPageNavigation
|
|
9429
|
-
})));
|
|
9430
|
-
};
|
|
9431
8801
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9432
8802
|
component: "div",
|
|
9433
8803
|
className: styles$5.UUIUserManagementList
|
|
9434
|
-
},
|
|
9435
|
-
className: styles$5.scrollOverlayMenu
|
|
9436
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9437
|
-
component: "div",
|
|
9438
|
-
className: clsx(styles$5.pageHeader)
|
|
9439
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9440
|
-
component: "div",
|
|
9441
|
-
display: "flex",
|
|
9442
|
-
justifyContent: "space-between",
|
|
9443
|
-
alignItems: "center",
|
|
9444
|
-
flexWrap: "wrap",
|
|
9445
|
-
style: {
|
|
9446
|
-
gap: '1rem'
|
|
9447
|
-
}
|
|
9448
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9449
|
-
component: "div",
|
|
9450
|
-
display: "flex",
|
|
9451
|
-
flexDirection: "column",
|
|
9452
|
-
style: {
|
|
9453
|
-
gap: '0.5rem'
|
|
9454
|
-
}
|
|
9455
|
-
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9456
|
-
placeholder: "Search by name, email & department",
|
|
9457
|
-
value: searchValue,
|
|
9458
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
9459
|
-
return onSearchHandler(e.target.value);
|
|
9460
|
-
},
|
|
9461
|
-
className: styles$5.overlaysearch
|
|
9462
|
-
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9463
|
-
component: "div",
|
|
9464
|
-
display: "flex",
|
|
9465
|
-
justifyContent: "space-between",
|
|
9466
|
-
alignItems: "center"
|
|
9467
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8804
|
+
}, !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9468
8805
|
open: isFileDownloading || isApiFetching,
|
|
9469
8806
|
className: styles$5.backdrop
|
|
9470
8807
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9471
8808
|
color: "inherit"
|
|
9472
8809
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9473
|
-
id: "table-root",
|
|
9474
8810
|
component: "div",
|
|
9475
8811
|
className: clsx(styles$5.pageHeader)
|
|
9476
8812
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -9495,7 +8831,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9495
8831
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9496
8832
|
variant: "h3",
|
|
9497
8833
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
9498
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))),
|
|
8834
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8835
|
+
component: "div",
|
|
8836
|
+
className: styles$5.buttonWrapper,
|
|
8837
|
+
display: "flex",
|
|
8838
|
+
justifyContent: "space-between",
|
|
8839
|
+
alignItems: "center",
|
|
8840
|
+
alignSelf: "flex-start"
|
|
8841
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8842
|
+
component: "div",
|
|
8843
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8844
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8845
|
+
buttonText: "Export all users",
|
|
8846
|
+
type: "outlined",
|
|
8847
|
+
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
8848
|
+
width: "22",
|
|
8849
|
+
height: "22"
|
|
8850
|
+
}),
|
|
8851
|
+
onClick: handleExportUsers
|
|
8852
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8853
|
+
component: "div",
|
|
8854
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8855
|
+
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
8856
|
+
buttonText: "Bulk actions",
|
|
8857
|
+
type: "outlined",
|
|
8858
|
+
menuListInfo: BulkUploadInfo
|
|
8859
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8860
|
+
component: "div",
|
|
8861
|
+
className: "pageHeader--button-single button-right"
|
|
8862
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8863
|
+
buttonText: "Add user",
|
|
8864
|
+
type: "contained",
|
|
8865
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
8866
|
+
width: "9",
|
|
8867
|
+
height: "9",
|
|
8868
|
+
color: "white"
|
|
8869
|
+
}),
|
|
8870
|
+
onClick: handleAddPageNavigation
|
|
8871
|
+
})))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9499
8872
|
component: "div",
|
|
9500
8873
|
display: "flex",
|
|
9501
8874
|
justifyContent: "space-between",
|
|
@@ -9540,9 +8913,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9540
8913
|
disableRowCheckbox: deactivatedUsers,
|
|
9541
8914
|
searchValue: searchValue,
|
|
9542
8915
|
isILadmin: isILadmin,
|
|
9543
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9544
|
-
onResetPasswordHandler: onResetPasswordHandler,
|
|
9545
|
-
toggleInviteModal: toggleInviteModal
|
|
8916
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9546
8917
|
}))
|
|
9547
8918
|
}, {
|
|
9548
8919
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
@@ -9558,10 +8929,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9558
8929
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9559
8930
|
variant: "body2",
|
|
9560
8931
|
className: clsx(styles$5.description)
|
|
9561
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
9562
|
-
onClick: redirectToNotifications,
|
|
9563
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9564
|
-
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
8932
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in Notifications.")), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9565
8933
|
data: signupRequestListInfo,
|
|
9566
8934
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9567
8935
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9593,54 +8961,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9593
8961
|
}))
|
|
9594
8962
|
}]
|
|
9595
8963
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9596
|
-
isOpen: deactivateSingle,
|
|
9597
|
-
closeHandler: function closeHandler() {
|
|
9598
|
-
setDeactivateSingle(false);
|
|
9599
|
-
},
|
|
9600
|
-
cancelLabel: "Cancel",
|
|
9601
|
-
submitLabel: "Deactivate",
|
|
9602
|
-
submitHandler: handleDeactivateUser,
|
|
9603
|
-
headerText: "Deactivate this user?",
|
|
9604
|
-
width: "400px",
|
|
9605
|
-
subHanderText: "",
|
|
9606
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
9607
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9608
|
-
modalClass: "deactivateSingleModal",
|
|
9609
|
-
modalBodyStyle: {
|
|
9610
|
-
overflowY: 'unset'
|
|
9611
|
-
}
|
|
9612
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9613
|
-
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9614
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9615
|
-
className: styles$5.deactivateAlert
|
|
9616
|
-
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9617
|
-
width: "9",
|
|
9618
|
-
height: "9"
|
|
9619
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9620
|
-
variant: "body2"
|
|
9621
|
-
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9622
|
-
onClick: knowMore,
|
|
9623
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9624
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9625
|
-
className: "iui__mt-15"
|
|
9626
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9627
|
-
isMove: true,
|
|
9628
|
-
additional: {
|
|
9629
|
-
page: 1,
|
|
9630
|
-
product: 'travel',
|
|
9631
|
-
userId: user.id
|
|
9632
|
-
},
|
|
9633
|
-
label: "Transfer approver role to",
|
|
9634
|
-
value: approverRole,
|
|
9635
|
-
onValueChange: selectApprover,
|
|
9636
|
-
loadOption: transferRoleOptions,
|
|
9637
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
9638
|
-
customLoadingText: "No results found"
|
|
9639
|
-
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9640
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9641
|
-
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9642
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9643
|
-
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9644
8964
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9645
8965
|
closeHandler: closeDeActivateModal,
|
|
9646
8966
|
cancelLabel: "Cancel",
|
|
@@ -9666,124 +8986,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9666
8986
|
className: styles$5.headerText
|
|
9667
8987
|
}, '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, {
|
|
9668
8988
|
className: styles$5.description
|
|
9669
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(
|
|
9670
|
-
isOpen: isBulkDeactivateModalOpen,
|
|
9671
|
-
closeHandler: closeDeActiveModal,
|
|
9672
|
-
cancelLabel: "Cancel",
|
|
9673
|
-
submitLabel: "Deactivate safe users",
|
|
9674
|
-
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9675
|
-
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9676
|
-
customButtonLabel: "Deactivate all users",
|
|
9677
|
-
customButtonHandler: handleDeactivateUsers,
|
|
9678
|
-
submitHandler: handleDeactivateSafeUsers,
|
|
9679
|
-
width: "640px",
|
|
9680
|
-
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9681
|
-
headerText: "Deactivate users?",
|
|
9682
|
-
modalBodyStyle: {
|
|
9683
|
-
maxHeight: 'calc(100vh - 50vh)'
|
|
9684
|
-
}
|
|
9685
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9686
|
-
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9687
|
-
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9688
|
-
color: "#9A6700",
|
|
9689
|
-
size: "14"
|
|
9690
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9691
|
-
variant: "body2"
|
|
9692
|
-
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9693
|
-
onClick: knowMore,
|
|
9694
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9695
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9696
|
-
className: "iui__my-15"
|
|
9697
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9698
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9699
|
-
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9700
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9701
|
-
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9702
|
-
var _item$data;
|
|
9703
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9704
|
-
key: index,
|
|
9705
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9706
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9707
|
-
firstName: item.first_name,
|
|
9708
|
-
lastName: item.last_name,
|
|
9709
|
-
isLetterAvatar: "true",
|
|
9710
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9711
|
-
secondaryText: item.email,
|
|
9712
|
-
letterAvatarTextColor: "black",
|
|
9713
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9714
|
-
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9715
|
-
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9716
|
-
color: "#9A6700",
|
|
9717
|
-
size: "14"
|
|
9718
|
-
}));
|
|
9719
|
-
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9720
|
-
style: {
|
|
9721
|
-
borderColor: '#E5E9ED'
|
|
9722
|
-
}
|
|
9723
|
-
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9724
|
-
className: "iui__my-15"
|
|
9725
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9726
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9727
|
-
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9728
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9729
|
-
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
9730
|
-
var _item$data2;
|
|
9731
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9732
|
-
key: index,
|
|
9733
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9734
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9735
|
-
firstName: item.first_name,
|
|
9736
|
-
lastName: item.last_name,
|
|
9737
|
-
isLetterAvatar: "true",
|
|
9738
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9739
|
-
secondaryText: item.email,
|
|
9740
|
-
letterAvatarTextColor: "black",
|
|
9741
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9742
|
-
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9743
|
-
}));
|
|
9744
|
-
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9745
|
-
isOpen: showInviteModal,
|
|
9746
|
-
closeHandler: function closeHandler() {
|
|
9747
|
-
return toggleInviteModalClose();
|
|
9748
|
-
},
|
|
9749
|
-
cancelLabel: "Cancel",
|
|
9750
|
-
headerText: "Resend Invites?",
|
|
9751
|
-
submitLabel: "Send",
|
|
9752
|
-
submitHandler: function submitHandler() {
|
|
9753
|
-
return onResendInviteHandler();
|
|
9754
|
-
},
|
|
9755
|
-
width: "400px",
|
|
9756
|
-
modalBodyStyle: {
|
|
9757
|
-
padding: '0px'
|
|
9758
|
-
},
|
|
9759
|
-
footerStyle: {
|
|
9760
|
-
justifyContent: 'center'
|
|
9761
|
-
}
|
|
9762
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9763
|
-
style: {
|
|
9764
|
-
display: 'flex',
|
|
9765
|
-
padding: '16px',
|
|
9766
|
-
margin: '8px 24px',
|
|
9767
|
-
border: '1px solid #FDE047',
|
|
9768
|
-
background: '#FEFCE8',
|
|
9769
|
-
borderRadius: '5px'
|
|
9770
|
-
}
|
|
9771
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9772
|
-
style: {
|
|
9773
|
-
marginRight: '5px'
|
|
9774
|
-
}
|
|
9775
|
-
}, /*#__PURE__*/React.createElement(InviteInfoIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
9776
|
-
style: {
|
|
9777
|
-
fontSize: '14px',
|
|
9778
|
-
color: '#374151'
|
|
9779
|
-
}
|
|
9780
|
-
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9781
|
-
style: {
|
|
9782
|
-
fontSize: '14px',
|
|
9783
|
-
color: '#374151',
|
|
9784
|
-
fontWeight: 'bold'
|
|
9785
|
-
}
|
|
9786
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
8989
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9787
8990
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9788
8991
|
closeImportUsersModal: closeImportUsersModal,
|
|
9789
8992
|
closeImportModal: closeImportModal
|
|
@@ -9792,8 +8995,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9792
8995
|
errMsg: hasVerificationError
|
|
9793
8996
|
}));
|
|
9794
8997
|
};
|
|
9795
|
-
var TabLabelCount = function TabLabelCount(
|
|
9796
|
-
var count =
|
|
8998
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
8999
|
+
var count = _ref3.count;
|
|
9797
9000
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9798
9001
|
className: styles$5.TabLabelCount
|
|
9799
9002
|
}, " ", count, " ");
|
|
@@ -9868,12 +9071,11 @@ function Header(props) {
|
|
|
9868
9071
|
})));
|
|
9869
9072
|
}
|
|
9870
9073
|
|
|
9871
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","
|
|
9074
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","buttonWidth":"_13tv0","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9872
9075
|
|
|
9873
9076
|
function Listview(_ref) {
|
|
9874
9077
|
var data = _ref.data,
|
|
9875
9078
|
name = _ref.name,
|
|
9876
|
-
tableName = _ref.tableName,
|
|
9877
9079
|
handleEditDialog = _ref.handleEditDialog,
|
|
9878
9080
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9879
9081
|
orderBy = _ref.orderBy,
|
|
@@ -9886,87 +9088,21 @@ function Listview(_ref) {
|
|
|
9886
9088
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9887
9089
|
page = _ref.page,
|
|
9888
9090
|
rowsPerPage = _ref.rowsPerPage;
|
|
9889
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9890
|
-
var _data$dept_head_detai;
|
|
9891
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
9892
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9893
|
-
}
|
|
9894
|
-
};
|
|
9895
9091
|
var columns = [{
|
|
9896
9092
|
id: 'name',
|
|
9897
9093
|
label: name,
|
|
9898
|
-
width: '
|
|
9899
|
-
sortable: true,
|
|
9900
|
-
cell: function cell(row) {
|
|
9901
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9902
|
-
component: "div"
|
|
9903
|
-
}, row.name);
|
|
9904
|
-
}
|
|
9905
|
-
}, {
|
|
9906
|
-
id: 'no_of_users',
|
|
9907
|
-
label: 'Number of users',
|
|
9908
|
-
width: '40%',
|
|
9909
|
-
sortable: true,
|
|
9910
|
-
cell: function cell(row) {
|
|
9911
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9912
|
-
component: "div"
|
|
9913
|
-
}, row.no_of_users);
|
|
9914
|
-
}
|
|
9915
|
-
}, {
|
|
9916
|
-
id: 'actions',
|
|
9917
|
-
label: 'Actions',
|
|
9918
|
-
width: '20%',
|
|
9919
|
-
cell: function cell(row) {
|
|
9920
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9921
|
-
display: "flex"
|
|
9922
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9923
|
-
buttonText: "Edit",
|
|
9924
|
-
className: styles$7.buttonWidth,
|
|
9925
|
-
onClick: function onClick() {
|
|
9926
|
-
return handleEditDialog(row);
|
|
9927
|
-
}
|
|
9928
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9929
|
-
buttonText: "Delete",
|
|
9930
|
-
className: styles$7.buttonWidth,
|
|
9931
|
-
onClick: function onClick() {
|
|
9932
|
-
return handleDeleteDialog(row, true);
|
|
9933
|
-
}
|
|
9934
|
-
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9935
|
-
buttonText: "Delete",
|
|
9936
|
-
className: styles$7.buttonWidth,
|
|
9937
|
-
onClick: function onClick() {
|
|
9938
|
-
return handleDeleteDialog(row, false);
|
|
9939
|
-
}
|
|
9940
|
-
}));
|
|
9941
|
-
}
|
|
9942
|
-
}];
|
|
9943
|
-
var departmentColumns = [{
|
|
9944
|
-
id: 'name',
|
|
9945
|
-
label: name,
|
|
9946
|
-
width: '30%',
|
|
9094
|
+
width: '45%',
|
|
9947
9095
|
sortable: true,
|
|
9948
9096
|
cell: function cell(row) {
|
|
9949
9097
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9950
9098
|
component: "div"
|
|
9951
9099
|
}, row.name);
|
|
9952
9100
|
}
|
|
9953
|
-
}, {
|
|
9954
|
-
id: 'department_head',
|
|
9955
|
-
label: 'Department head',
|
|
9956
|
-
width: '30%',
|
|
9957
|
-
sortable: true,
|
|
9958
|
-
cell: function cell(row) {
|
|
9959
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9960
|
-
component: "div"
|
|
9961
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9962
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9963
|
-
}, "Assigned by default"));
|
|
9964
|
-
}
|
|
9965
9101
|
}, {
|
|
9966
9102
|
id: 'no_of_users',
|
|
9967
9103
|
label: 'Number of users',
|
|
9968
9104
|
width: '45%',
|
|
9969
|
-
sortable:
|
|
9105
|
+
sortable: true,
|
|
9970
9106
|
cell: function cell(row) {
|
|
9971
9107
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9972
9108
|
component: "div"
|
|
@@ -9975,7 +9111,7 @@ function Listview(_ref) {
|
|
|
9975
9111
|
}, {
|
|
9976
9112
|
id: 'actions',
|
|
9977
9113
|
label: 'Actions',
|
|
9978
|
-
width: '
|
|
9114
|
+
width: '10%',
|
|
9979
9115
|
cell: function cell(row) {
|
|
9980
9116
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9981
9117
|
display: "flex"
|
|
@@ -10008,7 +9144,7 @@ function Listview(_ref) {
|
|
|
10008
9144
|
hasFilter: true,
|
|
10009
9145
|
isCheckboxTable: false,
|
|
10010
9146
|
count: data.count,
|
|
10011
|
-
columns:
|
|
9147
|
+
columns: columns,
|
|
10012
9148
|
rows: data.results,
|
|
10013
9149
|
page: page,
|
|
10014
9150
|
handleChangePage: handleChangePage,
|
|
@@ -10065,43 +9201,15 @@ function EditPanelDialog(_ref) {
|
|
|
10065
9201
|
var isOpen = _ref.isOpen,
|
|
10066
9202
|
closeHandler = _ref.closeHandler,
|
|
10067
9203
|
onValueChange = _ref.onValueChange,
|
|
10068
|
-
|
|
9204
|
+
submitHandler = _ref.submitHandler,
|
|
10069
9205
|
isError = _ref.isError,
|
|
10070
9206
|
name = _ref.name,
|
|
10071
9207
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
10072
|
-
validation = _ref.validation
|
|
10073
|
-
rowData = _ref.rowData,
|
|
10074
|
-
tableName = _ref.tableName,
|
|
10075
|
-
config = _ref.config;
|
|
9208
|
+
validation = _ref.validation;
|
|
10076
9209
|
var _useSelector = useSelector(function (state) {
|
|
10077
9210
|
return state.userPanel;
|
|
10078
9211
|
}),
|
|
10079
9212
|
dialogData = _useSelector.dialogData;
|
|
10080
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10081
|
-
var _data$dept_head_detai;
|
|
10082
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
10083
|
-
setHead({
|
|
10084
|
-
value: data.dept_head_details[0].id,
|
|
10085
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10086
|
-
});
|
|
10087
|
-
}
|
|
10088
|
-
};
|
|
10089
|
-
var _useState = useState({
|
|
10090
|
-
value: '',
|
|
10091
|
-
label: 'Select'
|
|
10092
|
-
}),
|
|
10093
|
-
head = _useState[0],
|
|
10094
|
-
setHead = _useState[1];
|
|
10095
|
-
useEffect(function () {
|
|
10096
|
-
deptHeadDetails(rowData);
|
|
10097
|
-
}, [rowData]);
|
|
10098
|
-
var history = useHistory();
|
|
10099
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10100
|
-
history.push({
|
|
10101
|
-
pathname: config.routes.users.add.path,
|
|
10102
|
-
state: rowData
|
|
10103
|
-
});
|
|
10104
|
-
};
|
|
10105
9213
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
10106
9214
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10107
9215
|
isOpen: isOpen,
|
|
@@ -10109,59 +9217,25 @@ function EditPanelDialog(_ref) {
|
|
|
10109
9217
|
headerText: "Edit " + name.toLowerCase(),
|
|
10110
9218
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
10111
9219
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
10112
|
-
submitHandler:
|
|
10113
|
-
|
|
10114
|
-
},
|
|
10115
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9220
|
+
submitHandler: submitHandler,
|
|
9221
|
+
width: "365px",
|
|
10116
9222
|
hideCloseIcon: false,
|
|
10117
9223
|
modalBodyStyle: {
|
|
10118
|
-
|
|
9224
|
+
maxHeight: '400px',
|
|
9225
|
+
overflow: 'auto',
|
|
9226
|
+
margin: '0px'
|
|
10119
9227
|
},
|
|
10120
9228
|
footerStyle: {
|
|
10121
9229
|
justifyContent: 'end'
|
|
10122
9230
|
}
|
|
10123
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10124
|
-
display: "flex",
|
|
10125
|
-
justifyContent: "center",
|
|
10126
|
-
alignItems: "center",
|
|
10127
|
-
flexDirection: "column",
|
|
10128
|
-
style: {
|
|
10129
|
-
marginBottom: '30px'
|
|
10130
|
-
}
|
|
10131
9231
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9232
|
+
component: "div",
|
|
10132
9233
|
display: "flex",
|
|
10133
9234
|
justifyContent: "center",
|
|
10134
9235
|
alignItems: "center",
|
|
10135
9236
|
flexDirection: "column",
|
|
10136
|
-
|
|
10137
|
-
}, /*#__PURE__*/React.createElement(
|
|
10138
|
-
className: styles$7.alertDescContainer
|
|
10139
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10140
|
-
className: styles$7.iconLayout,
|
|
10141
|
-
style: {
|
|
10142
|
-
paddingTop: '4px'
|
|
10143
|
-
}
|
|
10144
|
-
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10145
|
-
color: "#CA8A04",
|
|
10146
|
-
width: "25",
|
|
10147
|
-
height: "20",
|
|
10148
|
-
className: styles$7.iconStyle
|
|
10149
|
-
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10150
|
-
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.",
|
|
10151
|
-
style: {
|
|
10152
|
-
fontWeight: 'normal'
|
|
10153
|
-
}
|
|
10154
|
-
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10155
|
-
buttonText: "Add user",
|
|
10156
|
-
type: "text",
|
|
10157
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10158
|
-
width: "9",
|
|
10159
|
-
height: "9",
|
|
10160
|
-
color: "#EC5D25"
|
|
10161
|
-
}),
|
|
10162
|
-
onClick: handleAddPageNavigation,
|
|
10163
|
-
className: styles$7.addUserButton
|
|
10164
|
-
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9237
|
+
padding: "8px 24px"
|
|
9238
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10165
9239
|
label: name + " name",
|
|
10166
9240
|
name: "name",
|
|
10167
9241
|
defaultValue: dialogData.data.name,
|
|
@@ -10170,49 +9244,7 @@ function EditPanelDialog(_ref) {
|
|
|
10170
9244
|
isError: isError,
|
|
10171
9245
|
validation: validation,
|
|
10172
9246
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
10173
|
-
required: true
|
|
10174
|
-
style: tableName === 'department' && {
|
|
10175
|
-
width: '350px'
|
|
10176
|
-
}
|
|
10177
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10178
|
-
className: "iui__mt-15",
|
|
10179
|
-
style: {
|
|
10180
|
-
width: '100%'
|
|
10181
|
-
}
|
|
10182
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10183
|
-
label: "Department head",
|
|
10184
|
-
name: "name",
|
|
10185
|
-
defaultValue: head.label,
|
|
10186
|
-
placeholder: "",
|
|
10187
|
-
readOnly: true,
|
|
10188
|
-
style: {
|
|
10189
|
-
width: '350px'
|
|
10190
|
-
}
|
|
10191
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10192
|
-
className: "iui__mt-15",
|
|
10193
|
-
style: {
|
|
10194
|
-
width: '100%'
|
|
10195
|
-
}
|
|
10196
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10197
|
-
noResultsText: true,
|
|
10198
|
-
isMove: true,
|
|
10199
|
-
additional: {
|
|
10200
|
-
page: 1,
|
|
10201
|
-
departmentId: rowData.id
|
|
10202
|
-
},
|
|
10203
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
10204
|
-
label: "Department head",
|
|
10205
|
-
value: head,
|
|
10206
|
-
onValueChange: function onValueChange(_ref2) {
|
|
10207
|
-
var _value = _ref2._value;
|
|
10208
|
-
return setHead(_value);
|
|
10209
|
-
},
|
|
10210
|
-
loadOption: departmentHeadOptions,
|
|
10211
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10212
|
-
customLoadingText: "No users found in this department",
|
|
10213
|
-
customLoadingTextStyle: {
|
|
10214
|
-
color: '#374151'
|
|
10215
|
-
}
|
|
9247
|
+
required: true
|
|
10216
9248
|
})));
|
|
10217
9249
|
}
|
|
10218
9250
|
|
|
@@ -10391,15 +9423,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10391
9423
|
var _useState13 = useState(false),
|
|
10392
9424
|
isSortingChangeTemp = _useState13[0],
|
|
10393
9425
|
setSortingChangeTemp = _useState13[1];
|
|
10394
|
-
var _useState14 = useState(
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
var _useState15 = useState(
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
var _useState16 = useState(5),
|
|
10401
|
-
rowsPerPage = _useState16[0],
|
|
10402
|
-
setRowsPerPage = _useState16[1];
|
|
9426
|
+
var _useState14 = useState(1),
|
|
9427
|
+
page = _useState14[0],
|
|
9428
|
+
setPage = _useState14[1];
|
|
9429
|
+
var _useState15 = useState(5),
|
|
9430
|
+
rowsPerPage = _useState15[0],
|
|
9431
|
+
setRowsPerPage = _useState15[1];
|
|
10403
9432
|
var orderingParam = orderBy;
|
|
10404
9433
|
var _useSelector = useSelector(function (state) {
|
|
10405
9434
|
return state.userPanel;
|
|
@@ -10417,20 +9446,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10417
9446
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
10418
9447
|
setDataList(validatedValue);
|
|
10419
9448
|
};
|
|
10420
|
-
var _useState17 = useState(70),
|
|
10421
|
-
maxLengthForModal = _useState17[0],
|
|
10422
|
-
setMaxLengthForModal = _useState17[1];
|
|
10423
|
-
useEffect(function () {
|
|
10424
|
-
if (title === 'Business unit') {
|
|
10425
|
-
setMaxLengthForModal(150);
|
|
10426
|
-
}
|
|
10427
|
-
}, []);
|
|
10428
9449
|
var validation = {
|
|
10429
9450
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
10430
9451
|
regexOnBlur: null,
|
|
10431
9452
|
maxLimit: '',
|
|
10432
9453
|
minLimit: '',
|
|
10433
|
-
maxLength:
|
|
9454
|
+
maxLength: 70,
|
|
10434
9455
|
minLength: 0
|
|
10435
9456
|
};
|
|
10436
9457
|
useEffect(function () {
|
|
@@ -10503,7 +9524,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10503
9524
|
submitLabel: 'Save'
|
|
10504
9525
|
}, '', data));
|
|
10505
9526
|
setDataList(data.name);
|
|
10506
|
-
setRowData(data);
|
|
10507
9527
|
setEditModal(true);
|
|
10508
9528
|
};
|
|
10509
9529
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10518,12 +9538,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10518
9538
|
var payload = {
|
|
10519
9539
|
names: [dataList]
|
|
10520
9540
|
};
|
|
10521
|
-
if (tableName === 'department') {
|
|
10522
|
-
payload = {
|
|
10523
|
-
name: dataList,
|
|
10524
|
-
department_head_id: null
|
|
10525
|
-
};
|
|
10526
|
-
}
|
|
10527
9541
|
var message = title + " added successfully.";
|
|
10528
9542
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10529
9543
|
} else {
|
|
@@ -10537,12 +9551,9 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10537
9551
|
var message = title + " deleted successfully.";
|
|
10538
9552
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10539
9553
|
};
|
|
10540
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type
|
|
10541
|
-
if (optionalParams === void 0) {
|
|
10542
|
-
optionalParams = null;
|
|
10543
|
-
}
|
|
9554
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10544
9555
|
dispatch(userPanelShowLoader());
|
|
10545
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9556
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10546
9557
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10547
9558
|
dispatch(userPanelStopLoader());
|
|
10548
9559
|
if (type === 'delete') {
|
|
@@ -10584,14 +9595,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10584
9595
|
name: dataList
|
|
10585
9596
|
}]
|
|
10586
9597
|
};
|
|
10587
|
-
if (tableName === 'department') {
|
|
10588
|
-
payload = {
|
|
10589
|
-
name: dataList,
|
|
10590
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10591
|
-
};
|
|
10592
|
-
}
|
|
10593
9598
|
var message = title + " updated successfully.";
|
|
10594
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9599
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
10595
9600
|
setErrorEdit(false);
|
|
10596
9601
|
} else {
|
|
10597
9602
|
setErrorEdit(true);
|
|
@@ -10698,10 +9703,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10698
9703
|
submitHandler: handleEditPanel,
|
|
10699
9704
|
isError: errorEdit,
|
|
10700
9705
|
isDisabledSubmitBtn: loading,
|
|
10701
|
-
validation: validation
|
|
10702
|
-
rowData: rowData,
|
|
10703
|
-
tableName: tableName,
|
|
10704
|
-
config: config
|
|
9706
|
+
validation: validation
|
|
10705
9707
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10706
9708
|
config: config
|
|
10707
9709
|
}));
|