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