@itilite/iui-user-management 0.5.11 → 1.0.0
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/VectorinfoIcon~bdIVCeRl.jpg +0 -0
- package/dist/index.css +7 -111
- package/dist/index.js +580 -1515
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +584 -1519
- 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) {
|
|
@@ -69,6 +67,7 @@ var _Pact = /*#__PURE__*/function () {
|
|
|
69
67
|
};
|
|
70
68
|
return _Pact;
|
|
71
69
|
}();
|
|
70
|
+
|
|
72
71
|
function _settle(pact, state, value) {
|
|
73
72
|
if (!pact.s) {
|
|
74
73
|
if (value instanceof _Pact) {
|
|
@@ -97,6 +96,7 @@ function _settle(pact, state, value) {
|
|
|
97
96
|
function _isSettledPact(thenable) {
|
|
98
97
|
return thenable instanceof _Pact && thenable.s & 1;
|
|
99
98
|
}
|
|
99
|
+
|
|
100
100
|
function _forTo(array, body, check) {
|
|
101
101
|
var i = -1,
|
|
102
102
|
pact,
|
|
@@ -128,6 +128,7 @@ function _forTo(array, body, check) {
|
|
|
128
128
|
}
|
|
129
129
|
var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
130
130
|
var _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
131
|
+
|
|
131
132
|
function _catch(body, recover) {
|
|
132
133
|
try {
|
|
133
134
|
var result = body();
|
|
@@ -146,11 +147,17 @@ function r(e) {
|
|
|
146
147
|
var t,
|
|
147
148
|
f,
|
|
148
149
|
n = "";
|
|
149
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
150
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) {
|
|
151
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
152
|
+
} else for (t in e) {
|
|
153
|
+
e[t] && (n && (n += " "), n += t);
|
|
154
|
+
}
|
|
150
155
|
return n;
|
|
151
156
|
}
|
|
152
157
|
function clsx() {
|
|
153
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
158
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
159
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
160
|
+
}
|
|
154
161
|
return n;
|
|
155
162
|
}
|
|
156
163
|
|
|
@@ -354,9 +361,6 @@ var userAddEditUrl = {
|
|
|
354
361
|
approversSearch: function approversSearch() {
|
|
355
362
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
356
363
|
},
|
|
357
|
-
transferAppover: function transferAppover() {
|
|
358
|
-
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
-
},
|
|
360
364
|
preSignedUrl: function preSignedUrl() {
|
|
361
365
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
362
366
|
},
|
|
@@ -444,23 +448,15 @@ var userPanelUrl = {
|
|
|
444
448
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
445
449
|
},
|
|
446
450
|
getUnit: function getUnit(tableName, length, sort) {
|
|
447
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
451
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&order=" + sort;
|
|
448
452
|
},
|
|
449
453
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
450
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
454
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&order=" + sort;
|
|
451
455
|
},
|
|
452
456
|
moveUnit: function moveUnit() {
|
|
453
457
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
454
458
|
}
|
|
455
459
|
};
|
|
456
|
-
var departmentUrl = {
|
|
457
|
-
departmentUrl: function departmentUrl() {
|
|
458
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
459
|
-
},
|
|
460
|
-
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
461
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
462
|
-
}
|
|
463
|
-
};
|
|
464
460
|
|
|
465
461
|
var api = configs.api;
|
|
466
462
|
var NAoptionConfig = {
|
|
@@ -470,6 +466,7 @@ var NAoptionConfig = {
|
|
|
470
466
|
},
|
|
471
467
|
applyFor: ['employee_level', 'department']
|
|
472
468
|
};
|
|
469
|
+
|
|
473
470
|
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
474
471
|
var page = _ref.page,
|
|
475
472
|
tabelName = _ref.tabelName,
|
|
@@ -602,53 +599,11 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
602
599
|
return Promise.reject(e);
|
|
603
600
|
}
|
|
604
601
|
};
|
|
605
|
-
var
|
|
602
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
606
603
|
var page = _ref4.page,
|
|
607
604
|
product = _ref4.product,
|
|
608
|
-
userId = _ref4.userId
|
|
609
|
-
|
|
610
|
-
return Promise.resolve(_catch(function () {
|
|
611
|
-
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
612
|
-
return res.data;
|
|
613
|
-
})).then(function (response) {
|
|
614
|
-
var mappedValue = response.results.map(function (item) {
|
|
615
|
-
return {
|
|
616
|
-
value: item.email,
|
|
617
|
-
label: item.email,
|
|
618
|
-
type: 'detailed',
|
|
619
|
-
data: item
|
|
620
|
-
};
|
|
621
|
-
});
|
|
622
|
-
return {
|
|
623
|
-
options: mappedValue,
|
|
624
|
-
hasMore: !!response.next,
|
|
625
|
-
additional: {
|
|
626
|
-
page: page + 1,
|
|
627
|
-
product: product,
|
|
628
|
-
userId: userId
|
|
629
|
-
}
|
|
630
|
-
};
|
|
631
|
-
});
|
|
632
|
-
}, function () {
|
|
633
|
-
return {
|
|
634
|
-
options: [],
|
|
635
|
-
hasMore: false,
|
|
636
|
-
additional: {
|
|
637
|
-
page: 1,
|
|
638
|
-
product: product,
|
|
639
|
-
userId: userId
|
|
640
|
-
}
|
|
641
|
-
};
|
|
642
|
-
}));
|
|
643
|
-
} catch (e) {
|
|
644
|
-
return Promise.reject(e);
|
|
645
|
-
}
|
|
646
|
-
};
|
|
647
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
648
|
-
var page = _ref5.page,
|
|
649
|
-
product = _ref5.product,
|
|
650
|
-
userId = _ref5.userId,
|
|
651
|
-
placeholder = _ref5.placeholder;
|
|
605
|
+
userId = _ref4.userId,
|
|
606
|
+
placeholder = _ref4.placeholder;
|
|
652
607
|
try {
|
|
653
608
|
return Promise.resolve(_catch(function () {
|
|
654
609
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -694,9 +649,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
|
694
649
|
return Promise.reject(e);
|
|
695
650
|
}
|
|
696
651
|
};
|
|
697
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
698
|
-
var page =
|
|
699
|
-
tabelName =
|
|
652
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
653
|
+
var page = _ref5.page,
|
|
654
|
+
tabelName = _ref5.tabelName;
|
|
700
655
|
try {
|
|
701
656
|
return Promise.resolve(_catch(function () {
|
|
702
657
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -708,6 +663,7 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
708
663
|
label: item[tabelName]
|
|
709
664
|
};
|
|
710
665
|
});
|
|
666
|
+
|
|
711
667
|
return {
|
|
712
668
|
options: mappedValue,
|
|
713
669
|
hasMore: !!response.next,
|
|
@@ -731,45 +687,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
731
687
|
return Promise.reject(e);
|
|
732
688
|
}
|
|
733
689
|
};
|
|
734
|
-
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
735
|
-
var page = _ref7.page,
|
|
736
|
-
departmentId = _ref7.departmentId;
|
|
737
|
-
try {
|
|
738
|
-
return Promise.resolve(_catch(function () {
|
|
739
|
-
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
740
|
-
return res.data;
|
|
741
|
-
})).then(function (response) {
|
|
742
|
-
var mappedValue = response.results.map(function (item) {
|
|
743
|
-
return {
|
|
744
|
-
value: item.id,
|
|
745
|
-
label: item.first_name + ' ' + item.last_name,
|
|
746
|
-
type: 'detailed',
|
|
747
|
-
data: item
|
|
748
|
-
};
|
|
749
|
-
});
|
|
750
|
-
return {
|
|
751
|
-
options: mappedValue,
|
|
752
|
-
hasMore: !!response.next,
|
|
753
|
-
additional: {
|
|
754
|
-
page: page + 1,
|
|
755
|
-
departmentId: departmentId
|
|
756
|
-
}
|
|
757
|
-
};
|
|
758
|
-
});
|
|
759
|
-
}, function () {
|
|
760
|
-
return {
|
|
761
|
-
options: [],
|
|
762
|
-
hasMore: false,
|
|
763
|
-
additional: {
|
|
764
|
-
page: 1,
|
|
765
|
-
departmentId: departmentId
|
|
766
|
-
}
|
|
767
|
-
};
|
|
768
|
-
}));
|
|
769
|
-
} catch (e) {
|
|
770
|
-
return Promise.reject(e);
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
690
|
|
|
774
691
|
var UserRole = function UserRole(_ref) {
|
|
775
692
|
var _ref$list = _ref.list,
|
|
@@ -848,6 +765,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
848
765
|
if (userTags.length) {
|
|
849
766
|
res.user_tags = userTags;
|
|
850
767
|
}
|
|
768
|
+
|
|
851
769
|
if (payload.productAccess.travel) {
|
|
852
770
|
var _payload$passportInfo, _payload$passportInfo2, _payload$passportInfo3, _payload$passportInfo4, _payload$membershipIn, _payload$uploadedFile;
|
|
853
771
|
res.approvers.travel = [];
|
|
@@ -859,12 +777,14 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
859
777
|
});
|
|
860
778
|
}
|
|
861
779
|
}
|
|
780
|
+
|
|
862
781
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
863
782
|
res.approvers.travel.push({
|
|
864
783
|
email: payload.travelFYI.value,
|
|
865
784
|
sequence: 'fyi'
|
|
866
785
|
});
|
|
867
786
|
}
|
|
787
|
+
|
|
868
788
|
res.user_travel_info = {
|
|
869
789
|
passport_issue_country: payload !== null && payload !== void 0 && (_payload$passportInfo = payload.passportInfoInput) !== null && _payload$passportInfo !== void 0 && (_payload$passportInfo2 = _payload$passportInfo.passport_issue_country) !== null && _payload$passportInfo2 !== void 0 && _payload$passportInfo2.value ? payload.passportInfoInput.passport_issue_country.value : null,
|
|
870
790
|
nationality: payload !== null && payload !== void 0 && (_payload$passportInfo3 = payload.passportInfoInput) !== null && _payload$passportInfo3 !== void 0 && (_payload$passportInfo4 = _payload$passportInfo3.nationality) !== null && _payload$passportInfo4 !== void 0 && _payload$passportInfo4.value ? payload.passportInfoInput.nationality.value : null,
|
|
@@ -903,6 +823,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
903
823
|
res.files = [];
|
|
904
824
|
}
|
|
905
825
|
}
|
|
826
|
+
|
|
906
827
|
if (payload.productAccess.expense) {
|
|
907
828
|
res.approvers.expense = [];
|
|
908
829
|
for (var _key2 in payload.expenseApproversInput) {
|
|
@@ -913,6 +834,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
913
834
|
});
|
|
914
835
|
}
|
|
915
836
|
}
|
|
837
|
+
|
|
916
838
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
917
839
|
res.approvers.expense.push({
|
|
918
840
|
email: payload.expenseFYI.value,
|
|
@@ -1020,6 +942,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1020
942
|
});
|
|
1021
943
|
}
|
|
1022
944
|
}
|
|
945
|
+
|
|
1023
946
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
1024
947
|
res.fields.approvers.travel.push({
|
|
1025
948
|
email: payload.travelFYI.value,
|
|
@@ -1096,6 +1019,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1096
1019
|
res.fields.user_travel_info.redress_number = payload.secureTravelInputInfo.redress_number || null;
|
|
1097
1020
|
}
|
|
1098
1021
|
}
|
|
1022
|
+
|
|
1099
1023
|
if (payload.productAccess.expense) {
|
|
1100
1024
|
if (!env$1.isProfilePage()) {
|
|
1101
1025
|
res.fields.approvers.expense = [];
|
|
@@ -1107,6 +1031,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1107
1031
|
});
|
|
1108
1032
|
}
|
|
1109
1033
|
}
|
|
1034
|
+
|
|
1110
1035
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
1111
1036
|
res.fields.approvers.expense.push({
|
|
1112
1037
|
email: payload.expenseFYI.value,
|
|
@@ -1238,19 +1163,10 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1238
1163
|
payload: tabId
|
|
1239
1164
|
};
|
|
1240
1165
|
};
|
|
1241
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1242
|
-
if (roleTransfer === void 0) {
|
|
1243
|
-
roleTransfer = false;
|
|
1244
|
-
}
|
|
1245
|
-
var _payload = {
|
|
1246
|
-
role_transfer: roleTransfer
|
|
1247
|
-
};
|
|
1248
|
-
if (roleTransfer) {
|
|
1249
|
-
_payload.new_approver_user_id = newApproverUserId;
|
|
1250
|
-
}
|
|
1166
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1251
1167
|
return function (dispatch) {
|
|
1252
1168
|
return new Promise(function (resolve, reject) {
|
|
1253
|
-
api$1.
|
|
1169
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1254
1170
|
dispatch(setUserActiveStatus({
|
|
1255
1171
|
is_active: activateVal !== 0,
|
|
1256
1172
|
id: id
|
|
@@ -1347,6 +1263,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1347
1263
|
var _res$data;
|
|
1348
1264
|
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1349
1265
|
dispatch(stopLoader());
|
|
1266
|
+
reject();
|
|
1350
1267
|
}
|
|
1351
1268
|
})["catch"](function (err) {
|
|
1352
1269
|
reject(err);
|
|
@@ -1359,7 +1276,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1359
1276
|
return new Promise(function (resolve, reject) {
|
|
1360
1277
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1361
1278
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1362
|
-
resolve(
|
|
1279
|
+
resolve('success');
|
|
1363
1280
|
})["catch"](function (err) {
|
|
1364
1281
|
reject(err);
|
|
1365
1282
|
})["finally"](function () {});
|
|
@@ -1518,9 +1435,11 @@ var createUser = function createUser(payload) {
|
|
|
1518
1435
|
} else {
|
|
1519
1436
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1520
1437
|
reject(res.data.errors);
|
|
1438
|
+
return;
|
|
1521
1439
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1522
1440
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1523
1441
|
}
|
|
1442
|
+
reject();
|
|
1524
1443
|
}
|
|
1525
1444
|
})["catch"](function (err) {
|
|
1526
1445
|
var _err$response6;
|
|
@@ -1566,13 +1485,17 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1566
1485
|
});
|
|
1567
1486
|
};
|
|
1568
1487
|
};
|
|
1488
|
+
|
|
1569
1489
|
var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
1570
1490
|
return new Promise(function (resolve, reject) {
|
|
1571
1491
|
var formData = new FormData();
|
|
1492
|
+
|
|
1572
1493
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
1573
1494
|
formData.append(key, presignedPostData.fields[key]);
|
|
1574
1495
|
});
|
|
1496
|
+
|
|
1575
1497
|
formData.append('file', file);
|
|
1498
|
+
|
|
1576
1499
|
axios.post(presignedPostData.url, formData, {
|
|
1577
1500
|
headers: {
|
|
1578
1501
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1617,43 +1540,20 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1617
1540
|
});
|
|
1618
1541
|
};
|
|
1619
1542
|
};
|
|
1620
|
-
var
|
|
1621
|
-
return function (dispatch) {
|
|
1622
|
-
return new Promise(function (resolve, reject) {
|
|
1623
|
-
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1624
|
-
email: data.email
|
|
1625
|
-
}).then(function (res) {
|
|
1626
|
-
IUIToastMessageService$1.sNotify("The link to reset the password has been sent to the user's email address. Check your \"junk mail\" or \"spam\" folders in case it's not received.");
|
|
1627
|
-
resolve();
|
|
1628
|
-
})["catch"](function (err) {
|
|
1629
|
-
var _err$response9, _err$response9$data;
|
|
1630
|
-
if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
|
|
1631
|
-
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1632
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : (_err$response10$data$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
|
|
1633
|
-
reject(err);
|
|
1634
|
-
return;
|
|
1635
|
-
}
|
|
1636
|
-
reject(err);
|
|
1637
|
-
});
|
|
1638
|
-
});
|
|
1639
|
-
};
|
|
1640
|
-
};
|
|
1641
|
-
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1543
|
+
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1642
1544
|
return function (dispatch) {
|
|
1643
1545
|
return new Promise(function (resolve, reject) {
|
|
1644
|
-
api$2.
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1546
|
+
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1547
|
+
dispatch(fetchUserSignupRequests({
|
|
1548
|
+
ordering: 'asc',
|
|
1549
|
+
length: 5,
|
|
1550
|
+
page: 1,
|
|
1551
|
+
search: ''
|
|
1552
|
+
}));
|
|
1648
1553
|
resolve();
|
|
1649
1554
|
})["catch"](function (err) {
|
|
1650
|
-
var _err$
|
|
1651
|
-
|
|
1652
|
-
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1653
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : (_err$response12$data$ = _err$response12$data.message) === null || _err$response12$data$ === void 0 ? void 0 : _err$response12$data$.email[0]);
|
|
1654
|
-
reject(err);
|
|
1655
|
-
return;
|
|
1656
|
-
}
|
|
1555
|
+
var _err$response8, _err$response8$data;
|
|
1556
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
|
|
1657
1557
|
reject(err);
|
|
1658
1558
|
});
|
|
1659
1559
|
});
|
|
@@ -1795,7 +1695,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1795
1695
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1796
1696
|
return function (dispatch) {
|
|
1797
1697
|
return new Promise(function (resolve, reject) {
|
|
1798
|
-
api$2.post(
|
|
1698
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1799
1699
|
resolve(res);
|
|
1800
1700
|
})["catch"](function (err) {
|
|
1801
1701
|
var _err$response17, _err$response17$data;
|
|
@@ -1831,7 +1731,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1831
1731
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1832
1732
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1833
1733
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1834
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1835
1734
|
|
|
1836
1735
|
var api$3 = configs.api;
|
|
1837
1736
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1878,17 +1777,18 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1878
1777
|
});
|
|
1879
1778
|
};
|
|
1880
1779
|
};
|
|
1780
|
+
|
|
1881
1781
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1882
1782
|
return function (dispatch) {
|
|
1883
1783
|
return new Promise(function (resolve, reject) {
|
|
1884
|
-
api$3.post(
|
|
1784
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1885
1785
|
dispatch(getUserPanalData(getParam));
|
|
1886
1786
|
dispatch(closeDialog());
|
|
1887
1787
|
resolve(res);
|
|
1888
1788
|
})["catch"](function (err) {
|
|
1889
|
-
var _err$
|
|
1789
|
+
var _err$response2, _err$response2$data;
|
|
1890
1790
|
dispatch(userPanelStopLoader());
|
|
1891
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1791
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.message) || 'Opps, Something went wrong.');
|
|
1892
1792
|
});
|
|
1893
1793
|
});
|
|
1894
1794
|
};
|
|
@@ -1902,37 +1802,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1902
1802
|
dispatch(userPanelStopLoader());
|
|
1903
1803
|
resolve();
|
|
1904
1804
|
})["catch"](function (err) {
|
|
1905
|
-
var _err$
|
|
1906
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1805
|
+
var _err$response3, _err$response3$data;
|
|
1806
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1907
1807
|
dispatch(userPanelStopLoader());
|
|
1908
1808
|
});
|
|
1909
1809
|
});
|
|
1910
1810
|
};
|
|
1911
1811
|
};
|
|
1912
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1812
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1913
1813
|
return function (dispatch) {
|
|
1914
1814
|
return new Promise(function (resolve, reject) {
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
});
|
|
1925
|
-
} else {
|
|
1926
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1927
|
-
dispatch(getUserPanalData(getParam));
|
|
1928
|
-
dispatch(closeDialog());
|
|
1929
|
-
resolve();
|
|
1930
|
-
})["catch"](function (err) {
|
|
1931
|
-
var _err$response6, _err$response6$data;
|
|
1932
|
-
dispatch(userPanelStopLoader());
|
|
1933
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1934
|
-
});
|
|
1935
|
-
}
|
|
1815
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1816
|
+
dispatch(getUserPanalData(getParam));
|
|
1817
|
+
dispatch(closeDialog());
|
|
1818
|
+
resolve();
|
|
1819
|
+
})["catch"](function (err) {
|
|
1820
|
+
var _err$response4, _err$response4$data;
|
|
1821
|
+
dispatch(userPanelStopLoader());
|
|
1822
|
+
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.');
|
|
1823
|
+
});
|
|
1936
1824
|
});
|
|
1937
1825
|
};
|
|
1938
1826
|
};
|
|
@@ -1944,8 +1832,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1944
1832
|
dispatch(closeDialog());
|
|
1945
1833
|
resolve(res);
|
|
1946
1834
|
})["catch"](function (err) {
|
|
1947
|
-
var _err$
|
|
1948
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1835
|
+
var _err$response5, _err$response5$data;
|
|
1836
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
1949
1837
|
});
|
|
1950
1838
|
});
|
|
1951
1839
|
};
|
|
@@ -2433,6 +2321,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2433
2321
|
setOpenEditAproverModalFlag(false);
|
|
2434
2322
|
});
|
|
2435
2323
|
};
|
|
2324
|
+
|
|
2436
2325
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2437
2326
|
container: true,
|
|
2438
2327
|
className: (styles.headingPadding)
|
|
@@ -2580,7 +2469,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2580
2469
|
headerText: "Edit approver field",
|
|
2581
2470
|
cancelLabel: "Cancel",
|
|
2582
2471
|
submitLabel: "Save",
|
|
2583
|
-
submitHandler: handleEditAproverLabel
|
|
2472
|
+
submitHandler: handleEditAproverLabel
|
|
2473
|
+
,
|
|
2584
2474
|
width: "420px",
|
|
2585
2475
|
modalBodyStyle: {
|
|
2586
2476
|
maxHeight: '600px',
|
|
@@ -3034,8 +2924,8 @@ var workInfo = [{
|
|
|
3034
2924
|
validation: {
|
|
3035
2925
|
regexOnChange: null,
|
|
3036
2926
|
regexOnBlur: [{
|
|
3037
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
3038
|
-
message: "Only alphabets, numbers
|
|
2927
|
+
regex: /^[(A-Z)(a-z)(0-9)\-& ]*$/,
|
|
2928
|
+
message: "Only alphabets, numbers and - & are allowed."
|
|
3039
2929
|
}],
|
|
3040
2930
|
maxLimit: '',
|
|
3041
2931
|
minLimit: '',
|
|
@@ -3123,8 +3013,8 @@ var workInfo = [{
|
|
|
3123
3013
|
validation: {
|
|
3124
3014
|
regexOnChange: null,
|
|
3125
3015
|
regexOnBlur: [{
|
|
3126
|
-
regex: /^[A-Za-z0-9
|
|
3127
|
-
message: "Only alphabets, numbers & special characters . & ' ( )
|
|
3016
|
+
regex: /^[A-Za-z0-9 \-.,&'()\/]*$/,
|
|
3017
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3128
3018
|
}, {
|
|
3129
3019
|
regex: /^[a-zA-Z]/,
|
|
3130
3020
|
message: 'Designation should start with alphabets'
|
|
@@ -3135,6 +3025,31 @@ var workInfo = [{
|
|
|
3135
3025
|
minLength: 0
|
|
3136
3026
|
},
|
|
3137
3027
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3028
|
+
}, {
|
|
3029
|
+
id: 7,
|
|
3030
|
+
label: 'Manager',
|
|
3031
|
+
name: 'manager',
|
|
3032
|
+
required: false,
|
|
3033
|
+
type: 'async_select',
|
|
3034
|
+
fullWidth: false,
|
|
3035
|
+
visibility: true,
|
|
3036
|
+
readOnly: false,
|
|
3037
|
+
placeholder: 'Select manager',
|
|
3038
|
+
tabelName: 'manager',
|
|
3039
|
+
product: 'travel',
|
|
3040
|
+
loadOption: approversOptions
|
|
3041
|
+
}, {
|
|
3042
|
+
id: 8,
|
|
3043
|
+
label: 'Skip manager',
|
|
3044
|
+
name: 'skip manager',
|
|
3045
|
+
required: false,
|
|
3046
|
+
type: 'async_select',
|
|
3047
|
+
fullWidth: false,
|
|
3048
|
+
visibility: true,
|
|
3049
|
+
readOnly: false,
|
|
3050
|
+
placeholder: 'Select manager',
|
|
3051
|
+
product: 'travel',
|
|
3052
|
+
loadOption: approversOptions
|
|
3138
3053
|
}, {
|
|
3139
3054
|
id: 9,
|
|
3140
3055
|
label: 'Base location',
|
|
@@ -3970,6 +3885,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3970
3885
|
_userListInfo.results[i].is_active = action.payload.is_active;
|
|
3971
3886
|
}
|
|
3972
3887
|
});
|
|
3888
|
+
|
|
3973
3889
|
var _deactivatedUsers = _userListInfo.results.length > 0 ? _userListInfo.results.filter(function (val) {
|
|
3974
3890
|
return !val.is_active;
|
|
3975
3891
|
}).map(function (obj) {
|
|
@@ -3992,6 +3908,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3992
3908
|
}
|
|
3993
3909
|
});
|
|
3994
3910
|
});
|
|
3911
|
+
|
|
3995
3912
|
var _deactivatedUsers2 = _userListInfo2.results.length > 0 ? _userListInfo2.results.filter(function (val) {
|
|
3996
3913
|
return !val.is_active;
|
|
3997
3914
|
}).map(function (obj) {
|
|
@@ -4045,7 +3962,6 @@ var initialState$2 = {
|
|
|
4045
3962
|
previous: null,
|
|
4046
3963
|
results: []
|
|
4047
3964
|
},
|
|
4048
|
-
deptUsers: [],
|
|
4049
3965
|
loading: false
|
|
4050
3966
|
};
|
|
4051
3967
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4115,12 +4031,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4115
4031
|
loading: false
|
|
4116
4032
|
});
|
|
4117
4033
|
}
|
|
4118
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4119
|
-
{
|
|
4120
|
-
return _extends({}, state, {
|
|
4121
|
-
deptUsers: action.payload
|
|
4122
|
-
});
|
|
4123
|
-
}
|
|
4124
4034
|
default:
|
|
4125
4035
|
return state;
|
|
4126
4036
|
}
|
|
@@ -4307,7 +4217,8 @@ var rootReducer = combineReducers({
|
|
|
4307
4217
|
customFields: reducer$5
|
|
4308
4218
|
});
|
|
4309
4219
|
|
|
4310
|
-
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4220
|
+
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4221
|
+
));
|
|
4311
4222
|
|
|
4312
4223
|
function withStore(Component) {
|
|
4313
4224
|
function WrappedComponent(props) {
|
|
@@ -4850,7 +4761,8 @@ function AddPanelDialog(_ref) {
|
|
|
4850
4761
|
flexDirection: "column",
|
|
4851
4762
|
padding: "8px 20px"
|
|
4852
4763
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4853
|
-
label: name + " name"
|
|
4764
|
+
label: name + " name"
|
|
4765
|
+
,
|
|
4854
4766
|
name: "name",
|
|
4855
4767
|
defaultValue: "",
|
|
4856
4768
|
onValueChange: onValueChange,
|
|
@@ -4899,7 +4811,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4899
4811
|
isILadmin = _useSelector2.isILadmin,
|
|
4900
4812
|
companyName = _useSelector2.companyName;
|
|
4901
4813
|
var history = useHistory();
|
|
4902
|
-
var location = useLocation();
|
|
4903
4814
|
var _useState = useState({
|
|
4904
4815
|
travel: false,
|
|
4905
4816
|
expense: false
|
|
@@ -4935,31 +4846,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4935
4846
|
}
|
|
4936
4847
|
setProductAccess(_productAccess);
|
|
4937
4848
|
};
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
setNewCountryCode = _useState2[1];
|
|
4941
|
-
var _useState3 = useState(),
|
|
4942
|
-
countryDialCode = _useState3[0],
|
|
4943
|
-
setCountryDialCode = _useState3[1];
|
|
4944
|
-
var _useState4 = useState([]),
|
|
4945
|
-
countryContactCode = _useState4[0],
|
|
4946
|
-
setCountryContactCode = _useState4[1];
|
|
4947
|
-
useEffect(function () {
|
|
4948
|
-
var countryObject = countryContactCode.find(function (t) {
|
|
4949
|
-
return t.dial_code === countryDialCode;
|
|
4950
|
-
});
|
|
4951
|
-
if (countryObject) {
|
|
4952
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
4953
|
-
country_code: countryObject.code
|
|
4954
|
-
}));
|
|
4955
|
-
}
|
|
4956
|
-
}, [countryDialCode]);
|
|
4957
|
-
useEffect(function () {
|
|
4958
|
-
var extractedNumber = newCountryCode.substring(1);
|
|
4959
|
-
var convertedNumber = parseInt(extractedNumber);
|
|
4960
|
-
setCountryDialCode(convertedNumber);
|
|
4961
|
-
}, [newCountryCode]);
|
|
4962
|
-
var _useState5 = useState({
|
|
4849
|
+
|
|
4850
|
+
var _useState2 = useState({
|
|
4963
4851
|
first_name: '',
|
|
4964
4852
|
last_name: '',
|
|
4965
4853
|
email: '',
|
|
@@ -4970,9 +4858,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4970
4858
|
contact_country_code: '',
|
|
4971
4859
|
profile_pic: []
|
|
4972
4860
|
}),
|
|
4973
|
-
personalInfoInput =
|
|
4974
|
-
setPersonalInfoInput =
|
|
4975
|
-
var
|
|
4861
|
+
personalInfoInput = _useState2[0],
|
|
4862
|
+
setPersonalInfoInput = _useState2[1];
|
|
4863
|
+
var _useState3 = useState({
|
|
4976
4864
|
emp_level: {
|
|
4977
4865
|
value: '',
|
|
4978
4866
|
label: 'Select employee level'
|
|
@@ -4992,72 +4880,62 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4992
4880
|
},
|
|
4993
4881
|
designation: '',
|
|
4994
4882
|
base_location: '',
|
|
4995
|
-
manager_id: {
|
|
4996
|
-
value: '',
|
|
4997
|
-
label: 'Select Manager'
|
|
4998
|
-
},
|
|
4999
|
-
skip_manager_id: {
|
|
5000
|
-
value: '',
|
|
5001
|
-
label: 'Select Manager'
|
|
5002
|
-
},
|
|
5003
4883
|
currency: {
|
|
5004
4884
|
value: defaultCurrency,
|
|
5005
4885
|
label: defaultCurrency
|
|
5006
4886
|
}
|
|
5007
4887
|
}),
|
|
5008
|
-
employeeInfoInput =
|
|
5009
|
-
setEmployeeInfoInput =
|
|
5010
|
-
var
|
|
4888
|
+
employeeInfoInput = _useState3[0],
|
|
4889
|
+
setEmployeeInfoInput = _useState3[1];
|
|
4890
|
+
var _useState4 = useState({
|
|
5011
4891
|
emp_level: 0,
|
|
5012
4892
|
entity: 0,
|
|
5013
4893
|
business_unit: 0,
|
|
5014
4894
|
department: 0,
|
|
5015
|
-
currency: 0
|
|
5016
|
-
manager_id: 0,
|
|
5017
|
-
skip_manager_id: 0
|
|
4895
|
+
currency: 0
|
|
5018
4896
|
}),
|
|
5019
|
-
cacheForAsyncDropdown =
|
|
5020
|
-
clearCacheForAsyncDropdown =
|
|
5021
|
-
var
|
|
5022
|
-
userTagType =
|
|
5023
|
-
setUserTagType =
|
|
5024
|
-
var
|
|
5025
|
-
scroll =
|
|
5026
|
-
setScroll =
|
|
5027
|
-
var
|
|
5028
|
-
customFieldsInput =
|
|
5029
|
-
setCustomFieldsInput =
|
|
5030
|
-
var
|
|
5031
|
-
travelRole =
|
|
5032
|
-
setTravelRole =
|
|
5033
|
-
var
|
|
5034
|
-
travelApproversInput =
|
|
5035
|
-
setTravelApproversInput =
|
|
5036
|
-
var
|
|
4897
|
+
cacheForAsyncDropdown = _useState4[0],
|
|
4898
|
+
clearCacheForAsyncDropdown = _useState4[1];
|
|
4899
|
+
var _useState5 = useState({}),
|
|
4900
|
+
userTagType = _useState5[0],
|
|
4901
|
+
setUserTagType = _useState5[1];
|
|
4902
|
+
var _useState6 = useState(false),
|
|
4903
|
+
scroll = _useState6[0],
|
|
4904
|
+
setScroll = _useState6[1];
|
|
4905
|
+
var _useState7 = useState({}),
|
|
4906
|
+
customFieldsInput = _useState7[0],
|
|
4907
|
+
setCustomFieldsInput = _useState7[1];
|
|
4908
|
+
var _useState8 = useState('traveler'),
|
|
4909
|
+
travelRole = _useState8[0],
|
|
4910
|
+
setTravelRole = _useState8[1];
|
|
4911
|
+
var _useState9 = useState({}),
|
|
4912
|
+
travelApproversInput = _useState9[0],
|
|
4913
|
+
setTravelApproversInput = _useState9[1];
|
|
4914
|
+
var _useState10 = useState({
|
|
5037
4915
|
value: '',
|
|
5038
4916
|
label: 'Select approver'
|
|
5039
4917
|
}),
|
|
5040
|
-
travelFYI =
|
|
5041
|
-
setTravelFYI =
|
|
5042
|
-
var
|
|
5043
|
-
membershipInfoInput =
|
|
5044
|
-
setMembershipInfoInput =
|
|
5045
|
-
var
|
|
5046
|
-
removedMembershipInfoInput =
|
|
5047
|
-
setRemovedMembershipInfoInput =
|
|
5048
|
-
var
|
|
4918
|
+
travelFYI = _useState10[0],
|
|
4919
|
+
setTravelFYI = _useState10[1];
|
|
4920
|
+
var _useState11 = useState([]),
|
|
4921
|
+
membershipInfoInput = _useState11[0],
|
|
4922
|
+
setMembershipInfoInput = _useState11[1];
|
|
4923
|
+
var _useState12 = useState([]),
|
|
4924
|
+
removedMembershipInfoInput = _useState12[0],
|
|
4925
|
+
setRemovedMembershipInfoInput = _useState12[1];
|
|
4926
|
+
var _useState13 = useState({
|
|
5049
4927
|
flight_seat_preference: '',
|
|
5050
4928
|
meal_preference: ''
|
|
5051
4929
|
}),
|
|
5052
|
-
travelPreferenceInfo =
|
|
5053
|
-
settravelPreferenceInfo =
|
|
5054
|
-
var
|
|
4930
|
+
travelPreferenceInfo = _useState13[0],
|
|
4931
|
+
settravelPreferenceInfo = _useState13[1];
|
|
4932
|
+
var _useState14 = useState({
|
|
5055
4933
|
trusted_traveller: '',
|
|
5056
4934
|
redress_number: ''
|
|
5057
4935
|
}),
|
|
5058
|
-
secureTravelInputInfo =
|
|
5059
|
-
setSecureTravelInputInfo =
|
|
5060
|
-
var
|
|
4936
|
+
secureTravelInputInfo = _useState14[0],
|
|
4937
|
+
setSecureTravelInputInfo = _useState14[1];
|
|
4938
|
+
var _useState15 = useState({
|
|
5061
4939
|
passport_issue_country: {
|
|
5062
4940
|
value: '',
|
|
5063
4941
|
label: 'Select country'
|
|
@@ -5072,39 +4950,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5072
4950
|
passport_photo: [],
|
|
5073
4951
|
travel_docs: []
|
|
5074
4952
|
}),
|
|
5075
|
-
passportInfoInput =
|
|
5076
|
-
setPassportInfoInput =
|
|
5077
|
-
var
|
|
5078
|
-
filesForDelete =
|
|
5079
|
-
setFilesForDelete =
|
|
5080
|
-
var
|
|
5081
|
-
profilePicDelete =
|
|
5082
|
-
setProfilePicDelete =
|
|
5083
|
-
var
|
|
5084
|
-
isAdditionalInfoExpanded =
|
|
5085
|
-
setAdditionalInfoFlag =
|
|
5086
|
-
var
|
|
5087
|
-
expenseRole =
|
|
5088
|
-
setExpenseRole =
|
|
5089
|
-
var
|
|
5090
|
-
expenseApproversInput =
|
|
5091
|
-
setExpenseApproversInput =
|
|
5092
|
-
var
|
|
4953
|
+
passportInfoInput = _useState15[0],
|
|
4954
|
+
setPassportInfoInput = _useState15[1];
|
|
4955
|
+
var _useState16 = useState([]),
|
|
4956
|
+
filesForDelete = _useState16[0],
|
|
4957
|
+
setFilesForDelete = _useState16[1];
|
|
4958
|
+
var _useState17 = useState([]),
|
|
4959
|
+
profilePicDelete = _useState17[0],
|
|
4960
|
+
setProfilePicDelete = _useState17[1];
|
|
4961
|
+
var _useState18 = useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
4962
|
+
isAdditionalInfoExpanded = _useState18[0],
|
|
4963
|
+
setAdditionalInfoFlag = _useState18[1];
|
|
4964
|
+
var _useState19 = useState('submitter'),
|
|
4965
|
+
expenseRole = _useState19[0],
|
|
4966
|
+
setExpenseRole = _useState19[1];
|
|
4967
|
+
var _useState20 = useState({}),
|
|
4968
|
+
expenseApproversInput = _useState20[0],
|
|
4969
|
+
setExpenseApproversInput = _useState20[1];
|
|
4970
|
+
var _useState21 = useState({
|
|
5093
4971
|
value: '',
|
|
5094
4972
|
label: 'Select approver'
|
|
5095
4973
|
}),
|
|
5096
|
-
expenseFYI =
|
|
5097
|
-
setExpenseFYI =
|
|
4974
|
+
expenseFYI = _useState21[0],
|
|
4975
|
+
setExpenseFYI = _useState21[1];
|
|
5098
4976
|
var asyncSelectRefs = useRef({
|
|
5099
4977
|
emp_level: useRef(null),
|
|
5100
4978
|
entity: useRef(null),
|
|
5101
4979
|
business_unit: useRef(null),
|
|
5102
4980
|
department: useRef(null)
|
|
5103
4981
|
});
|
|
5104
|
-
var
|
|
5105
|
-
errorArray =
|
|
5106
|
-
setErrorArray =
|
|
5107
|
-
var
|
|
4982
|
+
var _useState22 = useState([]),
|
|
4983
|
+
errorArray = _useState22[0],
|
|
4984
|
+
setErrorArray = _useState22[1];
|
|
4985
|
+
var _useState23 = useState({
|
|
5108
4986
|
first_name: '',
|
|
5109
4987
|
last_name: '',
|
|
5110
4988
|
email: '',
|
|
@@ -5134,9 +5012,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5134
5012
|
userTagType: '',
|
|
5135
5013
|
profile_pic: ''
|
|
5136
5014
|
}),
|
|
5137
|
-
errorMsgs =
|
|
5138
|
-
setErrorMsgs =
|
|
5139
|
-
var
|
|
5015
|
+
errorMsgs = _useState23[0],
|
|
5016
|
+
setErrorMsgs = _useState23[1];
|
|
5017
|
+
var _useState24 = useState({
|
|
5140
5018
|
first_name: false,
|
|
5141
5019
|
last_name: false,
|
|
5142
5020
|
email: false,
|
|
@@ -5163,14 +5041,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5163
5041
|
userTagType: false,
|
|
5164
5042
|
profile_pic: false
|
|
5165
5043
|
}),
|
|
5166
|
-
inputChangeLog =
|
|
5167
|
-
updateInputChangeLog =
|
|
5168
|
-
var
|
|
5169
|
-
uploadedFiles =
|
|
5170
|
-
setUploadedFiles =
|
|
5171
|
-
var _useState29 = useState(70),
|
|
5172
|
-
maxLengthForModal = _useState29[0],
|
|
5173
|
-
setMaxLengthForModal = _useState29[1];
|
|
5044
|
+
inputChangeLog = _useState24[0],
|
|
5045
|
+
updateInputChangeLog = _useState24[1];
|
|
5046
|
+
var _useState25 = useState([]),
|
|
5047
|
+
uploadedFiles = _useState25[0],
|
|
5048
|
+
setUploadedFiles = _useState25[1];
|
|
5174
5049
|
var defaultAddModalData = {
|
|
5175
5050
|
isOpen: false,
|
|
5176
5051
|
isError: false,
|
|
@@ -5183,41 +5058,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5183
5058
|
regexOnBlur: null,
|
|
5184
5059
|
maxLimit: '',
|
|
5185
5060
|
minLimit: '',
|
|
5186
|
-
maxLength:
|
|
5061
|
+
maxLength: 70,
|
|
5187
5062
|
minLength: 0
|
|
5188
5063
|
};
|
|
5189
|
-
var
|
|
5190
|
-
addModalData =
|
|
5191
|
-
setAddModalData =
|
|
5064
|
+
var _useState26 = useState(defaultAddModalData),
|
|
5065
|
+
addModalData = _useState26[0],
|
|
5066
|
+
setAddModalData = _useState26[1];
|
|
5192
5067
|
var onAddModalClose = function onAddModalClose() {
|
|
5193
5068
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5194
5069
|
};
|
|
5195
|
-
useEffect(function () {
|
|
5196
|
-
var _location$state, _location$state2;
|
|
5197
|
-
if (location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.id && location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.name) {
|
|
5198
|
-
var _location$state3, _location$state4;
|
|
5199
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5200
|
-
department: {
|
|
5201
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5202
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5203
|
-
}
|
|
5204
|
-
}));
|
|
5205
|
-
}
|
|
5206
|
-
}, []);
|
|
5207
5070
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5208
5071
|
var title = '';
|
|
5209
5072
|
if (id === 'entity') {
|
|
5210
5073
|
title = 'Entity';
|
|
5211
|
-
setMaxLengthForModal(70);
|
|
5212
5074
|
} else if (id === 'department') {
|
|
5213
5075
|
title = 'Department';
|
|
5214
|
-
setMaxLengthForModal(70);
|
|
5215
5076
|
} else if (id === 'business_unit') {
|
|
5216
|
-
setMaxLengthForModal(150);
|
|
5217
5077
|
title = 'Business unit';
|
|
5218
5078
|
} else if (id === 'employee_level') {
|
|
5219
5079
|
title = 'Employee level';
|
|
5220
|
-
setMaxLengthForModal(70);
|
|
5221
5080
|
}
|
|
5222
5081
|
setAddModalData(_extends({}, addModalData, {
|
|
5223
5082
|
isOpen: true,
|
|
@@ -5233,42 +5092,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5233
5092
|
}));
|
|
5234
5093
|
} else {
|
|
5235
5094
|
dispatch(showLoader());
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
department_head_id: null
|
|
5241
|
-
};
|
|
5242
|
-
} else {
|
|
5243
|
-
dataObj = {
|
|
5244
|
-
names: [validatedValue]
|
|
5245
|
-
};
|
|
5246
|
-
}
|
|
5247
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5248
|
-
var _extends4;
|
|
5095
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5096
|
+
names: [validatedValue]
|
|
5097
|
+
})).then(function (res) {
|
|
5098
|
+
var _extends2;
|
|
5249
5099
|
setAddModalData(_extends({}, addModalData, {
|
|
5250
5100
|
isOpen: false
|
|
5251
5101
|
}));
|
|
5252
5102
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5253
5103
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
label: res.data.result.name
|
|
5259
|
-
}, _extends2)));
|
|
5260
|
-
} else {
|
|
5261
|
-
var _extends3;
|
|
5262
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5263
|
-
value: res.data.value,
|
|
5264
|
-
label: res.data.label
|
|
5265
|
-
}, _extends3)));
|
|
5266
|
-
}
|
|
5267
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5104
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5105
|
+
value: res.data.value,
|
|
5106
|
+
label: res.data.label
|
|
5107
|
+
}, _extends2)));
|
|
5268
5108
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5269
5109
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5270
|
-
var
|
|
5271
|
-
return _extends({}, prevState, (
|
|
5110
|
+
var _extends3;
|
|
5111
|
+
return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
|
|
5272
5112
|
});
|
|
5273
5113
|
dispatch(stopLoader());
|
|
5274
5114
|
});
|
|
@@ -5285,10 +5125,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5285
5125
|
};
|
|
5286
5126
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5287
5127
|
try {
|
|
5288
|
-
var
|
|
5128
|
+
var _temp6 = function _temp6() {
|
|
5289
5129
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5290
|
-
var
|
|
5291
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5130
|
+
var _extends4;
|
|
5131
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[_name] = true, _extends4)));
|
|
5292
5132
|
}
|
|
5293
5133
|
};
|
|
5294
5134
|
var _name = args._name,
|
|
@@ -5299,7 +5139,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5299
5139
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5300
5140
|
_args$_obj = args._obj,
|
|
5301
5141
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5302
|
-
var
|
|
5142
|
+
var _temp7 = function () {
|
|
5303
5143
|
if (_name === 'contact_number') {
|
|
5304
5144
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5305
5145
|
contact_number: _value.trim(),
|
|
@@ -5310,14 +5150,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5310
5150
|
updateError('country_code', _isError, _errorMsg);
|
|
5311
5151
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5312
5152
|
} else {
|
|
5313
|
-
var
|
|
5314
|
-
var
|
|
5315
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5153
|
+
var _temp8 = function _temp8() {
|
|
5154
|
+
var _extends5;
|
|
5155
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends5 = {}, _extends5[_name] = _value, _extends5)));
|
|
5316
5156
|
updateError(_name, _isError, _errorMsg);
|
|
5317
5157
|
};
|
|
5318
|
-
var
|
|
5158
|
+
var _temp9 = function () {
|
|
5319
5159
|
if (_name === 'profile_pic') {
|
|
5320
|
-
var
|
|
5160
|
+
var _temp10 = function () {
|
|
5321
5161
|
if (_obj.isUpload) {
|
|
5322
5162
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5323
5163
|
_value = _value.map(function (_val) {
|
|
@@ -5348,28 +5188,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5348
5188
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5349
5189
|
}
|
|
5350
5190
|
}();
|
|
5351
|
-
if (
|
|
5191
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5352
5192
|
}
|
|
5353
5193
|
}();
|
|
5354
|
-
return
|
|
5194
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5355
5195
|
}
|
|
5356
5196
|
}();
|
|
5357
|
-
return Promise.resolve(
|
|
5197
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5358
5198
|
} catch (e) {
|
|
5359
5199
|
return Promise.reject(e);
|
|
5360
5200
|
}
|
|
5361
5201
|
};
|
|
5362
5202
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5363
|
-
var
|
|
5203
|
+
var _extends6;
|
|
5364
5204
|
var _name = args._name,
|
|
5365
5205
|
_value = args._value,
|
|
5366
5206
|
_isError = args._isError,
|
|
5367
5207
|
_errorMsg = args._errorMsg;
|
|
5368
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5208
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5369
5209
|
updateError(_name, _isError, _errorMsg);
|
|
5370
5210
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5371
|
-
var
|
|
5372
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5211
|
+
var _extends7;
|
|
5212
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends7 = {}, _extends7[_name] = true, _extends7)));
|
|
5373
5213
|
}
|
|
5374
5214
|
};
|
|
5375
5215
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5379,9 +5219,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5379
5219
|
return tag.id;
|
|
5380
5220
|
};
|
|
5381
5221
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5382
|
-
var
|
|
5222
|
+
var _extends8;
|
|
5383
5223
|
var e = args._event;
|
|
5384
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5224
|
+
setUserTagType(_extends({}, userTagType, (_extends8 = {}, _extends8[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends8)));
|
|
5385
5225
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5386
5226
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5387
5227
|
userTagType: true
|
|
@@ -5389,26 +5229,30 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5389
5229
|
}
|
|
5390
5230
|
};
|
|
5391
5231
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5392
|
-
var
|
|
5232
|
+
var _extends9;
|
|
5393
5233
|
var _name = _ref2._name,
|
|
5394
5234
|
_value = _ref2._value;
|
|
5395
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5235
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends9 = {}, _extends9[_name] = _value, _extends9)));
|
|
5396
5236
|
};
|
|
5397
5237
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5398
|
-
var
|
|
5238
|
+
var _extends10;
|
|
5399
5239
|
var _name = _ref3._name,
|
|
5400
5240
|
_value = _ref3._value;
|
|
5401
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (
|
|
5241
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5402
5242
|
};
|
|
5403
5243
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5404
|
-
var
|
|
5244
|
+
var _extends11;
|
|
5405
5245
|
var _name = _ref4._name,
|
|
5406
5246
|
_value = _ref4._value;
|
|
5407
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5247
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5408
5248
|
};
|
|
5409
5249
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5410
5250
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
5411
|
-
_membershipInfoInput[index]
|
|
5251
|
+
if (_membershipInfoInput[index].membership_type === 'flight' && key === 'name') {
|
|
5252
|
+
_membershipInfoInput[index][key] = val.label;
|
|
5253
|
+
} else {
|
|
5254
|
+
_membershipInfoInput[index][key] = val;
|
|
5255
|
+
}
|
|
5412
5256
|
_membershipInfoInput[index].isEditMode = isEditMode;
|
|
5413
5257
|
setMembershipInfoInput(_membershipInfoInput);
|
|
5414
5258
|
};
|
|
@@ -5438,39 +5282,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5438
5282
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5439
5283
|
};
|
|
5440
5284
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5441
|
-
var
|
|
5285
|
+
var _extends12;
|
|
5442
5286
|
var _name = args._name,
|
|
5443
5287
|
_value = args._value,
|
|
5444
5288
|
_isError = args._isError,
|
|
5445
5289
|
_errorMsg = args._errorMsg;
|
|
5446
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5290
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5447
5291
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5448
|
-
var
|
|
5449
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5292
|
+
var _extends13;
|
|
5293
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends13 = {}, _extends13[_name] = true, _extends13)));
|
|
5450
5294
|
}
|
|
5451
5295
|
updateError(_name, _isError, _errorMsg);
|
|
5452
5296
|
};
|
|
5453
5297
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5454
|
-
var
|
|
5298
|
+
var _extends14;
|
|
5455
5299
|
var _name = args._name,
|
|
5456
5300
|
_value = args._value,
|
|
5457
5301
|
_isError = args._isError,
|
|
5458
5302
|
_errorMsg = args._errorMsg;
|
|
5459
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5303
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5460
5304
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5461
|
-
var
|
|
5462
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5305
|
+
var _extends15;
|
|
5306
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5463
5307
|
}
|
|
5464
5308
|
updateError(_name, _isError, _errorMsg);
|
|
5465
5309
|
};
|
|
5466
5310
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5467
5311
|
try {
|
|
5468
|
-
var
|
|
5469
|
-
var
|
|
5470
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5312
|
+
var _temp14 = function _temp14() {
|
|
5313
|
+
var _extends16;
|
|
5314
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5471
5315
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5472
|
-
var
|
|
5473
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5316
|
+
var _extends17;
|
|
5317
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5474
5318
|
}
|
|
5475
5319
|
updateError(_name, _isError, _errorMsg);
|
|
5476
5320
|
};
|
|
@@ -5508,9 +5352,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5508
5352
|
}
|
|
5509
5353
|
return Promise.resolve();
|
|
5510
5354
|
}
|
|
5511
|
-
var
|
|
5355
|
+
var _temp15 = function () {
|
|
5512
5356
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5513
|
-
var
|
|
5357
|
+
var _temp16 = function () {
|
|
5514
5358
|
if (_obj.isUpload) {
|
|
5515
5359
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5516
5360
|
if (_name === 'passport_photo') {
|
|
@@ -5554,10 +5398,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5554
5398
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5555
5399
|
}
|
|
5556
5400
|
}();
|
|
5557
|
-
if (
|
|
5401
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5558
5402
|
}
|
|
5559
5403
|
}();
|
|
5560
|
-
return Promise.resolve(
|
|
5404
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5561
5405
|
} catch (e) {
|
|
5562
5406
|
return Promise.reject(e);
|
|
5563
5407
|
}
|
|
@@ -5576,8 +5420,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5576
5420
|
return _errorArray;
|
|
5577
5421
|
});
|
|
5578
5422
|
setErrorMsgs(function (prevState) {
|
|
5579
|
-
var
|
|
5580
|
-
return _extends({}, prevState, (
|
|
5423
|
+
var _extends18;
|
|
5424
|
+
return _extends({}, prevState, (_extends18 = {}, _extends18[_name] = _errorMsg, _extends18));
|
|
5581
5425
|
});
|
|
5582
5426
|
};
|
|
5583
5427
|
var dispatch = useDispatch();
|
|
@@ -5609,7 +5453,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5609
5453
|
}
|
|
5610
5454
|
}));
|
|
5611
5455
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
5612
|
-
setCountryContactCode(_res);
|
|
5613
5456
|
if (isEditMode) {
|
|
5614
5457
|
if (!isProfile && !editUserId) return false;
|
|
5615
5458
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -5652,20 +5495,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5652
5495
|
value: '',
|
|
5653
5496
|
label: 'Select employee level'
|
|
5654
5497
|
},
|
|
5655
|
-
manager_id: res.employee_info.manager ? {
|
|
5656
|
-
value: res.employee_info.manager,
|
|
5657
|
-
label: res.employee_info.manager
|
|
5658
|
-
} : {
|
|
5659
|
-
value: '',
|
|
5660
|
-
label: 'Select Manager'
|
|
5661
|
-
},
|
|
5662
|
-
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5663
|
-
value: res.employee_info.skip_manager,
|
|
5664
|
-
label: res.employee_info.skip_manager
|
|
5665
|
-
} : {
|
|
5666
|
-
value: '',
|
|
5667
|
-
label: 'Select Manager'
|
|
5668
|
-
},
|
|
5669
5498
|
employee_id: res.employee_info.employee_id || '',
|
|
5670
5499
|
entity: res.employee_info.entity ? {
|
|
5671
5500
|
value: res.employee_info.entity.id,
|
|
@@ -5851,6 +5680,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5851
5680
|
required: true
|
|
5852
5681
|
}
|
|
5853
5682
|
}));
|
|
5683
|
+
|
|
5854
5684
|
var _productAccess = _extends({}, productAccess);
|
|
5855
5685
|
renderFields.products.forEach(function (product) {
|
|
5856
5686
|
_productAccess[product.name] = true;
|
|
@@ -5898,7 +5728,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5898
5728
|
}, [renderFields.expenseApprovers]);
|
|
5899
5729
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5900
5730
|
try {
|
|
5901
|
-
var
|
|
5731
|
+
var _temp19 = function _temp19() {
|
|
5902
5732
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5903
5733
|
dispatch(stopLoader());
|
|
5904
5734
|
return data;
|
|
@@ -5914,12 +5744,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5914
5744
|
userID: editUserId
|
|
5915
5745
|
});
|
|
5916
5746
|
});
|
|
5917
|
-
var
|
|
5747
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
5918
5748
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5919
5749
|
data.push(res);
|
|
5920
5750
|
});
|
|
5921
5751
|
});
|
|
5922
|
-
return Promise.resolve(
|
|
5752
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
5923
5753
|
} catch (e) {
|
|
5924
5754
|
return Promise.reject(e);
|
|
5925
5755
|
}
|
|
@@ -5931,12 +5761,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5931
5761
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5932
5762
|
return Promise.resolve();
|
|
5933
5763
|
}
|
|
5934
|
-
if (employeeInfoInput.manager_id.value !== '') {
|
|
5935
|
-
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5936
|
-
}
|
|
5937
|
-
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5938
|
-
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5939
|
-
}
|
|
5940
5764
|
var payload = {
|
|
5941
5765
|
personalInfoInput: personalInfoInput,
|
|
5942
5766
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6053,7 +5877,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6053
5877
|
}
|
|
6054
5878
|
_errorMsgs.passport_issue_date = '';
|
|
6055
5879
|
}
|
|
6056
|
-
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5880
|
+
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5881
|
+
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6057
5882
|
_isError = true;
|
|
6058
5883
|
if (_errorArray.indexOf('passport_photo') === -1) {
|
|
6059
5884
|
_errorArray.push('passport_photo');
|
|
@@ -6065,7 +5890,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6065
5890
|
}
|
|
6066
5891
|
_errorMsgs.passport_photo = '';
|
|
6067
5892
|
}
|
|
6068
|
-
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5893
|
+
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5894
|
+
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6069
5895
|
_isError = true;
|
|
6070
5896
|
if (_errorArray.indexOf('travel_docs') === -1) {
|
|
6071
5897
|
_errorArray.push('travel_docs');
|
|
@@ -6081,59 +5907,58 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6081
5907
|
if (_isError) {
|
|
6082
5908
|
setErrorArray(_errorArray);
|
|
6083
5909
|
setErrorMsgs(_errorMsgs);
|
|
6084
|
-
var
|
|
5910
|
+
for (var _key3 in _errorMsgs) {
|
|
6085
5911
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6086
5912
|
if (_errorMsgs[_key3]) {
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
5913
|
+
var _ret = function () {
|
|
5914
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5915
|
+
setAdditionalInfoFlag('open');
|
|
5916
|
+
}
|
|
5917
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5918
|
+
if (el) {
|
|
5919
|
+
setTimeout(function () {
|
|
5920
|
+
el.scrollIntoView({
|
|
5921
|
+
behavior: 'smooth',
|
|
5922
|
+
block: 'center'
|
|
5923
|
+
});
|
|
5924
|
+
}, 500);
|
|
5925
|
+
return "break";
|
|
5926
|
+
}
|
|
5927
|
+
}();
|
|
5928
|
+
if (_ret === "break") break;
|
|
6100
5929
|
}
|
|
6101
5930
|
}
|
|
6102
|
-
};
|
|
6103
|
-
for (var _key3 in _errorMsgs) {
|
|
6104
|
-
if (_loop()) break;
|
|
6105
5931
|
}
|
|
5932
|
+
return Promise.resolve();
|
|
6106
5933
|
}
|
|
6107
|
-
if (
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
5934
|
+
if (isEditMode && editUserId || isProfile) {
|
|
5935
|
+
dispatch(showLoader());
|
|
5936
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5937
|
+
if (isProfile) {
|
|
5938
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5939
|
+
(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);
|
|
5940
|
+
} else {
|
|
5941
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5942
|
+
(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);
|
|
5943
|
+
}
|
|
5944
|
+
})["catch"](function (err) {
|
|
5945
|
+
if (typeof err === 'object') {
|
|
5946
|
+
if (err.country_code) {
|
|
5947
|
+
err.contact_number = err.country_code;
|
|
6117
5948
|
}
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
if (
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
if (err
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
}
|
|
6132
|
-
setErrorArray(Object.keys(err));
|
|
6133
|
-
setErrorMsgs(err);
|
|
6134
|
-
var _loop2 = function _loop2() {
|
|
6135
|
-
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6136
|
-
if (err[_key4]) {
|
|
5949
|
+
if (err.contact_country_code) {
|
|
5950
|
+
err.contact_number = err.contact_country_code;
|
|
5951
|
+
}
|
|
5952
|
+
if (err.passport) {
|
|
5953
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5954
|
+
delete err.passport;
|
|
5955
|
+
}
|
|
5956
|
+
setErrorArray(Object.keys(err));
|
|
5957
|
+
setErrorMsgs(err);
|
|
5958
|
+
for (var _key4 in err) {
|
|
5959
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5960
|
+
if (err[_key4]) {
|
|
5961
|
+
var _ret2 = function () {
|
|
6137
5962
|
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6138
5963
|
setAdditionalInfoFlag('open');
|
|
6139
5964
|
}
|
|
@@ -6145,44 +5970,44 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6145
5970
|
block: 'center'
|
|
6146
5971
|
});
|
|
6147
5972
|
}, 500);
|
|
6148
|
-
return
|
|
5973
|
+
return "break";
|
|
6149
5974
|
}
|
|
6150
|
-
}
|
|
5975
|
+
}();
|
|
5976
|
+
if (_ret2 === "break") break;
|
|
6151
5977
|
}
|
|
6152
|
-
};
|
|
6153
|
-
for (var _key4 in err) {
|
|
6154
|
-
if (_loop2()) break;
|
|
6155
5978
|
}
|
|
6156
|
-
} else if (typeof err === 'string') {
|
|
6157
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6158
|
-
} else {
|
|
6159
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6160
5979
|
}
|
|
6161
|
-
}
|
|
6162
|
-
|
|
6163
|
-
}
|
|
6164
|
-
|
|
6165
|
-
|
|
6166
|
-
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6178
|
-
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
5980
|
+
} else if (typeof err === 'string') {
|
|
5981
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5982
|
+
} else {
|
|
5983
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5984
|
+
}
|
|
5985
|
+
})["finally"](function () {
|
|
5986
|
+
dispatch(stopLoader());
|
|
5987
|
+
});
|
|
5988
|
+
} else {
|
|
5989
|
+
dispatch(showLoader());
|
|
5990
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
5991
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5992
|
+
(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);
|
|
5993
|
+
})["catch"](function (err) {
|
|
5994
|
+
if (typeof err === 'object') {
|
|
5995
|
+
if (err.country_code) {
|
|
5996
|
+
err.contact_number = err.country_code;
|
|
5997
|
+
}
|
|
5998
|
+
if (err.contact_country_code) {
|
|
5999
|
+
err.contact_number = err.contact_country_code;
|
|
6000
|
+
}
|
|
6001
|
+
if (err.passport) {
|
|
6002
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6003
|
+
delete err.passport;
|
|
6004
|
+
}
|
|
6005
|
+
setErrorArray(Object.keys(err));
|
|
6006
|
+
setErrorMsgs(err);
|
|
6007
|
+
for (var _key5 in err) {
|
|
6008
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6009
|
+
if (err[_key5]) {
|
|
6010
|
+
var _ret3 = function () {
|
|
6186
6011
|
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6187
6012
|
setAdditionalInfoFlag('open');
|
|
6188
6013
|
}
|
|
@@ -6194,23 +6019,21 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6194
6019
|
block: 'center'
|
|
6195
6020
|
});
|
|
6196
6021
|
}, 500);
|
|
6197
|
-
return
|
|
6022
|
+
return "break";
|
|
6198
6023
|
}
|
|
6199
|
-
}
|
|
6024
|
+
}();
|
|
6025
|
+
if (_ret3 === "break") break;
|
|
6200
6026
|
}
|
|
6201
|
-
};
|
|
6202
|
-
for (var _key5 in err) {
|
|
6203
|
-
if (_loop3()) break;
|
|
6204
6027
|
}
|
|
6205
|
-
} else if (typeof err === 'string') {
|
|
6206
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6207
|
-
} else {
|
|
6208
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6209
6028
|
}
|
|
6210
|
-
}
|
|
6211
|
-
|
|
6212
|
-
}
|
|
6213
|
-
|
|
6029
|
+
} else if (typeof err === 'string') {
|
|
6030
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6031
|
+
} else {
|
|
6032
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6033
|
+
}
|
|
6034
|
+
})["finally"](function () {
|
|
6035
|
+
dispatch(stopLoader());
|
|
6036
|
+
});
|
|
6214
6037
|
}
|
|
6215
6038
|
return Promise.resolve();
|
|
6216
6039
|
} catch (e) {
|
|
@@ -6226,7 +6049,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6226
6049
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6227
6050
|
}
|
|
6228
6051
|
}
|
|
6229
|
-
}
|
|
6052
|
+
}
|
|
6053
|
+
else {
|
|
6230
6054
|
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
6231
6055
|
(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);
|
|
6232
6056
|
}
|
|
@@ -6248,13 +6072,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6248
6072
|
if (verifyUserId) {
|
|
6249
6073
|
dispatch(showLoader());
|
|
6250
6074
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6251
|
-
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6252
6075
|
setPersonalInfoInput(function (prevState) {
|
|
6253
6076
|
return _extends({}, prevState, {
|
|
6254
|
-
first_name: res.
|
|
6255
|
-
last_name: res.
|
|
6077
|
+
first_name: res.fname,
|
|
6078
|
+
last_name: res.lname,
|
|
6256
6079
|
email: res.email,
|
|
6257
|
-
contact_number: res
|
|
6080
|
+
contact_number: res.phone,
|
|
6081
|
+
dob: function () {
|
|
6082
|
+
var dt = new Date(res.dob);
|
|
6083
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6084
|
+
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6085
|
+
}(),
|
|
6086
|
+
|
|
6258
6087
|
gender: function () {
|
|
6259
6088
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6260
6089
|
}()
|
|
@@ -6299,6 +6128,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6299
6128
|
}()
|
|
6300
6129
|
});
|
|
6301
6130
|
});
|
|
6131
|
+
|
|
6302
6132
|
if (res.client_admin) {
|
|
6303
6133
|
setTravelApproversInput(function (prevState) {
|
|
6304
6134
|
var nextState = _extends({}, prevState);
|
|
@@ -6332,6 +6162,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6332
6162
|
});
|
|
6333
6163
|
}
|
|
6334
6164
|
};
|
|
6165
|
+
|
|
6335
6166
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6336
6167
|
component: "div",
|
|
6337
6168
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6348,7 +6179,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6348
6179
|
className: styles.breadcrumb
|
|
6349
6180
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6350
6181
|
breadCrumbs: [{
|
|
6351
|
-
href:
|
|
6182
|
+
href:
|
|
6183
|
+
config.routes.users.list.path,
|
|
6352
6184
|
label: 'Users',
|
|
6353
6185
|
hasLink: true
|
|
6354
6186
|
}]
|
|
@@ -6417,9 +6249,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6417
6249
|
if (!p.visibility) {
|
|
6418
6250
|
return null;
|
|
6419
6251
|
}
|
|
6420
|
-
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6421
|
-
return null;
|
|
6422
|
-
}
|
|
6423
6252
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6424
6253
|
item: true,
|
|
6425
6254
|
sm: 12,
|
|
@@ -6798,13 +6627,17 @@ var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
|
6798
6627
|
});
|
|
6799
6628
|
};
|
|
6800
6629
|
};
|
|
6630
|
+
|
|
6801
6631
|
var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
6802
6632
|
return new Promise(function (resolve, reject) {
|
|
6803
6633
|
var formData = new FormData();
|
|
6634
|
+
|
|
6804
6635
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
6805
6636
|
formData.append(key, presignedPostData.fields[key]);
|
|
6806
6637
|
});
|
|
6638
|
+
|
|
6807
6639
|
formData.append('file', file);
|
|
6640
|
+
|
|
6808
6641
|
axios.post(presignedPostData.url, formData, {
|
|
6809
6642
|
headers: {
|
|
6810
6643
|
'Content-Type': 'multipart/form-data'
|
|
@@ -6921,7 +6754,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6921
6754
|
};
|
|
6922
6755
|
};
|
|
6923
6756
|
|
|
6924
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","
|
|
6757
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6925
6758
|
|
|
6926
6759
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6927
6760
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6990,7 +6823,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6990
6823
|
file: doc
|
|
6991
6824
|
});
|
|
6992
6825
|
});
|
|
6993
|
-
var
|
|
6826
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
6994
6827
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6995
6828
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6996
6829
|
if (validatedRes.data.status) {
|
|
@@ -7030,7 +6863,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7030
6863
|
})).then(function () {});
|
|
7031
6864
|
});
|
|
7032
6865
|
});
|
|
7033
|
-
return Promise.resolve(
|
|
6866
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7034
6867
|
} catch (e) {
|
|
7035
6868
|
return Promise.reject(e);
|
|
7036
6869
|
}
|
|
@@ -7205,6 +7038,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7205
7038
|
setOpenImportUsersModal(false);
|
|
7206
7039
|
handleImportPagenavigation(jobId);
|
|
7207
7040
|
};
|
|
7041
|
+
|
|
7208
7042
|
var handleDownloadRecords = function handleDownloadRecords(type) {
|
|
7209
7043
|
try {
|
|
7210
7044
|
setDownlStatus(true);
|
|
@@ -8230,6 +8064,7 @@ var DropdownBtn = function DropdownBtn(props) {
|
|
|
8230
8064
|
if (val.disable) return false;
|
|
8231
8065
|
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
8232
8066
|
};
|
|
8067
|
+
|
|
8233
8068
|
var prevOpen = React.useRef(open);
|
|
8234
8069
|
React.useEffect(function () {
|
|
8235
8070
|
if (prevOpen.current === true && open === false) {
|
|
@@ -8344,10 +8179,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8344
8179
|
selected = props.selected,
|
|
8345
8180
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8346
8181
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8347
|
-
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8348
|
-
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8349
|
-
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8350
|
-
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8351
8182
|
orderBy = props.orderBy,
|
|
8352
8183
|
order = props.order,
|
|
8353
8184
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8365,21 +8196,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8365
8196
|
searchValue = props.searchValue,
|
|
8366
8197
|
_props$isILadmin = props.isILadmin,
|
|
8367
8198
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8368
|
-
var useStyles = makeStyles(function (theme) {
|
|
8369
|
-
return {
|
|
8370
|
-
tooltip: {
|
|
8371
|
-
background: '#1F2937',
|
|
8372
|
-
fontSize: '14px',
|
|
8373
|
-
color: '#ffffff',
|
|
8374
|
-
padding: '12px 16px',
|
|
8375
|
-
borderRadius: '6px'
|
|
8376
|
-
},
|
|
8377
|
-
arrow: {
|
|
8378
|
-
color: '#1F2937'
|
|
8379
|
-
}
|
|
8380
|
-
};
|
|
8381
|
-
});
|
|
8382
|
-
var classes = useStyles();
|
|
8383
8199
|
var columns = [{
|
|
8384
8200
|
id: 'first_name',
|
|
8385
8201
|
label: 'Name',
|
|
@@ -8399,27 +8215,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8399
8215
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic = row.profile_pic) === null || _row$profile_pic === void 0 ? void 0 : _row$profile_pic.presigned_url
|
|
8400
8216
|
}));
|
|
8401
8217
|
}
|
|
8402
|
-
}, {
|
|
8403
|
-
id: 'first_name',
|
|
8404
|
-
label: '',
|
|
8405
|
-
minWidth: 60,
|
|
8406
|
-
sortable: false,
|
|
8407
|
-
cell: function cell(row) {
|
|
8408
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8409
|
-
component: "div",
|
|
8410
|
-
width: 80
|
|
8411
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8412
|
-
title: "This user hasn't logged in to the platform yet",
|
|
8413
|
-
arrow: true,
|
|
8414
|
-
classes: {
|
|
8415
|
-
arrow: classes.arrow,
|
|
8416
|
-
tooltip: classes.tooltip
|
|
8417
|
-
},
|
|
8418
|
-
placement: "top-start"
|
|
8419
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
8420
|
-
className: clsx(styles$5.tooltipTextDiv)
|
|
8421
|
-
}, "Invited")) : null);
|
|
8422
|
-
}
|
|
8423
8218
|
}, {
|
|
8424
8219
|
id: 'emp_info__department__name',
|
|
8425
8220
|
label: 'Department',
|
|
@@ -8507,21 +8302,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8507
8302
|
return onEditHandler(row.id);
|
|
8508
8303
|
}
|
|
8509
8304
|
}];
|
|
8510
|
-
if (row && row.has_visited && row.is_active) {
|
|
8511
|
-
options.push({
|
|
8512
|
-
label: 'Reset password',
|
|
8513
|
-
handler: function handler() {
|
|
8514
|
-
return onResetPasswordHandler(row.email);
|
|
8515
|
-
}
|
|
8516
|
-
});
|
|
8517
|
-
} else if (row && row.is_active) {
|
|
8518
|
-
options.push({
|
|
8519
|
-
label: 'Resend invite',
|
|
8520
|
-
handler: function handler() {
|
|
8521
|
-
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8522
|
-
}
|
|
8523
|
-
});
|
|
8524
|
-
}
|
|
8525
8305
|
if (isILadmin) {
|
|
8526
8306
|
options.push({
|
|
8527
8307
|
label: 'Make primary admin',
|
|
@@ -8545,7 +8325,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8545
8325
|
endIcon: null,
|
|
8546
8326
|
outlinedBtn: false,
|
|
8547
8327
|
className: "threedotMenuBtn",
|
|
8548
|
-
MoreHorizIcon: true,
|
|
8549
8328
|
placement: "bottom-end"
|
|
8550
8329
|
}));
|
|
8551
8330
|
},
|
|
@@ -8553,6 +8332,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8553
8332
|
paddingLeft: '40px'
|
|
8554
8333
|
}
|
|
8555
8334
|
}];
|
|
8335
|
+
|
|
8556
8336
|
return /*#__PURE__*/React.createElement(IUITable, {
|
|
8557
8337
|
searchPlaceholder: "Search by name, email & department",
|
|
8558
8338
|
isCheckboxTable: true,
|
|
@@ -8575,8 +8355,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8575
8355
|
isDataFetching: isDataFetching,
|
|
8576
8356
|
disableRowCheckbox: disableRowCheckbox,
|
|
8577
8357
|
searchBoxWidth: "400px",
|
|
8578
|
-
searchValue: searchValue
|
|
8579
|
-
hideTopPagination: false
|
|
8358
|
+
searchValue: searchValue
|
|
8580
8359
|
});
|
|
8581
8360
|
};
|
|
8582
8361
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8607,18 +8386,20 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8607
8386
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
8608
8387
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8609
8388
|
};
|
|
8389
|
+
|
|
8610
8390
|
var columns = [{
|
|
8611
|
-
id: '
|
|
8391
|
+
id: 'fname',
|
|
8612
8392
|
label: 'Name',
|
|
8613
8393
|
minWidth: 250,
|
|
8614
8394
|
sortable: true,
|
|
8615
8395
|
cell: function cell(row) {
|
|
8616
8396
|
var _row$profile_pic2;
|
|
8617
8397
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8618
|
-
firstName: row.
|
|
8619
|
-
lastName: row.
|
|
8620
|
-
isLetterAvatar:
|
|
8621
|
-
|
|
8398
|
+
firstName: row.fname,
|
|
8399
|
+
lastName: row.lname,
|
|
8400
|
+
isLetterAvatar:
|
|
8401
|
+
row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8402
|
+
primaryText: row.fname + ' ' + row.lname,
|
|
8622
8403
|
secondaryText: row.email,
|
|
8623
8404
|
letterAvatarTextColor: "black",
|
|
8624
8405
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -8627,7 +8408,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8627
8408
|
}));
|
|
8628
8409
|
}
|
|
8629
8410
|
}, {
|
|
8630
|
-
id: '
|
|
8411
|
+
id: 'created',
|
|
8631
8412
|
label: 'Requested on',
|
|
8632
8413
|
minWidth: 100,
|
|
8633
8414
|
sortable: true,
|
|
@@ -8637,7 +8418,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8637
8418
|
width: 100
|
|
8638
8419
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8639
8420
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8640
|
-
}, formatDate(row.
|
|
8421
|
+
}, formatDate(row.created)));
|
|
8641
8422
|
}
|
|
8642
8423
|
}, {
|
|
8643
8424
|
id: 'actions',
|
|
@@ -8691,89 +8472,11 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8691
8472
|
});
|
|
8692
8473
|
};
|
|
8693
8474
|
|
|
8694
|
-
function InfoYellowIcon(props) {
|
|
8695
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8696
|
-
width: props.width,
|
|
8697
|
-
height: props.height,
|
|
8698
|
-
viewBox: "0 0 20 20",
|
|
8699
|
-
fill: "none",
|
|
8700
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8701
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8702
|
-
d: "M11 4.99951C11 5.5518 10.5523 5.99951 10 5.99951C9.44771 5.99951 9 5.5518 9 4.99951C9 4.44723 9.44771 3.99951 10 3.99951C10.5523 3.99951 11 4.44723 11 4.99951Z",
|
|
8703
|
-
fill: "#CA8A04"
|
|
8704
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8705
|
-
d: "M8 7.99951C7.44772 7.99951 7 8.44723 7 8.99951C7 9.5518 7.44772 9.99951 8 9.99951H9V12.9995H8C7.44772 12.9995 7 13.4472 7 13.9995C7 14.5518 7.44772 14.9995 8 14.9995H12C12.5523 14.9995 13 14.5518 13 13.9995C13 13.4472 12.5523 12.9995 12 12.9995H11V8.99951C11 8.44723 10.5523 7.99951 10 7.99951H8Z",
|
|
8706
|
-
fill: "#CA8A04"
|
|
8707
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8708
|
-
d: "M0 9.99951C0 15.5224 4.47715 19.9995 10 19.9995C15.5228 19.9995 20 15.5224 20 9.99951C20 4.47666 15.5228 -0.000488281 10 -0.000488281C4.47715 -0.000488281 0 4.47666 0 9.99951ZM10 1.99951C14.4183 1.99951 18 5.58123 18 9.99951C18 14.4178 14.4183 17.9995 10 17.9995C5.58172 17.9995 2 14.4178 2 9.99951C2 5.58123 5.58172 1.99951 10 1.99951Z",
|
|
8709
|
-
fill: "#CA8A04"
|
|
8710
|
-
}));
|
|
8711
|
-
}
|
|
8712
|
-
|
|
8713
|
-
function RedWarningIcon(props) {
|
|
8714
|
-
var _props$color = props.color,
|
|
8715
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8716
|
-
_props$size = props.size,
|
|
8717
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
8718
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8719
|
-
width: size,
|
|
8720
|
-
height: size,
|
|
8721
|
-
viewBox: "0 0 14 14",
|
|
8722
|
-
fill: color,
|
|
8723
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8724
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8725
|
-
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM6 4C6 3.44772 6.44772 3 7 3C7.55229 3 8 3.44772 8 4V6C8 6.55229 7.55229 7 7 7C6.44772 7 6 6.55229 6 6V4ZM6 10C6 9.44771 6.44772 9 7 9C7.55229 9 8 9.44771 8 10C8 10.5523 7.55229 11 7 11C6.44772 11 6 10.5523 6 10Z",
|
|
8726
|
-
fill: color
|
|
8727
|
-
}));
|
|
8728
|
-
}
|
|
8729
|
-
|
|
8730
|
-
function InviteInfoIcon() {
|
|
8731
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8732
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8733
|
-
width: "20",
|
|
8734
|
-
height: "20",
|
|
8735
|
-
fill: "none",
|
|
8736
|
-
viewBox: "0 0 20 20"
|
|
8737
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8738
|
-
fill: "#CA8A04",
|
|
8739
|
-
d: "M11 5a1 1 0 11-2 0 1 1 0 012 0zM8 8a1 1 0 000 2h1v3H8a1 1 0 100 2h4a1 1 0 100-2h-1V9a1 1 0 00-1-1H8z"
|
|
8740
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8741
|
-
fill: "#CA8A04",
|
|
8742
|
-
d: "M0 10c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10S0 4.477 0 10zm10-8a8 8 0 110 16 8 8 0 010-16z"
|
|
8743
|
-
}));
|
|
8744
|
-
}
|
|
8745
|
-
|
|
8746
8475
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8747
|
-
var env$7 = configs.env
|
|
8748
|
-
|
|
8749
|
-
var
|
|
8750
|
-
|
|
8751
|
-
msg = _ref.msg;
|
|
8752
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
8753
|
-
style: {
|
|
8754
|
-
display: 'flex',
|
|
8755
|
-
flexDirection: 'row',
|
|
8756
|
-
width: '270px',
|
|
8757
|
-
justifyContent: 'space-between'
|
|
8758
|
-
}
|
|
8759
|
-
}, /*#__PURE__*/React.createElement("p", {
|
|
8760
|
-
style: {
|
|
8761
|
-
whiteSpace: 'nowrap',
|
|
8762
|
-
paddingTop: '8px'
|
|
8763
|
-
}
|
|
8764
|
-
}, msg), /*#__PURE__*/React.createElement("p", {
|
|
8765
|
-
onClick: onUndo,
|
|
8766
|
-
style: {
|
|
8767
|
-
whiteSpace: 'nowrap',
|
|
8768
|
-
fontWeight: '600',
|
|
8769
|
-
fontSize: '1rem',
|
|
8770
|
-
padding: '8px 20px 0'
|
|
8771
|
-
}
|
|
8772
|
-
}, "UNDO"));
|
|
8773
|
-
};
|
|
8774
|
-
var UserList = function UserList(_ref2) {
|
|
8775
|
-
var config = _ref2.config,
|
|
8776
|
-
isProfile = _ref2.isProfile;
|
|
8476
|
+
var env$7 = configs.env;
|
|
8477
|
+
var UserList = function UserList(_ref) {
|
|
8478
|
+
var config = _ref.config,
|
|
8479
|
+
isProfile = _ref.isProfile;
|
|
8777
8480
|
env$7.init(config, isProfile);
|
|
8778
8481
|
var history = useHistory();
|
|
8779
8482
|
var _useSelector = useSelector(function (state) {
|
|
@@ -8783,49 +8486,27 @@ var UserList = function UserList(_ref2) {
|
|
|
8783
8486
|
isDataFetching = _useSelector.isDataFetching,
|
|
8784
8487
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8785
8488
|
tabValue = _useSelector.tabValue;
|
|
8786
|
-
var
|
|
8787
|
-
|
|
8788
|
-
|
|
8789
|
-
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8489
|
+
var _React$useState = React.useState(1),
|
|
8490
|
+
page = _React$useState[0],
|
|
8491
|
+
setPage = _React$useState[1];
|
|
8492
|
+
var _useState = useState(5),
|
|
8493
|
+
rowsPerPage = _useState[0],
|
|
8494
|
+
setRowsPerPage = _useState[1];
|
|
8495
|
+
var _React$useState2 = React.useState({}),
|
|
8496
|
+
selected = _React$useState2[0],
|
|
8497
|
+
setSelected = _React$useState2[1];
|
|
8498
|
+
var _React$useState3 = React.useState('asc'),
|
|
8499
|
+
order = _React$useState3[0],
|
|
8500
|
+
setOrder = _React$useState3[1];
|
|
8501
|
+
var _React$useState4 = React.useState('first_name'),
|
|
8502
|
+
orderBy = _React$useState4[0],
|
|
8503
|
+
setOrderBy = _React$useState4[1];
|
|
8504
|
+
var _useState2 = useState(''),
|
|
8505
|
+
searchValue = _useState2[0],
|
|
8506
|
+
setSearchValue = _useState2[1];
|
|
8802
8507
|
var _useState3 = useState(false),
|
|
8803
|
-
|
|
8804
|
-
|
|
8805
|
-
var _React$useState4 = React.useState(''),
|
|
8806
|
-
user = _React$useState4[0],
|
|
8807
|
-
setUser = _React$useState4[1];
|
|
8808
|
-
var _useState4 = useState(10),
|
|
8809
|
-
rowsPerPage = _useState4[0],
|
|
8810
|
-
setRowsPerPage = _useState4[1];
|
|
8811
|
-
var _React$useState5 = React.useState({}),
|
|
8812
|
-
selected = _React$useState5[0],
|
|
8813
|
-
setSelected = _React$useState5[1];
|
|
8814
|
-
var _React$useState6 = React.useState('asc'),
|
|
8815
|
-
order = _React$useState6[0],
|
|
8816
|
-
setOrder = _React$useState6[1];
|
|
8817
|
-
var _React$useState7 = React.useState(false),
|
|
8818
|
-
deactivateSingle = _React$useState7[0],
|
|
8819
|
-
setDeactivateSingle = _React$useState7[1];
|
|
8820
|
-
var _React$useState8 = React.useState('first_name'),
|
|
8821
|
-
orderBy = _React$useState8[0],
|
|
8822
|
-
setOrderBy = _React$useState8[1];
|
|
8823
|
-
var _useState5 = useState(''),
|
|
8824
|
-
searchValue = _useState5[0],
|
|
8825
|
-
setSearchValue = _useState5[1];
|
|
8826
|
-
var _useState6 = useState(false),
|
|
8827
|
-
isOpenDeActivateModal = _useState6[0],
|
|
8828
|
-
setOpenDeActivateModalFlag = _useState6[1];
|
|
8508
|
+
isOpenDeActivateModal = _useState3[0],
|
|
8509
|
+
setOpenDeActivateModalFlag = _useState3[1];
|
|
8829
8510
|
var _useSelector2 = useSelector(function (state) {
|
|
8830
8511
|
return state.common;
|
|
8831
8512
|
}),
|
|
@@ -8833,140 +8514,69 @@ var UserList = function UserList(_ref2) {
|
|
|
8833
8514
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8834
8515
|
isILadmin = _useSelector2.isILadmin,
|
|
8835
8516
|
companyName = _useSelector2.companyName;
|
|
8517
|
+
var _useState4 = useState(false),
|
|
8518
|
+
isOpenImportUsersModal = _useState4[0],
|
|
8519
|
+
setOpenImportUsersModal = _useState4[1];
|
|
8520
|
+
var _useState5 = useState(false),
|
|
8521
|
+
isFileDownloading = _useState5[0],
|
|
8522
|
+
setDownlStatus = _useState5[1];
|
|
8523
|
+
var _useState6 = useState(false),
|
|
8524
|
+
isSortingChange = _useState6[0],
|
|
8525
|
+
setSortingChange = _useState6[1];
|
|
8836
8526
|
var _useState7 = useState(false),
|
|
8837
|
-
|
|
8838
|
-
|
|
8527
|
+
isSearchingChange = _useState7[0],
|
|
8528
|
+
setSearchingChange = _useState7[1];
|
|
8839
8529
|
var _useState8 = useState(false),
|
|
8840
|
-
|
|
8841
|
-
|
|
8530
|
+
isSortingChangeTemp = _useState8[0],
|
|
8531
|
+
setSortingChangeTemp = _useState8[1];
|
|
8842
8532
|
var _useState9 = useState(false),
|
|
8843
|
-
|
|
8844
|
-
|
|
8533
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8534
|
+
setSearchingChangeTemp = _useState9[1];
|
|
8845
8535
|
var _useState10 = useState(false),
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8536
|
+
isApiFetching = _useState10[0],
|
|
8537
|
+
setisApiFetching = _useState10[1];
|
|
8538
|
+
|
|
8539
|
+
var _React$useState5 = React.useState(1),
|
|
8540
|
+
signup_page = _React$useState5[0],
|
|
8541
|
+
setSignUpPage = _React$useState5[1];
|
|
8542
|
+
var _useState11 = useState(5),
|
|
8543
|
+
signup_rowsPerPage = _useState11[0],
|
|
8544
|
+
setSignUpRowsPerPage = _useState11[1];
|
|
8545
|
+
var _React$useState6 = React.useState('asc'),
|
|
8546
|
+
signup_order = _React$useState6[0],
|
|
8547
|
+
setSignUpOrder = _React$useState6[1];
|
|
8548
|
+
var _React$useState7 = React.useState('fname'),
|
|
8549
|
+
signup_orderBy = _React$useState7[0],
|
|
8550
|
+
setSignUpOrderBy = _React$useState7[1];
|
|
8551
|
+
var _useState12 = useState(''),
|
|
8552
|
+
signup_searchValue = _useState12[0],
|
|
8553
|
+
set_signup_SearchValue = _useState12[1];
|
|
8854
8554
|
var _useState13 = useState(false),
|
|
8855
|
-
|
|
8856
|
-
|
|
8555
|
+
isSignUpSortingChange = _useState13[0],
|
|
8556
|
+
setSignUpSortingChange = _useState13[1];
|
|
8857
8557
|
var _useState14 = useState(false),
|
|
8858
|
-
|
|
8859
|
-
|
|
8860
|
-
var _useState15 = useState(
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
}),
|
|
8864
|
-
approverRole = _useState15[0],
|
|
8865
|
-
setApproverRole = _useState15[1];
|
|
8558
|
+
isSignUpSearchingChange = _useState14[0],
|
|
8559
|
+
setSignUpSearchingChange = _useState14[1];
|
|
8560
|
+
var _useState15 = useState(false),
|
|
8561
|
+
isSignUpSortingChangeTemp = _useState15[0],
|
|
8562
|
+
setSignUpSortingChangeTemp = _useState15[1];
|
|
8866
8563
|
var _useState16 = useState(false),
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
var _useState17 = useState(''),
|
|
8870
|
-
userIds = _useState17[0],
|
|
8871
|
-
setUserIds = _useState17[1];
|
|
8872
|
-
var _React$useState9 = React.useState(false),
|
|
8873
|
-
overlayMenu = _React$useState9[0],
|
|
8874
|
-
setOverlayMenu = _React$useState9[1];
|
|
8875
|
-
var _useState18 = useState(''),
|
|
8876
|
-
userFirstName = _useState18[0],
|
|
8877
|
-
setUserFirstName = _useState18[1];
|
|
8878
|
-
var _useState19 = useState(''),
|
|
8879
|
-
userLastName = _useState19[0],
|
|
8880
|
-
setUserLastName = _useState19[1];
|
|
8881
|
-
var _useState20 = useState(true),
|
|
8882
|
-
isDisabledSubmitBtn = _useState20[0],
|
|
8883
|
-
setIsDisabledSubmitBtn = _useState20[1];
|
|
8884
|
-
useScrollPosition(function (_ref3) {
|
|
8885
|
-
var prevPos = _ref3.prevPos,
|
|
8886
|
-
currPos = _ref3.currPos;
|
|
8887
|
-
if (prevPos.y - currPos.y > 0) {
|
|
8888
|
-
if (currPos.y <= -275) {
|
|
8889
|
-
setOverlayMenu(true);
|
|
8890
|
-
}
|
|
8891
|
-
} else {
|
|
8892
|
-
if (currPos.y > -295) {
|
|
8893
|
-
setOverlayMenu(false);
|
|
8894
|
-
}
|
|
8895
|
-
}
|
|
8896
|
-
}, [overlayMenu]);
|
|
8897
|
-
var scrollTo = function scrollTo(id) {
|
|
8898
|
-
var el = document.getElementById(id);
|
|
8899
|
-
window.scrollTo({
|
|
8900
|
-
top: el.offsetTop,
|
|
8901
|
-
behavior: 'smooth'
|
|
8902
|
-
});
|
|
8903
|
-
};
|
|
8904
|
-
var _React$useState10 = React.useState(1),
|
|
8905
|
-
signup_page = _React$useState10[0],
|
|
8906
|
-
setSignUpPage = _React$useState10[1];
|
|
8907
|
-
var _useState21 = useState(5),
|
|
8908
|
-
signup_rowsPerPage = _useState21[0],
|
|
8909
|
-
setSignUpRowsPerPage = _useState21[1];
|
|
8910
|
-
var _React$useState11 = React.useState('asc'),
|
|
8911
|
-
signup_order = _React$useState11[0],
|
|
8912
|
-
setSignUpOrder = _React$useState11[1];
|
|
8913
|
-
var _React$useState12 = React.useState('first_name'),
|
|
8914
|
-
signup_orderBy = _React$useState12[0],
|
|
8915
|
-
setSignUpOrderBy = _React$useState12[1];
|
|
8916
|
-
var _useState22 = useState(''),
|
|
8917
|
-
signup_searchValue = _useState22[0],
|
|
8918
|
-
set_signup_SearchValue = _useState22[1];
|
|
8919
|
-
var _useState23 = useState(false),
|
|
8920
|
-
isSignUpSortingChange = _useState23[0],
|
|
8921
|
-
setSignUpSortingChange = _useState23[1];
|
|
8922
|
-
var _useState24 = useState(false),
|
|
8923
|
-
isSignUpSearchingChange = _useState24[0],
|
|
8924
|
-
setSignUpSearchingChange = _useState24[1];
|
|
8925
|
-
var _useState25 = useState(false),
|
|
8926
|
-
isSignUpSortingChangeTemp = _useState25[0],
|
|
8927
|
-
setSignUpSortingChangeTemp = _useState25[1];
|
|
8928
|
-
var _useState26 = useState(false),
|
|
8929
|
-
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8930
|
-
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8564
|
+
isSignUpSearchingChangeTemp = _useState16[0],
|
|
8565
|
+
setSignUpSearchingChangeTemp = _useState16[1];
|
|
8931
8566
|
var _useSelector3 = useSelector(function (state) {
|
|
8932
8567
|
return state.userList;
|
|
8933
8568
|
}),
|
|
8934
8569
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8935
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
8936
|
-
if (config.routes.notification) {
|
|
8937
|
-
history.push({
|
|
8938
|
-
pathname: config.routes.notification.path
|
|
8939
|
-
});
|
|
8940
|
-
}
|
|
8941
|
-
};
|
|
8942
8570
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8943
8571
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8944
8572
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8945
8573
|
return false;
|
|
8946
8574
|
}
|
|
8947
|
-
|
|
8948
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8949
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8950
|
-
var _selected = Object.values(selected).flat();
|
|
8951
|
-
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8952
|
-
return _selected.includes(item.id.toString());
|
|
8953
|
-
});
|
|
8954
|
-
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8955
|
-
return _selected.includes(item.id.toString());
|
|
8956
|
-
});
|
|
8957
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8958
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8959
|
-
setIsBulkDeactivateModalOpen(true);
|
|
8960
|
-
} else {
|
|
8961
|
-
setOpenDeActivateModalFlag(true);
|
|
8962
|
-
}
|
|
8575
|
+
setOpenDeActivateModalFlag(true);
|
|
8963
8576
|
};
|
|
8964
8577
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8965
8578
|
setOpenDeActivateModalFlag(false);
|
|
8966
8579
|
};
|
|
8967
|
-
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8968
|
-
setIsBulkDeactivateModalOpen(false);
|
|
8969
|
-
};
|
|
8970
8580
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8971
8581
|
history.push(config.routes.users.add.path);
|
|
8972
8582
|
};
|
|
@@ -8979,32 +8589,50 @@ var UserList = function UserList(_ref2) {
|
|
|
8979
8589
|
var handleVerifyUserClick = function handleVerifyUserClick(userId) {
|
|
8980
8590
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8981
8591
|
};
|
|
8982
|
-
var
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8592
|
+
var UndoButton = function UndoButton(_ref2) {
|
|
8593
|
+
var msg = _ref2.msg,
|
|
8594
|
+
id = _ref2.id;
|
|
8595
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8596
|
+
display: "flex",
|
|
8597
|
+
flexDirection: "row",
|
|
8598
|
+
width: "270px"
|
|
8599
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8600
|
+
style: {
|
|
8601
|
+
whiteSpace: 'nowrap',
|
|
8602
|
+
paddingTop: '8px'
|
|
8603
|
+
}
|
|
8604
|
+
}, msg), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8605
|
+
type: "text",
|
|
8606
|
+
buttonText: "UNDO",
|
|
8607
|
+
style: {
|
|
8608
|
+
color: '#FFFFFF'
|
|
8986
8609
|
},
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
8610
|
+
onClick: function onClick() {
|
|
8611
|
+
return dispatch(undoneSignUpRejection(id));
|
|
8612
|
+
}
|
|
8613
|
+
}));
|
|
8614
|
+
};
|
|
8615
|
+
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8616
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8617
|
+
var _res$data;
|
|
8618
|
+
console.log(res);
|
|
8619
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
8620
|
+
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',
|
|
8621
|
+
id: userId
|
|
8622
|
+
}));
|
|
8623
|
+
if (res.status === true) {
|
|
8624
|
+
dispatch(showDataFetchingStatus());
|
|
8625
|
+
dispatch(fetchUserSignupRequests({
|
|
8626
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8627
|
+
length: signup_rowsPerPage,
|
|
8628
|
+
page: signup_page,
|
|
8629
|
+
search: signup_searchValue.trim()
|
|
8630
|
+
})).then(function () {
|
|
8631
|
+
return dispatch(stopDataFetchingStatus());
|
|
9005
8632
|
});
|
|
9006
8633
|
}
|
|
9007
|
-
|
|
8634
|
+
})["catch"](function (err) {
|
|
8635
|
+
console.log(err);
|
|
9008
8636
|
});
|
|
9009
8637
|
};
|
|
9010
8638
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9017,25 +8645,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9017
8645
|
};
|
|
9018
8646
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
9019
8647
|
var _extends2;
|
|
9020
|
-
var
|
|
9021
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9022
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9023
|
-
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8648
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
9024
8649
|
return n.is_active;
|
|
8650
|
+
}).map(function (obj) {
|
|
8651
|
+
return obj.id.toString();
|
|
9025
8652
|
});
|
|
9026
|
-
|
|
9027
|
-
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9028
|
-
if (obj.roles.is_approver === true) {
|
|
9029
|
-
_selectedUsersApprover.push(obj);
|
|
9030
|
-
} else if (obj.roles.is_approver === false) {
|
|
9031
|
-
_selectedUsersNotApprover.push(obj);
|
|
9032
|
-
}
|
|
9033
|
-
}
|
|
9034
|
-
selectedId.push(obj.id.toString());
|
|
9035
|
-
});
|
|
9036
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9037
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9038
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8653
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
9039
8654
|
};
|
|
9040
8655
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
9041
8656
|
var _extends3;
|
|
@@ -9053,156 +8668,58 @@ var UserList = function UserList(_ref2) {
|
|
|
9053
8668
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9054
8669
|
};
|
|
9055
8670
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9056
|
-
setPage(1);
|
|
9057
8671
|
setSearchValue(value);
|
|
9058
8672
|
setSearchingChange(true);
|
|
9059
8673
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
9060
8674
|
};
|
|
9061
8675
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9062
|
-
setPage(1);
|
|
9063
8676
|
set_signup_SearchValue(value);
|
|
9064
8677
|
setSignUpSearchingChange(true);
|
|
9065
8678
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9066
8679
|
};
|
|
9067
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page
|
|
8680
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9068
8681
|
var _extends4;
|
|
9069
8682
|
var selectedTemp = _extends({}, selected);
|
|
9070
8683
|
if (!(page in selectedTemp)) {
|
|
9071
8684
|
selectedTemp[page] = [];
|
|
9072
8685
|
}
|
|
9073
8686
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
9074
|
-
var
|
|
8687
|
+
var newSelected = [];
|
|
9075
8688
|
if (selectedIndex === -1) {
|
|
9076
|
-
|
|
8689
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
9077
8690
|
} else if (selectedIndex === 0) {
|
|
9078
|
-
|
|
8691
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
9079
8692
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
9080
|
-
|
|
8693
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
9081
8694
|
} else if (selectedIndex > 0) {
|
|
9082
|
-
|
|
8695
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9083
8696
|
}
|
|
9084
|
-
|
|
9085
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9086
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9087
|
-
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9088
|
-
return id !== item.id.toString();
|
|
9089
|
-
});
|
|
9090
|
-
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9091
|
-
return item.id.toString() !== id;
|
|
9092
|
-
});
|
|
9093
|
-
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9094
|
-
if (data.roles.is_approver === true) {
|
|
9095
|
-
_SelectedUsersApprover.push(data);
|
|
9096
|
-
} else if (data.roles.is_approver === false) {
|
|
9097
|
-
_SelectedUsersNotApprover.push(data);
|
|
9098
|
-
}
|
|
9099
|
-
}
|
|
9100
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9101
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9102
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8697
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
9103
8698
|
};
|
|
9104
|
-
useEffect(function () {
|
|
9105
|
-
setApproverRole({
|
|
9106
|
-
value: '',
|
|
9107
|
-
label: 'Select approver'
|
|
9108
|
-
});
|
|
9109
|
-
setDefaultId(null);
|
|
9110
|
-
setIsDisabledSubmitBtn(true);
|
|
9111
|
-
setApproveeStatus(false);
|
|
9112
|
-
if (deactivateSingle === true) {
|
|
9113
|
-
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9114
|
-
if (response.data["default"].id) {
|
|
9115
|
-
setDefaultId(response.data["default"].id);
|
|
9116
|
-
setApproverRole({
|
|
9117
|
-
value: '',
|
|
9118
|
-
label: response.data["default"].email
|
|
9119
|
-
});
|
|
9120
|
-
setIsDisabledSubmitBtn(false);
|
|
9121
|
-
setApproveeStatus(response.data["default"].approvee_status);
|
|
9122
|
-
}
|
|
9123
|
-
});
|
|
9124
|
-
}
|
|
9125
|
-
}, [deactivateSingle]);
|
|
9126
8699
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9127
8700
|
setRowsPerPage(+event.target.value);
|
|
9128
8701
|
setPage(1);
|
|
9129
8702
|
setSelected({});
|
|
9130
|
-
setSelectedUsersNotApprover([]);
|
|
9131
|
-
setSelectedUsersApprover([]);
|
|
9132
8703
|
setSortingChange(true);
|
|
9133
8704
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9134
8705
|
};
|
|
9135
8706
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
9136
8707
|
var isActive = e.target.checked;
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
setUser(item);
|
|
9145
|
-
} else {
|
|
9146
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9147
|
-
if (!isActive) {
|
|
9148
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9149
|
-
var _extends5;
|
|
9150
|
-
var selectedTemp = _extends({}, selected);
|
|
9151
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9152
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9153
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9154
|
-
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9155
|
-
return item.id != id;
|
|
9156
|
-
});
|
|
9157
|
-
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9158
|
-
return item.id != id;
|
|
9159
|
-
});
|
|
9160
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9161
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9162
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9163
|
-
}
|
|
9164
|
-
}
|
|
9165
|
-
});
|
|
8708
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8709
|
+
if (!isActive) {
|
|
8710
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8711
|
+
var _extends5;
|
|
8712
|
+
var selectedTemp = _extends({}, selected);
|
|
8713
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8714
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9166
8715
|
}
|
|
9167
8716
|
}
|
|
9168
8717
|
});
|
|
9169
8718
|
};
|
|
9170
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
9171
|
-
var _value = _ref4._value;
|
|
9172
|
-
if (_value.data.approvee_status) {
|
|
9173
|
-
setApproveeStatus(true);
|
|
9174
|
-
} else {
|
|
9175
|
-
setApproveeStatus(false);
|
|
9176
|
-
}
|
|
9177
|
-
setDefaultId(_value.data.id);
|
|
9178
|
-
setApproverRole(_value);
|
|
9179
|
-
setIsDisabledSubmitBtn(false);
|
|
9180
|
-
};
|
|
9181
|
-
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9182
|
-
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9183
|
-
setOpenDeActivateModalFlag(false);
|
|
9184
|
-
setDeactivateSingle(false);
|
|
9185
|
-
setSelected({});
|
|
9186
|
-
setSelectedUsersNotApprover([]);
|
|
9187
|
-
setSelectedUsersApprover([]);
|
|
9188
|
-
};
|
|
9189
8719
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
9190
8720
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
9191
8721
|
setOpenDeActivateModalFlag(false);
|
|
9192
8722
|
setSelected({});
|
|
9193
|
-
setSelectedUsersNotApprover([]);
|
|
9194
|
-
setSelectedUsersApprover([]);
|
|
9195
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9196
|
-
};
|
|
9197
|
-
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9198
|
-
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9199
|
-
return item.id;
|
|
9200
|
-
});
|
|
9201
|
-
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9202
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9203
|
-
setSelected({});
|
|
9204
|
-
setSelectedUsersNotApprover([]);
|
|
9205
|
-
setSelectedUsersApprover([]);
|
|
9206
8723
|
};
|
|
9207
8724
|
var importUserHandler = function importUserHandler() {
|
|
9208
8725
|
setOpenImportUsersModal(true);
|
|
@@ -9214,43 +8731,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9214
8731
|
setOpenImportUsersModal(false);
|
|
9215
8732
|
handleImportPagenavigation(jobId);
|
|
9216
8733
|
};
|
|
9217
|
-
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9218
|
-
dispatch(resetPasswordForUser({
|
|
9219
|
-
email: email
|
|
9220
|
-
}));
|
|
9221
|
-
};
|
|
9222
|
-
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9223
|
-
if (type === undefined) {
|
|
9224
|
-
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9225
|
-
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9226
|
-
return false;
|
|
9227
|
-
}
|
|
9228
|
-
}
|
|
9229
|
-
setUserIds(ids);
|
|
9230
|
-
setUserFirstName(firstName);
|
|
9231
|
-
setUserLastName(lastName);
|
|
9232
|
-
setToggleInviteModal(!showInviteModal);
|
|
9233
|
-
};
|
|
9234
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9235
|
-
setToggleInviteModal(!showInviteModal);
|
|
9236
|
-
};
|
|
9237
|
-
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9238
|
-
var userIdArr = [];
|
|
9239
|
-
if (userIds && !isNaN(userIds)) {
|
|
9240
|
-
userIdArr = [userIds];
|
|
9241
|
-
} else if (Object.keys(selected).length) {
|
|
9242
|
-
Object.values(selected).map(function (val, i) {
|
|
9243
|
-
if (val.length) {
|
|
9244
|
-
val.map(function (idx, i) {
|
|
9245
|
-
userIdArr.push(idx);
|
|
9246
|
-
});
|
|
9247
|
-
}
|
|
9248
|
-
});
|
|
9249
|
-
}
|
|
9250
|
-
setUserIds('');
|
|
9251
|
-
dispatch(resendInviteForUser(userIdArr));
|
|
9252
|
-
setToggleInviteModal(!showInviteModal);
|
|
9253
|
-
};
|
|
9254
8734
|
var handleExportUsers = function handleExportUsers() {
|
|
9255
8735
|
try {
|
|
9256
8736
|
setDownlStatus(true);
|
|
@@ -9290,9 +8770,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9290
8770
|
}, {
|
|
9291
8771
|
label: 'Bulk action history',
|
|
9292
8772
|
handler: handleBulkActionHistoryClick
|
|
9293
|
-
}, {
|
|
9294
|
-
label: 'Resend invite',
|
|
9295
|
-
handler: toggleInviteModal
|
|
9296
8773
|
}];
|
|
9297
8774
|
useEffect(function () {
|
|
9298
8775
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -9304,9 +8781,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9304
8781
|
userId: userId
|
|
9305
8782
|
}));
|
|
9306
8783
|
};
|
|
9307
|
-
var knowMore = function knowMore() {
|
|
9308
|
-
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9309
|
-
};
|
|
9310
8784
|
var dispatch = useDispatch();
|
|
9311
8785
|
useEffect(function () {
|
|
9312
8786
|
if (isTokenVerified === true) {
|
|
@@ -9320,7 +8794,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9320
8794
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9321
8795
|
setSearchingChange(false);
|
|
9322
8796
|
setisApiFetching(false);
|
|
9323
|
-
scrollTo('table-root');
|
|
9324
8797
|
});
|
|
9325
8798
|
}, 1000);
|
|
9326
8799
|
return function () {
|
|
@@ -9334,8 +8807,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9334
8807
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9335
8808
|
length: signup_rowsPerPage,
|
|
9336
8809
|
page: signup_page,
|
|
9337
|
-
search: signup_searchValue.trim()
|
|
9338
|
-
pagename: 'company'
|
|
8810
|
+
search: signup_searchValue.trim()
|
|
9339
8811
|
})).then(function () {
|
|
9340
8812
|
setSignUpSearchingChange(false);
|
|
9341
8813
|
setisApiFetching(false);
|
|
@@ -9347,7 +8819,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9347
8819
|
}
|
|
9348
8820
|
if (isSortingChange) {
|
|
9349
8821
|
setisApiFetching(true);
|
|
9350
|
-
scrollTo('table-root');
|
|
9351
8822
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9352
8823
|
setisApiFetching(false);
|
|
9353
8824
|
setSortingChange(false);
|
|
@@ -9362,8 +8833,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9362
8833
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9363
8834
|
length: signup_rowsPerPage,
|
|
9364
8835
|
page: signup_page,
|
|
9365
|
-
search: signup_searchValue.trim()
|
|
9366
|
-
pagename: 'company'
|
|
8836
|
+
search: signup_searchValue.trim()
|
|
9367
8837
|
})).then(function () {
|
|
9368
8838
|
setisApiFetching(false);
|
|
9369
8839
|
setSignUpSortingChange(false);
|
|
@@ -9379,8 +8849,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9379
8849
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9380
8850
|
length: signup_rowsPerPage,
|
|
9381
8851
|
page: signup_page,
|
|
9382
|
-
search: signup_searchValue.trim()
|
|
9383
|
-
pagename: 'company'
|
|
8852
|
+
search: signup_searchValue.trim()
|
|
9384
8853
|
})).then(function () {
|
|
9385
8854
|
return dispatch(stopDataFetchingStatus());
|
|
9386
8855
|
});
|
|
@@ -9388,89 +8857,15 @@ var UserList = function UserList(_ref2) {
|
|
|
9388
8857
|
}
|
|
9389
8858
|
}
|
|
9390
8859
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9391
|
-
var topRightButtons = function topRightButtons() {
|
|
9392
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9393
|
-
component: "div",
|
|
9394
|
-
className: styles$5.buttonWrapper,
|
|
9395
|
-
display: "flex",
|
|
9396
|
-
justifyContent: "space-between",
|
|
9397
|
-
alignItems: "center",
|
|
9398
|
-
alignSelf: "flex-start"
|
|
9399
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9400
|
-
component: "div",
|
|
9401
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9402
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9403
|
-
buttonText: "Export all users",
|
|
9404
|
-
type: "outlined",
|
|
9405
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9406
|
-
width: "22",
|
|
9407
|
-
height: "22"
|
|
9408
|
-
}),
|
|
9409
|
-
onClick: handleExportUsers
|
|
9410
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9411
|
-
component: "div",
|
|
9412
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9413
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9414
|
-
buttonText: "Bulk actions",
|
|
9415
|
-
type: "outlined",
|
|
9416
|
-
menuListInfo: BulkUploadInfo
|
|
9417
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9418
|
-
component: "div",
|
|
9419
|
-
className: "pageHeader--button-single button-right"
|
|
9420
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9421
|
-
buttonText: "Add user",
|
|
9422
|
-
type: "contained",
|
|
9423
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9424
|
-
width: "9",
|
|
9425
|
-
height: "9",
|
|
9426
|
-
color: "white"
|
|
9427
|
-
}),
|
|
9428
|
-
onClick: handleAddPageNavigation
|
|
9429
|
-
})));
|
|
9430
|
-
};
|
|
9431
8860
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9432
8861
|
component: "div",
|
|
9433
8862
|
className: styles$5.UUIUserManagementList
|
|
9434
|
-
},
|
|
9435
|
-
className: styles$5.scrollOverlayMenu
|
|
9436
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9437
|
-
component: "div",
|
|
9438
|
-
className: clsx(styles$5.pageHeader)
|
|
9439
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9440
|
-
component: "div",
|
|
9441
|
-
display: "flex",
|
|
9442
|
-
justifyContent: "space-between",
|
|
9443
|
-
alignItems: "center",
|
|
9444
|
-
flexWrap: "wrap",
|
|
9445
|
-
style: {
|
|
9446
|
-
gap: '1rem'
|
|
9447
|
-
}
|
|
9448
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9449
|
-
component: "div",
|
|
9450
|
-
display: "flex",
|
|
9451
|
-
flexDirection: "column",
|
|
9452
|
-
style: {
|
|
9453
|
-
gap: '0.5rem'
|
|
9454
|
-
}
|
|
9455
|
-
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9456
|
-
placeholder: "Search by name, email & department",
|
|
9457
|
-
value: searchValue,
|
|
9458
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
9459
|
-
return onSearchHandler(e.target.value);
|
|
9460
|
-
},
|
|
9461
|
-
className: styles$5.overlaysearch
|
|
9462
|
-
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9463
|
-
component: "div",
|
|
9464
|
-
display: "flex",
|
|
9465
|
-
justifyContent: "space-between",
|
|
9466
|
-
alignItems: "center"
|
|
9467
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8863
|
+
}, !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9468
8864
|
open: isFileDownloading || isApiFetching,
|
|
9469
8865
|
className: styles$5.backdrop
|
|
9470
8866
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9471
8867
|
color: "inherit"
|
|
9472
8868
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9473
|
-
id: "table-root",
|
|
9474
8869
|
component: "div",
|
|
9475
8870
|
className: clsx(styles$5.pageHeader)
|
|
9476
8871
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -9495,7 +8890,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9495
8890
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9496
8891
|
variant: "h3",
|
|
9497
8892
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
9498
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))),
|
|
8893
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8894
|
+
component: "div",
|
|
8895
|
+
className: styles$5.buttonWrapper,
|
|
8896
|
+
display: "flex",
|
|
8897
|
+
justifyContent: "space-between",
|
|
8898
|
+
alignItems: "center",
|
|
8899
|
+
alignSelf: "flex-start"
|
|
8900
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8901
|
+
component: "div",
|
|
8902
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8903
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8904
|
+
buttonText: "Export all users",
|
|
8905
|
+
type: "outlined",
|
|
8906
|
+
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
8907
|
+
width: "22",
|
|
8908
|
+
height: "22"
|
|
8909
|
+
}),
|
|
8910
|
+
onClick: handleExportUsers
|
|
8911
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8912
|
+
component: "div",
|
|
8913
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8914
|
+
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
8915
|
+
buttonText: "Bulk actions",
|
|
8916
|
+
type: "outlined",
|
|
8917
|
+
menuListInfo: BulkUploadInfo
|
|
8918
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8919
|
+
component: "div",
|
|
8920
|
+
className: "pageHeader--button-single button-right"
|
|
8921
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8922
|
+
buttonText: "Add user",
|
|
8923
|
+
type: "contained",
|
|
8924
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
8925
|
+
width: "9",
|
|
8926
|
+
height: "9",
|
|
8927
|
+
color: "white"
|
|
8928
|
+
}),
|
|
8929
|
+
onClick: handleAddPageNavigation
|
|
8930
|
+
})))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9499
8931
|
component: "div",
|
|
9500
8932
|
display: "flex",
|
|
9501
8933
|
justifyContent: "space-between",
|
|
@@ -9540,9 +8972,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9540
8972
|
disableRowCheckbox: deactivatedUsers,
|
|
9541
8973
|
searchValue: searchValue,
|
|
9542
8974
|
isILadmin: isILadmin,
|
|
9543
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9544
|
-
onResetPasswordHandler: onResetPasswordHandler,
|
|
9545
|
-
toggleInviteModal: toggleInviteModal
|
|
8975
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9546
8976
|
}))
|
|
9547
8977
|
}, {
|
|
9548
8978
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
@@ -9558,10 +8988,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9558
8988
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9559
8989
|
variant: "body2",
|
|
9560
8990
|
className: clsx(styles$5.description)
|
|
9561
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
9562
|
-
onClick: redirectToNotifications,
|
|
9563
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9564
|
-
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
8991
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in Notifications.")), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9565
8992
|
data: signupRequestListInfo,
|
|
9566
8993
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9567
8994
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9593,54 +9020,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9593
9020
|
}))
|
|
9594
9021
|
}]
|
|
9595
9022
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9596
|
-
isOpen: deactivateSingle,
|
|
9597
|
-
closeHandler: function closeHandler() {
|
|
9598
|
-
setDeactivateSingle(false);
|
|
9599
|
-
},
|
|
9600
|
-
cancelLabel: "Cancel",
|
|
9601
|
-
submitLabel: "Deactivate",
|
|
9602
|
-
submitHandler: handleDeactivateUser,
|
|
9603
|
-
headerText: "Deactivate this user?",
|
|
9604
|
-
width: "400px",
|
|
9605
|
-
subHanderText: "",
|
|
9606
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
9607
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9608
|
-
modalClass: "deactivateSingleModal",
|
|
9609
|
-
modalBodyStyle: {
|
|
9610
|
-
overflowY: 'unset'
|
|
9611
|
-
}
|
|
9612
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9613
|
-
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9614
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9615
|
-
className: styles$5.deactivateAlert
|
|
9616
|
-
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9617
|
-
width: "9",
|
|
9618
|
-
height: "9"
|
|
9619
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9620
|
-
variant: "body2"
|
|
9621
|
-
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9622
|
-
onClick: knowMore,
|
|
9623
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9624
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9625
|
-
className: "iui__mt-15"
|
|
9626
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9627
|
-
isMove: true,
|
|
9628
|
-
additional: {
|
|
9629
|
-
page: 1,
|
|
9630
|
-
product: 'travel',
|
|
9631
|
-
userId: user.id
|
|
9632
|
-
},
|
|
9633
|
-
label: "Transfer approver role to",
|
|
9634
|
-
value: approverRole,
|
|
9635
|
-
onValueChange: selectApprover,
|
|
9636
|
-
loadOption: transferRoleOptions,
|
|
9637
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
9638
|
-
customLoadingText: "No results found"
|
|
9639
|
-
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9640
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9641
|
-
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9642
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9643
|
-
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9644
9023
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9645
9024
|
closeHandler: closeDeActivateModal,
|
|
9646
9025
|
cancelLabel: "Cancel",
|
|
@@ -9666,124 +9045,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9666
9045
|
className: styles$5.headerText
|
|
9667
9046
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9668
9047
|
className: styles$5.description
|
|
9669
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(
|
|
9670
|
-
isOpen: isBulkDeactivateModalOpen,
|
|
9671
|
-
closeHandler: closeDeActiveModal,
|
|
9672
|
-
cancelLabel: "Cancel",
|
|
9673
|
-
submitLabel: "Deactivate safe users",
|
|
9674
|
-
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9675
|
-
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9676
|
-
customButtonLabel: "Deactivate all users",
|
|
9677
|
-
customButtonHandler: handleDeactivateUsers,
|
|
9678
|
-
submitHandler: handleDeactivateSafeUsers,
|
|
9679
|
-
width: "640px",
|
|
9680
|
-
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9681
|
-
headerText: "Deactivate users?",
|
|
9682
|
-
modalBodyStyle: {
|
|
9683
|
-
maxHeight: 'calc(100vh - 50vh)'
|
|
9684
|
-
}
|
|
9685
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9686
|
-
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9687
|
-
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9688
|
-
color: "#9A6700",
|
|
9689
|
-
size: "14"
|
|
9690
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9691
|
-
variant: "body2"
|
|
9692
|
-
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9693
|
-
onClick: knowMore,
|
|
9694
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9695
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9696
|
-
className: "iui__my-15"
|
|
9697
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9698
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9699
|
-
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9700
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9701
|
-
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9702
|
-
var _item$data;
|
|
9703
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9704
|
-
key: index,
|
|
9705
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9706
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9707
|
-
firstName: item.first_name,
|
|
9708
|
-
lastName: item.last_name,
|
|
9709
|
-
isLetterAvatar: "true",
|
|
9710
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9711
|
-
secondaryText: item.email,
|
|
9712
|
-
letterAvatarTextColor: "black",
|
|
9713
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9714
|
-
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9715
|
-
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9716
|
-
color: "#9A6700",
|
|
9717
|
-
size: "14"
|
|
9718
|
-
}));
|
|
9719
|
-
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9720
|
-
style: {
|
|
9721
|
-
borderColor: '#E5E9ED'
|
|
9722
|
-
}
|
|
9723
|
-
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9724
|
-
className: "iui__my-15"
|
|
9725
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9726
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9727
|
-
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9728
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9729
|
-
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
9730
|
-
var _item$data2;
|
|
9731
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9732
|
-
key: index,
|
|
9733
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9734
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9735
|
-
firstName: item.first_name,
|
|
9736
|
-
lastName: item.last_name,
|
|
9737
|
-
isLetterAvatar: "true",
|
|
9738
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9739
|
-
secondaryText: item.email,
|
|
9740
|
-
letterAvatarTextColor: "black",
|
|
9741
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9742
|
-
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9743
|
-
}));
|
|
9744
|
-
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9745
|
-
isOpen: showInviteModal,
|
|
9746
|
-
closeHandler: function closeHandler() {
|
|
9747
|
-
return toggleInviteModalClose();
|
|
9748
|
-
},
|
|
9749
|
-
cancelLabel: "Cancel",
|
|
9750
|
-
headerText: "Resend Invites?",
|
|
9751
|
-
submitLabel: "Send",
|
|
9752
|
-
submitHandler: function submitHandler() {
|
|
9753
|
-
return onResendInviteHandler();
|
|
9754
|
-
},
|
|
9755
|
-
width: "400px",
|
|
9756
|
-
modalBodyStyle: {
|
|
9757
|
-
padding: '0px'
|
|
9758
|
-
},
|
|
9759
|
-
footerStyle: {
|
|
9760
|
-
justifyContent: 'center'
|
|
9761
|
-
}
|
|
9762
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9763
|
-
style: {
|
|
9764
|
-
display: 'flex',
|
|
9765
|
-
padding: '16px',
|
|
9766
|
-
margin: '8px 24px',
|
|
9767
|
-
border: '1px solid #FDE047',
|
|
9768
|
-
background: '#FEFCE8',
|
|
9769
|
-
borderRadius: '5px'
|
|
9770
|
-
}
|
|
9771
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9772
|
-
style: {
|
|
9773
|
-
marginRight: '5px'
|
|
9774
|
-
}
|
|
9775
|
-
}, /*#__PURE__*/React.createElement(InviteInfoIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
9776
|
-
style: {
|
|
9777
|
-
fontSize: '14px',
|
|
9778
|
-
color: '#374151'
|
|
9779
|
-
}
|
|
9780
|
-
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9781
|
-
style: {
|
|
9782
|
-
fontSize: '14px',
|
|
9783
|
-
color: '#374151',
|
|
9784
|
-
fontWeight: 'bold'
|
|
9785
|
-
}
|
|
9786
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9048
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9787
9049
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9788
9050
|
closeImportUsersModal: closeImportUsersModal,
|
|
9789
9051
|
closeImportModal: closeImportModal
|
|
@@ -9792,8 +9054,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9792
9054
|
errMsg: hasVerificationError
|
|
9793
9055
|
}));
|
|
9794
9056
|
};
|
|
9795
|
-
var TabLabelCount = function TabLabelCount(
|
|
9796
|
-
var count =
|
|
9057
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
9058
|
+
var count = _ref3.count;
|
|
9797
9059
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9798
9060
|
className: styles$5.TabLabelCount
|
|
9799
9061
|
}, " ", count, " ");
|
|
@@ -9868,12 +9130,11 @@ function Header(props) {
|
|
|
9868
9130
|
})));
|
|
9869
9131
|
}
|
|
9870
9132
|
|
|
9871
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","
|
|
9133
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","buttonWidth":"_13tv0","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9872
9134
|
|
|
9873
9135
|
function Listview(_ref) {
|
|
9874
9136
|
var data = _ref.data,
|
|
9875
9137
|
name = _ref.name,
|
|
9876
|
-
tableName = _ref.tableName,
|
|
9877
9138
|
handleEditDialog = _ref.handleEditDialog,
|
|
9878
9139
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9879
9140
|
orderBy = _ref.orderBy,
|
|
@@ -9886,87 +9147,21 @@ function Listview(_ref) {
|
|
|
9886
9147
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9887
9148
|
page = _ref.page,
|
|
9888
9149
|
rowsPerPage = _ref.rowsPerPage;
|
|
9889
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9890
|
-
var _data$dept_head_detai;
|
|
9891
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
9892
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9893
|
-
}
|
|
9894
|
-
};
|
|
9895
9150
|
var columns = [{
|
|
9896
9151
|
id: 'name',
|
|
9897
9152
|
label: name,
|
|
9898
|
-
width: '
|
|
9899
|
-
sortable: true,
|
|
9900
|
-
cell: function cell(row) {
|
|
9901
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9902
|
-
component: "div"
|
|
9903
|
-
}, row.name);
|
|
9904
|
-
}
|
|
9905
|
-
}, {
|
|
9906
|
-
id: 'no_of_users',
|
|
9907
|
-
label: 'Number of users',
|
|
9908
|
-
width: '40%',
|
|
9909
|
-
sortable: true,
|
|
9910
|
-
cell: function cell(row) {
|
|
9911
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9912
|
-
component: "div"
|
|
9913
|
-
}, row.no_of_users);
|
|
9914
|
-
}
|
|
9915
|
-
}, {
|
|
9916
|
-
id: 'actions',
|
|
9917
|
-
label: 'Actions',
|
|
9918
|
-
width: '20%',
|
|
9919
|
-
cell: function cell(row) {
|
|
9920
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9921
|
-
display: "flex"
|
|
9922
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9923
|
-
buttonText: "Edit",
|
|
9924
|
-
className: styles$7.buttonWidth,
|
|
9925
|
-
onClick: function onClick() {
|
|
9926
|
-
return handleEditDialog(row);
|
|
9927
|
-
}
|
|
9928
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9929
|
-
buttonText: "Delete",
|
|
9930
|
-
className: styles$7.buttonWidth,
|
|
9931
|
-
onClick: function onClick() {
|
|
9932
|
-
return handleDeleteDialog(row, true);
|
|
9933
|
-
}
|
|
9934
|
-
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9935
|
-
buttonText: "Delete",
|
|
9936
|
-
className: styles$7.buttonWidth,
|
|
9937
|
-
onClick: function onClick() {
|
|
9938
|
-
return handleDeleteDialog(row, false);
|
|
9939
|
-
}
|
|
9940
|
-
}));
|
|
9941
|
-
}
|
|
9942
|
-
}];
|
|
9943
|
-
var departmentColumns = [{
|
|
9944
|
-
id: 'name',
|
|
9945
|
-
label: name,
|
|
9946
|
-
width: '30%',
|
|
9153
|
+
width: '45%',
|
|
9947
9154
|
sortable: true,
|
|
9948
9155
|
cell: function cell(row) {
|
|
9949
9156
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9950
9157
|
component: "div"
|
|
9951
9158
|
}, row.name);
|
|
9952
9159
|
}
|
|
9953
|
-
}, {
|
|
9954
|
-
id: 'department_head',
|
|
9955
|
-
label: 'Department head',
|
|
9956
|
-
width: '30%',
|
|
9957
|
-
sortable: true,
|
|
9958
|
-
cell: function cell(row) {
|
|
9959
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9960
|
-
component: "div"
|
|
9961
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9962
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9963
|
-
}, "Assigned by default"));
|
|
9964
|
-
}
|
|
9965
9160
|
}, {
|
|
9966
9161
|
id: 'no_of_users',
|
|
9967
9162
|
label: 'Number of users',
|
|
9968
9163
|
width: '45%',
|
|
9969
|
-
sortable:
|
|
9164
|
+
sortable: true,
|
|
9970
9165
|
cell: function cell(row) {
|
|
9971
9166
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9972
9167
|
component: "div"
|
|
@@ -9975,7 +9170,7 @@ function Listview(_ref) {
|
|
|
9975
9170
|
}, {
|
|
9976
9171
|
id: 'actions',
|
|
9977
9172
|
label: 'Actions',
|
|
9978
|
-
width: '
|
|
9173
|
+
width: '10%',
|
|
9979
9174
|
cell: function cell(row) {
|
|
9980
9175
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9981
9176
|
display: "flex"
|
|
@@ -10008,7 +9203,7 @@ function Listview(_ref) {
|
|
|
10008
9203
|
hasFilter: true,
|
|
10009
9204
|
isCheckboxTable: false,
|
|
10010
9205
|
count: data.count,
|
|
10011
|
-
columns:
|
|
9206
|
+
columns: columns,
|
|
10012
9207
|
rows: data.results,
|
|
10013
9208
|
page: page,
|
|
10014
9209
|
handleChangePage: handleChangePage,
|
|
@@ -10065,43 +9260,16 @@ function EditPanelDialog(_ref) {
|
|
|
10065
9260
|
var isOpen = _ref.isOpen,
|
|
10066
9261
|
closeHandler = _ref.closeHandler,
|
|
10067
9262
|
onValueChange = _ref.onValueChange,
|
|
10068
|
-
|
|
9263
|
+
submitHandler = _ref.submitHandler,
|
|
10069
9264
|
isError = _ref.isError,
|
|
10070
9265
|
name = _ref.name,
|
|
10071
9266
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
10072
|
-
validation = _ref.validation
|
|
10073
|
-
rowData = _ref.rowData,
|
|
10074
|
-
tableName = _ref.tableName,
|
|
10075
|
-
config = _ref.config;
|
|
9267
|
+
validation = _ref.validation;
|
|
10076
9268
|
var _useSelector = useSelector(function (state) {
|
|
10077
9269
|
return state.userPanel;
|
|
10078
9270
|
}),
|
|
10079
9271
|
dialogData = _useSelector.dialogData;
|
|
10080
|
-
|
|
10081
|
-
var _data$dept_head_detai;
|
|
10082
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
10083
|
-
setHead({
|
|
10084
|
-
value: data.dept_head_details[0].id,
|
|
10085
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10086
|
-
});
|
|
10087
|
-
}
|
|
10088
|
-
};
|
|
10089
|
-
var _useState = useState({
|
|
10090
|
-
value: '',
|
|
10091
|
-
label: 'Select'
|
|
10092
|
-
}),
|
|
10093
|
-
head = _useState[0],
|
|
10094
|
-
setHead = _useState[1];
|
|
10095
|
-
useEffect(function () {
|
|
10096
|
-
deptHeadDetails(rowData);
|
|
10097
|
-
}, [rowData]);
|
|
10098
|
-
var history = useHistory();
|
|
10099
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10100
|
-
history.push({
|
|
10101
|
-
pathname: config.routes.users.add.path,
|
|
10102
|
-
state: rowData
|
|
10103
|
-
});
|
|
10104
|
-
};
|
|
9272
|
+
|
|
10105
9273
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
10106
9274
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10107
9275
|
isOpen: isOpen,
|
|
@@ -10109,60 +9277,27 @@ function EditPanelDialog(_ref) {
|
|
|
10109
9277
|
headerText: "Edit " + name.toLowerCase(),
|
|
10110
9278
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
10111
9279
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
10112
|
-
submitHandler:
|
|
10113
|
-
|
|
10114
|
-
},
|
|
10115
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9280
|
+
submitHandler: submitHandler,
|
|
9281
|
+
width: "365px",
|
|
10116
9282
|
hideCloseIcon: false,
|
|
10117
9283
|
modalBodyStyle: {
|
|
10118
|
-
|
|
9284
|
+
maxHeight: '400px',
|
|
9285
|
+
overflow: 'auto',
|
|
9286
|
+
margin: '0px'
|
|
10119
9287
|
},
|
|
10120
9288
|
footerStyle: {
|
|
10121
9289
|
justifyContent: 'end'
|
|
10122
9290
|
}
|
|
10123
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10124
|
-
display: "flex",
|
|
10125
|
-
justifyContent: "center",
|
|
10126
|
-
alignItems: "center",
|
|
10127
|
-
flexDirection: "column",
|
|
10128
|
-
style: {
|
|
10129
|
-
marginBottom: '30px'
|
|
10130
|
-
}
|
|
10131
9291
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9292
|
+
component: "div",
|
|
10132
9293
|
display: "flex",
|
|
10133
9294
|
justifyContent: "center",
|
|
10134
9295
|
alignItems: "center",
|
|
10135
9296
|
flexDirection: "column",
|
|
10136
|
-
|
|
10137
|
-
}, /*#__PURE__*/React.createElement(
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
className: styles$7.iconLayout,
|
|
10141
|
-
style: {
|
|
10142
|
-
paddingTop: '4px'
|
|
10143
|
-
}
|
|
10144
|
-
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10145
|
-
color: "#CA8A04",
|
|
10146
|
-
width: "25",
|
|
10147
|
-
height: "20",
|
|
10148
|
-
className: styles$7.iconStyle
|
|
10149
|
-
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10150
|
-
label: "By default, the primary admin gets assigned as the department head. This department has no users, so to change department head, add a new user.",
|
|
10151
|
-
style: {
|
|
10152
|
-
fontWeight: 'normal'
|
|
10153
|
-
}
|
|
10154
|
-
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10155
|
-
buttonText: "Add user",
|
|
10156
|
-
type: "text",
|
|
10157
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10158
|
-
width: "9",
|
|
10159
|
-
height: "9",
|
|
10160
|
-
color: "#EC5D25"
|
|
10161
|
-
}),
|
|
10162
|
-
onClick: handleAddPageNavigation,
|
|
10163
|
-
className: styles$7.addUserButton
|
|
10164
|
-
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
10165
|
-
label: name + " name",
|
|
9297
|
+
padding: "8px 24px"
|
|
9298
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9299
|
+
label: name + " name"
|
|
9300
|
+
,
|
|
10166
9301
|
name: "name",
|
|
10167
9302
|
defaultValue: dialogData.data.name,
|
|
10168
9303
|
onValueChange: onValueChange,
|
|
@@ -10170,49 +9305,7 @@ function EditPanelDialog(_ref) {
|
|
|
10170
9305
|
isError: isError,
|
|
10171
9306
|
validation: validation,
|
|
10172
9307
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
10173
|
-
required: true
|
|
10174
|
-
style: tableName === 'department' && {
|
|
10175
|
-
width: '350px'
|
|
10176
|
-
}
|
|
10177
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10178
|
-
className: "iui__mt-15",
|
|
10179
|
-
style: {
|
|
10180
|
-
width: '100%'
|
|
10181
|
-
}
|
|
10182
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10183
|
-
label: "Department head",
|
|
10184
|
-
name: "name",
|
|
10185
|
-
defaultValue: head.label,
|
|
10186
|
-
placeholder: "",
|
|
10187
|
-
readOnly: true,
|
|
10188
|
-
style: {
|
|
10189
|
-
width: '350px'
|
|
10190
|
-
}
|
|
10191
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10192
|
-
className: "iui__mt-15",
|
|
10193
|
-
style: {
|
|
10194
|
-
width: '100%'
|
|
10195
|
-
}
|
|
10196
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10197
|
-
noResultsText: true,
|
|
10198
|
-
isMove: true,
|
|
10199
|
-
additional: {
|
|
10200
|
-
page: 1,
|
|
10201
|
-
departmentId: rowData.id
|
|
10202
|
-
},
|
|
10203
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
10204
|
-
label: "Department head",
|
|
10205
|
-
value: head,
|
|
10206
|
-
onValueChange: function onValueChange(_ref2) {
|
|
10207
|
-
var _value = _ref2._value;
|
|
10208
|
-
return setHead(_value);
|
|
10209
|
-
},
|
|
10210
|
-
loadOption: departmentHeadOptions,
|
|
10211
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10212
|
-
customLoadingText: "No users found in this department",
|
|
10213
|
-
customLoadingTextStyle: {
|
|
10214
|
-
color: '#374151'
|
|
10215
|
-
}
|
|
9308
|
+
required: true
|
|
10216
9309
|
})));
|
|
10217
9310
|
}
|
|
10218
9311
|
|
|
@@ -10391,15 +9484,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10391
9484
|
var _useState13 = useState(false),
|
|
10392
9485
|
isSortingChangeTemp = _useState13[0],
|
|
10393
9486
|
setSortingChangeTemp = _useState13[1];
|
|
10394
|
-
var _useState14 = useState(
|
|
10395
|
-
|
|
10396
|
-
|
|
10397
|
-
var _useState15 = useState(
|
|
10398
|
-
|
|
10399
|
-
|
|
10400
|
-
var _useState16 = useState(5),
|
|
10401
|
-
rowsPerPage = _useState16[0],
|
|
10402
|
-
setRowsPerPage = _useState16[1];
|
|
9487
|
+
var _useState14 = useState(1),
|
|
9488
|
+
page = _useState14[0],
|
|
9489
|
+
setPage = _useState14[1];
|
|
9490
|
+
var _useState15 = useState(5),
|
|
9491
|
+
rowsPerPage = _useState15[0],
|
|
9492
|
+
setRowsPerPage = _useState15[1];
|
|
10403
9493
|
var orderingParam = orderBy;
|
|
10404
9494
|
var _useSelector = useSelector(function (state) {
|
|
10405
9495
|
return state.userPanel;
|
|
@@ -10412,25 +9502,18 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10412
9502
|
}),
|
|
10413
9503
|
isTokenVerified = _useSelector2.isTokenVerified,
|
|
10414
9504
|
hasVerificationError = _useSelector2.hasVerificationError;
|
|
9505
|
+
|
|
10415
9506
|
var onValueChange = function onValueChange(_ref2) {
|
|
10416
9507
|
var _value = _ref2._value;
|
|
10417
9508
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
10418
9509
|
setDataList(validatedValue);
|
|
10419
9510
|
};
|
|
10420
|
-
var _useState17 = useState(70),
|
|
10421
|
-
maxLengthForModal = _useState17[0],
|
|
10422
|
-
setMaxLengthForModal = _useState17[1];
|
|
10423
|
-
useEffect(function () {
|
|
10424
|
-
if (title === 'Business unit') {
|
|
10425
|
-
setMaxLengthForModal(150);
|
|
10426
|
-
}
|
|
10427
|
-
}, []);
|
|
10428
9511
|
var validation = {
|
|
10429
9512
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
10430
9513
|
regexOnBlur: null,
|
|
10431
9514
|
maxLimit: '',
|
|
10432
9515
|
minLimit: '',
|
|
10433
|
-
maxLength:
|
|
9516
|
+
maxLength: 70,
|
|
10434
9517
|
minLength: 0
|
|
10435
9518
|
};
|
|
10436
9519
|
useEffect(function () {
|
|
@@ -10503,7 +9586,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10503
9586
|
submitLabel: 'Save'
|
|
10504
9587
|
}, '', data));
|
|
10505
9588
|
setDataList(data.name);
|
|
10506
|
-
setRowData(data);
|
|
10507
9589
|
setEditModal(true);
|
|
10508
9590
|
};
|
|
10509
9591
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10518,12 +9600,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10518
9600
|
var payload = {
|
|
10519
9601
|
names: [dataList]
|
|
10520
9602
|
};
|
|
10521
|
-
if (tableName === 'department') {
|
|
10522
|
-
payload = {
|
|
10523
|
-
name: dataList,
|
|
10524
|
-
department_head_id: null
|
|
10525
|
-
};
|
|
10526
|
-
}
|
|
10527
9603
|
var message = title + " added successfully.";
|
|
10528
9604
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10529
9605
|
} else {
|
|
@@ -10537,12 +9613,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10537
9613
|
var message = title + " deleted successfully.";
|
|
10538
9614
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10539
9615
|
};
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
optionalParams = null;
|
|
10543
|
-
}
|
|
9616
|
+
|
|
9617
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10544
9618
|
dispatch(userPanelShowLoader());
|
|
10545
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9619
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10546
9620
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10547
9621
|
dispatch(userPanelStopLoader());
|
|
10548
9622
|
if (type === 'delete') {
|
|
@@ -10584,14 +9658,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10584
9658
|
name: dataList
|
|
10585
9659
|
}]
|
|
10586
9660
|
};
|
|
10587
|
-
if (tableName === 'department') {
|
|
10588
|
-
payload = {
|
|
10589
|
-
name: dataList,
|
|
10590
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10591
|
-
};
|
|
10592
|
-
}
|
|
10593
9661
|
var message = title + " updated successfully.";
|
|
10594
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9662
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
10595
9663
|
setErrorEdit(false);
|
|
10596
9664
|
} else {
|
|
10597
9665
|
setErrorEdit(true);
|
|
@@ -10698,10 +9766,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10698
9766
|
submitHandler: handleEditPanel,
|
|
10699
9767
|
isError: errorEdit,
|
|
10700
9768
|
isDisabledSubmitBtn: loading,
|
|
10701
|
-
validation: validation
|
|
10702
|
-
rowData: rowData,
|
|
10703
|
-
tableName: tableName,
|
|
10704
|
-
config: config
|
|
9769
|
+
validation: validation
|
|
10705
9770
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10706
9771
|
config: config
|
|
10707
9772
|
}));
|