@itilite/iui-user-management 0.4.20 → 0.4.22
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 +9 -113
- package/dist/index.js +511 -1961
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +515 -1965
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -4
package/dist/index.js
CHANGED
|
@@ -14,12 +14,10 @@ var moment = _interopDefault(require('moment'));
|
|
|
14
14
|
var reduxDevtoolsExtension = require('redux-devtools-extension');
|
|
15
15
|
var reactRouterDom = require('react-router-dom');
|
|
16
16
|
var styles$8 = require('@material-ui/core/styles');
|
|
17
|
-
var Tooltip = _interopDefault(require('@material-ui/core/Tooltip'));
|
|
18
17
|
var Switch = _interopDefault(require('@material-ui/core/Switch'));
|
|
19
18
|
var MoreHorizIcon = _interopDefault(require('@material-ui/icons/MoreHoriz'));
|
|
20
19
|
var Button = _interopDefault(require('@material-ui/core/Button'));
|
|
21
20
|
var core = require('@material-ui/core');
|
|
22
|
-
var useScrollPosition = require('@n8tb1t/use-scroll-position');
|
|
23
21
|
|
|
24
22
|
function _extends() {
|
|
25
23
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -35,37 +33,6 @@ function _extends() {
|
|
|
35
33
|
};
|
|
36
34
|
return _extends.apply(this, arguments);
|
|
37
35
|
}
|
|
38
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
39
|
-
if (!o) return;
|
|
40
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
41
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
42
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
43
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
44
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
45
|
-
}
|
|
46
|
-
function _arrayLikeToArray(arr, len) {
|
|
47
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
48
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
49
|
-
return arr2;
|
|
50
|
-
}
|
|
51
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
52
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
53
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
54
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
55
|
-
if (it) o = it;
|
|
56
|
-
var i = 0;
|
|
57
|
-
return function () {
|
|
58
|
-
if (i >= o.length) return {
|
|
59
|
-
done: true
|
|
60
|
-
};
|
|
61
|
-
return {
|
|
62
|
-
done: false,
|
|
63
|
-
value: o[i++]
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
68
|
-
}
|
|
69
36
|
|
|
70
37
|
var _Pact = /*#__PURE__*/function () {
|
|
71
38
|
function _Pact() {}
|
|
@@ -180,11 +147,17 @@ function r(e) {
|
|
|
180
147
|
var t,
|
|
181
148
|
f,
|
|
182
149
|
n = "";
|
|
183
|
-
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++)
|
|
150
|
+
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++) {
|
|
151
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
152
|
+
} else for (t in e) {
|
|
153
|
+
e[t] && (n && (n += " "), n += t);
|
|
154
|
+
}
|
|
184
155
|
return n;
|
|
185
156
|
}
|
|
186
157
|
function clsx() {
|
|
187
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
158
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
159
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
160
|
+
}
|
|
188
161
|
return n;
|
|
189
162
|
}
|
|
190
163
|
|
|
@@ -388,9 +361,6 @@ var userAddEditUrl = {
|
|
|
388
361
|
approversSearch: function approversSearch() {
|
|
389
362
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
390
363
|
},
|
|
391
|
-
transferAppover: function transferAppover() {
|
|
392
|
-
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
393
|
-
},
|
|
394
364
|
preSignedUrl: function preSignedUrl() {
|
|
395
365
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
396
366
|
},
|
|
@@ -423,12 +393,6 @@ var userAddEditUrl = {
|
|
|
423
393
|
},
|
|
424
394
|
undoRejectUserVerification: function undoRejectUserVerification(userId) {
|
|
425
395
|
return "api/v1/onboarding/user-signup-reject/" + userId + "?action=undo";
|
|
426
|
-
},
|
|
427
|
-
cardsEditUserDetails: function cardsEditUserDetails(userId) {
|
|
428
|
-
return env.getCardsapiURL() + "/authorization/user/" + userId;
|
|
429
|
-
},
|
|
430
|
-
cardsAddUsersDetails: function cardsAddUsersDetails() {
|
|
431
|
-
return env.getCardsapiURL() + "/authorization/company/" + IUILocalStorageService.getCompanyId() + "/roles";
|
|
432
396
|
}
|
|
433
397
|
};
|
|
434
398
|
var userListUrl = {
|
|
@@ -484,23 +448,15 @@ var userPanelUrl = {
|
|
|
484
448
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
485
449
|
},
|
|
486
450
|
getUnit: function getUnit(tableName, length, sort) {
|
|
487
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
451
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&order=" + sort;
|
|
488
452
|
},
|
|
489
453
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
490
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
454
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&order=" + sort;
|
|
491
455
|
},
|
|
492
456
|
moveUnit: function moveUnit() {
|
|
493
457
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
494
458
|
}
|
|
495
459
|
};
|
|
496
|
-
var departmentUrl = {
|
|
497
|
-
departmentUrl: function departmentUrl() {
|
|
498
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
499
|
-
},
|
|
500
|
-
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
501
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
460
|
|
|
505
461
|
var api = utils.configs.api;
|
|
506
462
|
var NAoptionConfig = {
|
|
@@ -642,53 +598,11 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
642
598
|
return Promise.reject(e);
|
|
643
599
|
}
|
|
644
600
|
};
|
|
645
|
-
var
|
|
601
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
646
602
|
var page = _ref4.page,
|
|
647
603
|
product = _ref4.product,
|
|
648
|
-
userId = _ref4.userId
|
|
649
|
-
|
|
650
|
-
return Promise.resolve(_catch(function () {
|
|
651
|
-
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
652
|
-
return res.data;
|
|
653
|
-
})).then(function (response) {
|
|
654
|
-
var mappedValue = response.results.map(function (item) {
|
|
655
|
-
return {
|
|
656
|
-
value: item.email,
|
|
657
|
-
label: item.email,
|
|
658
|
-
type: 'detailed',
|
|
659
|
-
data: item
|
|
660
|
-
};
|
|
661
|
-
});
|
|
662
|
-
return {
|
|
663
|
-
options: mappedValue,
|
|
664
|
-
hasMore: !!response.next,
|
|
665
|
-
additional: {
|
|
666
|
-
page: page + 1,
|
|
667
|
-
product: product,
|
|
668
|
-
userId: userId
|
|
669
|
-
}
|
|
670
|
-
};
|
|
671
|
-
});
|
|
672
|
-
}, function () {
|
|
673
|
-
return {
|
|
674
|
-
options: [],
|
|
675
|
-
hasMore: false,
|
|
676
|
-
additional: {
|
|
677
|
-
page: 1,
|
|
678
|
-
product: product,
|
|
679
|
-
userId: userId
|
|
680
|
-
}
|
|
681
|
-
};
|
|
682
|
-
}));
|
|
683
|
-
} catch (e) {
|
|
684
|
-
return Promise.reject(e);
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
688
|
-
var page = _ref5.page,
|
|
689
|
-
product = _ref5.product,
|
|
690
|
-
userId = _ref5.userId,
|
|
691
|
-
placeholder = _ref5.placeholder;
|
|
604
|
+
userId = _ref4.userId,
|
|
605
|
+
placeholder = _ref4.placeholder;
|
|
692
606
|
try {
|
|
693
607
|
return Promise.resolve(_catch(function () {
|
|
694
608
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -734,9 +648,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
|
734
648
|
return Promise.reject(e);
|
|
735
649
|
}
|
|
736
650
|
};
|
|
737
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
738
|
-
var page =
|
|
739
|
-
tabelName =
|
|
651
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
652
|
+
var page = _ref5.page,
|
|
653
|
+
tabelName = _ref5.tabelName;
|
|
740
654
|
try {
|
|
741
655
|
return Promise.resolve(_catch(function () {
|
|
742
656
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -771,45 +685,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
771
685
|
return Promise.reject(e);
|
|
772
686
|
}
|
|
773
687
|
};
|
|
774
|
-
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
775
|
-
var page = _ref7.page,
|
|
776
|
-
departmentId = _ref7.departmentId;
|
|
777
|
-
try {
|
|
778
|
-
return Promise.resolve(_catch(function () {
|
|
779
|
-
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
780
|
-
return res.data;
|
|
781
|
-
})).then(function (response) {
|
|
782
|
-
var mappedValue = response.results.map(function (item) {
|
|
783
|
-
return {
|
|
784
|
-
value: item.id,
|
|
785
|
-
label: item.first_name + ' ' + item.last_name,
|
|
786
|
-
type: 'detailed',
|
|
787
|
-
data: item
|
|
788
|
-
};
|
|
789
|
-
});
|
|
790
|
-
return {
|
|
791
|
-
options: mappedValue,
|
|
792
|
-
hasMore: !!response.next,
|
|
793
|
-
additional: {
|
|
794
|
-
page: page + 1,
|
|
795
|
-
departmentId: departmentId
|
|
796
|
-
}
|
|
797
|
-
};
|
|
798
|
-
});
|
|
799
|
-
}, function () {
|
|
800
|
-
return {
|
|
801
|
-
options: [],
|
|
802
|
-
hasMore: false,
|
|
803
|
-
additional: {
|
|
804
|
-
page: 1,
|
|
805
|
-
departmentId: departmentId
|
|
806
|
-
}
|
|
807
|
-
};
|
|
808
|
-
}));
|
|
809
|
-
} catch (e) {
|
|
810
|
-
return Promise.reject(e);
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
688
|
|
|
814
689
|
var UserRole = function UserRole(_ref) {
|
|
815
690
|
var _ref$list = _ref.list,
|
|
@@ -831,7 +706,6 @@ var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expi
|
|
|
831
706
|
var SHOW_LOADER = 'SHOW_LOADER';
|
|
832
707
|
var STOP_LOADER = 'STOP_LOADER';
|
|
833
708
|
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
834
|
-
var SET_CARDS_DETAILS = 'SET_CARDS_DETAILS';
|
|
835
709
|
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
836
710
|
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
837
711
|
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
@@ -876,15 +750,9 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
876
750
|
if (payload.productAccess.expense) {
|
|
877
751
|
product.expense = payload.expenseRole || null;
|
|
878
752
|
}
|
|
879
|
-
if (payload.productAccess.card) {
|
|
880
|
-
var splitRole = payload.cardsRole.split(":");
|
|
881
|
-
var cardsUsmRole = splitRole[2];
|
|
882
|
-
product.card = cardsUsmRole || null;
|
|
883
|
-
}
|
|
884
753
|
return product;
|
|
885
754
|
}(),
|
|
886
|
-
approvers: {}
|
|
887
|
-
requested_user_is_admin: payload.isCardsAdmin
|
|
755
|
+
approvers: {}
|
|
888
756
|
};
|
|
889
757
|
var userTags = [];
|
|
890
758
|
for (var key in payload.userTagType) {
|
|
@@ -976,20 +844,13 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
976
844
|
var res = {
|
|
977
845
|
fields: {
|
|
978
846
|
user_personal_info: {},
|
|
979
|
-
employee_info: {}
|
|
980
|
-
requested_user_is_admin: payload.isCardsAdmin
|
|
847
|
+
employee_info: {}
|
|
981
848
|
}
|
|
982
849
|
};
|
|
983
850
|
if (!env$1.isProfilePage()) {
|
|
984
851
|
res.fields.product = function () {
|
|
985
|
-
if (payload.productAccess.travel && payload.productAccess.expense
|
|
986
|
-
return 'expense+travel+card';
|
|
987
|
-
} else if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
852
|
+
if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
988
853
|
return 'expense+travel';
|
|
989
|
-
} else if (payload.productAccess.expense && payload.productAccess.card) {
|
|
990
|
-
return 'expense+card';
|
|
991
|
-
} else if (payload.productAccess.travel && payload.productAccess.card) {
|
|
992
|
-
return 'travel+card';
|
|
993
854
|
} else if (payload.productAccess.travel) {
|
|
994
855
|
return 'travel';
|
|
995
856
|
} else {
|
|
@@ -1004,11 +865,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1004
865
|
if (payload.productAccess.expense) {
|
|
1005
866
|
roles.expense = payload.expenseRole;
|
|
1006
867
|
}
|
|
1007
|
-
if (payload.productAccess.card) {
|
|
1008
|
-
var splitRole = payload.cardsRole.split(":");
|
|
1009
|
-
var cardsUsmRole = splitRole[2];
|
|
1010
|
-
roles.card = cardsUsmRole;
|
|
1011
|
-
}
|
|
1012
868
|
return roles;
|
|
1013
869
|
}();
|
|
1014
870
|
res.fields.custom_attributes = payload.customFieldsInput;
|
|
@@ -1297,19 +1153,10 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1297
1153
|
payload: tabId
|
|
1298
1154
|
};
|
|
1299
1155
|
};
|
|
1300
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1301
|
-
if (roleTransfer === void 0) {
|
|
1302
|
-
roleTransfer = false;
|
|
1303
|
-
}
|
|
1304
|
-
var _payload = {
|
|
1305
|
-
role_transfer: roleTransfer
|
|
1306
|
-
};
|
|
1307
|
-
if (roleTransfer) {
|
|
1308
|
-
_payload.new_approver_user_id = newApproverUserId;
|
|
1309
|
-
}
|
|
1156
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1310
1157
|
return function (dispatch) {
|
|
1311
1158
|
return new Promise(function (resolve, reject) {
|
|
1312
|
-
api$1.
|
|
1159
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1313
1160
|
dispatch(setUserActiveStatus({
|
|
1314
1161
|
is_active: activateVal !== 0,
|
|
1315
1162
|
id: id
|
|
@@ -1347,12 +1194,6 @@ var setRenderFields = function setRenderFields(payload) {
|
|
|
1347
1194
|
payload: payload
|
|
1348
1195
|
};
|
|
1349
1196
|
};
|
|
1350
|
-
var setCardsDetails = function setCardsDetails(payload) {
|
|
1351
|
-
return {
|
|
1352
|
-
type: SET_CARDS_DETAILS,
|
|
1353
|
-
payload: payload
|
|
1354
|
-
};
|
|
1355
|
-
};
|
|
1356
1197
|
var setCustomField = function setCustomField(payload) {
|
|
1357
1198
|
return {
|
|
1358
1199
|
type: SET_CUSTOM_FIELD,
|
|
@@ -1412,6 +1253,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1412
1253
|
var _res$data;
|
|
1413
1254
|
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.');
|
|
1414
1255
|
dispatch(stopLoader());
|
|
1256
|
+
reject();
|
|
1415
1257
|
}
|
|
1416
1258
|
})["catch"](function (err) {
|
|
1417
1259
|
reject(err);
|
|
@@ -1424,7 +1266,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1424
1266
|
return new Promise(function (resolve, reject) {
|
|
1425
1267
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1426
1268
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1427
|
-
resolve(
|
|
1269
|
+
resolve('success');
|
|
1428
1270
|
})["catch"](function (err) {
|
|
1429
1271
|
reject(err);
|
|
1430
1272
|
})["finally"](function () {});
|
|
@@ -1583,9 +1425,11 @@ var createUser = function createUser(payload) {
|
|
|
1583
1425
|
} else {
|
|
1584
1426
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1585
1427
|
reject(res.data.errors);
|
|
1428
|
+
return;
|
|
1586
1429
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1587
1430
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1588
1431
|
}
|
|
1432
|
+
reject();
|
|
1589
1433
|
}
|
|
1590
1434
|
})["catch"](function (err) {
|
|
1591
1435
|
var _err$response6;
|
|
@@ -1682,43 +1526,20 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1682
1526
|
});
|
|
1683
1527
|
};
|
|
1684
1528
|
};
|
|
1685
|
-
var
|
|
1686
|
-
return function (dispatch) {
|
|
1687
|
-
return new Promise(function (resolve, reject) {
|
|
1688
|
-
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1689
|
-
email: data.email
|
|
1690
|
-
}).then(function (res) {
|
|
1691
|
-
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.");
|
|
1692
|
-
resolve();
|
|
1693
|
-
})["catch"](function (err) {
|
|
1694
|
-
var _err$response9, _err$response9$data;
|
|
1695
|
-
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)) {
|
|
1696
|
-
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1697
|
-
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]);
|
|
1698
|
-
reject(err);
|
|
1699
|
-
return;
|
|
1700
|
-
}
|
|
1701
|
-
reject(err);
|
|
1702
|
-
});
|
|
1703
|
-
});
|
|
1704
|
-
};
|
|
1705
|
-
};
|
|
1706
|
-
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1529
|
+
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1707
1530
|
return function (dispatch) {
|
|
1708
1531
|
return new Promise(function (resolve, reject) {
|
|
1709
|
-
api$2.
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1532
|
+
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1533
|
+
dispatch(fetchUserSignupRequests({
|
|
1534
|
+
ordering: 'asc',
|
|
1535
|
+
length: 5,
|
|
1536
|
+
page: 1,
|
|
1537
|
+
search: ''
|
|
1538
|
+
}));
|
|
1713
1539
|
resolve();
|
|
1714
1540
|
})["catch"](function (err) {
|
|
1715
|
-
var _err$
|
|
1716
|
-
|
|
1717
|
-
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1718
|
-
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]);
|
|
1719
|
-
reject(err);
|
|
1720
|
-
return;
|
|
1721
|
-
}
|
|
1541
|
+
var _err$response8, _err$response8$data;
|
|
1542
|
+
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.');
|
|
1722
1543
|
reject(err);
|
|
1723
1544
|
});
|
|
1724
1545
|
});
|
|
@@ -1860,7 +1681,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1860
1681
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1861
1682
|
return function (dispatch) {
|
|
1862
1683
|
return new Promise(function (resolve, reject) {
|
|
1863
|
-
api$2.post(
|
|
1684
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1864
1685
|
resolve(res);
|
|
1865
1686
|
})["catch"](function (err) {
|
|
1866
1687
|
var _err$response17, _err$response17$data;
|
|
@@ -1896,7 +1717,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1896
1717
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1897
1718
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1898
1719
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1899
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1900
1720
|
|
|
1901
1721
|
var api$3 = utils.configs.api;
|
|
1902
1722
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1946,14 +1766,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1946
1766
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1947
1767
|
return function (dispatch) {
|
|
1948
1768
|
return new Promise(function (resolve, reject) {
|
|
1949
|
-
api$3.post(
|
|
1769
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1950
1770
|
dispatch(getUserPanalData(getParam));
|
|
1951
1771
|
dispatch(closeDialog());
|
|
1952
1772
|
resolve(res);
|
|
1953
1773
|
})["catch"](function (err) {
|
|
1954
|
-
var _err$
|
|
1774
|
+
var _err$response2, _err$response2$data;
|
|
1955
1775
|
dispatch(userPanelStopLoader());
|
|
1956
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1776
|
+
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.');
|
|
1957
1777
|
});
|
|
1958
1778
|
});
|
|
1959
1779
|
};
|
|
@@ -1967,37 +1787,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1967
1787
|
dispatch(userPanelStopLoader());
|
|
1968
1788
|
resolve();
|
|
1969
1789
|
})["catch"](function (err) {
|
|
1970
|
-
var _err$
|
|
1971
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1790
|
+
var _err$response3, _err$response3$data;
|
|
1791
|
+
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.');
|
|
1972
1792
|
dispatch(userPanelStopLoader());
|
|
1973
1793
|
});
|
|
1974
1794
|
});
|
|
1975
1795
|
};
|
|
1976
1796
|
};
|
|
1977
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1797
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1978
1798
|
return function (dispatch) {
|
|
1979
1799
|
return new Promise(function (resolve, reject) {
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
});
|
|
1990
|
-
} else {
|
|
1991
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1992
|
-
dispatch(getUserPanalData(getParam));
|
|
1993
|
-
dispatch(closeDialog());
|
|
1994
|
-
resolve();
|
|
1995
|
-
})["catch"](function (err) {
|
|
1996
|
-
var _err$response6, _err$response6$data;
|
|
1997
|
-
dispatch(userPanelStopLoader());
|
|
1998
|
-
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.');
|
|
1999
|
-
});
|
|
2000
|
-
}
|
|
1800
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1801
|
+
dispatch(getUserPanalData(getParam));
|
|
1802
|
+
dispatch(closeDialog());
|
|
1803
|
+
resolve();
|
|
1804
|
+
})["catch"](function (err) {
|
|
1805
|
+
var _err$response4, _err$response4$data;
|
|
1806
|
+
dispatch(userPanelStopLoader());
|
|
1807
|
+
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.');
|
|
1808
|
+
});
|
|
2001
1809
|
});
|
|
2002
1810
|
};
|
|
2003
1811
|
};
|
|
@@ -2009,8 +1817,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
2009
1817
|
dispatch(closeDialog());
|
|
2010
1818
|
resolve(res);
|
|
2011
1819
|
})["catch"](function (err) {
|
|
2012
|
-
var _err$
|
|
2013
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1820
|
+
var _err$response5, _err$response5$data;
|
|
1821
|
+
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.');
|
|
2014
1822
|
});
|
|
2015
1823
|
});
|
|
2016
1824
|
};
|
|
@@ -2330,7 +2138,7 @@ var PaymentCards = function PaymentCards(_ref3) {
|
|
|
2330
2138
|
isDefaultCard: !!+card.metadata.default_card,
|
|
2331
2139
|
pg: paymentDetails.pg
|
|
2332
2140
|
});
|
|
2333
|
-
}), (!paymentDetails.cards || paymentDetails.cards.length <
|
|
2141
|
+
}), (!paymentDetails.cards || paymentDetails.cards.length < 6) && paymentDetails.pg.gateway.toLowerCase() === 'stripe' && paymentDetails.pg.save_card_enable === 1 && /*#__PURE__*/React__default.createElement(AddCard, {
|
|
2334
2142
|
pg: paymentDetails.pg
|
|
2335
2143
|
}))))));
|
|
2336
2144
|
};
|
|
@@ -3099,8 +2907,8 @@ var workInfo = [{
|
|
|
3099
2907
|
validation: {
|
|
3100
2908
|
regexOnChange: null,
|
|
3101
2909
|
regexOnBlur: [{
|
|
3102
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
3103
|
-
message: "Only alphabets, numbers
|
|
2910
|
+
regex: /^[(A-Z)(a-z)(0-9)\-& ]*$/,
|
|
2911
|
+
message: "Only alphabets, numbers and - & are allowed."
|
|
3104
2912
|
}],
|
|
3105
2913
|
maxLimit: '',
|
|
3106
2914
|
minLimit: '',
|
|
@@ -3188,8 +2996,8 @@ var workInfo = [{
|
|
|
3188
2996
|
validation: {
|
|
3189
2997
|
regexOnChange: null,
|
|
3190
2998
|
regexOnBlur: [{
|
|
3191
|
-
regex: /^[A-Za-z0-9
|
|
3192
|
-
message: "Only alphabets, numbers & special characters . & ' ( )
|
|
2999
|
+
regex: /^[A-Za-z0-9 \-.,&'()\/]*$/,
|
|
3000
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3193
3001
|
}, {
|
|
3194
3002
|
regex: /^[a-zA-Z]/,
|
|
3195
3003
|
message: 'Designation should start with alphabets'
|
|
@@ -3255,12 +3063,6 @@ var products = [{
|
|
|
3255
3063
|
name: 'expense',
|
|
3256
3064
|
type: 'checkbox',
|
|
3257
3065
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3258
|
-
}, {
|
|
3259
|
-
id: 3,
|
|
3260
|
-
label: 'Card',
|
|
3261
|
-
name: 'card',
|
|
3262
|
-
type: 'checkbox',
|
|
3263
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3264
3066
|
}];
|
|
3265
3067
|
var dropdownList = {
|
|
3266
3068
|
gender: [{
|
|
@@ -3431,34 +3233,6 @@ var expenseConstants = {
|
|
|
3431
3233
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3432
3234
|
}]
|
|
3433
3235
|
};
|
|
3434
|
-
var cardsConstants = {
|
|
3435
|
-
heading: 'Card specific information',
|
|
3436
|
-
roleHeading: 'Card role',
|
|
3437
|
-
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3438
|
-
roles: [{
|
|
3439
|
-
id: 1,
|
|
3440
|
-
label: 'Card holder',
|
|
3441
|
-
description: 'Can view own cards and transactions.',
|
|
3442
|
-
value: '',
|
|
3443
|
-
name: '',
|
|
3444
|
-
type: 'radio',
|
|
3445
|
-
isAssigned: false,
|
|
3446
|
-
fullWidth: false,
|
|
3447
|
-
visibility: true,
|
|
3448
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3449
|
-
}, {
|
|
3450
|
-
id: 2,
|
|
3451
|
-
label: 'Card admin',
|
|
3452
|
-
description: 'Has full administrative access to the card program. Can issue cards, set card limits, add users, has visibility into all transactions, statements and balances.',
|
|
3453
|
-
value: '',
|
|
3454
|
-
name: '',
|
|
3455
|
-
type: 'radio',
|
|
3456
|
-
isAssigned: false,
|
|
3457
|
-
fullWidth: false,
|
|
3458
|
-
visibility: true,
|
|
3459
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3460
|
-
}]
|
|
3461
|
-
};
|
|
3462
3236
|
var passportInfo = [{
|
|
3463
3237
|
id: 1,
|
|
3464
3238
|
label: 'Passport issuing country',
|
|
@@ -3688,12 +3462,6 @@ var initialState = {
|
|
|
3688
3462
|
travelConstants: travelConstants,
|
|
3689
3463
|
expenseConstants: expenseConstants
|
|
3690
3464
|
},
|
|
3691
|
-
isCardsDetailsRendered: false,
|
|
3692
|
-
isCardsAdmin: false,
|
|
3693
|
-
cardsDetails: {
|
|
3694
|
-
cardsRoles: cardsConstants.roles,
|
|
3695
|
-
cardsConstants: cardsConstants
|
|
3696
|
-
},
|
|
3697
3465
|
dropdownList: dropdownList,
|
|
3698
3466
|
maxTravelApprovers: 10,
|
|
3699
3467
|
maxExpenseApprovers: 10,
|
|
@@ -3860,37 +3628,11 @@ var reducer = function reducer(state, action) {
|
|
|
3860
3628
|
isRendered: true
|
|
3861
3629
|
});
|
|
3862
3630
|
}
|
|
3863
|
-
case SET_CARDS_DETAILS:
|
|
3864
|
-
{
|
|
3865
|
-
var _action$payload8, _action$payload8$role, _action$payload9;
|
|
3866
|
-
var cardsDetails = _extends({}, state.cardsDetails);
|
|
3867
|
-
if (action !== null && action !== void 0 && (_action$payload8 = action.payload) !== null && _action$payload8 !== void 0 && (_action$payload8$role = _action$payload8.roles) !== null && _action$payload8$role !== void 0 && _action$payload8$role.length) {
|
|
3868
|
-
cardsDetails.cardsRoles = action.payload.roles.map(function (role) {
|
|
3869
|
-
return {
|
|
3870
|
-
id: role.id,
|
|
3871
|
-
label: role.name,
|
|
3872
|
-
description: role.description,
|
|
3873
|
-
value: role.value,
|
|
3874
|
-
isAssigned: role.is_assigned,
|
|
3875
|
-
name: role.value,
|
|
3876
|
-
type: 'radio',
|
|
3877
|
-
fullWidth: false,
|
|
3878
|
-
visibility: true,
|
|
3879
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3880
|
-
};
|
|
3881
|
-
});
|
|
3882
|
-
}
|
|
3883
|
-
return _extends({}, state, {
|
|
3884
|
-
cardsDetails: cardsDetails,
|
|
3885
|
-
isCardsDetailsRendered: true,
|
|
3886
|
-
isCardsAdmin: action === null || action === void 0 ? void 0 : (_action$payload9 = action.payload) === null || _action$payload9 === void 0 ? void 0 : _action$payload9.requested_user_is_admin
|
|
3887
|
-
});
|
|
3888
|
-
}
|
|
3889
3631
|
case SET_STATIC_FIELDS_VISIBILITY:
|
|
3890
3632
|
{
|
|
3891
3633
|
var _personalInfo = state.renderFields.personalInfo.map(function (input) {
|
|
3892
|
-
var _action$
|
|
3893
|
-
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$
|
|
3634
|
+
var _action$payload8;
|
|
3635
|
+
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$payload8 = action.payload) !== null && _action$payload8 !== void 0 && _action$payload8[input.name]) {
|
|
3894
3636
|
if (Object.hasOwnProperty.call(action.payload[input.name], 'readOnly')) {
|
|
3895
3637
|
input.readOnly = action.payload[input.name].readOnly;
|
|
3896
3638
|
}
|
|
@@ -4176,7 +3918,6 @@ var initialState$2 = {
|
|
|
4176
3918
|
previous: null,
|
|
4177
3919
|
results: []
|
|
4178
3920
|
},
|
|
4179
|
-
deptUsers: [],
|
|
4180
3921
|
loading: false
|
|
4181
3922
|
};
|
|
4182
3923
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4246,12 +3987,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4246
3987
|
loading: false
|
|
4247
3988
|
});
|
|
4248
3989
|
}
|
|
4249
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4250
|
-
{
|
|
4251
|
-
return _extends({}, state, {
|
|
4252
|
-
deptUsers: action.payload
|
|
4253
|
-
});
|
|
4254
|
-
}
|
|
4255
3990
|
default:
|
|
4256
3991
|
return state;
|
|
4257
3992
|
}
|
|
@@ -4943,9 +4678,7 @@ var ErrorMessages = {
|
|
|
4943
4678
|
passport_expiry_date: 'Please enter passport expiry date.',
|
|
4944
4679
|
passport_photo: 'Please attach passport photo.',
|
|
4945
4680
|
travel_docs: 'Please attach travel docs.',
|
|
4946
|
-
products: 'Please select atleast one product access.'
|
|
4947
|
-
only_cards_products: 'Currently, Card cannot be selected as a standalone option. Please add at least one more product.',
|
|
4948
|
-
none_products: 'Select at least one product. If opting for card, please choose at least one additional product.'
|
|
4681
|
+
products: 'Please select atleast one product access.'
|
|
4949
4682
|
};
|
|
4950
4683
|
|
|
4951
4684
|
function AddPanelDialog(_ref) {
|
|
@@ -4995,73 +4728,7 @@ function AddPanelDialog(_ref) {
|
|
|
4995
4728
|
})));
|
|
4996
4729
|
}
|
|
4997
4730
|
|
|
4998
|
-
var
|
|
4999
|
-
var cardsConstants = props.cardsConstants,
|
|
5000
|
-
_props$onRoleChange = props.onRoleChange,
|
|
5001
|
-
onRoleChange = _props$onRoleChange === void 0 ? function () {} : _props$onRoleChange,
|
|
5002
|
-
_props$roleValue = props.roleValue,
|
|
5003
|
-
roleValue = _props$roleValue === void 0 ? '' : _props$roleValue,
|
|
5004
|
-
_props$isProfile = props.isProfile,
|
|
5005
|
-
isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
|
|
5006
|
-
_props$roles = props.roles,
|
|
5007
|
-
roles = _props$roles === void 0 ? [] : _props$roles,
|
|
5008
|
-
_props$cardsAdmin = props.cardsAdmin,
|
|
5009
|
-
cardsAdmin = _props$cardsAdmin === void 0 ? false : _props$cardsAdmin,
|
|
5010
|
-
editUserId = props.editUserId,
|
|
5011
|
-
loggedInUserId = props.loggedInUserId;
|
|
5012
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5013
|
-
container: true,
|
|
5014
|
-
className: (styles.headingPadding)
|
|
5015
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
5016
|
-
variant: "h3",
|
|
5017
|
-
className: clsx(styles.heading, styles.headingMedium)
|
|
5018
|
-
}, cardsConstants.heading)), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
5019
|
-
className: styles.dividerColor
|
|
5020
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5021
|
-
container: true,
|
|
5022
|
-
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
5023
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5024
|
-
item: true,
|
|
5025
|
-
sm: 12,
|
|
5026
|
-
md: 4
|
|
5027
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
5028
|
-
label: cardsConstants.roleHeading,
|
|
5029
|
-
headerType: true,
|
|
5030
|
-
description: cardsConstants.roleDescription
|
|
5031
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5032
|
-
item: true,
|
|
5033
|
-
sm: 12,
|
|
5034
|
-
md: 8,
|
|
5035
|
-
lg: 8,
|
|
5036
|
-
xl: 6
|
|
5037
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5038
|
-
container: true,
|
|
5039
|
-
className: styles.formFieldsWrapper
|
|
5040
|
-
}, isProfile || loggedInUserId === editUserId ? /*#__PURE__*/React__default.createElement(UserRole, {
|
|
5041
|
-
list: roles,
|
|
5042
|
-
value: roleValue
|
|
5043
|
-
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIRadio, {
|
|
5044
|
-
list: roles,
|
|
5045
|
-
value: roleValue,
|
|
5046
|
-
onValueChange: onRoleChange,
|
|
5047
|
-
disabled: cardsAdmin ? false : true
|
|
5048
|
-
})), !cardsAdmin && !isProfile && /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5049
|
-
item: true,
|
|
5050
|
-
sm: 12,
|
|
5051
|
-
md: 12,
|
|
5052
|
-
lg: 12,
|
|
5053
|
-
style: {
|
|
5054
|
-
marginTop: "24px"
|
|
5055
|
-
}
|
|
5056
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
5057
|
-
variant: "body2",
|
|
5058
|
-
component: "span",
|
|
5059
|
-
className: styles.errorTextCls
|
|
5060
|
-
}, editUserId ? "Only Card admin can change the Card role." : "Only Card admin can change card roles. By default this user will have Card Holder role.")))));
|
|
5061
|
-
};
|
|
5062
|
-
|
|
5063
|
-
var IUIToastMessageService$4 = utils.services.IUIToastMessageService,
|
|
5064
|
-
IUILocalStorageService$5 = utils.services.IUILocalStorageService;
|
|
4731
|
+
var IUIToastMessageService$4 = utils.services.IUIToastMessageService;
|
|
5065
4732
|
var env$4 = utils.configs.env;
|
|
5066
4733
|
var UserAddEdit = function UserAddEdit(props) {
|
|
5067
4734
|
var isEditMode = props.isEditMode,
|
|
@@ -5088,10 +4755,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5088
4755
|
isRendered = _useSelector.isRendered,
|
|
5089
4756
|
maxTravelApprovers = _useSelector.maxTravelApprovers,
|
|
5090
4757
|
maxExpenseApprovers = _useSelector.maxExpenseApprovers,
|
|
5091
|
-
maxMembershipInput = _useSelector.maxMembershipInput
|
|
5092
|
-
isCardsDetailsRendered = _useSelector.isCardsDetailsRendered,
|
|
5093
|
-
isCardsAdmin = _useSelector.isCardsAdmin,
|
|
5094
|
-
cardsDetails = _useSelector.cardsDetails;
|
|
4758
|
+
maxMembershipInput = _useSelector.maxMembershipInput;
|
|
5095
4759
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
5096
4760
|
return state.common;
|
|
5097
4761
|
}),
|
|
@@ -5101,11 +4765,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5101
4765
|
isILadmin = _useSelector2.isILadmin,
|
|
5102
4766
|
companyName = _useSelector2.companyName;
|
|
5103
4767
|
var history = reactRouterDom.useHistory();
|
|
5104
|
-
var location = reactRouterDom.useLocation();
|
|
5105
4768
|
var _useState = React.useState({
|
|
5106
4769
|
travel: false,
|
|
5107
|
-
expense: false
|
|
5108
|
-
card: false
|
|
4770
|
+
expense: false
|
|
5109
4771
|
}),
|
|
5110
4772
|
productAccess = _useState[0],
|
|
5111
4773
|
setProductAccess = _useState[1];
|
|
@@ -5116,13 +4778,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5116
4778
|
errorMsgs.products = '';
|
|
5117
4779
|
var _productAccess = _extends({}, productAccess);
|
|
5118
4780
|
_productAccess[value] = !_productAccess[value];
|
|
5119
|
-
if (_productAccess.travel === false && _productAccess.expense === false
|
|
4781
|
+
if (_productAccess.travel === false && _productAccess.expense === false) {
|
|
5120
4782
|
var _errorArray = [].concat(errorArray);
|
|
5121
4783
|
var _errorMsgs = _extends({}, errorMsgs);
|
|
5122
4784
|
if (_errorArray.indexOf('products') === -1) {
|
|
5123
4785
|
_errorArray.push('products');
|
|
5124
4786
|
}
|
|
5125
|
-
_errorMsgs.products = ErrorMessages.
|
|
4787
|
+
_errorMsgs.products = ErrorMessages.products;
|
|
5126
4788
|
setErrorArray(_errorArray);
|
|
5127
4789
|
setErrorMsgs(_errorMsgs);
|
|
5128
4790
|
var el = document.getElementById('products');
|
|
@@ -5132,202 +4794,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5132
4794
|
block: 'center'
|
|
5133
4795
|
});
|
|
5134
4796
|
}
|
|
5135
|
-
} else if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.card === false) {
|
|
5136
|
-
var _errorArray2 = [].concat(errorArray);
|
|
5137
|
-
var _errorMsgs2 = _extends({}, errorMsgs);
|
|
5138
|
-
if (_errorArray2.indexOf('products') === -1) {
|
|
5139
|
-
_errorArray2.push('products');
|
|
5140
|
-
}
|
|
5141
|
-
_errorMsgs2.products = ErrorMessages.products;
|
|
5142
|
-
setErrorArray(_errorArray2);
|
|
5143
|
-
setErrorMsgs(_errorMsgs2);
|
|
5144
|
-
var _el = document.getElementById('products');
|
|
5145
|
-
if (_el) {
|
|
5146
|
-
_el.scrollIntoView({
|
|
5147
|
-
behavior: 'smooth',
|
|
5148
|
-
block: 'center'
|
|
5149
|
-
});
|
|
5150
|
-
}
|
|
5151
4797
|
} else {
|
|
5152
4798
|
setErrorArray(errorArray);
|
|
5153
4799
|
setErrorMsgs(errorMsgs);
|
|
5154
4800
|
}
|
|
5155
4801
|
setProductAccess(_productAccess);
|
|
5156
4802
|
};
|
|
5157
|
-
var _useState2 = React.useState(
|
|
5158
|
-
newCountryCode = _useState2[0],
|
|
5159
|
-
setNewCountryCode = _useState2[1];
|
|
5160
|
-
var _useState3 = React.useState(),
|
|
5161
|
-
countryDialCode = _useState3[0],
|
|
5162
|
-
setCountryDialCode = _useState3[1];
|
|
5163
|
-
var _useState4 = React.useState([]),
|
|
5164
|
-
countryContactCode = _useState4[0],
|
|
5165
|
-
setCountryContactCode = _useState4[1];
|
|
5166
|
-
var updateUserApiCall = function updateUserApiCall(payload, inputChangeLog) {
|
|
5167
|
-
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5168
|
-
if (isProfile) {
|
|
5169
|
-
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5170
|
-
(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);
|
|
5171
|
-
} else {
|
|
5172
|
-
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5173
|
-
(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);
|
|
5174
|
-
}
|
|
5175
|
-
setFilesForDelete([]);
|
|
5176
|
-
setProfilePicDelete([]);
|
|
5177
|
-
})["catch"](function (err) {
|
|
5178
|
-
if (typeof err === 'object') {
|
|
5179
|
-
if (err.country_code) {
|
|
5180
|
-
err.contact_number = err.country_code;
|
|
5181
|
-
}
|
|
5182
|
-
if (err.contact_country_code) {
|
|
5183
|
-
err.contact_number = err.contact_country_code;
|
|
5184
|
-
}
|
|
5185
|
-
if (err.passport) {
|
|
5186
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5187
|
-
delete err.passport;
|
|
5188
|
-
}
|
|
5189
|
-
setErrorArray(Object.keys(err));
|
|
5190
|
-
setErrorMsgs(err);
|
|
5191
|
-
var _loop = function _loop() {
|
|
5192
|
-
if (Object.hasOwnProperty.call(err, key)) {
|
|
5193
|
-
if (err[key]) {
|
|
5194
|
-
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5195
|
-
setAdditionalInfoFlag('open');
|
|
5196
|
-
}
|
|
5197
|
-
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5198
|
-
if (el) {
|
|
5199
|
-
setTimeout(function () {
|
|
5200
|
-
el.scrollIntoView({
|
|
5201
|
-
behavior: 'smooth',
|
|
5202
|
-
block: 'center'
|
|
5203
|
-
});
|
|
5204
|
-
}, 500);
|
|
5205
|
-
return 1;
|
|
5206
|
-
}
|
|
5207
|
-
}
|
|
5208
|
-
}
|
|
5209
|
-
};
|
|
5210
|
-
for (var key in err) {
|
|
5211
|
-
if (_loop()) break;
|
|
5212
|
-
}
|
|
5213
|
-
} else if (typeof err === 'string') {
|
|
5214
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
5215
|
-
} else {
|
|
5216
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5217
|
-
}
|
|
5218
|
-
})["finally"](function () {
|
|
5219
|
-
dispatch(stopLoader());
|
|
5220
|
-
});
|
|
5221
|
-
};
|
|
5222
|
-
var createUserApiCall = function createUserApiCall(payload) {
|
|
5223
|
-
dispatch(createUser(payload)).then(function (res) {
|
|
5224
|
-
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5225
|
-
if (config !== null && config !== void 0 && (_config$routes3 = config.routes) !== null && _config$routes3 !== void 0 && (_config$routes3$users = _config$routes3.users) !== null && _config$routes3$users !== void 0 && (_config$routes3$users2 = _config$routes3$users.list) !== null && _config$routes3$users2 !== void 0 && _config$routes3$users2.path) {
|
|
5226
|
-
history.push({
|
|
5227
|
-
pathname: config.routes.users.list.path
|
|
5228
|
-
});
|
|
5229
|
-
}
|
|
5230
|
-
})["catch"](function (err) {
|
|
5231
|
-
if (typeof err === 'object') {
|
|
5232
|
-
if (err.country_code) {
|
|
5233
|
-
err.contact_number = err.country_code;
|
|
5234
|
-
}
|
|
5235
|
-
if (err.contact_country_code) {
|
|
5236
|
-
err.contact_number = err.contact_country_code;
|
|
5237
|
-
}
|
|
5238
|
-
if (err.passport) {
|
|
5239
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5240
|
-
delete err.passport;
|
|
5241
|
-
}
|
|
5242
|
-
setErrorArray(Object.keys(err));
|
|
5243
|
-
setErrorMsgs(err);
|
|
5244
|
-
var _loop2 = function _loop2() {
|
|
5245
|
-
if (Object.hasOwnProperty.call(err, key)) {
|
|
5246
|
-
if (err[key]) {
|
|
5247
|
-
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5248
|
-
setAdditionalInfoFlag('open');
|
|
5249
|
-
}
|
|
5250
|
-
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5251
|
-
if (el) {
|
|
5252
|
-
setTimeout(function () {
|
|
5253
|
-
el.scrollIntoView({
|
|
5254
|
-
behavior: 'smooth',
|
|
5255
|
-
block: 'center'
|
|
5256
|
-
});
|
|
5257
|
-
}, 500);
|
|
5258
|
-
return 1;
|
|
5259
|
-
}
|
|
5260
|
-
}
|
|
5261
|
-
}
|
|
5262
|
-
};
|
|
5263
|
-
for (var key in err) {
|
|
5264
|
-
if (_loop2()) break;
|
|
5265
|
-
}
|
|
5266
|
-
} else if (typeof err === 'string') {
|
|
5267
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
5268
|
-
} else {
|
|
5269
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5270
|
-
}
|
|
5271
|
-
})["finally"](function () {
|
|
5272
|
-
dispatch(stopLoader());
|
|
5273
|
-
});
|
|
5274
|
-
};
|
|
5275
|
-
var fetchEditUserCardsDetails = function fetchEditUserCardsDetails(editUserId) {
|
|
5276
|
-
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
5277
|
-
method: 'GET',
|
|
5278
|
-
headers: {
|
|
5279
|
-
'Content-Type': 'application/json',
|
|
5280
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5281
|
-
}
|
|
5282
|
-
}).then(function (response) {
|
|
5283
|
-
return response.json();
|
|
5284
|
-
}).then(function (res) {
|
|
5285
|
-
var _res$roles;
|
|
5286
|
-
if (res !== null && res !== void 0 && (_res$roles = res.roles) !== null && _res$roles !== void 0 && _res$roles.length) {
|
|
5287
|
-
dispatch(setCardsDetails(res));
|
|
5288
|
-
} else {
|
|
5289
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5290
|
-
}
|
|
5291
|
-
})["catch"](function (error) {
|
|
5292
|
-
console.log("errorrr", error);
|
|
5293
|
-
});
|
|
5294
|
-
};
|
|
5295
|
-
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
5296
|
-
fetch(userAddEditUrl.cardsAddUsersDetails(), {
|
|
5297
|
-
method: 'GET',
|
|
5298
|
-
headers: {
|
|
5299
|
-
'Content-Type': 'application/json',
|
|
5300
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5301
|
-
}
|
|
5302
|
-
}).then(function (response) {
|
|
5303
|
-
return response.json();
|
|
5304
|
-
}).then(function (res) {
|
|
5305
|
-
var _res$roles2;
|
|
5306
|
-
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
5307
|
-
dispatch(setCardsDetails(res));
|
|
5308
|
-
} else {
|
|
5309
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5310
|
-
}
|
|
5311
|
-
})["catch"](function (error) {
|
|
5312
|
-
console.log("errorrr", error);
|
|
5313
|
-
});
|
|
5314
|
-
};
|
|
5315
|
-
React.useEffect(function () {
|
|
5316
|
-
var countryObject = countryContactCode.find(function (t) {
|
|
5317
|
-
return t.dial_code === countryDialCode;
|
|
5318
|
-
});
|
|
5319
|
-
if (countryObject) {
|
|
5320
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5321
|
-
country_code: countryObject.code
|
|
5322
|
-
}));
|
|
5323
|
-
}
|
|
5324
|
-
}, [countryDialCode]);
|
|
5325
|
-
React.useEffect(function () {
|
|
5326
|
-
var extractedNumber = newCountryCode.substring(1);
|
|
5327
|
-
var convertedNumber = parseInt(extractedNumber);
|
|
5328
|
-
setCountryDialCode(convertedNumber);
|
|
5329
|
-
}, [newCountryCode]);
|
|
5330
|
-
var _useState5 = React.useState({
|
|
4803
|
+
var _useState2 = React.useState({
|
|
5331
4804
|
first_name: '',
|
|
5332
4805
|
last_name: '',
|
|
5333
4806
|
email: '',
|
|
@@ -5338,9 +4811,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5338
4811
|
contact_country_code: '',
|
|
5339
4812
|
profile_pic: []
|
|
5340
4813
|
}),
|
|
5341
|
-
personalInfoInput =
|
|
5342
|
-
setPersonalInfoInput =
|
|
5343
|
-
var
|
|
4814
|
+
personalInfoInput = _useState2[0],
|
|
4815
|
+
setPersonalInfoInput = _useState2[1];
|
|
4816
|
+
var _useState3 = React.useState({
|
|
5344
4817
|
emp_level: {
|
|
5345
4818
|
value: '',
|
|
5346
4819
|
label: 'Select employee level'
|
|
@@ -5360,72 +4833,62 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5360
4833
|
},
|
|
5361
4834
|
designation: '',
|
|
5362
4835
|
base_location: '',
|
|
5363
|
-
manager_id: {
|
|
5364
|
-
value: '',
|
|
5365
|
-
label: 'Select Manager'
|
|
5366
|
-
},
|
|
5367
|
-
skip_manager_id: {
|
|
5368
|
-
value: '',
|
|
5369
|
-
label: 'Select Manager'
|
|
5370
|
-
},
|
|
5371
4836
|
currency: {
|
|
5372
4837
|
value: defaultCurrency,
|
|
5373
4838
|
label: defaultCurrency
|
|
5374
4839
|
}
|
|
5375
4840
|
}),
|
|
5376
|
-
employeeInfoInput =
|
|
5377
|
-
setEmployeeInfoInput =
|
|
5378
|
-
var
|
|
4841
|
+
employeeInfoInput = _useState3[0],
|
|
4842
|
+
setEmployeeInfoInput = _useState3[1];
|
|
4843
|
+
var _useState4 = React.useState({
|
|
5379
4844
|
emp_level: 0,
|
|
5380
4845
|
entity: 0,
|
|
5381
4846
|
business_unit: 0,
|
|
5382
4847
|
department: 0,
|
|
5383
|
-
currency: 0
|
|
5384
|
-
manager_id: 0,
|
|
5385
|
-
skip_manager_id: 0
|
|
4848
|
+
currency: 0
|
|
5386
4849
|
}),
|
|
5387
|
-
cacheForAsyncDropdown =
|
|
5388
|
-
clearCacheForAsyncDropdown =
|
|
5389
|
-
var
|
|
5390
|
-
userTagType =
|
|
5391
|
-
setUserTagType =
|
|
5392
|
-
var
|
|
5393
|
-
scroll =
|
|
5394
|
-
setScroll =
|
|
5395
|
-
var
|
|
5396
|
-
customFieldsInput =
|
|
5397
|
-
setCustomFieldsInput =
|
|
5398
|
-
var
|
|
5399
|
-
travelRole =
|
|
5400
|
-
setTravelRole =
|
|
5401
|
-
var
|
|
5402
|
-
travelApproversInput =
|
|
5403
|
-
setTravelApproversInput =
|
|
5404
|
-
var
|
|
4850
|
+
cacheForAsyncDropdown = _useState4[0],
|
|
4851
|
+
clearCacheForAsyncDropdown = _useState4[1];
|
|
4852
|
+
var _useState5 = React.useState({}),
|
|
4853
|
+
userTagType = _useState5[0],
|
|
4854
|
+
setUserTagType = _useState5[1];
|
|
4855
|
+
var _useState6 = React.useState(false),
|
|
4856
|
+
scroll = _useState6[0],
|
|
4857
|
+
setScroll = _useState6[1];
|
|
4858
|
+
var _useState7 = React.useState({}),
|
|
4859
|
+
customFieldsInput = _useState7[0],
|
|
4860
|
+
setCustomFieldsInput = _useState7[1];
|
|
4861
|
+
var _useState8 = React.useState('traveler'),
|
|
4862
|
+
travelRole = _useState8[0],
|
|
4863
|
+
setTravelRole = _useState8[1];
|
|
4864
|
+
var _useState9 = React.useState({}),
|
|
4865
|
+
travelApproversInput = _useState9[0],
|
|
4866
|
+
setTravelApproversInput = _useState9[1];
|
|
4867
|
+
var _useState10 = React.useState({
|
|
5405
4868
|
value: '',
|
|
5406
4869
|
label: 'Select approver'
|
|
5407
4870
|
}),
|
|
5408
|
-
travelFYI =
|
|
5409
|
-
setTravelFYI =
|
|
5410
|
-
var
|
|
5411
|
-
membershipInfoInput =
|
|
5412
|
-
setMembershipInfoInput =
|
|
5413
|
-
var
|
|
5414
|
-
removedMembershipInfoInput =
|
|
5415
|
-
setRemovedMembershipInfoInput =
|
|
5416
|
-
var
|
|
4871
|
+
travelFYI = _useState10[0],
|
|
4872
|
+
setTravelFYI = _useState10[1];
|
|
4873
|
+
var _useState11 = React.useState([]),
|
|
4874
|
+
membershipInfoInput = _useState11[0],
|
|
4875
|
+
setMembershipInfoInput = _useState11[1];
|
|
4876
|
+
var _useState12 = React.useState([]),
|
|
4877
|
+
removedMembershipInfoInput = _useState12[0],
|
|
4878
|
+
setRemovedMembershipInfoInput = _useState12[1];
|
|
4879
|
+
var _useState13 = React.useState({
|
|
5417
4880
|
flight_seat_preference: '',
|
|
5418
4881
|
meal_preference: ''
|
|
5419
4882
|
}),
|
|
5420
|
-
travelPreferenceInfo =
|
|
5421
|
-
settravelPreferenceInfo =
|
|
5422
|
-
var
|
|
4883
|
+
travelPreferenceInfo = _useState13[0],
|
|
4884
|
+
settravelPreferenceInfo = _useState13[1];
|
|
4885
|
+
var _useState14 = React.useState({
|
|
5423
4886
|
trusted_traveller: '',
|
|
5424
4887
|
redress_number: ''
|
|
5425
4888
|
}),
|
|
5426
|
-
secureTravelInputInfo =
|
|
5427
|
-
setSecureTravelInputInfo =
|
|
5428
|
-
var
|
|
4889
|
+
secureTravelInputInfo = _useState14[0],
|
|
4890
|
+
setSecureTravelInputInfo = _useState14[1];
|
|
4891
|
+
var _useState15 = React.useState({
|
|
5429
4892
|
passport_issue_country: {
|
|
5430
4893
|
value: '',
|
|
5431
4894
|
label: 'Select country'
|
|
@@ -5440,76 +4903,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5440
4903
|
passport_photo: [],
|
|
5441
4904
|
travel_docs: []
|
|
5442
4905
|
}),
|
|
5443
|
-
passportInfoInput =
|
|
5444
|
-
setPassportInfoInput =
|
|
5445
|
-
var
|
|
5446
|
-
filesForDelete =
|
|
5447
|
-
setFilesForDelete =
|
|
5448
|
-
var
|
|
5449
|
-
profilePicDelete =
|
|
5450
|
-
setProfilePicDelete =
|
|
5451
|
-
var
|
|
5452
|
-
isAdditionalInfoExpanded =
|
|
5453
|
-
setAdditionalInfoFlag =
|
|
5454
|
-
var
|
|
5455
|
-
expenseRole =
|
|
5456
|
-
setExpenseRole =
|
|
5457
|
-
var
|
|
5458
|
-
expenseApproversInput =
|
|
5459
|
-
setExpenseApproversInput =
|
|
5460
|
-
var
|
|
4906
|
+
passportInfoInput = _useState15[0],
|
|
4907
|
+
setPassportInfoInput = _useState15[1];
|
|
4908
|
+
var _useState16 = React.useState([]),
|
|
4909
|
+
filesForDelete = _useState16[0],
|
|
4910
|
+
setFilesForDelete = _useState16[1];
|
|
4911
|
+
var _useState17 = React.useState([]),
|
|
4912
|
+
profilePicDelete = _useState17[0],
|
|
4913
|
+
setProfilePicDelete = _useState17[1];
|
|
4914
|
+
var _useState18 = React.useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
4915
|
+
isAdditionalInfoExpanded = _useState18[0],
|
|
4916
|
+
setAdditionalInfoFlag = _useState18[1];
|
|
4917
|
+
var _useState19 = React.useState('submitter'),
|
|
4918
|
+
expenseRole = _useState19[0],
|
|
4919
|
+
setExpenseRole = _useState19[1];
|
|
4920
|
+
var _useState20 = React.useState({}),
|
|
4921
|
+
expenseApproversInput = _useState20[0],
|
|
4922
|
+
setExpenseApproversInput = _useState20[1];
|
|
4923
|
+
var _useState21 = React.useState({
|
|
5461
4924
|
value: '',
|
|
5462
4925
|
label: 'Select approver'
|
|
5463
4926
|
}),
|
|
5464
|
-
expenseFYI =
|
|
5465
|
-
setExpenseFYI =
|
|
5466
|
-
var _useState25 = React.useState(''),
|
|
5467
|
-
cardsRole = _useState25[0],
|
|
5468
|
-
setCardsRole = _useState25[1];
|
|
5469
|
-
React.useEffect(function () {
|
|
5470
|
-
if (productAccess.card === false) {
|
|
5471
|
-
setCardsRole('');
|
|
5472
|
-
}
|
|
5473
|
-
}, [productAccess.card]);
|
|
5474
|
-
React.useEffect(function () {
|
|
5475
|
-
if (isCardsDetailsRendered && !isProfile && productAccess.card) {
|
|
5476
|
-
var selectedRole = cardsDetails.cardsRoles.find(function (role) {
|
|
5477
|
-
return role.isAssigned;
|
|
5478
|
-
});
|
|
5479
|
-
if (selectedRole) {
|
|
5480
|
-
setCardsRole(selectedRole.value);
|
|
5481
|
-
} else {
|
|
5482
|
-
var defaultRole = cardsDetails.cardsRoles.find(function (role) {
|
|
5483
|
-
var splitRoleVal = role.value.split(':');
|
|
5484
|
-
return splitRoleVal[2] === 'card-holder';
|
|
5485
|
-
});
|
|
5486
|
-
if (defaultRole) {
|
|
5487
|
-
setCardsRole(defaultRole.value);
|
|
5488
|
-
}
|
|
5489
|
-
}
|
|
5490
|
-
} else if (isCardsDetailsRendered && isProfile && productAccess.card) {
|
|
5491
|
-
var targetRole = isCardsAdmin ? 'card-admin' : 'card-holder';
|
|
5492
|
-
for (var _iterator = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step; !(_step = _iterator()).done;) {
|
|
5493
|
-
var role = _step.value;
|
|
5494
|
-
var splitRoleVal = role.value.split(':');
|
|
5495
|
-
var profileRole = splitRoleVal[2];
|
|
5496
|
-
if (profileRole === targetRole) {
|
|
5497
|
-
setCardsRole(role.value);
|
|
5498
|
-
break;
|
|
5499
|
-
}
|
|
5500
|
-
}
|
|
5501
|
-
}
|
|
5502
|
-
}, [isCardsDetailsRendered, cardsDetails, isProfile, productAccess.card, isCardsAdmin]);
|
|
4927
|
+
expenseFYI = _useState21[0],
|
|
4928
|
+
setExpenseFYI = _useState21[1];
|
|
5503
4929
|
var asyncSelectRefs = React.useRef({
|
|
5504
4930
|
emp_level: React.useRef(null),
|
|
5505
4931
|
entity: React.useRef(null),
|
|
5506
4932
|
business_unit: React.useRef(null),
|
|
5507
4933
|
department: React.useRef(null)
|
|
5508
4934
|
});
|
|
5509
|
-
var
|
|
5510
|
-
errorArray =
|
|
5511
|
-
setErrorArray =
|
|
5512
|
-
var
|
|
4935
|
+
var _useState22 = React.useState([]),
|
|
4936
|
+
errorArray = _useState22[0],
|
|
4937
|
+
setErrorArray = _useState22[1];
|
|
4938
|
+
var _useState23 = React.useState({
|
|
5513
4939
|
first_name: '',
|
|
5514
4940
|
last_name: '',
|
|
5515
4941
|
email: '',
|
|
@@ -5539,9 +4965,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5539
4965
|
userTagType: '',
|
|
5540
4966
|
profile_pic: ''
|
|
5541
4967
|
}),
|
|
5542
|
-
errorMsgs =
|
|
5543
|
-
setErrorMsgs =
|
|
5544
|
-
var
|
|
4968
|
+
errorMsgs = _useState23[0],
|
|
4969
|
+
setErrorMsgs = _useState23[1];
|
|
4970
|
+
var _useState24 = React.useState({
|
|
5545
4971
|
first_name: false,
|
|
5546
4972
|
last_name: false,
|
|
5547
4973
|
email: false,
|
|
@@ -5568,14 +4994,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5568
4994
|
userTagType: false,
|
|
5569
4995
|
profile_pic: false
|
|
5570
4996
|
}),
|
|
5571
|
-
inputChangeLog =
|
|
5572
|
-
updateInputChangeLog =
|
|
5573
|
-
var
|
|
5574
|
-
uploadedFiles =
|
|
5575
|
-
setUploadedFiles =
|
|
5576
|
-
var _useState30 = React.useState(70),
|
|
5577
|
-
maxLengthForModal = _useState30[0],
|
|
5578
|
-
setMaxLengthForModal = _useState30[1];
|
|
4997
|
+
inputChangeLog = _useState24[0],
|
|
4998
|
+
updateInputChangeLog = _useState24[1];
|
|
4999
|
+
var _useState25 = React.useState([]),
|
|
5000
|
+
uploadedFiles = _useState25[0],
|
|
5001
|
+
setUploadedFiles = _useState25[1];
|
|
5579
5002
|
var defaultAddModalData = {
|
|
5580
5003
|
isOpen: false,
|
|
5581
5004
|
isError: false,
|
|
@@ -5588,41 +5011,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5588
5011
|
regexOnBlur: null,
|
|
5589
5012
|
maxLimit: '',
|
|
5590
5013
|
minLimit: '',
|
|
5591
|
-
maxLength:
|
|
5014
|
+
maxLength: 70,
|
|
5592
5015
|
minLength: 0
|
|
5593
5016
|
};
|
|
5594
|
-
var
|
|
5595
|
-
addModalData =
|
|
5596
|
-
setAddModalData =
|
|
5017
|
+
var _useState26 = React.useState(defaultAddModalData),
|
|
5018
|
+
addModalData = _useState26[0],
|
|
5019
|
+
setAddModalData = _useState26[1];
|
|
5597
5020
|
var onAddModalClose = function onAddModalClose() {
|
|
5598
5021
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5599
5022
|
};
|
|
5600
|
-
React.useEffect(function () {
|
|
5601
|
-
var _location$state, _location$state2;
|
|
5602
|
-
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) {
|
|
5603
|
-
var _location$state3, _location$state4;
|
|
5604
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5605
|
-
department: {
|
|
5606
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5607
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5608
|
-
}
|
|
5609
|
-
}));
|
|
5610
|
-
}
|
|
5611
|
-
}, []);
|
|
5612
5023
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5613
5024
|
var title = '';
|
|
5614
5025
|
if (id === 'entity') {
|
|
5615
5026
|
title = 'Entity';
|
|
5616
|
-
setMaxLengthForModal(70);
|
|
5617
5027
|
} else if (id === 'department') {
|
|
5618
5028
|
title = 'Department';
|
|
5619
|
-
setMaxLengthForModal(70);
|
|
5620
5029
|
} else if (id === 'business_unit') {
|
|
5621
|
-
setMaxLengthForModal(150);
|
|
5622
5030
|
title = 'Business unit';
|
|
5623
5031
|
} else if (id === 'employee_level') {
|
|
5624
5032
|
title = 'Employee level';
|
|
5625
|
-
setMaxLengthForModal(70);
|
|
5626
5033
|
}
|
|
5627
5034
|
setAddModalData(_extends({}, addModalData, {
|
|
5628
5035
|
isOpen: true,
|
|
@@ -5638,42 +5045,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5638
5045
|
}));
|
|
5639
5046
|
} else {
|
|
5640
5047
|
dispatch(showLoader());
|
|
5641
|
-
|
|
5642
|
-
|
|
5643
|
-
|
|
5644
|
-
|
|
5645
|
-
department_head_id: null
|
|
5646
|
-
};
|
|
5647
|
-
} else {
|
|
5648
|
-
dataObj = {
|
|
5649
|
-
names: [validatedValue]
|
|
5650
|
-
};
|
|
5651
|
-
}
|
|
5652
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5653
|
-
var _extends4;
|
|
5048
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5049
|
+
names: [validatedValue]
|
|
5050
|
+
})).then(function (res) {
|
|
5051
|
+
var _extends2;
|
|
5654
5052
|
setAddModalData(_extends({}, addModalData, {
|
|
5655
5053
|
isOpen: false
|
|
5656
5054
|
}));
|
|
5657
5055
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5658
5056
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
label: res.data.result.name
|
|
5664
|
-
}, _extends2)));
|
|
5665
|
-
} else {
|
|
5666
|
-
var _extends3;
|
|
5667
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5668
|
-
value: res.data.value,
|
|
5669
|
-
label: res.data.label
|
|
5670
|
-
}, _extends3)));
|
|
5671
|
-
}
|
|
5672
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5057
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5058
|
+
value: res.data.value,
|
|
5059
|
+
label: res.data.label
|
|
5060
|
+
}, _extends2)));
|
|
5673
5061
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5674
5062
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5675
|
-
var
|
|
5676
|
-
return _extends({}, prevState, (
|
|
5063
|
+
var _extends3;
|
|
5064
|
+
return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
|
|
5677
5065
|
});
|
|
5678
5066
|
dispatch(stopLoader());
|
|
5679
5067
|
});
|
|
@@ -5690,10 +5078,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5690
5078
|
};
|
|
5691
5079
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5692
5080
|
try {
|
|
5693
|
-
var
|
|
5081
|
+
var _temp6 = function _temp6() {
|
|
5694
5082
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5695
|
-
var
|
|
5696
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5083
|
+
var _extends4;
|
|
5084
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[_name] = true, _extends4)));
|
|
5697
5085
|
}
|
|
5698
5086
|
};
|
|
5699
5087
|
var _name = args._name,
|
|
@@ -5704,7 +5092,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5704
5092
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5705
5093
|
_args$_obj = args._obj,
|
|
5706
5094
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5707
|
-
var
|
|
5095
|
+
var _temp7 = function () {
|
|
5708
5096
|
if (_name === 'contact_number') {
|
|
5709
5097
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5710
5098
|
contact_number: _value.trim(),
|
|
@@ -5715,14 +5103,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5715
5103
|
updateError('country_code', _isError, _errorMsg);
|
|
5716
5104
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5717
5105
|
} else {
|
|
5718
|
-
var
|
|
5719
|
-
var
|
|
5720
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5106
|
+
var _temp8 = function _temp8() {
|
|
5107
|
+
var _extends5;
|
|
5108
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends5 = {}, _extends5[_name] = _value, _extends5)));
|
|
5721
5109
|
updateError(_name, _isError, _errorMsg);
|
|
5722
5110
|
};
|
|
5723
|
-
var
|
|
5111
|
+
var _temp9 = function () {
|
|
5724
5112
|
if (_name === 'profile_pic') {
|
|
5725
|
-
var
|
|
5113
|
+
var _temp10 = function () {
|
|
5726
5114
|
if (_obj.isUpload) {
|
|
5727
5115
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5728
5116
|
_value = _value.map(function (_val) {
|
|
@@ -5753,28 +5141,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5753
5141
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5754
5142
|
}
|
|
5755
5143
|
}();
|
|
5756
|
-
if (
|
|
5144
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5757
5145
|
}
|
|
5758
5146
|
}();
|
|
5759
|
-
return
|
|
5147
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5760
5148
|
}
|
|
5761
5149
|
}();
|
|
5762
|
-
return Promise.resolve(
|
|
5150
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5763
5151
|
} catch (e) {
|
|
5764
5152
|
return Promise.reject(e);
|
|
5765
5153
|
}
|
|
5766
5154
|
};
|
|
5767
5155
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5768
|
-
var
|
|
5156
|
+
var _extends6;
|
|
5769
5157
|
var _name = args._name,
|
|
5770
5158
|
_value = args._value,
|
|
5771
5159
|
_isError = args._isError,
|
|
5772
5160
|
_errorMsg = args._errorMsg;
|
|
5773
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5161
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5774
5162
|
updateError(_name, _isError, _errorMsg);
|
|
5775
5163
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5776
|
-
var
|
|
5777
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5164
|
+
var _extends7;
|
|
5165
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends7 = {}, _extends7[_name] = true, _extends7)));
|
|
5778
5166
|
}
|
|
5779
5167
|
};
|
|
5780
5168
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5784,9 +5172,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5784
5172
|
return tag.id;
|
|
5785
5173
|
};
|
|
5786
5174
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5787
|
-
var
|
|
5175
|
+
var _extends8;
|
|
5788
5176
|
var e = args._event;
|
|
5789
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5177
|
+
setUserTagType(_extends({}, userTagType, (_extends8 = {}, _extends8[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends8)));
|
|
5790
5178
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5791
5179
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5792
5180
|
userTagType: true
|
|
@@ -5794,22 +5182,22 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5794
5182
|
}
|
|
5795
5183
|
};
|
|
5796
5184
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5797
|
-
var
|
|
5185
|
+
var _extends9;
|
|
5798
5186
|
var _name = _ref2._name,
|
|
5799
5187
|
_value = _ref2._value;
|
|
5800
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5188
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends9 = {}, _extends9[_name] = _value, _extends9)));
|
|
5801
5189
|
};
|
|
5802
5190
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5803
|
-
var
|
|
5191
|
+
var _extends10;
|
|
5804
5192
|
var _name = _ref3._name,
|
|
5805
5193
|
_value = _ref3._value;
|
|
5806
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (
|
|
5194
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5807
5195
|
};
|
|
5808
5196
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5809
|
-
var
|
|
5197
|
+
var _extends11;
|
|
5810
5198
|
var _name = _ref4._name,
|
|
5811
5199
|
_value = _ref4._value;
|
|
5812
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5200
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5813
5201
|
};
|
|
5814
5202
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5815
5203
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5843,39 +5231,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5843
5231
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5844
5232
|
};
|
|
5845
5233
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5846
|
-
var
|
|
5234
|
+
var _extends12;
|
|
5847
5235
|
var _name = args._name,
|
|
5848
5236
|
_value = args._value,
|
|
5849
5237
|
_isError = args._isError,
|
|
5850
5238
|
_errorMsg = args._errorMsg;
|
|
5851
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5239
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5852
5240
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5853
|
-
var
|
|
5854
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5241
|
+
var _extends13;
|
|
5242
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends13 = {}, _extends13[_name] = true, _extends13)));
|
|
5855
5243
|
}
|
|
5856
5244
|
updateError(_name, _isError, _errorMsg);
|
|
5857
5245
|
};
|
|
5858
5246
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5859
|
-
var
|
|
5247
|
+
var _extends14;
|
|
5860
5248
|
var _name = args._name,
|
|
5861
5249
|
_value = args._value,
|
|
5862
5250
|
_isError = args._isError,
|
|
5863
5251
|
_errorMsg = args._errorMsg;
|
|
5864
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5252
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5865
5253
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5866
|
-
var
|
|
5867
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5254
|
+
var _extends15;
|
|
5255
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5868
5256
|
}
|
|
5869
5257
|
updateError(_name, _isError, _errorMsg);
|
|
5870
5258
|
};
|
|
5871
5259
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5872
5260
|
try {
|
|
5873
|
-
var
|
|
5874
|
-
var
|
|
5875
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5261
|
+
var _temp14 = function _temp14() {
|
|
5262
|
+
var _extends16;
|
|
5263
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5876
5264
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5877
|
-
var
|
|
5878
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5265
|
+
var _extends17;
|
|
5266
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5879
5267
|
}
|
|
5880
5268
|
updateError(_name, _isError, _errorMsg);
|
|
5881
5269
|
};
|
|
@@ -5913,9 +5301,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5913
5301
|
}
|
|
5914
5302
|
return Promise.resolve();
|
|
5915
5303
|
}
|
|
5916
|
-
var
|
|
5304
|
+
var _temp15 = function () {
|
|
5917
5305
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5918
|
-
var
|
|
5306
|
+
var _temp16 = function () {
|
|
5919
5307
|
if (_obj.isUpload) {
|
|
5920
5308
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5921
5309
|
if (_name === 'passport_photo') {
|
|
@@ -5959,10 +5347,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5959
5347
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5960
5348
|
}
|
|
5961
5349
|
}();
|
|
5962
|
-
if (
|
|
5350
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5963
5351
|
}
|
|
5964
5352
|
}();
|
|
5965
|
-
return Promise.resolve(
|
|
5353
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5966
5354
|
} catch (e) {
|
|
5967
5355
|
return Promise.reject(e);
|
|
5968
5356
|
}
|
|
@@ -5981,8 +5369,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5981
5369
|
return _errorArray;
|
|
5982
5370
|
});
|
|
5983
5371
|
setErrorMsgs(function (prevState) {
|
|
5984
|
-
var
|
|
5985
|
-
return _extends({}, prevState, (
|
|
5372
|
+
var _extends18;
|
|
5373
|
+
return _extends({}, prevState, (_extends18 = {}, _extends18[_name] = _errorMsg, _extends18));
|
|
5986
5374
|
});
|
|
5987
5375
|
};
|
|
5988
5376
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -6004,11 +5392,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6004
5392
|
}, [isTokenVerified]);
|
|
6005
5393
|
React.useEffect(function () {
|
|
6006
5394
|
if (isRendered === true) {
|
|
6007
|
-
renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
|
|
6008
|
-
if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
|
|
6009
|
-
editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
|
|
6010
|
-
}
|
|
6011
|
-
});
|
|
6012
5395
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
6013
5396
|
country_code: countryCode
|
|
6014
5397
|
}));
|
|
@@ -6019,7 +5402,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6019
5402
|
}
|
|
6020
5403
|
}));
|
|
6021
5404
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
6022
|
-
setCountryContactCode(_res);
|
|
6023
5405
|
if (isEditMode) {
|
|
6024
5406
|
if (!isProfile && !editUserId) return false;
|
|
6025
5407
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -6062,20 +5444,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6062
5444
|
value: '',
|
|
6063
5445
|
label: 'Select employee level'
|
|
6064
5446
|
},
|
|
6065
|
-
manager_id: res.employee_info.manager ? {
|
|
6066
|
-
value: res.employee_info.manager,
|
|
6067
|
-
label: res.employee_info.manager
|
|
6068
|
-
} : {
|
|
6069
|
-
value: '',
|
|
6070
|
-
label: 'Select Manager'
|
|
6071
|
-
},
|
|
6072
|
-
skip_manager_id: res.employee_info.skip_manager ? {
|
|
6073
|
-
value: res.employee_info.skip_manager,
|
|
6074
|
-
label: res.employee_info.skip_manager
|
|
6075
|
-
} : {
|
|
6076
|
-
value: '',
|
|
6077
|
-
label: 'Select Manager'
|
|
6078
|
-
},
|
|
6079
5447
|
employee_id: res.employee_info.employee_id || '',
|
|
6080
5448
|
entity: res.employee_info.entity ? {
|
|
6081
5449
|
value: res.employee_info.entity.id,
|
|
@@ -6130,8 +5498,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6130
5498
|
var products = res.user_product.split('+');
|
|
6131
5499
|
setProductAccess({
|
|
6132
5500
|
travel: products.includes('travel'),
|
|
6133
|
-
expense: products.includes('expense')
|
|
6134
|
-
card: products.includes('card')
|
|
5501
|
+
expense: products.includes('expense')
|
|
6135
5502
|
});
|
|
6136
5503
|
if (products.includes('travel')) {
|
|
6137
5504
|
var _res$travel_info, _res$travel_info2, _res$travel_info3, _res$travel_info4, _res$travel_info5, _res$travel_info6;
|
|
@@ -6309,7 +5676,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6309
5676
|
}, [renderFields.expenseApprovers]);
|
|
6310
5677
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
6311
5678
|
try {
|
|
6312
|
-
var
|
|
5679
|
+
var _temp19 = function _temp19() {
|
|
6313
5680
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
6314
5681
|
dispatch(stopLoader());
|
|
6315
5682
|
return data;
|
|
@@ -6325,12 +5692,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6325
5692
|
userID: editUserId
|
|
6326
5693
|
});
|
|
6327
5694
|
});
|
|
6328
|
-
var
|
|
5695
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
6329
5696
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
6330
5697
|
data.push(res);
|
|
6331
5698
|
});
|
|
6332
5699
|
});
|
|
6333
|
-
return Promise.resolve(
|
|
5700
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
6334
5701
|
} catch (e) {
|
|
6335
5702
|
return Promise.reject(e);
|
|
6336
5703
|
}
|
|
@@ -6342,15 +5709,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6342
5709
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
6343
5710
|
return Promise.resolve();
|
|
6344
5711
|
}
|
|
6345
|
-
if (employeeInfoInput.manager_id.value !== '') {
|
|
6346
|
-
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
6347
|
-
}
|
|
6348
|
-
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
6349
|
-
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
6350
|
-
}
|
|
6351
|
-
var cardsPayload = {
|
|
6352
|
-
"roles": [cardsRole]
|
|
6353
|
-
};
|
|
6354
5712
|
var payload = {
|
|
6355
5713
|
personalInfoInput: personalInfoInput,
|
|
6356
5714
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6369,9 +5727,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6369
5727
|
uploadedFiles: uploadedFiles,
|
|
6370
5728
|
filesForDelete: filesForDelete,
|
|
6371
5729
|
profilePicDelete: profilePicDelete,
|
|
6372
|
-
userTagType: userTagType
|
|
6373
|
-
cardsRole: cardsRole,
|
|
6374
|
-
isCardsAdmin: isCardsAdmin
|
|
5730
|
+
userTagType: userTagType
|
|
6375
5731
|
};
|
|
6376
5732
|
if (verifyUserId) {
|
|
6377
5733
|
payload.verifyUserId = verifyUserId;
|
|
@@ -6497,130 +5853,133 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6497
5853
|
if (_isError) {
|
|
6498
5854
|
setErrorArray(_errorArray);
|
|
6499
5855
|
setErrorMsgs(_errorMsgs);
|
|
6500
|
-
var
|
|
5856
|
+
for (var _key3 in _errorMsgs) {
|
|
6501
5857
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6502
5858
|
if (_errorMsgs[_key3]) {
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
5859
|
+
var _ret = function () {
|
|
5860
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5861
|
+
setAdditionalInfoFlag('open');
|
|
5862
|
+
}
|
|
5863
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5864
|
+
if (el) {
|
|
5865
|
+
setTimeout(function () {
|
|
5866
|
+
el.scrollIntoView({
|
|
5867
|
+
behavior: 'smooth',
|
|
5868
|
+
block: 'center'
|
|
5869
|
+
});
|
|
5870
|
+
}, 500);
|
|
5871
|
+
return "break";
|
|
5872
|
+
}
|
|
5873
|
+
}();
|
|
5874
|
+
if (_ret === "break") break;
|
|
6516
5875
|
}
|
|
6517
5876
|
}
|
|
6518
|
-
};
|
|
6519
|
-
for (var _key3 in _errorMsgs) {
|
|
6520
|
-
if (_loop3()) break;
|
|
6521
5877
|
}
|
|
5878
|
+
return Promise.resolve();
|
|
6522
5879
|
}
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
if (!_isError) {
|
|
6530
|
-
if (isEditMode && editUserId || isProfile) {
|
|
6531
|
-
dispatch(showLoader());
|
|
6532
|
-
if (cardApiflag && !isProfile && editUserId !== (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
6533
|
-
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
6534
|
-
method: 'POST',
|
|
6535
|
-
body: JSON.stringify(cardsPayload),
|
|
6536
|
-
headers: {
|
|
6537
|
-
'Content-Type': 'application/json',
|
|
6538
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6539
|
-
}
|
|
6540
|
-
}).then(function (response) {
|
|
6541
|
-
if (response.status === 200) {
|
|
6542
|
-
updateUserApiCall(payload, inputChangeLog);
|
|
6543
|
-
} else {
|
|
6544
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6545
|
-
}
|
|
6546
|
-
})["catch"](function (error) {
|
|
6547
|
-
console.log("errorrr", error);
|
|
6548
|
-
})["finally"](function () {
|
|
6549
|
-
dispatch(stopLoader());
|
|
6550
|
-
});
|
|
5880
|
+
if (isEditMode && editUserId || isProfile) {
|
|
5881
|
+
dispatch(showLoader());
|
|
5882
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5883
|
+
if (isProfile) {
|
|
5884
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5885
|
+
(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);
|
|
6551
5886
|
} else {
|
|
6552
|
-
|
|
5887
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5888
|
+
(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);
|
|
6553
5889
|
}
|
|
6554
|
-
}
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
5890
|
+
})["catch"](function (err) {
|
|
5891
|
+
if (typeof err === 'object') {
|
|
5892
|
+
if (err.country_code) {
|
|
5893
|
+
err.contact_number = err.country_code;
|
|
5894
|
+
}
|
|
5895
|
+
if (err.contact_country_code) {
|
|
5896
|
+
err.contact_number = err.contact_country_code;
|
|
5897
|
+
}
|
|
5898
|
+
if (err.passport) {
|
|
5899
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5900
|
+
delete err.passport;
|
|
5901
|
+
}
|
|
5902
|
+
setErrorArray(Object.keys(err));
|
|
5903
|
+
setErrorMsgs(err);
|
|
5904
|
+
for (var _key4 in err) {
|
|
5905
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5906
|
+
if (err[_key4]) {
|
|
5907
|
+
var _ret2 = function () {
|
|
5908
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
5909
|
+
setAdditionalInfoFlag('open');
|
|
5910
|
+
}
|
|
5911
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
5912
|
+
if (el) {
|
|
5913
|
+
setTimeout(function () {
|
|
5914
|
+
el.scrollIntoView({
|
|
5915
|
+
behavior: 'smooth',
|
|
5916
|
+
block: 'center'
|
|
5917
|
+
});
|
|
5918
|
+
}, 500);
|
|
5919
|
+
return "break";
|
|
5920
|
+
}
|
|
5921
|
+
}();
|
|
5922
|
+
if (_ret2 === "break") break;
|
|
6587
5923
|
}
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
5924
|
+
}
|
|
5925
|
+
}
|
|
5926
|
+
} else if (typeof err === 'string') {
|
|
5927
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5928
|
+
} else {
|
|
5929
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5930
|
+
}
|
|
5931
|
+
})["finally"](function () {
|
|
5932
|
+
dispatch(stopLoader());
|
|
5933
|
+
});
|
|
5934
|
+
} else {
|
|
5935
|
+
dispatch(showLoader());
|
|
5936
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
5937
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5938
|
+
(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);
|
|
5939
|
+
})["catch"](function (err) {
|
|
5940
|
+
if (typeof err === 'object') {
|
|
5941
|
+
if (err.country_code) {
|
|
5942
|
+
err.contact_number = err.country_code;
|
|
5943
|
+
}
|
|
5944
|
+
if (err.contact_country_code) {
|
|
5945
|
+
err.contact_number = err.contact_country_code;
|
|
5946
|
+
}
|
|
5947
|
+
if (err.passport) {
|
|
5948
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5949
|
+
delete err.passport;
|
|
5950
|
+
}
|
|
5951
|
+
setErrorArray(Object.keys(err));
|
|
5952
|
+
setErrorMsgs(err);
|
|
5953
|
+
for (var _key5 in err) {
|
|
5954
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
5955
|
+
if (err[_key5]) {
|
|
5956
|
+
var _ret3 = function () {
|
|
5957
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
5958
|
+
setAdditionalInfoFlag('open');
|
|
6606
5959
|
}
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
|
|
6610
|
-
|
|
5960
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
5961
|
+
if (el) {
|
|
5962
|
+
setTimeout(function () {
|
|
5963
|
+
el.scrollIntoView({
|
|
5964
|
+
behavior: 'smooth',
|
|
5965
|
+
block: 'center'
|
|
5966
|
+
});
|
|
5967
|
+
}, 500);
|
|
5968
|
+
return "break";
|
|
5969
|
+
}
|
|
5970
|
+
}();
|
|
5971
|
+
if (_ret3 === "break") break;
|
|
6611
5972
|
}
|
|
6612
|
-
} else if (typeof err === 'string') {
|
|
6613
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6614
|
-
} else {
|
|
6615
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6616
5973
|
}
|
|
6617
|
-
}
|
|
6618
|
-
|
|
6619
|
-
|
|
5974
|
+
}
|
|
5975
|
+
} else if (typeof err === 'string') {
|
|
5976
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6620
5977
|
} else {
|
|
6621
|
-
|
|
5978
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6622
5979
|
}
|
|
6623
|
-
}
|
|
5980
|
+
})["finally"](function () {
|
|
5981
|
+
dispatch(stopLoader());
|
|
5982
|
+
});
|
|
6624
5983
|
}
|
|
6625
5984
|
return Promise.resolve();
|
|
6626
5985
|
} catch (e) {
|
|
@@ -6637,8 +5996,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6637
5996
|
}
|
|
6638
5997
|
}
|
|
6639
5998
|
} else {
|
|
6640
|
-
var _config$
|
|
6641
|
-
(config === null || config === void 0 ? void 0 : (_config$
|
|
5999
|
+
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
6000
|
+
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$users = _config$routes4.users) === null || _config$routes4$users === void 0 ? void 0 : (_config$routes4$users2 = _config$routes4$users.list) === null || _config$routes4$users2 === void 0 ? void 0 : _config$routes4$users2.path) && history.push(config.routes.users.list.path);
|
|
6642
6001
|
}
|
|
6643
6002
|
};
|
|
6644
6003
|
var handleCustomFieldsNavigation = function handleCustomFieldsNavigation() {
|
|
@@ -6658,13 +6017,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6658
6017
|
if (verifyUserId) {
|
|
6659
6018
|
dispatch(showLoader());
|
|
6660
6019
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6661
|
-
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6662
6020
|
setPersonalInfoInput(function (prevState) {
|
|
6663
6021
|
return _extends({}, prevState, {
|
|
6664
|
-
first_name: res.
|
|
6665
|
-
last_name: res.
|
|
6022
|
+
first_name: res.fname,
|
|
6023
|
+
last_name: res.lname,
|
|
6666
6024
|
email: res.email,
|
|
6667
|
-
contact_number: res
|
|
6025
|
+
contact_number: res.phone,
|
|
6026
|
+
dob: function () {
|
|
6027
|
+
var dt = new Date(res.dob);
|
|
6028
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6029
|
+
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6030
|
+
}(),
|
|
6668
6031
|
gender: function () {
|
|
6669
6032
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6670
6033
|
}()
|
|
@@ -6827,9 +6190,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6827
6190
|
if (!p.visibility) {
|
|
6828
6191
|
return null;
|
|
6829
6192
|
}
|
|
6830
|
-
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6831
|
-
return null;
|
|
6832
|
-
}
|
|
6833
6193
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
6834
6194
|
item: true,
|
|
6835
6195
|
sm: 12,
|
|
@@ -6951,13 +6311,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6951
6311
|
className: styles.productContainerGap
|
|
6952
6312
|
}, renderFields.products.map(function (p, i) {
|
|
6953
6313
|
p.readOnly = isProfile;
|
|
6954
|
-
if (p.id === 3 && !isCardsAdmin && !isProfile) {
|
|
6955
|
-
p.readOnly = true;
|
|
6956
|
-
p.disableText = "Only card admin can change this access.";
|
|
6957
|
-
} else if (p.id === 3 && editUserId === (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
6958
|
-
p.readOnly = true;
|
|
6959
|
-
p.disableText = "You cannot update your own Card product";
|
|
6960
|
-
}
|
|
6961
6314
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
6962
6315
|
item: true,
|
|
6963
6316
|
sm: 12,
|
|
@@ -7050,21 +6403,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7050
6403
|
isProfile: isProfile,
|
|
7051
6404
|
editUserId: editUserId,
|
|
7052
6405
|
roles: renderFields.expenseRoles
|
|
7053
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
7054
|
-
className: styles.dividerColor
|
|
7055
|
-
}), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React__default.createElement(CardsField, {
|
|
7056
|
-
cardsConstants: cardsDetails.cardsConstants,
|
|
7057
|
-
type: "card",
|
|
7058
|
-
isProfile: isProfile,
|
|
7059
|
-
onRoleChange: function onRoleChange(_ref7) {
|
|
7060
|
-
var _value = _ref7._value;
|
|
7061
|
-
return setCardsRole(_value);
|
|
7062
|
-
},
|
|
7063
|
-
roleValue: cardsRole,
|
|
7064
|
-
roles: cardsDetails.cardsRoles,
|
|
7065
|
-
cardsAdmin: isCardsAdmin,
|
|
7066
|
-
editUserId: editUserId,
|
|
7067
|
-
loggedInUserId: id === null || id === void 0 ? void 0 : id.toString()
|
|
7068
6406
|
}))) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
7069
6407
|
config: config,
|
|
7070
6408
|
errMsg: hasVerificationError
|
|
@@ -7353,7 +6691,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
7353
6691
|
};
|
|
7354
6692
|
};
|
|
7355
6693
|
|
|
7356
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","
|
|
6694
|
+
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"};
|
|
7357
6695
|
|
|
7358
6696
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
7359
6697
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7422,7 +6760,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7422
6760
|
file: doc
|
|
7423
6761
|
});
|
|
7424
6762
|
});
|
|
7425
|
-
var
|
|
6763
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
7426
6764
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
7427
6765
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
7428
6766
|
if (validatedRes.data.status) {
|
|
@@ -7462,7 +6800,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7462
6800
|
})).then(function () {});
|
|
7463
6801
|
});
|
|
7464
6802
|
});
|
|
7465
|
-
return Promise.resolve(
|
|
6803
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7466
6804
|
} catch (e) {
|
|
7467
6805
|
return Promise.reject(e);
|
|
7468
6806
|
}
|
|
@@ -8776,10 +8114,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8776
8114
|
selected = props.selected,
|
|
8777
8115
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8778
8116
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8779
|
-
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8780
|
-
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8781
|
-
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8782
|
-
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8783
8117
|
orderBy = props.orderBy,
|
|
8784
8118
|
order = props.order,
|
|
8785
8119
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8797,21 +8131,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8797
8131
|
searchValue = props.searchValue,
|
|
8798
8132
|
_props$isILadmin = props.isILadmin,
|
|
8799
8133
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8800
|
-
var useStyles = styles$8.makeStyles(function (theme) {
|
|
8801
|
-
return {
|
|
8802
|
-
tooltip: {
|
|
8803
|
-
background: '#1F2937',
|
|
8804
|
-
fontSize: '14px',
|
|
8805
|
-
color: '#ffffff',
|
|
8806
|
-
padding: '12px 16px',
|
|
8807
|
-
borderRadius: '6px'
|
|
8808
|
-
},
|
|
8809
|
-
arrow: {
|
|
8810
|
-
color: '#1F2937'
|
|
8811
|
-
}
|
|
8812
|
-
};
|
|
8813
|
-
});
|
|
8814
|
-
var classes = useStyles();
|
|
8815
8134
|
var columns = [{
|
|
8816
8135
|
id: 'first_name',
|
|
8817
8136
|
label: 'Name',
|
|
@@ -8831,27 +8150,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8831
8150
|
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
|
|
8832
8151
|
}));
|
|
8833
8152
|
}
|
|
8834
|
-
}, {
|
|
8835
|
-
id: 'first_name',
|
|
8836
|
-
label: '',
|
|
8837
|
-
minWidth: 60,
|
|
8838
|
-
sortable: false,
|
|
8839
|
-
cell: function cell(row) {
|
|
8840
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8841
|
-
component: "div",
|
|
8842
|
-
width: 80
|
|
8843
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8844
|
-
title: "This user hasn't logged in to the platform yet",
|
|
8845
|
-
arrow: true,
|
|
8846
|
-
classes: {
|
|
8847
|
-
arrow: classes.arrow,
|
|
8848
|
-
tooltip: classes.tooltip
|
|
8849
|
-
},
|
|
8850
|
-
placement: "top-start"
|
|
8851
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8852
|
-
className: clsx(styles$5.tooltipTextDiv)
|
|
8853
|
-
}, "Invited")) : null);
|
|
8854
|
-
}
|
|
8855
8153
|
}, {
|
|
8856
8154
|
id: 'emp_info__department__name',
|
|
8857
8155
|
label: 'Department',
|
|
@@ -8873,7 +8171,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8873
8171
|
cell: function cell(row) {
|
|
8874
8172
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8875
8173
|
component: "div"
|
|
8876
|
-
}, row.products.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null,
|
|
8174
|
+
}, row.products.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8877
8175
|
component: "div",
|
|
8878
8176
|
display: "flex"
|
|
8879
8177
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
@@ -8886,7 +8184,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8886
8184
|
style: {
|
|
8887
8185
|
whiteSpace: 'nowrap'
|
|
8888
8186
|
}
|
|
8889
|
-
}, "\xA0" + row.products[0].role))
|
|
8187
|
+
}, "\xA0" + row.products[0].role)), row.products[1] && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8890
8188
|
component: "div",
|
|
8891
8189
|
display: "flex"
|
|
8892
8190
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
@@ -8899,20 +8197,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8899
8197
|
style: {
|
|
8900
8198
|
whiteSpace: 'nowrap'
|
|
8901
8199
|
}
|
|
8902
|
-
}, "\xA0" + row.products[1].role))
|
|
8903
|
-
component: "div",
|
|
8904
|
-
display: "flex"
|
|
8905
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8906
|
-
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor),
|
|
8907
|
-
style: {
|
|
8908
|
-
whiteSpace: 'nowrap'
|
|
8909
|
-
}
|
|
8910
|
-
}, row.products[2].name + ' / '), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8911
|
-
className: clsx(styles$5.rowText, styles$5.textTransform),
|
|
8912
|
-
style: {
|
|
8913
|
-
whiteSpace: 'nowrap'
|
|
8914
|
-
}
|
|
8915
|
-
}, "\xA0" + row.products[2].role))) : '');
|
|
8200
|
+
}, "\xA0" + row.products[1].role))) : '');
|
|
8916
8201
|
}
|
|
8917
8202
|
}, {
|
|
8918
8203
|
id: 'status',
|
|
@@ -8952,21 +8237,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8952
8237
|
return onEditHandler(row.id);
|
|
8953
8238
|
}
|
|
8954
8239
|
}];
|
|
8955
|
-
if (row && row.has_visited && row.is_active) {
|
|
8956
|
-
options.push({
|
|
8957
|
-
label: 'Reset password',
|
|
8958
|
-
handler: function handler() {
|
|
8959
|
-
return onResetPasswordHandler(row.email);
|
|
8960
|
-
}
|
|
8961
|
-
});
|
|
8962
|
-
} else if (row && row.is_active) {
|
|
8963
|
-
options.push({
|
|
8964
|
-
label: 'Resend invite',
|
|
8965
|
-
handler: function handler() {
|
|
8966
|
-
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8967
|
-
}
|
|
8968
|
-
});
|
|
8969
|
-
}
|
|
8970
8240
|
if (isILadmin) {
|
|
8971
8241
|
options.push({
|
|
8972
8242
|
label: 'Make primary admin',
|
|
@@ -8990,7 +8260,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8990
8260
|
endIcon: null,
|
|
8991
8261
|
outlinedBtn: false,
|
|
8992
8262
|
className: "threedotMenuBtn",
|
|
8993
|
-
MoreHorizIcon: true,
|
|
8994
8263
|
placement: "bottom-end"
|
|
8995
8264
|
}));
|
|
8996
8265
|
},
|
|
@@ -9020,8 +8289,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
9020
8289
|
isDataFetching: isDataFetching,
|
|
9021
8290
|
disableRowCheckbox: disableRowCheckbox,
|
|
9022
8291
|
searchBoxWidth: "400px",
|
|
9023
|
-
searchValue: searchValue
|
|
9024
|
-
hideTopPagination: false
|
|
8292
|
+
searchValue: searchValue
|
|
9025
8293
|
});
|
|
9026
8294
|
};
|
|
9027
8295
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -9053,17 +8321,17 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9053
8321
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
9054
8322
|
};
|
|
9055
8323
|
var columns = [{
|
|
9056
|
-
id: '
|
|
8324
|
+
id: 'fname',
|
|
9057
8325
|
label: 'Name',
|
|
9058
8326
|
minWidth: 250,
|
|
9059
8327
|
sortable: true,
|
|
9060
8328
|
cell: function cell(row) {
|
|
9061
8329
|
var _row$profile_pic2;
|
|
9062
8330
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9063
|
-
firstName: row.
|
|
9064
|
-
lastName: row.
|
|
8331
|
+
firstName: row.fname,
|
|
8332
|
+
lastName: row.lname,
|
|
9065
8333
|
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
9066
|
-
primaryText: row.
|
|
8334
|
+
primaryText: row.fname + ' ' + row.lname,
|
|
9067
8335
|
secondaryText: row.email,
|
|
9068
8336
|
letterAvatarTextColor: "black",
|
|
9069
8337
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -9072,7 +8340,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9072
8340
|
}));
|
|
9073
8341
|
}
|
|
9074
8342
|
}, {
|
|
9075
|
-
id: '
|
|
8343
|
+
id: 'created',
|
|
9076
8344
|
label: 'Requested on',
|
|
9077
8345
|
minWidth: 100,
|
|
9078
8346
|
sortable: true,
|
|
@@ -9082,7 +8350,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9082
8350
|
width: 100
|
|
9083
8351
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9084
8352
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
9085
|
-
}, formatDate(row.
|
|
8353
|
+
}, formatDate(row.created)));
|
|
9086
8354
|
}
|
|
9087
8355
|
}, {
|
|
9088
8356
|
id: 'actions',
|
|
@@ -9136,61 +8404,8 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9136
8404
|
});
|
|
9137
8405
|
};
|
|
9138
8406
|
|
|
9139
|
-
function InfoYellowIcon(props) {
|
|
9140
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
9141
|
-
width: props.width,
|
|
9142
|
-
height: props.height,
|
|
9143
|
-
viewBox: "0 0 20 20",
|
|
9144
|
-
fill: "none",
|
|
9145
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9146
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
9147
|
-
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",
|
|
9148
|
-
fill: "#CA8A04"
|
|
9149
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
9150
|
-
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",
|
|
9151
|
-
fill: "#CA8A04"
|
|
9152
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
9153
|
-
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",
|
|
9154
|
-
fill: "#CA8A04"
|
|
9155
|
-
}));
|
|
9156
|
-
}
|
|
9157
|
-
|
|
9158
|
-
function RedWarningIcon(props) {
|
|
9159
|
-
var _props$color = props.color,
|
|
9160
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
9161
|
-
_props$size = props.size,
|
|
9162
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
9163
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
9164
|
-
width: size,
|
|
9165
|
-
height: size,
|
|
9166
|
-
viewBox: "0 0 14 14",
|
|
9167
|
-
fill: color,
|
|
9168
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9169
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
9170
|
-
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",
|
|
9171
|
-
fill: color
|
|
9172
|
-
}));
|
|
9173
|
-
}
|
|
9174
|
-
|
|
9175
|
-
function InviteInfoIcon() {
|
|
9176
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
9177
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9178
|
-
width: "20",
|
|
9179
|
-
height: "20",
|
|
9180
|
-
fill: "none",
|
|
9181
|
-
viewBox: "0 0 20 20"
|
|
9182
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
9183
|
-
fill: "#CA8A04",
|
|
9184
|
-
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"
|
|
9185
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
9186
|
-
fill: "#CA8A04",
|
|
9187
|
-
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"
|
|
9188
|
-
}));
|
|
9189
|
-
}
|
|
9190
|
-
|
|
9191
8407
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
9192
|
-
var env$7 = utils.configs.env
|
|
9193
|
-
api$7 = utils.configs.api;
|
|
8408
|
+
var env$7 = utils.configs.env;
|
|
9194
8409
|
var UndoButton = function UndoButton(_ref) {
|
|
9195
8410
|
var onUndo = _ref.onUndo,
|
|
9196
8411
|
msg = _ref.msg;
|
|
@@ -9228,49 +8443,27 @@ var UserList = function UserList(_ref2) {
|
|
|
9228
8443
|
isDataFetching = _useSelector.isDataFetching,
|
|
9229
8444
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
9230
8445
|
tabValue = _useSelector.tabValue;
|
|
9231
|
-
var
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
9244
|
-
|
|
9245
|
-
|
|
9246
|
-
|
|
8446
|
+
var _React$useState = React__default.useState(1),
|
|
8447
|
+
page = _React$useState[0],
|
|
8448
|
+
setPage = _React$useState[1];
|
|
8449
|
+
var _useState = React.useState(5),
|
|
8450
|
+
rowsPerPage = _useState[0],
|
|
8451
|
+
setRowsPerPage = _useState[1];
|
|
8452
|
+
var _React$useState2 = React__default.useState({}),
|
|
8453
|
+
selected = _React$useState2[0],
|
|
8454
|
+
setSelected = _React$useState2[1];
|
|
8455
|
+
var _React$useState3 = React__default.useState('asc'),
|
|
8456
|
+
order = _React$useState3[0],
|
|
8457
|
+
setOrder = _React$useState3[1];
|
|
8458
|
+
var _React$useState4 = React__default.useState('first_name'),
|
|
8459
|
+
orderBy = _React$useState4[0],
|
|
8460
|
+
setOrderBy = _React$useState4[1];
|
|
8461
|
+
var _useState2 = React.useState(''),
|
|
8462
|
+
searchValue = _useState2[0],
|
|
8463
|
+
setSearchValue = _useState2[1];
|
|
9247
8464
|
var _useState3 = React.useState(false),
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
var _React$useState4 = React__default.useState(''),
|
|
9251
|
-
user = _React$useState4[0],
|
|
9252
|
-
setUser = _React$useState4[1];
|
|
9253
|
-
var _useState4 = React.useState(10),
|
|
9254
|
-
rowsPerPage = _useState4[0],
|
|
9255
|
-
setRowsPerPage = _useState4[1];
|
|
9256
|
-
var _React$useState5 = React__default.useState({}),
|
|
9257
|
-
selected = _React$useState5[0],
|
|
9258
|
-
setSelected = _React$useState5[1];
|
|
9259
|
-
var _React$useState6 = React__default.useState('asc'),
|
|
9260
|
-
order = _React$useState6[0],
|
|
9261
|
-
setOrder = _React$useState6[1];
|
|
9262
|
-
var _React$useState7 = React__default.useState(false),
|
|
9263
|
-
deactivateSingle = _React$useState7[0],
|
|
9264
|
-
setDeactivateSingle = _React$useState7[1];
|
|
9265
|
-
var _React$useState8 = React__default.useState('first_name'),
|
|
9266
|
-
orderBy = _React$useState8[0],
|
|
9267
|
-
setOrderBy = _React$useState8[1];
|
|
9268
|
-
var _useState5 = React.useState(''),
|
|
9269
|
-
searchValue = _useState5[0],
|
|
9270
|
-
setSearchValue = _useState5[1];
|
|
9271
|
-
var _useState6 = React.useState(false),
|
|
9272
|
-
isOpenDeActivateModal = _useState6[0],
|
|
9273
|
-
setOpenDeActivateModalFlag = _useState6[1];
|
|
8465
|
+
isOpenDeActivateModal = _useState3[0],
|
|
8466
|
+
setOpenDeActivateModalFlag = _useState3[1];
|
|
9274
8467
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
9275
8468
|
return state.common;
|
|
9276
8469
|
}),
|
|
@@ -9278,140 +8471,68 @@ var UserList = function UserList(_ref2) {
|
|
|
9278
8471
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
9279
8472
|
isILadmin = _useSelector2.isILadmin,
|
|
9280
8473
|
companyName = _useSelector2.companyName;
|
|
8474
|
+
var _useState4 = React.useState(false),
|
|
8475
|
+
isOpenImportUsersModal = _useState4[0],
|
|
8476
|
+
setOpenImportUsersModal = _useState4[1];
|
|
8477
|
+
var _useState5 = React.useState(false),
|
|
8478
|
+
isFileDownloading = _useState5[0],
|
|
8479
|
+
setDownlStatus = _useState5[1];
|
|
8480
|
+
var _useState6 = React.useState(false),
|
|
8481
|
+
isSortingChange = _useState6[0],
|
|
8482
|
+
setSortingChange = _useState6[1];
|
|
9281
8483
|
var _useState7 = React.useState(false),
|
|
9282
|
-
|
|
9283
|
-
|
|
8484
|
+
isSearchingChange = _useState7[0],
|
|
8485
|
+
setSearchingChange = _useState7[1];
|
|
9284
8486
|
var _useState8 = React.useState(false),
|
|
9285
|
-
|
|
9286
|
-
|
|
8487
|
+
isSortingChangeTemp = _useState8[0],
|
|
8488
|
+
setSortingChangeTemp = _useState8[1];
|
|
9287
8489
|
var _useState9 = React.useState(false),
|
|
9288
|
-
|
|
9289
|
-
|
|
8490
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8491
|
+
setSearchingChangeTemp = _useState9[1];
|
|
9290
8492
|
var _useState10 = React.useState(false),
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
var
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
var
|
|
9297
|
-
|
|
9298
|
-
|
|
8493
|
+
isApiFetching = _useState10[0],
|
|
8494
|
+
setisApiFetching = _useState10[1];
|
|
8495
|
+
var _React$useState5 = React__default.useState(1),
|
|
8496
|
+
signup_page = _React$useState5[0],
|
|
8497
|
+
setSignUpPage = _React$useState5[1];
|
|
8498
|
+
var _useState11 = React.useState(5),
|
|
8499
|
+
signup_rowsPerPage = _useState11[0],
|
|
8500
|
+
setSignUpRowsPerPage = _useState11[1];
|
|
8501
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8502
|
+
signup_order = _React$useState6[0],
|
|
8503
|
+
setSignUpOrder = _React$useState6[1];
|
|
8504
|
+
var _React$useState7 = React__default.useState('fname'),
|
|
8505
|
+
signup_orderBy = _React$useState7[0],
|
|
8506
|
+
setSignUpOrderBy = _React$useState7[1];
|
|
8507
|
+
var _useState12 = React.useState(''),
|
|
8508
|
+
signup_searchValue = _useState12[0],
|
|
8509
|
+
set_signup_SearchValue = _useState12[1];
|
|
9299
8510
|
var _useState13 = React.useState(false),
|
|
9300
|
-
|
|
9301
|
-
|
|
8511
|
+
isSignUpSortingChange = _useState13[0],
|
|
8512
|
+
setSignUpSortingChange = _useState13[1];
|
|
9302
8513
|
var _useState14 = React.useState(false),
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
var _useState15 = React.useState(
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
}),
|
|
9309
|
-
approverRole = _useState15[0],
|
|
9310
|
-
setApproverRole = _useState15[1];
|
|
8514
|
+
isSignUpSearchingChange = _useState14[0],
|
|
8515
|
+
setSignUpSearchingChange = _useState14[1];
|
|
8516
|
+
var _useState15 = React.useState(false),
|
|
8517
|
+
isSignUpSortingChangeTemp = _useState15[0],
|
|
8518
|
+
setSignUpSortingChangeTemp = _useState15[1];
|
|
9311
8519
|
var _useState16 = React.useState(false),
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
var _useState17 = React.useState(''),
|
|
9315
|
-
userIds = _useState17[0],
|
|
9316
|
-
setUserIds = _useState17[1];
|
|
9317
|
-
var _React$useState9 = React__default.useState(false),
|
|
9318
|
-
overlayMenu = _React$useState9[0],
|
|
9319
|
-
setOverlayMenu = _React$useState9[1];
|
|
9320
|
-
var _useState18 = React.useState(''),
|
|
9321
|
-
userFirstName = _useState18[0],
|
|
9322
|
-
setUserFirstName = _useState18[1];
|
|
9323
|
-
var _useState19 = React.useState(''),
|
|
9324
|
-
userLastName = _useState19[0],
|
|
9325
|
-
setUserLastName = _useState19[1];
|
|
9326
|
-
var _useState20 = React.useState(true),
|
|
9327
|
-
isDisabledSubmitBtn = _useState20[0],
|
|
9328
|
-
setIsDisabledSubmitBtn = _useState20[1];
|
|
9329
|
-
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
9330
|
-
var prevPos = _ref3.prevPos,
|
|
9331
|
-
currPos = _ref3.currPos;
|
|
9332
|
-
if (prevPos.y - currPos.y > 0) {
|
|
9333
|
-
if (currPos.y <= -275) {
|
|
9334
|
-
setOverlayMenu(true);
|
|
9335
|
-
}
|
|
9336
|
-
} else {
|
|
9337
|
-
if (currPos.y > -295) {
|
|
9338
|
-
setOverlayMenu(false);
|
|
9339
|
-
}
|
|
9340
|
-
}
|
|
9341
|
-
}, [overlayMenu]);
|
|
9342
|
-
var scrollTo = function scrollTo(id) {
|
|
9343
|
-
var el = document.getElementById(id);
|
|
9344
|
-
window.scrollTo({
|
|
9345
|
-
top: el.offsetTop,
|
|
9346
|
-
behavior: 'smooth'
|
|
9347
|
-
});
|
|
9348
|
-
};
|
|
9349
|
-
var _React$useState10 = React__default.useState(1),
|
|
9350
|
-
signup_page = _React$useState10[0],
|
|
9351
|
-
setSignUpPage = _React$useState10[1];
|
|
9352
|
-
var _useState21 = React.useState(5),
|
|
9353
|
-
signup_rowsPerPage = _useState21[0],
|
|
9354
|
-
setSignUpRowsPerPage = _useState21[1];
|
|
9355
|
-
var _React$useState11 = React__default.useState('asc'),
|
|
9356
|
-
signup_order = _React$useState11[0],
|
|
9357
|
-
setSignUpOrder = _React$useState11[1];
|
|
9358
|
-
var _React$useState12 = React__default.useState('first_name'),
|
|
9359
|
-
signup_orderBy = _React$useState12[0],
|
|
9360
|
-
setSignUpOrderBy = _React$useState12[1];
|
|
9361
|
-
var _useState22 = React.useState(''),
|
|
9362
|
-
signup_searchValue = _useState22[0],
|
|
9363
|
-
set_signup_SearchValue = _useState22[1];
|
|
9364
|
-
var _useState23 = React.useState(false),
|
|
9365
|
-
isSignUpSortingChange = _useState23[0],
|
|
9366
|
-
setSignUpSortingChange = _useState23[1];
|
|
9367
|
-
var _useState24 = React.useState(false),
|
|
9368
|
-
isSignUpSearchingChange = _useState24[0],
|
|
9369
|
-
setSignUpSearchingChange = _useState24[1];
|
|
9370
|
-
var _useState25 = React.useState(false),
|
|
9371
|
-
isSignUpSortingChangeTemp = _useState25[0],
|
|
9372
|
-
setSignUpSortingChangeTemp = _useState25[1];
|
|
9373
|
-
var _useState26 = React.useState(false),
|
|
9374
|
-
isSignUpSearchingChangeTemp = _useState26[0],
|
|
9375
|
-
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8520
|
+
isSignUpSearchingChangeTemp = _useState16[0],
|
|
8521
|
+
setSignUpSearchingChangeTemp = _useState16[1];
|
|
9376
8522
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
9377
8523
|
return state.userList;
|
|
9378
8524
|
}),
|
|
9379
8525
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
9380
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
9381
|
-
if (config.routes.notification) {
|
|
9382
|
-
history.push({
|
|
9383
|
-
pathname: config.routes.notification.path
|
|
9384
|
-
});
|
|
9385
|
-
}
|
|
9386
|
-
};
|
|
9387
8526
|
var openDeactivateModal = function openDeactivateModal() {
|
|
9388
8527
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9389
8528
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
9390
8529
|
return false;
|
|
9391
8530
|
}
|
|
9392
|
-
|
|
9393
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9394
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9395
|
-
var _selected = Object.values(selected).flat();
|
|
9396
|
-
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
9397
|
-
return _selected.includes(item.id.toString());
|
|
9398
|
-
});
|
|
9399
|
-
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
9400
|
-
return _selected.includes(item.id.toString());
|
|
9401
|
-
});
|
|
9402
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9403
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9404
|
-
setIsBulkDeactivateModalOpen(true);
|
|
9405
|
-
} else {
|
|
9406
|
-
setOpenDeActivateModalFlag(true);
|
|
9407
|
-
}
|
|
8531
|
+
setOpenDeActivateModalFlag(true);
|
|
9408
8532
|
};
|
|
9409
8533
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
9410
8534
|
setOpenDeActivateModalFlag(false);
|
|
9411
8535
|
};
|
|
9412
|
-
var closeDeActiveModal = function closeDeActiveModal() {
|
|
9413
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9414
|
-
};
|
|
9415
8536
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9416
8537
|
history.push(config.routes.users.add.path);
|
|
9417
8538
|
};
|
|
@@ -9425,31 +8546,27 @@ var UserList = function UserList(_ref2) {
|
|
|
9425
8546
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
9426
8547
|
};
|
|
9427
8548
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
return dispatch(stopDataFetchingStatus());
|
|
9446
|
-
});
|
|
9447
|
-
}
|
|
9448
|
-
})["catch"](function (err) {
|
|
9449
|
-
console.log(err);
|
|
8549
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8550
|
+
if (res.status === true) {
|
|
8551
|
+
var _res$data;
|
|
8552
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React__default.createElement(UndoButton, {
|
|
8553
|
+
undo: function undo() {
|
|
8554
|
+
return dispatch(undoneSignUpRejection(userId));
|
|
8555
|
+
},
|
|
8556
|
+
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'
|
|
8557
|
+
}));
|
|
8558
|
+
dispatch(showDataFetchingStatus());
|
|
8559
|
+
dispatch(fetchUserSignupRequests({
|
|
8560
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8561
|
+
length: signup_rowsPerPage,
|
|
8562
|
+
page: signup_page,
|
|
8563
|
+
search: signup_searchValue.trim()
|
|
8564
|
+
})).then(function () {
|
|
8565
|
+
return dispatch(stopDataFetchingStatus());
|
|
9450
8566
|
});
|
|
9451
8567
|
}
|
|
9452
|
-
|
|
8568
|
+
})["catch"](function (err) {
|
|
8569
|
+
console.log(err);
|
|
9453
8570
|
});
|
|
9454
8571
|
};
|
|
9455
8572
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9462,25 +8579,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9462
8579
|
};
|
|
9463
8580
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
9464
8581
|
var _extends2;
|
|
9465
|
-
var
|
|
9466
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9467
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9468
|
-
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8582
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
9469
8583
|
return n.is_active;
|
|
8584
|
+
}).map(function (obj) {
|
|
8585
|
+
return obj.id.toString();
|
|
9470
8586
|
});
|
|
9471
|
-
|
|
9472
|
-
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9473
|
-
if (obj.roles.is_approver === true) {
|
|
9474
|
-
_selectedUsersApprover.push(obj);
|
|
9475
|
-
} else if (obj.roles.is_approver === false) {
|
|
9476
|
-
_selectedUsersNotApprover.push(obj);
|
|
9477
|
-
}
|
|
9478
|
-
}
|
|
9479
|
-
selectedId.push(obj.id.toString());
|
|
9480
|
-
});
|
|
9481
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9482
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9483
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8587
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
9484
8588
|
};
|
|
9485
8589
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
9486
8590
|
var _extends3;
|
|
@@ -9498,156 +8602,58 @@ var UserList = function UserList(_ref2) {
|
|
|
9498
8602
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9499
8603
|
};
|
|
9500
8604
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9501
|
-
setPage(1);
|
|
9502
8605
|
setSearchValue(value);
|
|
9503
8606
|
setSearchingChange(true);
|
|
9504
8607
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
9505
8608
|
};
|
|
9506
8609
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9507
|
-
setPage(1);
|
|
9508
8610
|
set_signup_SearchValue(value);
|
|
9509
8611
|
setSignUpSearchingChange(true);
|
|
9510
8612
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9511
8613
|
};
|
|
9512
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page
|
|
8614
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9513
8615
|
var _extends4;
|
|
9514
8616
|
var selectedTemp = _extends({}, selected);
|
|
9515
8617
|
if (!(page in selectedTemp)) {
|
|
9516
8618
|
selectedTemp[page] = [];
|
|
9517
8619
|
}
|
|
9518
8620
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
9519
|
-
var
|
|
8621
|
+
var newSelected = [];
|
|
9520
8622
|
if (selectedIndex === -1) {
|
|
9521
|
-
|
|
8623
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
9522
8624
|
} else if (selectedIndex === 0) {
|
|
9523
|
-
|
|
8625
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
9524
8626
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
9525
|
-
|
|
8627
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
9526
8628
|
} else if (selectedIndex > 0) {
|
|
9527
|
-
|
|
9528
|
-
}
|
|
9529
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9530
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9531
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9532
|
-
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9533
|
-
return id !== item.id.toString();
|
|
9534
|
-
});
|
|
9535
|
-
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9536
|
-
return item.id.toString() !== id;
|
|
9537
|
-
});
|
|
9538
|
-
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9539
|
-
if (data.roles.is_approver === true) {
|
|
9540
|
-
_SelectedUsersApprover.push(data);
|
|
9541
|
-
} else if (data.roles.is_approver === false) {
|
|
9542
|
-
_SelectedUsersNotApprover.push(data);
|
|
9543
|
-
}
|
|
8629
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9544
8630
|
}
|
|
9545
|
-
|
|
9546
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9547
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8631
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
9548
8632
|
};
|
|
9549
|
-
React.useEffect(function () {
|
|
9550
|
-
setApproverRole({
|
|
9551
|
-
value: '',
|
|
9552
|
-
label: 'Select approver'
|
|
9553
|
-
});
|
|
9554
|
-
setDefaultId(null);
|
|
9555
|
-
setIsDisabledSubmitBtn(true);
|
|
9556
|
-
setApproveeStatus(false);
|
|
9557
|
-
if (deactivateSingle === true) {
|
|
9558
|
-
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9559
|
-
if (response.data["default"].id) {
|
|
9560
|
-
setDefaultId(response.data["default"].id);
|
|
9561
|
-
setApproverRole({
|
|
9562
|
-
value: '',
|
|
9563
|
-
label: response.data["default"].email
|
|
9564
|
-
});
|
|
9565
|
-
setIsDisabledSubmitBtn(false);
|
|
9566
|
-
setApproveeStatus(response.data["default"].approvee_status);
|
|
9567
|
-
}
|
|
9568
|
-
});
|
|
9569
|
-
}
|
|
9570
|
-
}, [deactivateSingle]);
|
|
9571
8633
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9572
8634
|
setRowsPerPage(+event.target.value);
|
|
9573
8635
|
setPage(1);
|
|
9574
8636
|
setSelected({});
|
|
9575
|
-
setSelectedUsersNotApprover([]);
|
|
9576
|
-
setSelectedUsersApprover([]);
|
|
9577
8637
|
setSortingChange(true);
|
|
9578
8638
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9579
8639
|
};
|
|
9580
8640
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
9581
8641
|
var isActive = e.target.checked;
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
setUser(item);
|
|
9590
|
-
} else {
|
|
9591
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9592
|
-
if (!isActive) {
|
|
9593
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9594
|
-
var _extends5;
|
|
9595
|
-
var selectedTemp = _extends({}, selected);
|
|
9596
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9597
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9598
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9599
|
-
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9600
|
-
return item.id != id;
|
|
9601
|
-
});
|
|
9602
|
-
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9603
|
-
return item.id != id;
|
|
9604
|
-
});
|
|
9605
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9606
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9607
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9608
|
-
}
|
|
9609
|
-
}
|
|
9610
|
-
});
|
|
8642
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8643
|
+
if (!isActive) {
|
|
8644
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8645
|
+
var _extends5;
|
|
8646
|
+
var selectedTemp = _extends({}, selected);
|
|
8647
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8648
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9611
8649
|
}
|
|
9612
8650
|
}
|
|
9613
8651
|
});
|
|
9614
8652
|
};
|
|
9615
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
9616
|
-
var _value = _ref4._value;
|
|
9617
|
-
if (_value.data.approvee_status) {
|
|
9618
|
-
setApproveeStatus(true);
|
|
9619
|
-
} else {
|
|
9620
|
-
setApproveeStatus(false);
|
|
9621
|
-
}
|
|
9622
|
-
setDefaultId(_value.data.id);
|
|
9623
|
-
setApproverRole(_value);
|
|
9624
|
-
setIsDisabledSubmitBtn(false);
|
|
9625
|
-
};
|
|
9626
|
-
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9627
|
-
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9628
|
-
setOpenDeActivateModalFlag(false);
|
|
9629
|
-
setDeactivateSingle(false);
|
|
9630
|
-
setSelected({});
|
|
9631
|
-
setSelectedUsersNotApprover([]);
|
|
9632
|
-
setSelectedUsersApprover([]);
|
|
9633
|
-
};
|
|
9634
8653
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
9635
8654
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
9636
8655
|
setOpenDeActivateModalFlag(false);
|
|
9637
8656
|
setSelected({});
|
|
9638
|
-
setSelectedUsersNotApprover([]);
|
|
9639
|
-
setSelectedUsersApprover([]);
|
|
9640
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9641
|
-
};
|
|
9642
|
-
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9643
|
-
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9644
|
-
return item.id;
|
|
9645
|
-
});
|
|
9646
|
-
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9647
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9648
|
-
setSelected({});
|
|
9649
|
-
setSelectedUsersNotApprover([]);
|
|
9650
|
-
setSelectedUsersApprover([]);
|
|
9651
8657
|
};
|
|
9652
8658
|
var importUserHandler = function importUserHandler() {
|
|
9653
8659
|
setOpenImportUsersModal(true);
|
|
@@ -9659,43 +8665,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9659
8665
|
setOpenImportUsersModal(false);
|
|
9660
8666
|
handleImportPagenavigation(jobId);
|
|
9661
8667
|
};
|
|
9662
|
-
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9663
|
-
dispatch(resetPasswordForUser({
|
|
9664
|
-
email: email
|
|
9665
|
-
}));
|
|
9666
|
-
};
|
|
9667
|
-
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9668
|
-
if (type === undefined) {
|
|
9669
|
-
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9670
|
-
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9671
|
-
return false;
|
|
9672
|
-
}
|
|
9673
|
-
}
|
|
9674
|
-
setUserIds(ids);
|
|
9675
|
-
setUserFirstName(firstName);
|
|
9676
|
-
setUserLastName(lastName);
|
|
9677
|
-
setToggleInviteModal(!showInviteModal);
|
|
9678
|
-
};
|
|
9679
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9680
|
-
setToggleInviteModal(!showInviteModal);
|
|
9681
|
-
};
|
|
9682
|
-
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9683
|
-
var userIdArr = [];
|
|
9684
|
-
if (userIds && !isNaN(userIds)) {
|
|
9685
|
-
userIdArr = [userIds];
|
|
9686
|
-
} else if (Object.keys(selected).length) {
|
|
9687
|
-
Object.values(selected).map(function (val, i) {
|
|
9688
|
-
if (val.length) {
|
|
9689
|
-
val.map(function (idx, i) {
|
|
9690
|
-
userIdArr.push(idx);
|
|
9691
|
-
});
|
|
9692
|
-
}
|
|
9693
|
-
});
|
|
9694
|
-
}
|
|
9695
|
-
setUserIds('');
|
|
9696
|
-
dispatch(resendInviteForUser(userIdArr));
|
|
9697
|
-
setToggleInviteModal(!showInviteModal);
|
|
9698
|
-
};
|
|
9699
8668
|
var handleExportUsers = function handleExportUsers() {
|
|
9700
8669
|
try {
|
|
9701
8670
|
setDownlStatus(true);
|
|
@@ -9735,9 +8704,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9735
8704
|
}, {
|
|
9736
8705
|
label: 'Bulk action history',
|
|
9737
8706
|
handler: handleBulkActionHistoryClick
|
|
9738
|
-
}, {
|
|
9739
|
-
label: 'Resend invite',
|
|
9740
|
-
handler: toggleInviteModal
|
|
9741
8707
|
}];
|
|
9742
8708
|
React.useEffect(function () {
|
|
9743
8709
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -9749,9 +8715,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9749
8715
|
userId: userId
|
|
9750
8716
|
}));
|
|
9751
8717
|
};
|
|
9752
|
-
var knowMore = function knowMore() {
|
|
9753
|
-
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9754
|
-
};
|
|
9755
8718
|
var dispatch = reactRedux.useDispatch();
|
|
9756
8719
|
React.useEffect(function () {
|
|
9757
8720
|
if (isTokenVerified === true) {
|
|
@@ -9765,7 +8728,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9765
8728
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9766
8729
|
setSearchingChange(false);
|
|
9767
8730
|
setisApiFetching(false);
|
|
9768
|
-
scrollTo('table-root');
|
|
9769
8731
|
});
|
|
9770
8732
|
}, 1000);
|
|
9771
8733
|
return function () {
|
|
@@ -9779,8 +8741,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9779
8741
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9780
8742
|
length: signup_rowsPerPage,
|
|
9781
8743
|
page: signup_page,
|
|
9782
|
-
search: signup_searchValue.trim()
|
|
9783
|
-
pagename: 'company'
|
|
8744
|
+
search: signup_searchValue.trim()
|
|
9784
8745
|
})).then(function () {
|
|
9785
8746
|
setSignUpSearchingChange(false);
|
|
9786
8747
|
setisApiFetching(false);
|
|
@@ -9792,7 +8753,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9792
8753
|
}
|
|
9793
8754
|
if (isSortingChange) {
|
|
9794
8755
|
setisApiFetching(true);
|
|
9795
|
-
scrollTo('table-root');
|
|
9796
8756
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9797
8757
|
setisApiFetching(false);
|
|
9798
8758
|
setSortingChange(false);
|
|
@@ -9807,8 +8767,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9807
8767
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9808
8768
|
length: signup_rowsPerPage,
|
|
9809
8769
|
page: signup_page,
|
|
9810
|
-
search: signup_searchValue.trim()
|
|
9811
|
-
pagename: 'company'
|
|
8770
|
+
search: signup_searchValue.trim()
|
|
9812
8771
|
})).then(function () {
|
|
9813
8772
|
setisApiFetching(false);
|
|
9814
8773
|
setSignUpSortingChange(false);
|
|
@@ -9824,8 +8783,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9824
8783
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9825
8784
|
length: signup_rowsPerPage,
|
|
9826
8785
|
page: signup_page,
|
|
9827
|
-
search: signup_searchValue.trim()
|
|
9828
|
-
pagename: 'company'
|
|
8786
|
+
search: signup_searchValue.trim()
|
|
9829
8787
|
})).then(function () {
|
|
9830
8788
|
return dispatch(stopDataFetchingStatus());
|
|
9831
8789
|
});
|
|
@@ -9833,89 +8791,15 @@ var UserList = function UserList(_ref2) {
|
|
|
9833
8791
|
}
|
|
9834
8792
|
}
|
|
9835
8793
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9836
|
-
var topRightButtons = function topRightButtons() {
|
|
9837
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9838
|
-
component: "div",
|
|
9839
|
-
className: styles$5.buttonWrapper,
|
|
9840
|
-
display: "flex",
|
|
9841
|
-
justifyContent: "space-between",
|
|
9842
|
-
alignItems: "center",
|
|
9843
|
-
alignSelf: "flex-start"
|
|
9844
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9845
|
-
component: "div",
|
|
9846
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9847
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9848
|
-
buttonText: "Export all users",
|
|
9849
|
-
type: "outlined",
|
|
9850
|
-
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9851
|
-
width: "22",
|
|
9852
|
-
height: "22"
|
|
9853
|
-
}),
|
|
9854
|
-
onClick: handleExportUsers
|
|
9855
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9856
|
-
component: "div",
|
|
9857
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9858
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9859
|
-
buttonText: "Bulk actions",
|
|
9860
|
-
type: "outlined",
|
|
9861
|
-
menuListInfo: BulkUploadInfo
|
|
9862
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9863
|
-
component: "div",
|
|
9864
|
-
className: "pageHeader--button-single button-right"
|
|
9865
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9866
|
-
buttonText: "Add user",
|
|
9867
|
-
type: "contained",
|
|
9868
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9869
|
-
width: "9",
|
|
9870
|
-
height: "9",
|
|
9871
|
-
color: "white"
|
|
9872
|
-
}),
|
|
9873
|
-
onClick: handleAddPageNavigation
|
|
9874
|
-
})));
|
|
9875
|
-
};
|
|
9876
8794
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9877
8795
|
component: "div",
|
|
9878
8796
|
className: styles$5.UUIUserManagementList
|
|
9879
|
-
},
|
|
9880
|
-
className: styles$5.scrollOverlayMenu
|
|
9881
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9882
|
-
component: "div",
|
|
9883
|
-
className: clsx(styles$5.pageHeader)
|
|
9884
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9885
|
-
component: "div",
|
|
9886
|
-
display: "flex",
|
|
9887
|
-
justifyContent: "space-between",
|
|
9888
|
-
alignItems: "center",
|
|
9889
|
-
flexWrap: "wrap",
|
|
9890
|
-
style: {
|
|
9891
|
-
gap: '1rem'
|
|
9892
|
-
}
|
|
9893
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9894
|
-
component: "div",
|
|
9895
|
-
display: "flex",
|
|
9896
|
-
flexDirection: "column",
|
|
9897
|
-
style: {
|
|
9898
|
-
gap: '0.5rem'
|
|
9899
|
-
}
|
|
9900
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
|
|
9901
|
-
placeholder: "Search by name, email & department",
|
|
9902
|
-
value: searchValue,
|
|
9903
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
9904
|
-
return onSearchHandler(e.target.value);
|
|
9905
|
-
},
|
|
9906
|
-
className: styles$5.overlaysearch
|
|
9907
|
-
})), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9908
|
-
component: "div",
|
|
9909
|
-
display: "flex",
|
|
9910
|
-
justifyContent: "space-between",
|
|
9911
|
-
alignItems: "center"
|
|
9912
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8797
|
+
}, !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
9913
8798
|
open: isFileDownloading || isApiFetching,
|
|
9914
8799
|
className: styles$5.backdrop
|
|
9915
8800
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
|
|
9916
8801
|
color: "inherit"
|
|
9917
8802
|
})), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9918
|
-
id: "table-root",
|
|
9919
8803
|
component: "div",
|
|
9920
8804
|
className: clsx(styles$5.pageHeader)
|
|
9921
8805
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -9940,7 +8824,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9940
8824
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9941
8825
|
variant: "h3",
|
|
9942
8826
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
9943
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))),
|
|
8827
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8828
|
+
component: "div",
|
|
8829
|
+
className: styles$5.buttonWrapper,
|
|
8830
|
+
display: "flex",
|
|
8831
|
+
justifyContent: "space-between",
|
|
8832
|
+
alignItems: "center",
|
|
8833
|
+
alignSelf: "flex-start"
|
|
8834
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8835
|
+
component: "div",
|
|
8836
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8837
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8838
|
+
buttonText: "Export all users",
|
|
8839
|
+
type: "outlined",
|
|
8840
|
+
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
8841
|
+
width: "22",
|
|
8842
|
+
height: "22"
|
|
8843
|
+
}),
|
|
8844
|
+
onClick: handleExportUsers
|
|
8845
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8846
|
+
component: "div",
|
|
8847
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8848
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
8849
|
+
buttonText: "Bulk actions",
|
|
8850
|
+
type: "outlined",
|
|
8851
|
+
menuListInfo: BulkUploadInfo
|
|
8852
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8853
|
+
component: "div",
|
|
8854
|
+
className: "pageHeader--button-single button-right"
|
|
8855
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8856
|
+
buttonText: "Add user",
|
|
8857
|
+
type: "contained",
|
|
8858
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
8859
|
+
width: "9",
|
|
8860
|
+
height: "9",
|
|
8861
|
+
color: "white"
|
|
8862
|
+
}),
|
|
8863
|
+
onClick: handleAddPageNavigation
|
|
8864
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9944
8865
|
component: "div",
|
|
9945
8866
|
display: "flex",
|
|
9946
8867
|
justifyContent: "space-between",
|
|
@@ -9985,9 +8906,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9985
8906
|
disableRowCheckbox: deactivatedUsers,
|
|
9986
8907
|
searchValue: searchValue,
|
|
9987
8908
|
isILadmin: isILadmin,
|
|
9988
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9989
|
-
onResetPasswordHandler: onResetPasswordHandler,
|
|
9990
|
-
toggleInviteModal: toggleInviteModal
|
|
8909
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9991
8910
|
}))
|
|
9992
8911
|
}, {
|
|
9993
8912
|
label: /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React__default.createElement(TabLabelCount, {
|
|
@@ -10003,10 +8922,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10003
8922
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
10004
8923
|
variant: "body2",
|
|
10005
8924
|
className: clsx(styles$5.description)
|
|
10006
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
10007
|
-
onClick: redirectToNotifications,
|
|
10008
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
10009
|
-
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
8925
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in Notifications.")), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
10010
8926
|
data: signupRequestListInfo,
|
|
10011
8927
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
10012
8928
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -10038,54 +8954,6 @@ var UserList = function UserList(_ref2) {
|
|
|
10038
8954
|
}))
|
|
10039
8955
|
}]
|
|
10040
8956
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
10041
|
-
isOpen: deactivateSingle,
|
|
10042
|
-
closeHandler: function closeHandler() {
|
|
10043
|
-
setDeactivateSingle(false);
|
|
10044
|
-
},
|
|
10045
|
-
cancelLabel: "Cancel",
|
|
10046
|
-
submitLabel: "Deactivate",
|
|
10047
|
-
submitHandler: handleDeactivateUser,
|
|
10048
|
-
headerText: "Deactivate this user?",
|
|
10049
|
-
width: "400px",
|
|
10050
|
-
subHanderText: "",
|
|
10051
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
10052
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10053
|
-
modalClass: "deactivateSingleModal",
|
|
10054
|
-
modalBodyStyle: {
|
|
10055
|
-
overflowY: 'unset'
|
|
10056
|
-
}
|
|
10057
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10058
|
-
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
10059
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10060
|
-
className: styles$5.deactivateAlert
|
|
10061
|
-
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
10062
|
-
width: "9",
|
|
10063
|
-
height: "9"
|
|
10064
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
10065
|
-
variant: "body2"
|
|
10066
|
-
}, /*#__PURE__*/React__default.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__default.createElement("span", {
|
|
10067
|
-
onClick: knowMore,
|
|
10068
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
10069
|
-
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10070
|
-
className: "iui__mt-15"
|
|
10071
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10072
|
-
isMove: true,
|
|
10073
|
-
additional: {
|
|
10074
|
-
page: 1,
|
|
10075
|
-
product: 'travel',
|
|
10076
|
-
userId: user.id
|
|
10077
|
-
},
|
|
10078
|
-
label: "Transfer approver role to",
|
|
10079
|
-
value: approverRole,
|
|
10080
|
-
onValueChange: selectApprover,
|
|
10081
|
-
loadOption: transferRoleOptions,
|
|
10082
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10083
|
-
customLoadingText: "No results found"
|
|
10084
|
-
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10085
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
10086
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10087
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
10088
|
-
}, "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__default.createElement(iuistyles.IUIModal, {
|
|
10089
8957
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
10090
8958
|
closeHandler: closeDeActivateModal,
|
|
10091
8959
|
cancelLabel: "Cancel",
|
|
@@ -10111,124 +8979,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10111
8979
|
className: styles$5.headerText
|
|
10112
8980
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
10113
8981
|
className: styles$5.description
|
|
10114
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(
|
|
10115
|
-
isOpen: isBulkDeactivateModalOpen,
|
|
10116
|
-
closeHandler: closeDeActiveModal,
|
|
10117
|
-
cancelLabel: "Cancel",
|
|
10118
|
-
submitLabel: "Deactivate safe users",
|
|
10119
|
-
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
10120
|
-
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
10121
|
-
customButtonLabel: "Deactivate all users",
|
|
10122
|
-
customButtonHandler: handleDeactivateUsers,
|
|
10123
|
-
submitHandler: handleDeactivateSafeUsers,
|
|
10124
|
-
width: "640px",
|
|
10125
|
-
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
10126
|
-
headerText: "Deactivate users?",
|
|
10127
|
-
modalBodyStyle: {
|
|
10128
|
-
maxHeight: 'calc(100vh - 50vh)'
|
|
10129
|
-
}
|
|
10130
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10131
|
-
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
10132
|
-
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
10133
|
-
color: "#9A6700",
|
|
10134
|
-
size: "14"
|
|
10135
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
10136
|
-
variant: "body2"
|
|
10137
|
-
}, "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__default.createElement("span", {
|
|
10138
|
-
onClick: knowMore,
|
|
10139
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
10140
|
-
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10141
|
-
className: "iui__my-15"
|
|
10142
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10143
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
10144
|
-
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10145
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
10146
|
-
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
10147
|
-
var _item$data;
|
|
10148
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10149
|
-
key: index,
|
|
10150
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
10151
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
10152
|
-
firstName: item.first_name,
|
|
10153
|
-
lastName: item.last_name,
|
|
10154
|
-
isLetterAvatar: "true",
|
|
10155
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
10156
|
-
secondaryText: item.email,
|
|
10157
|
-
letterAvatarTextColor: "black",
|
|
10158
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
10159
|
-
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
10160
|
-
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
10161
|
-
color: "#9A6700",
|
|
10162
|
-
size: "14"
|
|
10163
|
-
}));
|
|
10164
|
-
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
10165
|
-
style: {
|
|
10166
|
-
borderColor: '#E5E9ED'
|
|
10167
|
-
}
|
|
10168
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10169
|
-
className: "iui__my-15"
|
|
10170
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10171
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
10172
|
-
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10173
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
10174
|
-
}, "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) {
|
|
10175
|
-
var _item$data2;
|
|
10176
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10177
|
-
key: index,
|
|
10178
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
10179
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
10180
|
-
firstName: item.first_name,
|
|
10181
|
-
lastName: item.last_name,
|
|
10182
|
-
isLetterAvatar: "true",
|
|
10183
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
10184
|
-
secondaryText: item.email,
|
|
10185
|
-
letterAvatarTextColor: "black",
|
|
10186
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
10187
|
-
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
10188
|
-
}));
|
|
10189
|
-
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
10190
|
-
isOpen: showInviteModal,
|
|
10191
|
-
closeHandler: function closeHandler() {
|
|
10192
|
-
return toggleInviteModalClose();
|
|
10193
|
-
},
|
|
10194
|
-
cancelLabel: "Cancel",
|
|
10195
|
-
headerText: "Resend Invites?",
|
|
10196
|
-
submitLabel: "Send",
|
|
10197
|
-
submitHandler: function submitHandler() {
|
|
10198
|
-
return onResendInviteHandler();
|
|
10199
|
-
},
|
|
10200
|
-
width: "400px",
|
|
10201
|
-
modalBodyStyle: {
|
|
10202
|
-
padding: '0px'
|
|
10203
|
-
},
|
|
10204
|
-
footerStyle: {
|
|
10205
|
-
justifyContent: 'center'
|
|
10206
|
-
}
|
|
10207
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10208
|
-
style: {
|
|
10209
|
-
display: 'flex',
|
|
10210
|
-
padding: '16px',
|
|
10211
|
-
margin: '8px 24px',
|
|
10212
|
-
border: '1px solid #FDE047',
|
|
10213
|
-
background: '#FEFCE8',
|
|
10214
|
-
borderRadius: '5px'
|
|
10215
|
-
}
|
|
10216
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
10217
|
-
style: {
|
|
10218
|
-
marginRight: '5px'
|
|
10219
|
-
}
|
|
10220
|
-
}, /*#__PURE__*/React__default.createElement(InviteInfoIcon, null)), /*#__PURE__*/React__default.createElement("div", {
|
|
10221
|
-
style: {
|
|
10222
|
-
fontSize: '14px',
|
|
10223
|
-
color: '#374151'
|
|
10224
|
-
}
|
|
10225
|
-
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
10226
|
-
style: {
|
|
10227
|
-
fontSize: '14px',
|
|
10228
|
-
color: '#374151',
|
|
10229
|
-
fontWeight: 'bold'
|
|
10230
|
-
}
|
|
10231
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
8982
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
10232
8983
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
10233
8984
|
closeImportUsersModal: closeImportUsersModal,
|
|
10234
8985
|
closeImportModal: closeImportModal
|
|
@@ -10237,8 +8988,8 @@ var UserList = function UserList(_ref2) {
|
|
|
10237
8988
|
errMsg: hasVerificationError
|
|
10238
8989
|
}));
|
|
10239
8990
|
};
|
|
10240
|
-
var TabLabelCount = function TabLabelCount(
|
|
10241
|
-
var count =
|
|
8991
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
8992
|
+
var count = _ref3.count;
|
|
10242
8993
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10243
8994
|
className: styles$5.TabLabelCount
|
|
10244
8995
|
}, " ", count, " ");
|
|
@@ -10313,12 +9064,11 @@ function Header(props) {
|
|
|
10313
9064
|
})));
|
|
10314
9065
|
}
|
|
10315
9066
|
|
|
10316
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","
|
|
9067
|
+
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"};
|
|
10317
9068
|
|
|
10318
9069
|
function Listview(_ref) {
|
|
10319
9070
|
var data = _ref.data,
|
|
10320
9071
|
name = _ref.name,
|
|
10321
|
-
tableName = _ref.tableName,
|
|
10322
9072
|
handleEditDialog = _ref.handleEditDialog,
|
|
10323
9073
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
10324
9074
|
orderBy = _ref.orderBy,
|
|
@@ -10331,87 +9081,21 @@ function Listview(_ref) {
|
|
|
10331
9081
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
10332
9082
|
page = _ref.page,
|
|
10333
9083
|
rowsPerPage = _ref.rowsPerPage;
|
|
10334
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10335
|
-
var _data$dept_head_detai;
|
|
10336
|
-
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) {
|
|
10337
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
10338
|
-
}
|
|
10339
|
-
};
|
|
10340
9084
|
var columns = [{
|
|
10341
9085
|
id: 'name',
|
|
10342
9086
|
label: name,
|
|
10343
|
-
width: '
|
|
10344
|
-
sortable: true,
|
|
10345
|
-
cell: function cell(row) {
|
|
10346
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10347
|
-
component: "div"
|
|
10348
|
-
}, row.name);
|
|
10349
|
-
}
|
|
10350
|
-
}, {
|
|
10351
|
-
id: 'no_of_users',
|
|
10352
|
-
label: 'Number of users',
|
|
10353
|
-
width: '40%',
|
|
10354
|
-
sortable: true,
|
|
10355
|
-
cell: function cell(row) {
|
|
10356
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10357
|
-
component: "div"
|
|
10358
|
-
}, row.no_of_users);
|
|
10359
|
-
}
|
|
10360
|
-
}, {
|
|
10361
|
-
id: 'actions',
|
|
10362
|
-
label: 'Actions',
|
|
10363
|
-
width: '20%',
|
|
10364
|
-
cell: function cell(row) {
|
|
10365
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10366
|
-
display: "flex"
|
|
10367
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10368
|
-
buttonText: "Edit",
|
|
10369
|
-
className: styles$7.buttonWidth,
|
|
10370
|
-
onClick: function onClick() {
|
|
10371
|
-
return handleEditDialog(row);
|
|
10372
|
-
}
|
|
10373
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10374
|
-
buttonText: "Delete",
|
|
10375
|
-
className: styles$7.buttonWidth,
|
|
10376
|
-
onClick: function onClick() {
|
|
10377
|
-
return handleDeleteDialog(row, true);
|
|
10378
|
-
}
|
|
10379
|
-
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10380
|
-
buttonText: "Delete",
|
|
10381
|
-
className: styles$7.buttonWidth,
|
|
10382
|
-
onClick: function onClick() {
|
|
10383
|
-
return handleDeleteDialog(row, false);
|
|
10384
|
-
}
|
|
10385
|
-
}));
|
|
10386
|
-
}
|
|
10387
|
-
}];
|
|
10388
|
-
var departmentColumns = [{
|
|
10389
|
-
id: 'name',
|
|
10390
|
-
label: name,
|
|
10391
|
-
width: '30%',
|
|
9087
|
+
width: '45%',
|
|
10392
9088
|
sortable: true,
|
|
10393
9089
|
cell: function cell(row) {
|
|
10394
9090
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10395
9091
|
component: "div"
|
|
10396
9092
|
}, row.name);
|
|
10397
9093
|
}
|
|
10398
|
-
}, {
|
|
10399
|
-
id: 'department_head',
|
|
10400
|
-
label: 'Department head',
|
|
10401
|
-
width: '30%',
|
|
10402
|
-
sortable: true,
|
|
10403
|
-
cell: function cell(row) {
|
|
10404
|
-
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10405
|
-
component: "div"
|
|
10406
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
10407
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
10408
|
-
}, "Assigned by default"));
|
|
10409
|
-
}
|
|
10410
9094
|
}, {
|
|
10411
9095
|
id: 'no_of_users',
|
|
10412
9096
|
label: 'Number of users',
|
|
10413
9097
|
width: '45%',
|
|
10414
|
-
sortable:
|
|
9098
|
+
sortable: true,
|
|
10415
9099
|
cell: function cell(row) {
|
|
10416
9100
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10417
9101
|
component: "div"
|
|
@@ -10420,7 +9104,7 @@ function Listview(_ref) {
|
|
|
10420
9104
|
}, {
|
|
10421
9105
|
id: 'actions',
|
|
10422
9106
|
label: 'Actions',
|
|
10423
|
-
width: '
|
|
9107
|
+
width: '10%',
|
|
10424
9108
|
cell: function cell(row) {
|
|
10425
9109
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10426
9110
|
display: "flex"
|
|
@@ -10453,7 +9137,7 @@ function Listview(_ref) {
|
|
|
10453
9137
|
hasFilter: true,
|
|
10454
9138
|
isCheckboxTable: false,
|
|
10455
9139
|
count: data.count,
|
|
10456
|
-
columns:
|
|
9140
|
+
columns: columns,
|
|
10457
9141
|
rows: data.results,
|
|
10458
9142
|
page: page,
|
|
10459
9143
|
handleChangePage: handleChangePage,
|
|
@@ -10510,43 +9194,15 @@ function EditPanelDialog(_ref) {
|
|
|
10510
9194
|
var isOpen = _ref.isOpen,
|
|
10511
9195
|
closeHandler = _ref.closeHandler,
|
|
10512
9196
|
onValueChange = _ref.onValueChange,
|
|
10513
|
-
|
|
9197
|
+
submitHandler = _ref.submitHandler,
|
|
10514
9198
|
isError = _ref.isError,
|
|
10515
9199
|
name = _ref.name,
|
|
10516
9200
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
10517
|
-
validation = _ref.validation
|
|
10518
|
-
rowData = _ref.rowData,
|
|
10519
|
-
tableName = _ref.tableName,
|
|
10520
|
-
config = _ref.config;
|
|
9201
|
+
validation = _ref.validation;
|
|
10521
9202
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
10522
9203
|
return state.userPanel;
|
|
10523
9204
|
}),
|
|
10524
9205
|
dialogData = _useSelector.dialogData;
|
|
10525
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10526
|
-
var _data$dept_head_detai;
|
|
10527
|
-
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) {
|
|
10528
|
-
setHead({
|
|
10529
|
-
value: data.dept_head_details[0].id,
|
|
10530
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10531
|
-
});
|
|
10532
|
-
}
|
|
10533
|
-
};
|
|
10534
|
-
var _useState = React.useState({
|
|
10535
|
-
value: '',
|
|
10536
|
-
label: 'Select'
|
|
10537
|
-
}),
|
|
10538
|
-
head = _useState[0],
|
|
10539
|
-
setHead = _useState[1];
|
|
10540
|
-
React.useEffect(function () {
|
|
10541
|
-
deptHeadDetails(rowData);
|
|
10542
|
-
}, [rowData]);
|
|
10543
|
-
var history = reactRouterDom.useHistory();
|
|
10544
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10545
|
-
history.push({
|
|
10546
|
-
pathname: config.routes.users.add.path,
|
|
10547
|
-
state: rowData
|
|
10548
|
-
});
|
|
10549
|
-
};
|
|
10550
9206
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
10551
9207
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10552
9208
|
isOpen: isOpen,
|
|
@@ -10554,59 +9210,25 @@ function EditPanelDialog(_ref) {
|
|
|
10554
9210
|
headerText: "Edit " + name.toLowerCase(),
|
|
10555
9211
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
10556
9212
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
10557
|
-
submitHandler:
|
|
10558
|
-
|
|
10559
|
-
},
|
|
10560
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9213
|
+
submitHandler: submitHandler,
|
|
9214
|
+
width: "365px",
|
|
10561
9215
|
hideCloseIcon: false,
|
|
10562
9216
|
modalBodyStyle: {
|
|
10563
|
-
|
|
9217
|
+
maxHeight: '400px',
|
|
9218
|
+
overflow: 'auto',
|
|
9219
|
+
margin: '0px'
|
|
10564
9220
|
},
|
|
10565
9221
|
footerStyle: {
|
|
10566
9222
|
justifyContent: 'end'
|
|
10567
9223
|
}
|
|
10568
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10569
|
-
display: "flex",
|
|
10570
|
-
justifyContent: "center",
|
|
10571
|
-
alignItems: "center",
|
|
10572
|
-
flexDirection: "column",
|
|
10573
|
-
style: {
|
|
10574
|
-
marginBottom: '30px'
|
|
10575
|
-
}
|
|
10576
9224
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9225
|
+
component: "div",
|
|
10577
9226
|
display: "flex",
|
|
10578
9227
|
justifyContent: "center",
|
|
10579
9228
|
alignItems: "center",
|
|
10580
9229
|
flexDirection: "column",
|
|
10581
|
-
|
|
10582
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10583
|
-
className: styles$7.alertDescContainer
|
|
10584
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10585
|
-
className: styles$7.iconLayout,
|
|
10586
|
-
style: {
|
|
10587
|
-
paddingTop: '4px'
|
|
10588
|
-
}
|
|
10589
|
-
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10590
|
-
color: "#CA8A04",
|
|
10591
|
-
width: "25",
|
|
10592
|
-
height: "20",
|
|
10593
|
-
className: styles$7.iconStyle
|
|
10594
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10595
|
-
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.",
|
|
10596
|
-
style: {
|
|
10597
|
-
fontWeight: 'normal'
|
|
10598
|
-
}
|
|
10599
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10600
|
-
buttonText: "Add user",
|
|
10601
|
-
type: "text",
|
|
10602
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10603
|
-
width: "9",
|
|
10604
|
-
height: "9",
|
|
10605
|
-
color: "#EC5D25"
|
|
10606
|
-
}),
|
|
10607
|
-
onClick: handleAddPageNavigation,
|
|
10608
|
-
className: styles$7.addUserButton
|
|
10609
|
-
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9230
|
+
padding: "8px 24px"
|
|
9231
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10610
9232
|
label: name + " name",
|
|
10611
9233
|
name: "name",
|
|
10612
9234
|
defaultValue: dialogData.data.name,
|
|
@@ -10615,49 +9237,7 @@ function EditPanelDialog(_ref) {
|
|
|
10615
9237
|
isError: isError,
|
|
10616
9238
|
validation: validation,
|
|
10617
9239
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
10618
|
-
required: true
|
|
10619
|
-
style: tableName === 'department' && {
|
|
10620
|
-
width: '350px'
|
|
10621
|
-
}
|
|
10622
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10623
|
-
className: "iui__mt-15",
|
|
10624
|
-
style: {
|
|
10625
|
-
width: '100%'
|
|
10626
|
-
}
|
|
10627
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10628
|
-
label: "Department head",
|
|
10629
|
-
name: "name",
|
|
10630
|
-
defaultValue: head.label,
|
|
10631
|
-
placeholder: "",
|
|
10632
|
-
readOnly: true,
|
|
10633
|
-
style: {
|
|
10634
|
-
width: '350px'
|
|
10635
|
-
}
|
|
10636
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10637
|
-
className: "iui__mt-15",
|
|
10638
|
-
style: {
|
|
10639
|
-
width: '100%'
|
|
10640
|
-
}
|
|
10641
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10642
|
-
noResultsText: true,
|
|
10643
|
-
isMove: true,
|
|
10644
|
-
additional: {
|
|
10645
|
-
page: 1,
|
|
10646
|
-
departmentId: rowData.id
|
|
10647
|
-
},
|
|
10648
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
10649
|
-
label: "Department head",
|
|
10650
|
-
value: head,
|
|
10651
|
-
onValueChange: function onValueChange(_ref2) {
|
|
10652
|
-
var _value = _ref2._value;
|
|
10653
|
-
return setHead(_value);
|
|
10654
|
-
},
|
|
10655
|
-
loadOption: departmentHeadOptions,
|
|
10656
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10657
|
-
customLoadingText: "No users found in this department",
|
|
10658
|
-
customLoadingTextStyle: {
|
|
10659
|
-
color: '#374151'
|
|
10660
|
-
}
|
|
9240
|
+
required: true
|
|
10661
9241
|
})));
|
|
10662
9242
|
}
|
|
10663
9243
|
|
|
@@ -10836,15 +9416,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10836
9416
|
var _useState13 = React.useState(false),
|
|
10837
9417
|
isSortingChangeTemp = _useState13[0],
|
|
10838
9418
|
setSortingChangeTemp = _useState13[1];
|
|
10839
|
-
var _useState14 = React.useState(
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
var _useState15 = React.useState(
|
|
10843
|
-
|
|
10844
|
-
|
|
10845
|
-
var _useState16 = React.useState(5),
|
|
10846
|
-
rowsPerPage = _useState16[0],
|
|
10847
|
-
setRowsPerPage = _useState16[1];
|
|
9419
|
+
var _useState14 = React.useState(1),
|
|
9420
|
+
page = _useState14[0],
|
|
9421
|
+
setPage = _useState14[1];
|
|
9422
|
+
var _useState15 = React.useState(5),
|
|
9423
|
+
rowsPerPage = _useState15[0],
|
|
9424
|
+
setRowsPerPage = _useState15[1];
|
|
10848
9425
|
var orderingParam = orderBy;
|
|
10849
9426
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
10850
9427
|
return state.userPanel;
|
|
@@ -10862,20 +9439,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10862
9439
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
10863
9440
|
setDataList(validatedValue);
|
|
10864
9441
|
};
|
|
10865
|
-
var _useState17 = React.useState(70),
|
|
10866
|
-
maxLengthForModal = _useState17[0],
|
|
10867
|
-
setMaxLengthForModal = _useState17[1];
|
|
10868
|
-
React.useEffect(function () {
|
|
10869
|
-
if (title === 'Business unit') {
|
|
10870
|
-
setMaxLengthForModal(150);
|
|
10871
|
-
}
|
|
10872
|
-
}, []);
|
|
10873
9442
|
var validation = {
|
|
10874
9443
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
10875
9444
|
regexOnBlur: null,
|
|
10876
9445
|
maxLimit: '',
|
|
10877
9446
|
minLimit: '',
|
|
10878
|
-
maxLength:
|
|
9447
|
+
maxLength: 70,
|
|
10879
9448
|
minLength: 0
|
|
10880
9449
|
};
|
|
10881
9450
|
React.useEffect(function () {
|
|
@@ -10948,7 +9517,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10948
9517
|
submitLabel: 'Save'
|
|
10949
9518
|
}, '', data));
|
|
10950
9519
|
setDataList(data.name);
|
|
10951
|
-
setRowData(data);
|
|
10952
9520
|
setEditModal(true);
|
|
10953
9521
|
};
|
|
10954
9522
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10963,12 +9531,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10963
9531
|
var payload = {
|
|
10964
9532
|
names: [dataList]
|
|
10965
9533
|
};
|
|
10966
|
-
if (tableName === 'department') {
|
|
10967
|
-
payload = {
|
|
10968
|
-
name: dataList,
|
|
10969
|
-
department_head_id: null
|
|
10970
|
-
};
|
|
10971
|
-
}
|
|
10972
9534
|
var message = title + " added successfully.";
|
|
10973
9535
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10974
9536
|
} else {
|
|
@@ -10982,12 +9544,9 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10982
9544
|
var message = title + " deleted successfully.";
|
|
10983
9545
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10984
9546
|
};
|
|
10985
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type
|
|
10986
|
-
if (optionalParams === void 0) {
|
|
10987
|
-
optionalParams = null;
|
|
10988
|
-
}
|
|
9547
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10989
9548
|
dispatch(userPanelShowLoader());
|
|
10990
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9549
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10991
9550
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10992
9551
|
dispatch(userPanelStopLoader());
|
|
10993
9552
|
if (type === 'delete') {
|
|
@@ -11029,14 +9588,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11029
9588
|
name: dataList
|
|
11030
9589
|
}]
|
|
11031
9590
|
};
|
|
11032
|
-
if (tableName === 'department') {
|
|
11033
|
-
payload = {
|
|
11034
|
-
name: dataList,
|
|
11035
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
11036
|
-
};
|
|
11037
|
-
}
|
|
11038
9591
|
var message = title + " updated successfully.";
|
|
11039
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9592
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
11040
9593
|
setErrorEdit(false);
|
|
11041
9594
|
} else {
|
|
11042
9595
|
setErrorEdit(true);
|
|
@@ -11143,10 +9696,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11143
9696
|
submitHandler: handleEditPanel,
|
|
11144
9697
|
isError: errorEdit,
|
|
11145
9698
|
isDisabledSubmitBtn: loading,
|
|
11146
|
-
validation: validation
|
|
11147
|
-
rowData: rowData,
|
|
11148
|
-
tableName: tableName,
|
|
11149
|
-
config: config
|
|
9699
|
+
validation: validation
|
|
11150
9700
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
11151
9701
|
config: config
|
|
11152
9702
|
}));
|