@itilite/iui-user-management 0.4.920 → 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 +557 -1518
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +561 -1522
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -3
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,46 +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
|
-
console.log(response.next);
|
|
751
|
-
return {
|
|
752
|
-
options: mappedValue,
|
|
753
|
-
hasMore: !!response.next,
|
|
754
|
-
additional: {
|
|
755
|
-
page: page + 1,
|
|
756
|
-
departmentId: departmentId
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
});
|
|
760
|
-
}, function () {
|
|
761
|
-
return {
|
|
762
|
-
options: [],
|
|
763
|
-
hasMore: false,
|
|
764
|
-
additional: {
|
|
765
|
-
page: 1,
|
|
766
|
-
departmentId: departmentId
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
}));
|
|
770
|
-
} catch (e) {
|
|
771
|
-
return Promise.reject(e);
|
|
772
|
-
}
|
|
773
|
-
};
|
|
774
690
|
|
|
775
691
|
var UserRole = function UserRole(_ref) {
|
|
776
692
|
var _ref$list = _ref.list,
|
|
@@ -849,6 +765,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
849
765
|
if (userTags.length) {
|
|
850
766
|
res.user_tags = userTags;
|
|
851
767
|
}
|
|
768
|
+
|
|
852
769
|
if (payload.productAccess.travel) {
|
|
853
770
|
var _payload$passportInfo, _payload$passportInfo2, _payload$passportInfo3, _payload$passportInfo4, _payload$membershipIn, _payload$uploadedFile;
|
|
854
771
|
res.approvers.travel = [];
|
|
@@ -860,12 +777,14 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
860
777
|
});
|
|
861
778
|
}
|
|
862
779
|
}
|
|
780
|
+
|
|
863
781
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
864
782
|
res.approvers.travel.push({
|
|
865
783
|
email: payload.travelFYI.value,
|
|
866
784
|
sequence: 'fyi'
|
|
867
785
|
});
|
|
868
786
|
}
|
|
787
|
+
|
|
869
788
|
res.user_travel_info = {
|
|
870
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,
|
|
871
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,
|
|
@@ -904,6 +823,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
904
823
|
res.files = [];
|
|
905
824
|
}
|
|
906
825
|
}
|
|
826
|
+
|
|
907
827
|
if (payload.productAccess.expense) {
|
|
908
828
|
res.approvers.expense = [];
|
|
909
829
|
for (var _key2 in payload.expenseApproversInput) {
|
|
@@ -914,6 +834,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
914
834
|
});
|
|
915
835
|
}
|
|
916
836
|
}
|
|
837
|
+
|
|
917
838
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
918
839
|
res.approvers.expense.push({
|
|
919
840
|
email: payload.expenseFYI.value,
|
|
@@ -1021,6 +942,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1021
942
|
});
|
|
1022
943
|
}
|
|
1023
944
|
}
|
|
945
|
+
|
|
1024
946
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
1025
947
|
res.fields.approvers.travel.push({
|
|
1026
948
|
email: payload.travelFYI.value,
|
|
@@ -1097,6 +1019,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1097
1019
|
res.fields.user_travel_info.redress_number = payload.secureTravelInputInfo.redress_number || null;
|
|
1098
1020
|
}
|
|
1099
1021
|
}
|
|
1022
|
+
|
|
1100
1023
|
if (payload.productAccess.expense) {
|
|
1101
1024
|
if (!env$1.isProfilePage()) {
|
|
1102
1025
|
res.fields.approvers.expense = [];
|
|
@@ -1108,6 +1031,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1108
1031
|
});
|
|
1109
1032
|
}
|
|
1110
1033
|
}
|
|
1034
|
+
|
|
1111
1035
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
1112
1036
|
res.fields.approvers.expense.push({
|
|
1113
1037
|
email: payload.expenseFYI.value,
|
|
@@ -1239,19 +1163,10 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1239
1163
|
payload: tabId
|
|
1240
1164
|
};
|
|
1241
1165
|
};
|
|
1242
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1243
|
-
if (roleTransfer === void 0) {
|
|
1244
|
-
roleTransfer = false;
|
|
1245
|
-
}
|
|
1246
|
-
var _payload = {
|
|
1247
|
-
role_transfer: roleTransfer
|
|
1248
|
-
};
|
|
1249
|
-
if (roleTransfer) {
|
|
1250
|
-
_payload.new_approver_user_id = newApproverUserId;
|
|
1251
|
-
}
|
|
1166
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1252
1167
|
return function (dispatch) {
|
|
1253
1168
|
return new Promise(function (resolve, reject) {
|
|
1254
|
-
api$1.
|
|
1169
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1255
1170
|
dispatch(setUserActiveStatus({
|
|
1256
1171
|
is_active: activateVal !== 0,
|
|
1257
1172
|
id: id
|
|
@@ -1348,6 +1263,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1348
1263
|
var _res$data;
|
|
1349
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.');
|
|
1350
1265
|
dispatch(stopLoader());
|
|
1266
|
+
reject();
|
|
1351
1267
|
}
|
|
1352
1268
|
})["catch"](function (err) {
|
|
1353
1269
|
reject(err);
|
|
@@ -1360,7 +1276,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1360
1276
|
return new Promise(function (resolve, reject) {
|
|
1361
1277
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1362
1278
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1363
|
-
resolve(
|
|
1279
|
+
resolve('success');
|
|
1364
1280
|
})["catch"](function (err) {
|
|
1365
1281
|
reject(err);
|
|
1366
1282
|
})["finally"](function () {});
|
|
@@ -1519,9 +1435,11 @@ var createUser = function createUser(payload) {
|
|
|
1519
1435
|
} else {
|
|
1520
1436
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1521
1437
|
reject(res.data.errors);
|
|
1438
|
+
return;
|
|
1522
1439
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1523
1440
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1524
1441
|
}
|
|
1442
|
+
reject();
|
|
1525
1443
|
}
|
|
1526
1444
|
})["catch"](function (err) {
|
|
1527
1445
|
var _err$response6;
|
|
@@ -1567,13 +1485,17 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1567
1485
|
});
|
|
1568
1486
|
};
|
|
1569
1487
|
};
|
|
1488
|
+
|
|
1570
1489
|
var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
1571
1490
|
return new Promise(function (resolve, reject) {
|
|
1572
1491
|
var formData = new FormData();
|
|
1492
|
+
|
|
1573
1493
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
1574
1494
|
formData.append(key, presignedPostData.fields[key]);
|
|
1575
1495
|
});
|
|
1496
|
+
|
|
1576
1497
|
formData.append('file', file);
|
|
1498
|
+
|
|
1577
1499
|
axios.post(presignedPostData.url, formData, {
|
|
1578
1500
|
headers: {
|
|
1579
1501
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1637,48 +1559,6 @@ var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
|
1637
1559
|
});
|
|
1638
1560
|
};
|
|
1639
1561
|
};
|
|
1640
|
-
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1641
|
-
return function (dispatch) {
|
|
1642
|
-
return new Promise(function (resolve, reject) {
|
|
1643
|
-
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1644
|
-
email: data.email
|
|
1645
|
-
}).then(function (res) {
|
|
1646
|
-
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.");
|
|
1647
|
-
resolve();
|
|
1648
|
-
})["catch"](function (err) {
|
|
1649
|
-
var _err$response9, _err$response9$data;
|
|
1650
|
-
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)) {
|
|
1651
|
-
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1652
|
-
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]);
|
|
1653
|
-
reject(err);
|
|
1654
|
-
return;
|
|
1655
|
-
}
|
|
1656
|
-
reject(err);
|
|
1657
|
-
});
|
|
1658
|
-
});
|
|
1659
|
-
};
|
|
1660
|
-
};
|
|
1661
|
-
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1662
|
-
return function (dispatch) {
|
|
1663
|
-
return new Promise(function (resolve, reject) {
|
|
1664
|
-
api$2.post(userAddEditUrl.resendInviteForUserApi(), {
|
|
1665
|
-
user_ids: data
|
|
1666
|
-
}).then(function (res) {
|
|
1667
|
-
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1668
|
-
resolve();
|
|
1669
|
-
})["catch"](function (err) {
|
|
1670
|
-
var _err$response11, _err$response11$data;
|
|
1671
|
-
if (!(err !== null && err !== void 0 && (_err$response11 = err.response) !== null && _err$response11 !== void 0 && (_err$response11$data = _err$response11.data) !== null && _err$response11$data !== void 0 && _err$response11$data.status)) {
|
|
1672
|
-
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1673
|
-
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]);
|
|
1674
|
-
reject(err);
|
|
1675
|
-
return;
|
|
1676
|
-
}
|
|
1677
|
-
reject(err);
|
|
1678
|
-
});
|
|
1679
|
-
});
|
|
1680
|
-
};
|
|
1681
|
-
};
|
|
1682
1562
|
var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
1683
1563
|
return function (dispatch) {
|
|
1684
1564
|
return new Promise(function (resolve, reject) {
|
|
@@ -1815,7 +1695,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1815
1695
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1816
1696
|
return function (dispatch) {
|
|
1817
1697
|
return new Promise(function (resolve, reject) {
|
|
1818
|
-
api$2.post(
|
|
1698
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1819
1699
|
resolve(res);
|
|
1820
1700
|
})["catch"](function (err) {
|
|
1821
1701
|
var _err$response17, _err$response17$data;
|
|
@@ -1851,7 +1731,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1851
1731
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1852
1732
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1853
1733
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1854
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1855
1734
|
|
|
1856
1735
|
var api$3 = configs.api;
|
|
1857
1736
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1898,17 +1777,18 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1898
1777
|
});
|
|
1899
1778
|
};
|
|
1900
1779
|
};
|
|
1780
|
+
|
|
1901
1781
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1902
1782
|
return function (dispatch) {
|
|
1903
1783
|
return new Promise(function (resolve, reject) {
|
|
1904
|
-
api$3.post(
|
|
1784
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1905
1785
|
dispatch(getUserPanalData(getParam));
|
|
1906
1786
|
dispatch(closeDialog());
|
|
1907
1787
|
resolve(res);
|
|
1908
1788
|
})["catch"](function (err) {
|
|
1909
|
-
var _err$
|
|
1789
|
+
var _err$response2, _err$response2$data;
|
|
1910
1790
|
dispatch(userPanelStopLoader());
|
|
1911
|
-
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.');
|
|
1912
1792
|
});
|
|
1913
1793
|
});
|
|
1914
1794
|
};
|
|
@@ -1922,37 +1802,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1922
1802
|
dispatch(userPanelStopLoader());
|
|
1923
1803
|
resolve();
|
|
1924
1804
|
})["catch"](function (err) {
|
|
1925
|
-
var _err$
|
|
1926
|
-
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.');
|
|
1927
1807
|
dispatch(userPanelStopLoader());
|
|
1928
1808
|
});
|
|
1929
1809
|
});
|
|
1930
1810
|
};
|
|
1931
1811
|
};
|
|
1932
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1812
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1933
1813
|
return function (dispatch) {
|
|
1934
1814
|
return new Promise(function (resolve, reject) {
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
});
|
|
1945
|
-
} else {
|
|
1946
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1947
|
-
dispatch(getUserPanalData(getParam));
|
|
1948
|
-
dispatch(closeDialog());
|
|
1949
|
-
resolve();
|
|
1950
|
-
})["catch"](function (err) {
|
|
1951
|
-
var _err$response6, _err$response6$data;
|
|
1952
|
-
dispatch(userPanelStopLoader());
|
|
1953
|
-
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.');
|
|
1954
|
-
});
|
|
1955
|
-
}
|
|
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
|
+
});
|
|
1956
1824
|
});
|
|
1957
1825
|
};
|
|
1958
1826
|
};
|
|
@@ -1964,8 +1832,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1964
1832
|
dispatch(closeDialog());
|
|
1965
1833
|
resolve(res);
|
|
1966
1834
|
})["catch"](function (err) {
|
|
1967
|
-
var _err$
|
|
1968
|
-
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.');
|
|
1969
1837
|
});
|
|
1970
1838
|
});
|
|
1971
1839
|
};
|
|
@@ -2453,6 +2321,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2453
2321
|
setOpenEditAproverModalFlag(false);
|
|
2454
2322
|
});
|
|
2455
2323
|
};
|
|
2324
|
+
|
|
2456
2325
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2457
2326
|
container: true,
|
|
2458
2327
|
className: (styles.headingPadding)
|
|
@@ -2600,7 +2469,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2600
2469
|
headerText: "Edit approver field",
|
|
2601
2470
|
cancelLabel: "Cancel",
|
|
2602
2471
|
submitLabel: "Save",
|
|
2603
|
-
submitHandler: handleEditAproverLabel
|
|
2472
|
+
submitHandler: handleEditAproverLabel
|
|
2473
|
+
,
|
|
2604
2474
|
width: "420px",
|
|
2605
2475
|
modalBodyStyle: {
|
|
2606
2476
|
maxHeight: '600px',
|
|
@@ -3054,8 +2924,8 @@ var workInfo = [{
|
|
|
3054
2924
|
validation: {
|
|
3055
2925
|
regexOnChange: null,
|
|
3056
2926
|
regexOnBlur: [{
|
|
3057
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
3058
|
-
message: "Only alphabets, numbers
|
|
2927
|
+
regex: /^[(A-Z)(a-z)(0-9)\-& ]*$/,
|
|
2928
|
+
message: "Only alphabets, numbers and - & are allowed."
|
|
3059
2929
|
}],
|
|
3060
2930
|
maxLimit: '',
|
|
3061
2931
|
minLimit: '',
|
|
@@ -3143,8 +3013,8 @@ var workInfo = [{
|
|
|
3143
3013
|
validation: {
|
|
3144
3014
|
regexOnChange: null,
|
|
3145
3015
|
regexOnBlur: [{
|
|
3146
|
-
regex: /^[A-Za-z0-9
|
|
3147
|
-
message: "Only alphabets, numbers & special characters . & ' ( )
|
|
3016
|
+
regex: /^[A-Za-z0-9 \-.,&'()\/]*$/,
|
|
3017
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3148
3018
|
}, {
|
|
3149
3019
|
regex: /^[a-zA-Z]/,
|
|
3150
3020
|
message: 'Designation should start with alphabets'
|
|
@@ -3155,6 +3025,31 @@ var workInfo = [{
|
|
|
3155
3025
|
minLength: 0
|
|
3156
3026
|
},
|
|
3157
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
|
|
3158
3053
|
}, {
|
|
3159
3054
|
id: 9,
|
|
3160
3055
|
label: 'Base location',
|
|
@@ -3990,6 +3885,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3990
3885
|
_userListInfo.results[i].is_active = action.payload.is_active;
|
|
3991
3886
|
}
|
|
3992
3887
|
});
|
|
3888
|
+
|
|
3993
3889
|
var _deactivatedUsers = _userListInfo.results.length > 0 ? _userListInfo.results.filter(function (val) {
|
|
3994
3890
|
return !val.is_active;
|
|
3995
3891
|
}).map(function (obj) {
|
|
@@ -4012,6 +3908,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
4012
3908
|
}
|
|
4013
3909
|
});
|
|
4014
3910
|
});
|
|
3911
|
+
|
|
4015
3912
|
var _deactivatedUsers2 = _userListInfo2.results.length > 0 ? _userListInfo2.results.filter(function (val) {
|
|
4016
3913
|
return !val.is_active;
|
|
4017
3914
|
}).map(function (obj) {
|
|
@@ -4065,7 +3962,6 @@ var initialState$2 = {
|
|
|
4065
3962
|
previous: null,
|
|
4066
3963
|
results: []
|
|
4067
3964
|
},
|
|
4068
|
-
deptUsers: [],
|
|
4069
3965
|
loading: false
|
|
4070
3966
|
};
|
|
4071
3967
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4135,12 +4031,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4135
4031
|
loading: false
|
|
4136
4032
|
});
|
|
4137
4033
|
}
|
|
4138
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4139
|
-
{
|
|
4140
|
-
return _extends({}, state, {
|
|
4141
|
-
deptUsers: action.payload
|
|
4142
|
-
});
|
|
4143
|
-
}
|
|
4144
4034
|
default:
|
|
4145
4035
|
return state;
|
|
4146
4036
|
}
|
|
@@ -4327,7 +4217,8 @@ var rootReducer = combineReducers({
|
|
|
4327
4217
|
customFields: reducer$5
|
|
4328
4218
|
});
|
|
4329
4219
|
|
|
4330
|
-
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4220
|
+
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4221
|
+
));
|
|
4331
4222
|
|
|
4332
4223
|
function withStore(Component) {
|
|
4333
4224
|
function WrappedComponent(props) {
|
|
@@ -4870,7 +4761,8 @@ function AddPanelDialog(_ref) {
|
|
|
4870
4761
|
flexDirection: "column",
|
|
4871
4762
|
padding: "8px 20px"
|
|
4872
4763
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4873
|
-
label: name + " name"
|
|
4764
|
+
label: name + " name"
|
|
4765
|
+
,
|
|
4874
4766
|
name: "name",
|
|
4875
4767
|
defaultValue: "",
|
|
4876
4768
|
onValueChange: onValueChange,
|
|
@@ -4919,7 +4811,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4919
4811
|
isILadmin = _useSelector2.isILadmin,
|
|
4920
4812
|
companyName = _useSelector2.companyName;
|
|
4921
4813
|
var history = useHistory();
|
|
4922
|
-
var location = useLocation();
|
|
4923
4814
|
var _useState = useState({
|
|
4924
4815
|
travel: false,
|
|
4925
4816
|
expense: false
|
|
@@ -4955,32 +4846,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4955
4846
|
}
|
|
4956
4847
|
setProductAccess(_productAccess);
|
|
4957
4848
|
};
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
setNewCountryCode = _useState2[1];
|
|
4961
|
-
var _useState3 = useState(),
|
|
4962
|
-
countryDialCode = _useState3[0],
|
|
4963
|
-
setCountryDialCode = _useState3[1];
|
|
4964
|
-
var _useState4 = useState([]),
|
|
4965
|
-
countryContactCode = _useState4[0],
|
|
4966
|
-
setCountryContactCode = _useState4[1];
|
|
4967
|
-
useEffect(function () {
|
|
4968
|
-
var countryObject = countryContactCode.find(function (t) {
|
|
4969
|
-
return t.dial_code === countryDialCode;
|
|
4970
|
-
});
|
|
4971
|
-
console.log('countryObject', countryDialCode, countryObject);
|
|
4972
|
-
if (countryObject) {
|
|
4973
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
4974
|
-
country_code: countryObject.code
|
|
4975
|
-
}));
|
|
4976
|
-
}
|
|
4977
|
-
}, [countryDialCode]);
|
|
4978
|
-
useEffect(function () {
|
|
4979
|
-
var extractedNumber = newCountryCode.substring(1);
|
|
4980
|
-
var convertedNumber = parseInt(extractedNumber);
|
|
4981
|
-
setCountryDialCode(convertedNumber);
|
|
4982
|
-
}, [newCountryCode]);
|
|
4983
|
-
var _useState5 = useState({
|
|
4849
|
+
|
|
4850
|
+
var _useState2 = useState({
|
|
4984
4851
|
first_name: '',
|
|
4985
4852
|
last_name: '',
|
|
4986
4853
|
email: '',
|
|
@@ -4991,9 +4858,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4991
4858
|
contact_country_code: '',
|
|
4992
4859
|
profile_pic: []
|
|
4993
4860
|
}),
|
|
4994
|
-
personalInfoInput =
|
|
4995
|
-
setPersonalInfoInput =
|
|
4996
|
-
var
|
|
4861
|
+
personalInfoInput = _useState2[0],
|
|
4862
|
+
setPersonalInfoInput = _useState2[1];
|
|
4863
|
+
var _useState3 = useState({
|
|
4997
4864
|
emp_level: {
|
|
4998
4865
|
value: '',
|
|
4999
4866
|
label: 'Select employee level'
|
|
@@ -5013,72 +4880,62 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5013
4880
|
},
|
|
5014
4881
|
designation: '',
|
|
5015
4882
|
base_location: '',
|
|
5016
|
-
manager_id: {
|
|
5017
|
-
value: '',
|
|
5018
|
-
label: 'Select Manager'
|
|
5019
|
-
},
|
|
5020
|
-
skip_manager_id: {
|
|
5021
|
-
value: '',
|
|
5022
|
-
label: 'Select Manager'
|
|
5023
|
-
},
|
|
5024
4883
|
currency: {
|
|
5025
4884
|
value: defaultCurrency,
|
|
5026
4885
|
label: defaultCurrency
|
|
5027
4886
|
}
|
|
5028
4887
|
}),
|
|
5029
|
-
employeeInfoInput =
|
|
5030
|
-
setEmployeeInfoInput =
|
|
5031
|
-
var
|
|
4888
|
+
employeeInfoInput = _useState3[0],
|
|
4889
|
+
setEmployeeInfoInput = _useState3[1];
|
|
4890
|
+
var _useState4 = useState({
|
|
5032
4891
|
emp_level: 0,
|
|
5033
4892
|
entity: 0,
|
|
5034
4893
|
business_unit: 0,
|
|
5035
4894
|
department: 0,
|
|
5036
|
-
currency: 0
|
|
5037
|
-
manager_id: 0,
|
|
5038
|
-
skip_manager_id: 0
|
|
4895
|
+
currency: 0
|
|
5039
4896
|
}),
|
|
5040
|
-
cacheForAsyncDropdown =
|
|
5041
|
-
clearCacheForAsyncDropdown =
|
|
5042
|
-
var
|
|
5043
|
-
userTagType =
|
|
5044
|
-
setUserTagType =
|
|
5045
|
-
var
|
|
5046
|
-
scroll =
|
|
5047
|
-
setScroll =
|
|
5048
|
-
var
|
|
5049
|
-
customFieldsInput =
|
|
5050
|
-
setCustomFieldsInput =
|
|
5051
|
-
var
|
|
5052
|
-
travelRole =
|
|
5053
|
-
setTravelRole =
|
|
5054
|
-
var
|
|
5055
|
-
travelApproversInput =
|
|
5056
|
-
setTravelApproversInput =
|
|
5057
|
-
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({
|
|
5058
4915
|
value: '',
|
|
5059
4916
|
label: 'Select approver'
|
|
5060
4917
|
}),
|
|
5061
|
-
travelFYI =
|
|
5062
|
-
setTravelFYI =
|
|
5063
|
-
var
|
|
5064
|
-
membershipInfoInput =
|
|
5065
|
-
setMembershipInfoInput =
|
|
5066
|
-
var
|
|
5067
|
-
removedMembershipInfoInput =
|
|
5068
|
-
setRemovedMembershipInfoInput =
|
|
5069
|
-
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({
|
|
5070
4927
|
flight_seat_preference: '',
|
|
5071
4928
|
meal_preference: ''
|
|
5072
4929
|
}),
|
|
5073
|
-
travelPreferenceInfo =
|
|
5074
|
-
settravelPreferenceInfo =
|
|
5075
|
-
var
|
|
4930
|
+
travelPreferenceInfo = _useState13[0],
|
|
4931
|
+
settravelPreferenceInfo = _useState13[1];
|
|
4932
|
+
var _useState14 = useState({
|
|
5076
4933
|
trusted_traveller: '',
|
|
5077
4934
|
redress_number: ''
|
|
5078
4935
|
}),
|
|
5079
|
-
secureTravelInputInfo =
|
|
5080
|
-
setSecureTravelInputInfo =
|
|
5081
|
-
var
|
|
4936
|
+
secureTravelInputInfo = _useState14[0],
|
|
4937
|
+
setSecureTravelInputInfo = _useState14[1];
|
|
4938
|
+
var _useState15 = useState({
|
|
5082
4939
|
passport_issue_country: {
|
|
5083
4940
|
value: '',
|
|
5084
4941
|
label: 'Select country'
|
|
@@ -5093,39 +4950,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5093
4950
|
passport_photo: [],
|
|
5094
4951
|
travel_docs: []
|
|
5095
4952
|
}),
|
|
5096
|
-
passportInfoInput =
|
|
5097
|
-
setPassportInfoInput =
|
|
5098
|
-
var
|
|
5099
|
-
filesForDelete =
|
|
5100
|
-
setFilesForDelete =
|
|
5101
|
-
var
|
|
5102
|
-
profilePicDelete =
|
|
5103
|
-
setProfilePicDelete =
|
|
5104
|
-
var
|
|
5105
|
-
isAdditionalInfoExpanded =
|
|
5106
|
-
setAdditionalInfoFlag =
|
|
5107
|
-
var
|
|
5108
|
-
expenseRole =
|
|
5109
|
-
setExpenseRole =
|
|
5110
|
-
var
|
|
5111
|
-
expenseApproversInput =
|
|
5112
|
-
setExpenseApproversInput =
|
|
5113
|
-
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({
|
|
5114
4971
|
value: '',
|
|
5115
4972
|
label: 'Select approver'
|
|
5116
4973
|
}),
|
|
5117
|
-
expenseFYI =
|
|
5118
|
-
setExpenseFYI =
|
|
4974
|
+
expenseFYI = _useState21[0],
|
|
4975
|
+
setExpenseFYI = _useState21[1];
|
|
5119
4976
|
var asyncSelectRefs = useRef({
|
|
5120
4977
|
emp_level: useRef(null),
|
|
5121
4978
|
entity: useRef(null),
|
|
5122
4979
|
business_unit: useRef(null),
|
|
5123
4980
|
department: useRef(null)
|
|
5124
4981
|
});
|
|
5125
|
-
var
|
|
5126
|
-
errorArray =
|
|
5127
|
-
setErrorArray =
|
|
5128
|
-
var
|
|
4982
|
+
var _useState22 = useState([]),
|
|
4983
|
+
errorArray = _useState22[0],
|
|
4984
|
+
setErrorArray = _useState22[1];
|
|
4985
|
+
var _useState23 = useState({
|
|
5129
4986
|
first_name: '',
|
|
5130
4987
|
last_name: '',
|
|
5131
4988
|
email: '',
|
|
@@ -5155,9 +5012,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5155
5012
|
userTagType: '',
|
|
5156
5013
|
profile_pic: ''
|
|
5157
5014
|
}),
|
|
5158
|
-
errorMsgs =
|
|
5159
|
-
setErrorMsgs =
|
|
5160
|
-
var
|
|
5015
|
+
errorMsgs = _useState23[0],
|
|
5016
|
+
setErrorMsgs = _useState23[1];
|
|
5017
|
+
var _useState24 = useState({
|
|
5161
5018
|
first_name: false,
|
|
5162
5019
|
last_name: false,
|
|
5163
5020
|
email: false,
|
|
@@ -5184,14 +5041,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5184
5041
|
userTagType: false,
|
|
5185
5042
|
profile_pic: false
|
|
5186
5043
|
}),
|
|
5187
|
-
inputChangeLog =
|
|
5188
|
-
updateInputChangeLog =
|
|
5189
|
-
var
|
|
5190
|
-
uploadedFiles =
|
|
5191
|
-
setUploadedFiles =
|
|
5192
|
-
var _useState29 = useState(70),
|
|
5193
|
-
maxLengthForModal = _useState29[0],
|
|
5194
|
-
setMaxLengthForModal = _useState29[1];
|
|
5044
|
+
inputChangeLog = _useState24[0],
|
|
5045
|
+
updateInputChangeLog = _useState24[1];
|
|
5046
|
+
var _useState25 = useState([]),
|
|
5047
|
+
uploadedFiles = _useState25[0],
|
|
5048
|
+
setUploadedFiles = _useState25[1];
|
|
5195
5049
|
var defaultAddModalData = {
|
|
5196
5050
|
isOpen: false,
|
|
5197
5051
|
isError: false,
|
|
@@ -5204,41 +5058,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5204
5058
|
regexOnBlur: null,
|
|
5205
5059
|
maxLimit: '',
|
|
5206
5060
|
minLimit: '',
|
|
5207
|
-
maxLength:
|
|
5061
|
+
maxLength: 70,
|
|
5208
5062
|
minLength: 0
|
|
5209
5063
|
};
|
|
5210
|
-
var
|
|
5211
|
-
addModalData =
|
|
5212
|
-
setAddModalData =
|
|
5064
|
+
var _useState26 = useState(defaultAddModalData),
|
|
5065
|
+
addModalData = _useState26[0],
|
|
5066
|
+
setAddModalData = _useState26[1];
|
|
5213
5067
|
var onAddModalClose = function onAddModalClose() {
|
|
5214
5068
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5215
5069
|
};
|
|
5216
|
-
useEffect(function () {
|
|
5217
|
-
var _location$state, _location$state2;
|
|
5218
|
-
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) {
|
|
5219
|
-
var _location$state3, _location$state4;
|
|
5220
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5221
|
-
department: {
|
|
5222
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5223
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5224
|
-
}
|
|
5225
|
-
}));
|
|
5226
|
-
}
|
|
5227
|
-
}, []);
|
|
5228
5070
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5229
5071
|
var title = '';
|
|
5230
5072
|
if (id === 'entity') {
|
|
5231
5073
|
title = 'Entity';
|
|
5232
|
-
setMaxLengthForModal(70);
|
|
5233
5074
|
} else if (id === 'department') {
|
|
5234
5075
|
title = 'Department';
|
|
5235
|
-
setMaxLengthForModal(70);
|
|
5236
5076
|
} else if (id === 'business_unit') {
|
|
5237
|
-
setMaxLengthForModal(150);
|
|
5238
5077
|
title = 'Business unit';
|
|
5239
5078
|
} else if (id === 'employee_level') {
|
|
5240
5079
|
title = 'Employee level';
|
|
5241
|
-
setMaxLengthForModal(70);
|
|
5242
5080
|
}
|
|
5243
5081
|
setAddModalData(_extends({}, addModalData, {
|
|
5244
5082
|
isOpen: true,
|
|
@@ -5254,42 +5092,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5254
5092
|
}));
|
|
5255
5093
|
} else {
|
|
5256
5094
|
dispatch(showLoader());
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
department_head_id: null
|
|
5262
|
-
};
|
|
5263
|
-
} else {
|
|
5264
|
-
dataObj = {
|
|
5265
|
-
names: [validatedValue]
|
|
5266
|
-
};
|
|
5267
|
-
}
|
|
5268
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5269
|
-
var _extends4;
|
|
5095
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5096
|
+
names: [validatedValue]
|
|
5097
|
+
})).then(function (res) {
|
|
5098
|
+
var _extends2;
|
|
5270
5099
|
setAddModalData(_extends({}, addModalData, {
|
|
5271
5100
|
isOpen: false
|
|
5272
5101
|
}));
|
|
5273
5102
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5274
5103
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
label: res.data.result.name
|
|
5280
|
-
}, _extends2)));
|
|
5281
|
-
} else {
|
|
5282
|
-
var _extends3;
|
|
5283
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5284
|
-
value: res.data.value,
|
|
5285
|
-
label: res.data.label
|
|
5286
|
-
}, _extends3)));
|
|
5287
|
-
}
|
|
5288
|
-
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)));
|
|
5289
5108
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5290
5109
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5291
|
-
var
|
|
5292
|
-
return _extends({}, prevState, (
|
|
5110
|
+
var _extends3;
|
|
5111
|
+
return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
|
|
5293
5112
|
});
|
|
5294
5113
|
dispatch(stopLoader());
|
|
5295
5114
|
});
|
|
@@ -5306,10 +5125,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5306
5125
|
};
|
|
5307
5126
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5308
5127
|
try {
|
|
5309
|
-
var
|
|
5128
|
+
var _temp6 = function _temp6() {
|
|
5310
5129
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5311
|
-
var
|
|
5312
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5130
|
+
var _extends4;
|
|
5131
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[_name] = true, _extends4)));
|
|
5313
5132
|
}
|
|
5314
5133
|
};
|
|
5315
5134
|
var _name = args._name,
|
|
@@ -5320,7 +5139,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5320
5139
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5321
5140
|
_args$_obj = args._obj,
|
|
5322
5141
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5323
|
-
var
|
|
5142
|
+
var _temp7 = function () {
|
|
5324
5143
|
if (_name === 'contact_number') {
|
|
5325
5144
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5326
5145
|
contact_number: _value.trim(),
|
|
@@ -5331,14 +5150,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5331
5150
|
updateError('country_code', _isError, _errorMsg);
|
|
5332
5151
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5333
5152
|
} else {
|
|
5334
|
-
var
|
|
5335
|
-
var
|
|
5336
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5153
|
+
var _temp8 = function _temp8() {
|
|
5154
|
+
var _extends5;
|
|
5155
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends5 = {}, _extends5[_name] = _value, _extends5)));
|
|
5337
5156
|
updateError(_name, _isError, _errorMsg);
|
|
5338
5157
|
};
|
|
5339
|
-
var
|
|
5158
|
+
var _temp9 = function () {
|
|
5340
5159
|
if (_name === 'profile_pic') {
|
|
5341
|
-
var
|
|
5160
|
+
var _temp10 = function () {
|
|
5342
5161
|
if (_obj.isUpload) {
|
|
5343
5162
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5344
5163
|
_value = _value.map(function (_val) {
|
|
@@ -5369,29 +5188,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5369
5188
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5370
5189
|
}
|
|
5371
5190
|
}();
|
|
5372
|
-
if (
|
|
5191
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5373
5192
|
}
|
|
5374
5193
|
}();
|
|
5375
|
-
return
|
|
5194
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5376
5195
|
}
|
|
5377
5196
|
}();
|
|
5378
|
-
return Promise.resolve(
|
|
5197
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5379
5198
|
} catch (e) {
|
|
5380
5199
|
return Promise.reject(e);
|
|
5381
5200
|
}
|
|
5382
5201
|
};
|
|
5383
5202
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5384
|
-
var
|
|
5203
|
+
var _extends6;
|
|
5385
5204
|
var _name = args._name,
|
|
5386
5205
|
_value = args._value,
|
|
5387
5206
|
_isError = args._isError,
|
|
5388
5207
|
_errorMsg = args._errorMsg;
|
|
5389
|
-
|
|
5390
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5208
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5391
5209
|
updateError(_name, _isError, _errorMsg);
|
|
5392
5210
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5393
|
-
var
|
|
5394
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5211
|
+
var _extends7;
|
|
5212
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends7 = {}, _extends7[_name] = true, _extends7)));
|
|
5395
5213
|
}
|
|
5396
5214
|
};
|
|
5397
5215
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5401,9 +5219,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5401
5219
|
return tag.id;
|
|
5402
5220
|
};
|
|
5403
5221
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5404
|
-
var
|
|
5222
|
+
var _extends8;
|
|
5405
5223
|
var e = args._event;
|
|
5406
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5224
|
+
setUserTagType(_extends({}, userTagType, (_extends8 = {}, _extends8[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends8)));
|
|
5407
5225
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5408
5226
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5409
5227
|
userTagType: true
|
|
@@ -5411,27 +5229,30 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5411
5229
|
}
|
|
5412
5230
|
};
|
|
5413
5231
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5414
|
-
var
|
|
5232
|
+
var _extends9;
|
|
5415
5233
|
var _name = _ref2._name,
|
|
5416
5234
|
_value = _ref2._value;
|
|
5417
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5235
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends9 = {}, _extends9[_name] = _value, _extends9)));
|
|
5418
5236
|
};
|
|
5419
5237
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5420
|
-
var
|
|
5238
|
+
var _extends10;
|
|
5421
5239
|
var _name = _ref3._name,
|
|
5422
5240
|
_value = _ref3._value;
|
|
5423
|
-
|
|
5424
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5241
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5425
5242
|
};
|
|
5426
5243
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5427
|
-
var
|
|
5244
|
+
var _extends11;
|
|
5428
5245
|
var _name = _ref4._name,
|
|
5429
5246
|
_value = _ref4._value;
|
|
5430
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5247
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5431
5248
|
};
|
|
5432
5249
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5433
5250
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
5434
|
-
_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
|
+
}
|
|
5435
5256
|
_membershipInfoInput[index].isEditMode = isEditMode;
|
|
5436
5257
|
setMembershipInfoInput(_membershipInfoInput);
|
|
5437
5258
|
};
|
|
@@ -5461,39 +5282,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5461
5282
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5462
5283
|
};
|
|
5463
5284
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5464
|
-
var
|
|
5285
|
+
var _extends12;
|
|
5465
5286
|
var _name = args._name,
|
|
5466
5287
|
_value = args._value,
|
|
5467
5288
|
_isError = args._isError,
|
|
5468
5289
|
_errorMsg = args._errorMsg;
|
|
5469
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5290
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5470
5291
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5471
|
-
var
|
|
5472
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5292
|
+
var _extends13;
|
|
5293
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends13 = {}, _extends13[_name] = true, _extends13)));
|
|
5473
5294
|
}
|
|
5474
5295
|
updateError(_name, _isError, _errorMsg);
|
|
5475
5296
|
};
|
|
5476
5297
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5477
|
-
var
|
|
5298
|
+
var _extends14;
|
|
5478
5299
|
var _name = args._name,
|
|
5479
5300
|
_value = args._value,
|
|
5480
5301
|
_isError = args._isError,
|
|
5481
5302
|
_errorMsg = args._errorMsg;
|
|
5482
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5303
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5483
5304
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5484
|
-
var
|
|
5485
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5305
|
+
var _extends15;
|
|
5306
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5486
5307
|
}
|
|
5487
5308
|
updateError(_name, _isError, _errorMsg);
|
|
5488
5309
|
};
|
|
5489
5310
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5490
5311
|
try {
|
|
5491
|
-
var
|
|
5492
|
-
var
|
|
5493
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5312
|
+
var _temp14 = function _temp14() {
|
|
5313
|
+
var _extends16;
|
|
5314
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5494
5315
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5495
|
-
var
|
|
5496
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5316
|
+
var _extends17;
|
|
5317
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5497
5318
|
}
|
|
5498
5319
|
updateError(_name, _isError, _errorMsg);
|
|
5499
5320
|
};
|
|
@@ -5531,9 +5352,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5531
5352
|
}
|
|
5532
5353
|
return Promise.resolve();
|
|
5533
5354
|
}
|
|
5534
|
-
var
|
|
5355
|
+
var _temp15 = function () {
|
|
5535
5356
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5536
|
-
var
|
|
5357
|
+
var _temp16 = function () {
|
|
5537
5358
|
if (_obj.isUpload) {
|
|
5538
5359
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5539
5360
|
if (_name === 'passport_photo') {
|
|
@@ -5577,10 +5398,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5577
5398
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5578
5399
|
}
|
|
5579
5400
|
}();
|
|
5580
|
-
if (
|
|
5401
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5581
5402
|
}
|
|
5582
5403
|
}();
|
|
5583
|
-
return Promise.resolve(
|
|
5404
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5584
5405
|
} catch (e) {
|
|
5585
5406
|
return Promise.reject(e);
|
|
5586
5407
|
}
|
|
@@ -5599,8 +5420,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5599
5420
|
return _errorArray;
|
|
5600
5421
|
});
|
|
5601
5422
|
setErrorMsgs(function (prevState) {
|
|
5602
|
-
var
|
|
5603
|
-
return _extends({}, prevState, (
|
|
5423
|
+
var _extends18;
|
|
5424
|
+
return _extends({}, prevState, (_extends18 = {}, _extends18[_name] = _errorMsg, _extends18));
|
|
5604
5425
|
});
|
|
5605
5426
|
};
|
|
5606
5427
|
var dispatch = useDispatch();
|
|
@@ -5632,8 +5453,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5632
5453
|
}
|
|
5633
5454
|
}));
|
|
5634
5455
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
5635
|
-
setCountryContactCode(_res);
|
|
5636
|
-
console.log('this is new', _res);
|
|
5637
5456
|
if (isEditMode) {
|
|
5638
5457
|
if (!isProfile && !editUserId) return false;
|
|
5639
5458
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -5676,20 +5495,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5676
5495
|
value: '',
|
|
5677
5496
|
label: 'Select employee level'
|
|
5678
5497
|
},
|
|
5679
|
-
manager_id: res.employee_info.manager ? {
|
|
5680
|
-
value: res.employee_info.manager,
|
|
5681
|
-
label: res.employee_info.manager
|
|
5682
|
-
} : {
|
|
5683
|
-
value: '',
|
|
5684
|
-
label: 'Select Manager'
|
|
5685
|
-
},
|
|
5686
|
-
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5687
|
-
value: res.employee_info.skip_manager,
|
|
5688
|
-
label: res.employee_info.skip_manager
|
|
5689
|
-
} : {
|
|
5690
|
-
value: '',
|
|
5691
|
-
label: 'Select Manager'
|
|
5692
|
-
},
|
|
5693
5498
|
employee_id: res.employee_info.employee_id || '',
|
|
5694
5499
|
entity: res.employee_info.entity ? {
|
|
5695
5500
|
value: res.employee_info.entity.id,
|
|
@@ -5875,6 +5680,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5875
5680
|
required: true
|
|
5876
5681
|
}
|
|
5877
5682
|
}));
|
|
5683
|
+
|
|
5878
5684
|
var _productAccess = _extends({}, productAccess);
|
|
5879
5685
|
renderFields.products.forEach(function (product) {
|
|
5880
5686
|
_productAccess[product.name] = true;
|
|
@@ -5922,7 +5728,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5922
5728
|
}, [renderFields.expenseApprovers]);
|
|
5923
5729
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5924
5730
|
try {
|
|
5925
|
-
var
|
|
5731
|
+
var _temp19 = function _temp19() {
|
|
5926
5732
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5927
5733
|
dispatch(stopLoader());
|
|
5928
5734
|
return data;
|
|
@@ -5938,12 +5744,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5938
5744
|
userID: editUserId
|
|
5939
5745
|
});
|
|
5940
5746
|
});
|
|
5941
|
-
var
|
|
5747
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
5942
5748
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5943
5749
|
data.push(res);
|
|
5944
5750
|
});
|
|
5945
5751
|
});
|
|
5946
|
-
return Promise.resolve(
|
|
5752
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
5947
5753
|
} catch (e) {
|
|
5948
5754
|
return Promise.reject(e);
|
|
5949
5755
|
}
|
|
@@ -5955,13 +5761,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5955
5761
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5956
5762
|
return Promise.resolve();
|
|
5957
5763
|
}
|
|
5958
|
-
console.log(employeeInfoInput, 'data');
|
|
5959
|
-
if (employeeInfoInput.manager_id.value !== '') {
|
|
5960
|
-
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5961
|
-
}
|
|
5962
|
-
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5963
|
-
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5964
|
-
}
|
|
5965
5764
|
var payload = {
|
|
5966
5765
|
personalInfoInput: personalInfoInput,
|
|
5967
5766
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6019,7 +5818,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6019
5818
|
}
|
|
6020
5819
|
}
|
|
6021
5820
|
for (var _key in employeeInfo) {
|
|
6022
|
-
console.log('key', _key);
|
|
6023
5821
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
6024
5822
|
if (employeeInfo[_key] === false && employeeInfoInput[_key] !== undefined && (typeof employeeInfoInput[_key] === 'string' && !employeeInfoInput[_key] || typeof employeeInfoInput[_key] === 'object' && !employeeInfoInput[_key].value) && fieldsVisibility.employee_info[_key] !== 2) {
|
|
6025
5823
|
_isError = true;
|
|
@@ -6079,7 +5877,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6079
5877
|
}
|
|
6080
5878
|
_errorMsgs.passport_issue_date = '';
|
|
6081
5879
|
}
|
|
6082
|
-
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) {
|
|
6083
5882
|
_isError = true;
|
|
6084
5883
|
if (_errorArray.indexOf('passport_photo') === -1) {
|
|
6085
5884
|
_errorArray.push('passport_photo');
|
|
@@ -6091,7 +5890,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6091
5890
|
}
|
|
6092
5891
|
_errorMsgs.passport_photo = '';
|
|
6093
5892
|
}
|
|
6094
|
-
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) {
|
|
6095
5895
|
_isError = true;
|
|
6096
5896
|
if (_errorArray.indexOf('travel_docs') === -1) {
|
|
6097
5897
|
_errorArray.push('travel_docs');
|
|
@@ -6107,60 +5907,58 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6107
5907
|
if (_isError) {
|
|
6108
5908
|
setErrorArray(_errorArray);
|
|
6109
5909
|
setErrorMsgs(_errorMsgs);
|
|
6110
|
-
var
|
|
5910
|
+
for (var _key3 in _errorMsgs) {
|
|
6111
5911
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6112
5912
|
if (_errorMsgs[_key3]) {
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
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;
|
|
6126
5929
|
}
|
|
6127
5930
|
}
|
|
6128
|
-
};
|
|
6129
|
-
for (var _key3 in _errorMsgs) {
|
|
6130
|
-
var _ret = _loop();
|
|
6131
|
-
if (_ret === "break") break;
|
|
6132
5931
|
}
|
|
5932
|
+
return Promise.resolve();
|
|
6133
5933
|
}
|
|
6134
|
-
if (
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
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;
|
|
6144
5948
|
}
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
if (
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
if (err
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
}
|
|
6159
|
-
setErrorArray(Object.keys(err));
|
|
6160
|
-
setErrorMsgs(err);
|
|
6161
|
-
var _loop2 = function _loop2() {
|
|
6162
|
-
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6163
|
-
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 () {
|
|
6164
5962
|
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6165
5963
|
setAdditionalInfoFlag('open');
|
|
6166
5964
|
}
|
|
@@ -6174,43 +5972,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6174
5972
|
}, 500);
|
|
6175
5973
|
return "break";
|
|
6176
5974
|
}
|
|
6177
|
-
}
|
|
5975
|
+
}();
|
|
5976
|
+
if (_ret2 === "break") break;
|
|
6178
5977
|
}
|
|
6179
|
-
};
|
|
6180
|
-
for (var _key4 in err) {
|
|
6181
|
-
var _ret2 = _loop2();
|
|
6182
|
-
if (_ret2 === "break") break;
|
|
6183
5978
|
}
|
|
6184
|
-
} else if (typeof err === 'string') {
|
|
6185
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6186
|
-
} else {
|
|
6187
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6188
5979
|
}
|
|
6189
|
-
}
|
|
6190
|
-
|
|
6191
|
-
}
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
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 () {
|
|
6214
6011
|
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6215
6012
|
setAdditionalInfoFlag('open');
|
|
6216
6013
|
}
|
|
@@ -6224,22 +6021,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6224
6021
|
}, 500);
|
|
6225
6022
|
return "break";
|
|
6226
6023
|
}
|
|
6227
|
-
}
|
|
6024
|
+
}();
|
|
6025
|
+
if (_ret3 === "break") break;
|
|
6228
6026
|
}
|
|
6229
|
-
};
|
|
6230
|
-
for (var _key5 in err) {
|
|
6231
|
-
var _ret3 = _loop3();
|
|
6232
|
-
if (_ret3 === "break") break;
|
|
6233
6027
|
}
|
|
6234
|
-
} else if (typeof err === 'string') {
|
|
6235
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6236
|
-
} else {
|
|
6237
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6238
6028
|
}
|
|
6239
|
-
}
|
|
6240
|
-
|
|
6241
|
-
}
|
|
6242
|
-
|
|
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
|
+
});
|
|
6243
6037
|
}
|
|
6244
6038
|
return Promise.resolve();
|
|
6245
6039
|
} catch (e) {
|
|
@@ -6255,7 +6049,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6255
6049
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6256
6050
|
}
|
|
6257
6051
|
}
|
|
6258
|
-
}
|
|
6052
|
+
}
|
|
6053
|
+
else {
|
|
6259
6054
|
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
6260
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);
|
|
6261
6056
|
}
|
|
@@ -6277,14 +6072,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6277
6072
|
if (verifyUserId) {
|
|
6278
6073
|
dispatch(showLoader());
|
|
6279
6074
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6280
|
-
console.log('this is response', res);
|
|
6281
|
-
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6282
6075
|
setPersonalInfoInput(function (prevState) {
|
|
6283
6076
|
return _extends({}, prevState, {
|
|
6284
|
-
first_name: res.
|
|
6285
|
-
last_name: res.
|
|
6077
|
+
first_name: res.fname,
|
|
6078
|
+
last_name: res.lname,
|
|
6286
6079
|
email: res.email,
|
|
6287
|
-
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
|
+
|
|
6288
6087
|
gender: function () {
|
|
6289
6088
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6290
6089
|
}()
|
|
@@ -6329,6 +6128,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6329
6128
|
}()
|
|
6330
6129
|
});
|
|
6331
6130
|
});
|
|
6131
|
+
|
|
6332
6132
|
if (res.client_admin) {
|
|
6333
6133
|
setTravelApproversInput(function (prevState) {
|
|
6334
6134
|
var nextState = _extends({}, prevState);
|
|
@@ -6362,6 +6162,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6362
6162
|
});
|
|
6363
6163
|
}
|
|
6364
6164
|
};
|
|
6165
|
+
|
|
6365
6166
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6366
6167
|
component: "div",
|
|
6367
6168
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6378,7 +6179,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6378
6179
|
className: styles.breadcrumb
|
|
6379
6180
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6380
6181
|
breadCrumbs: [{
|
|
6381
|
-
href:
|
|
6182
|
+
href:
|
|
6183
|
+
config.routes.users.list.path,
|
|
6382
6184
|
label: 'Users',
|
|
6383
6185
|
hasLink: true
|
|
6384
6186
|
}]
|
|
@@ -6447,9 +6249,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6447
6249
|
if (!p.visibility) {
|
|
6448
6250
|
return null;
|
|
6449
6251
|
}
|
|
6450
|
-
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6451
|
-
return null;
|
|
6452
|
-
}
|
|
6453
6252
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6454
6253
|
item: true,
|
|
6455
6254
|
sm: 12,
|
|
@@ -6828,13 +6627,17 @@ var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
|
6828
6627
|
});
|
|
6829
6628
|
};
|
|
6830
6629
|
};
|
|
6630
|
+
|
|
6831
6631
|
var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
6832
6632
|
return new Promise(function (resolve, reject) {
|
|
6833
6633
|
var formData = new FormData();
|
|
6634
|
+
|
|
6834
6635
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
6835
6636
|
formData.append(key, presignedPostData.fields[key]);
|
|
6836
6637
|
});
|
|
6638
|
+
|
|
6837
6639
|
formData.append('file', file);
|
|
6640
|
+
|
|
6838
6641
|
axios.post(presignedPostData.url, formData, {
|
|
6839
6642
|
headers: {
|
|
6840
6643
|
'Content-Type': 'multipart/form-data'
|
|
@@ -6951,7 +6754,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6951
6754
|
};
|
|
6952
6755
|
};
|
|
6953
6756
|
|
|
6954
|
-
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"};
|
|
6955
6758
|
|
|
6956
6759
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6957
6760
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7020,7 +6823,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7020
6823
|
file: doc
|
|
7021
6824
|
});
|
|
7022
6825
|
});
|
|
7023
|
-
var
|
|
6826
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
7024
6827
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
7025
6828
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
7026
6829
|
if (validatedRes.data.status) {
|
|
@@ -7060,7 +6863,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7060
6863
|
})).then(function () {});
|
|
7061
6864
|
});
|
|
7062
6865
|
});
|
|
7063
|
-
return Promise.resolve(
|
|
6866
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7064
6867
|
} catch (e) {
|
|
7065
6868
|
return Promise.reject(e);
|
|
7066
6869
|
}
|
|
@@ -7235,6 +7038,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7235
7038
|
setOpenImportUsersModal(false);
|
|
7236
7039
|
handleImportPagenavigation(jobId);
|
|
7237
7040
|
};
|
|
7041
|
+
|
|
7238
7042
|
var handleDownloadRecords = function handleDownloadRecords(type) {
|
|
7239
7043
|
try {
|
|
7240
7044
|
setDownlStatus(true);
|
|
@@ -8260,6 +8064,7 @@ var DropdownBtn = function DropdownBtn(props) {
|
|
|
8260
8064
|
if (val.disable) return false;
|
|
8261
8065
|
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
8262
8066
|
};
|
|
8067
|
+
|
|
8263
8068
|
var prevOpen = React.useRef(open);
|
|
8264
8069
|
React.useEffect(function () {
|
|
8265
8070
|
if (prevOpen.current === true && open === false) {
|
|
@@ -8374,10 +8179,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8374
8179
|
selected = props.selected,
|
|
8375
8180
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8376
8181
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8377
|
-
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8378
|
-
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8379
|
-
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8380
|
-
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8381
8182
|
orderBy = props.orderBy,
|
|
8382
8183
|
order = props.order,
|
|
8383
8184
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8395,21 +8196,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8395
8196
|
searchValue = props.searchValue,
|
|
8396
8197
|
_props$isILadmin = props.isILadmin,
|
|
8397
8198
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8398
|
-
var useStyles = makeStyles(function (theme) {
|
|
8399
|
-
return {
|
|
8400
|
-
tooltip: {
|
|
8401
|
-
background: '#1F2937',
|
|
8402
|
-
fontSize: '14px',
|
|
8403
|
-
color: '#ffffff',
|
|
8404
|
-
padding: '12px 16px',
|
|
8405
|
-
borderRadius: '6px'
|
|
8406
|
-
},
|
|
8407
|
-
arrow: {
|
|
8408
|
-
color: '#1F2937'
|
|
8409
|
-
}
|
|
8410
|
-
};
|
|
8411
|
-
});
|
|
8412
|
-
var classes = useStyles();
|
|
8413
8199
|
var columns = [{
|
|
8414
8200
|
id: 'first_name',
|
|
8415
8201
|
label: 'Name',
|
|
@@ -8429,27 +8215,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8429
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
|
|
8430
8216
|
}));
|
|
8431
8217
|
}
|
|
8432
|
-
}, {
|
|
8433
|
-
id: 'first_name',
|
|
8434
|
-
label: '',
|
|
8435
|
-
minWidth: 60,
|
|
8436
|
-
sortable: false,
|
|
8437
|
-
cell: function cell(row) {
|
|
8438
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8439
|
-
component: "div",
|
|
8440
|
-
width: 80
|
|
8441
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8442
|
-
title: "This user hasn't logged in to the platform yet",
|
|
8443
|
-
arrow: true,
|
|
8444
|
-
classes: {
|
|
8445
|
-
arrow: classes.arrow,
|
|
8446
|
-
tooltip: classes.tooltip
|
|
8447
|
-
},
|
|
8448
|
-
placement: "top-start"
|
|
8449
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
8450
|
-
className: clsx(styles$5.tooltipTextDiv)
|
|
8451
|
-
}, "Invited")) : null);
|
|
8452
|
-
}
|
|
8453
8218
|
}, {
|
|
8454
8219
|
id: 'emp_info__department__name',
|
|
8455
8220
|
label: 'Department',
|
|
@@ -8537,21 +8302,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8537
8302
|
return onEditHandler(row.id);
|
|
8538
8303
|
}
|
|
8539
8304
|
}];
|
|
8540
|
-
if (row && row.has_visited && row.is_active) {
|
|
8541
|
-
options.push({
|
|
8542
|
-
label: 'Reset password',
|
|
8543
|
-
handler: function handler() {
|
|
8544
|
-
return onResetPasswordHandler(row.email);
|
|
8545
|
-
}
|
|
8546
|
-
});
|
|
8547
|
-
} else if (row && row.is_active) {
|
|
8548
|
-
options.push({
|
|
8549
|
-
label: 'Resend invite',
|
|
8550
|
-
handler: function handler() {
|
|
8551
|
-
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8552
|
-
}
|
|
8553
|
-
});
|
|
8554
|
-
}
|
|
8555
8305
|
if (isILadmin) {
|
|
8556
8306
|
options.push({
|
|
8557
8307
|
label: 'Make primary admin',
|
|
@@ -8575,7 +8325,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8575
8325
|
endIcon: null,
|
|
8576
8326
|
outlinedBtn: false,
|
|
8577
8327
|
className: "threedotMenuBtn",
|
|
8578
|
-
MoreHorizIcon: true,
|
|
8579
8328
|
placement: "bottom-end"
|
|
8580
8329
|
}));
|
|
8581
8330
|
},
|
|
@@ -8583,6 +8332,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8583
8332
|
paddingLeft: '40px'
|
|
8584
8333
|
}
|
|
8585
8334
|
}];
|
|
8335
|
+
|
|
8586
8336
|
return /*#__PURE__*/React.createElement(IUITable, {
|
|
8587
8337
|
searchPlaceholder: "Search by name, email & department",
|
|
8588
8338
|
isCheckboxTable: true,
|
|
@@ -8605,8 +8355,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8605
8355
|
isDataFetching: isDataFetching,
|
|
8606
8356
|
disableRowCheckbox: disableRowCheckbox,
|
|
8607
8357
|
searchBoxWidth: "400px",
|
|
8608
|
-
searchValue: searchValue
|
|
8609
|
-
hideTopPagination: false
|
|
8358
|
+
searchValue: searchValue
|
|
8610
8359
|
});
|
|
8611
8360
|
};
|
|
8612
8361
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8637,18 +8386,20 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8637
8386
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
8638
8387
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8639
8388
|
};
|
|
8389
|
+
|
|
8640
8390
|
var columns = [{
|
|
8641
|
-
id: '
|
|
8391
|
+
id: 'fname',
|
|
8642
8392
|
label: 'Name',
|
|
8643
8393
|
minWidth: 250,
|
|
8644
8394
|
sortable: true,
|
|
8645
8395
|
cell: function cell(row) {
|
|
8646
8396
|
var _row$profile_pic2;
|
|
8647
8397
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8648
|
-
firstName: row.
|
|
8649
|
-
lastName: row.
|
|
8650
|
-
isLetterAvatar:
|
|
8651
|
-
|
|
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,
|
|
8652
8403
|
secondaryText: row.email,
|
|
8653
8404
|
letterAvatarTextColor: "black",
|
|
8654
8405
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -8657,7 +8408,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8657
8408
|
}));
|
|
8658
8409
|
}
|
|
8659
8410
|
}, {
|
|
8660
|
-
id: '
|
|
8411
|
+
id: 'created',
|
|
8661
8412
|
label: 'Requested on',
|
|
8662
8413
|
minWidth: 100,
|
|
8663
8414
|
sortable: true,
|
|
@@ -8667,7 +8418,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8667
8418
|
width: 100
|
|
8668
8419
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8669
8420
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8670
|
-
}, formatDate(row.
|
|
8421
|
+
}, formatDate(row.created)));
|
|
8671
8422
|
}
|
|
8672
8423
|
}, {
|
|
8673
8424
|
id: 'actions',
|
|
@@ -8721,89 +8472,11 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8721
8472
|
});
|
|
8722
8473
|
};
|
|
8723
8474
|
|
|
8724
|
-
function InfoYellowIcon(props) {
|
|
8725
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8726
|
-
width: props.width,
|
|
8727
|
-
height: props.height,
|
|
8728
|
-
viewBox: "0 0 20 20",
|
|
8729
|
-
fill: "none",
|
|
8730
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8731
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8732
|
-
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",
|
|
8733
|
-
fill: "#CA8A04"
|
|
8734
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8735
|
-
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",
|
|
8736
|
-
fill: "#CA8A04"
|
|
8737
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8738
|
-
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",
|
|
8739
|
-
fill: "#CA8A04"
|
|
8740
|
-
}));
|
|
8741
|
-
}
|
|
8742
|
-
|
|
8743
|
-
function RedWarningIcon(props) {
|
|
8744
|
-
var _props$color = props.color,
|
|
8745
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8746
|
-
_props$size = props.size,
|
|
8747
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
8748
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8749
|
-
width: size,
|
|
8750
|
-
height: size,
|
|
8751
|
-
viewBox: "0 0 14 14",
|
|
8752
|
-
fill: color,
|
|
8753
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8754
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8755
|
-
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",
|
|
8756
|
-
fill: color
|
|
8757
|
-
}));
|
|
8758
|
-
}
|
|
8759
|
-
|
|
8760
|
-
function InviteInfoIcon() {
|
|
8761
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8762
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
8763
|
-
width: "20",
|
|
8764
|
-
height: "20",
|
|
8765
|
-
fill: "none",
|
|
8766
|
-
viewBox: "0 0 20 20"
|
|
8767
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8768
|
-
fill: "#CA8A04",
|
|
8769
|
-
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"
|
|
8770
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8771
|
-
fill: "#CA8A04",
|
|
8772
|
-
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"
|
|
8773
|
-
}));
|
|
8774
|
-
}
|
|
8775
|
-
|
|
8776
8475
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8777
|
-
var env$7 = configs.env
|
|
8778
|
-
|
|
8779
|
-
var
|
|
8780
|
-
|
|
8781
|
-
msg = _ref.msg;
|
|
8782
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
8783
|
-
style: {
|
|
8784
|
-
display: 'flex',
|
|
8785
|
-
flexDirection: 'row',
|
|
8786
|
-
width: '270px',
|
|
8787
|
-
justifyContent: 'space-between'
|
|
8788
|
-
}
|
|
8789
|
-
}, /*#__PURE__*/React.createElement("p", {
|
|
8790
|
-
style: {
|
|
8791
|
-
whiteSpace: 'nowrap',
|
|
8792
|
-
paddingTop: '8px'
|
|
8793
|
-
}
|
|
8794
|
-
}, msg), /*#__PURE__*/React.createElement("p", {
|
|
8795
|
-
onClick: onUndo,
|
|
8796
|
-
style: {
|
|
8797
|
-
whiteSpace: 'nowrap',
|
|
8798
|
-
fontWeight: '600',
|
|
8799
|
-
fontSize: '1rem',
|
|
8800
|
-
padding: '8px 20px 0'
|
|
8801
|
-
}
|
|
8802
|
-
}, "UNDO"));
|
|
8803
|
-
};
|
|
8804
|
-
var UserList = function UserList(_ref2) {
|
|
8805
|
-
var config = _ref2.config,
|
|
8806
|
-
isProfile = _ref2.isProfile;
|
|
8476
|
+
var env$7 = configs.env;
|
|
8477
|
+
var UserList = function UserList(_ref) {
|
|
8478
|
+
var config = _ref.config,
|
|
8479
|
+
isProfile = _ref.isProfile;
|
|
8807
8480
|
env$7.init(config, isProfile);
|
|
8808
8481
|
var history = useHistory();
|
|
8809
8482
|
var _useSelector = useSelector(function (state) {
|
|
@@ -8813,49 +8486,27 @@ var UserList = function UserList(_ref2) {
|
|
|
8813
8486
|
isDataFetching = _useSelector.isDataFetching,
|
|
8814
8487
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8815
8488
|
tabValue = _useSelector.tabValue;
|
|
8816
|
-
var
|
|
8817
|
-
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
|
|
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];
|
|
8832
8507
|
var _useState3 = useState(false),
|
|
8833
|
-
|
|
8834
|
-
|
|
8835
|
-
var _React$useState4 = React.useState(''),
|
|
8836
|
-
user = _React$useState4[0],
|
|
8837
|
-
setUser = _React$useState4[1];
|
|
8838
|
-
var _useState4 = useState(10),
|
|
8839
|
-
rowsPerPage = _useState4[0],
|
|
8840
|
-
setRowsPerPage = _useState4[1];
|
|
8841
|
-
var _React$useState5 = React.useState({}),
|
|
8842
|
-
selected = _React$useState5[0],
|
|
8843
|
-
setSelected = _React$useState5[1];
|
|
8844
|
-
var _React$useState6 = React.useState('asc'),
|
|
8845
|
-
order = _React$useState6[0],
|
|
8846
|
-
setOrder = _React$useState6[1];
|
|
8847
|
-
var _React$useState7 = React.useState(false),
|
|
8848
|
-
deactivateSingle = _React$useState7[0],
|
|
8849
|
-
setDeactivateSingle = _React$useState7[1];
|
|
8850
|
-
var _React$useState8 = React.useState('first_name'),
|
|
8851
|
-
orderBy = _React$useState8[0],
|
|
8852
|
-
setOrderBy = _React$useState8[1];
|
|
8853
|
-
var _useState5 = useState(''),
|
|
8854
|
-
searchValue = _useState5[0],
|
|
8855
|
-
setSearchValue = _useState5[1];
|
|
8856
|
-
var _useState6 = useState(false),
|
|
8857
|
-
isOpenDeActivateModal = _useState6[0],
|
|
8858
|
-
setOpenDeActivateModalFlag = _useState6[1];
|
|
8508
|
+
isOpenDeActivateModal = _useState3[0],
|
|
8509
|
+
setOpenDeActivateModalFlag = _useState3[1];
|
|
8859
8510
|
var _useSelector2 = useSelector(function (state) {
|
|
8860
8511
|
return state.common;
|
|
8861
8512
|
}),
|
|
@@ -8863,140 +8514,69 @@ var UserList = function UserList(_ref2) {
|
|
|
8863
8514
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8864
8515
|
isILadmin = _useSelector2.isILadmin,
|
|
8865
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];
|
|
8866
8526
|
var _useState7 = useState(false),
|
|
8867
|
-
|
|
8868
|
-
|
|
8527
|
+
isSearchingChange = _useState7[0],
|
|
8528
|
+
setSearchingChange = _useState7[1];
|
|
8869
8529
|
var _useState8 = useState(false),
|
|
8870
|
-
|
|
8871
|
-
|
|
8530
|
+
isSortingChangeTemp = _useState8[0],
|
|
8531
|
+
setSortingChangeTemp = _useState8[1];
|
|
8872
8532
|
var _useState9 = useState(false),
|
|
8873
|
-
|
|
8874
|
-
|
|
8533
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8534
|
+
setSearchingChangeTemp = _useState9[1];
|
|
8875
8535
|
var _useState10 = useState(false),
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
8882
|
-
|
|
8883
|
-
|
|
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];
|
|
8884
8554
|
var _useState13 = useState(false),
|
|
8885
|
-
|
|
8886
|
-
|
|
8555
|
+
isSignUpSortingChange = _useState13[0],
|
|
8556
|
+
setSignUpSortingChange = _useState13[1];
|
|
8887
8557
|
var _useState14 = useState(false),
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
var _useState15 = useState(
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
}),
|
|
8894
|
-
approverRole = _useState15[0],
|
|
8895
|
-
setApproverRole = _useState15[1];
|
|
8558
|
+
isSignUpSearchingChange = _useState14[0],
|
|
8559
|
+
setSignUpSearchingChange = _useState14[1];
|
|
8560
|
+
var _useState15 = useState(false),
|
|
8561
|
+
isSignUpSortingChangeTemp = _useState15[0],
|
|
8562
|
+
setSignUpSortingChangeTemp = _useState15[1];
|
|
8896
8563
|
var _useState16 = useState(false),
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
var _useState17 = useState(''),
|
|
8900
|
-
userIds = _useState17[0],
|
|
8901
|
-
setUserIds = _useState17[1];
|
|
8902
|
-
var _React$useState9 = React.useState(false),
|
|
8903
|
-
overlayMenu = _React$useState9[0],
|
|
8904
|
-
setOverlayMenu = _React$useState9[1];
|
|
8905
|
-
var _useState18 = useState(''),
|
|
8906
|
-
userFirstName = _useState18[0],
|
|
8907
|
-
setUserFirstName = _useState18[1];
|
|
8908
|
-
var _useState19 = useState(''),
|
|
8909
|
-
userLastName = _useState19[0],
|
|
8910
|
-
setUserLastName = _useState19[1];
|
|
8911
|
-
var _useState20 = useState(true),
|
|
8912
|
-
isDisabledSubmitBtn = _useState20[0],
|
|
8913
|
-
setIsDisabledSubmitBtn = _useState20[1];
|
|
8914
|
-
useScrollPosition(function (_ref3) {
|
|
8915
|
-
var prevPos = _ref3.prevPos,
|
|
8916
|
-
currPos = _ref3.currPos;
|
|
8917
|
-
if (prevPos.y - currPos.y > 0) {
|
|
8918
|
-
if (currPos.y <= -275) {
|
|
8919
|
-
setOverlayMenu(true);
|
|
8920
|
-
}
|
|
8921
|
-
} else {
|
|
8922
|
-
if (currPos.y > -295) {
|
|
8923
|
-
setOverlayMenu(false);
|
|
8924
|
-
}
|
|
8925
|
-
}
|
|
8926
|
-
}, [overlayMenu]);
|
|
8927
|
-
var scrollTo = function scrollTo(id) {
|
|
8928
|
-
var el = document.getElementById(id);
|
|
8929
|
-
window.scrollTo({
|
|
8930
|
-
top: el.offsetTop,
|
|
8931
|
-
behavior: 'smooth'
|
|
8932
|
-
});
|
|
8933
|
-
};
|
|
8934
|
-
var _React$useState10 = React.useState(1),
|
|
8935
|
-
signup_page = _React$useState10[0],
|
|
8936
|
-
setSignUpPage = _React$useState10[1];
|
|
8937
|
-
var _useState21 = useState(5),
|
|
8938
|
-
signup_rowsPerPage = _useState21[0],
|
|
8939
|
-
setSignUpRowsPerPage = _useState21[1];
|
|
8940
|
-
var _React$useState11 = React.useState('asc'),
|
|
8941
|
-
signup_order = _React$useState11[0],
|
|
8942
|
-
setSignUpOrder = _React$useState11[1];
|
|
8943
|
-
var _React$useState12 = React.useState('first_name'),
|
|
8944
|
-
signup_orderBy = _React$useState12[0],
|
|
8945
|
-
setSignUpOrderBy = _React$useState12[1];
|
|
8946
|
-
var _useState22 = useState(''),
|
|
8947
|
-
signup_searchValue = _useState22[0],
|
|
8948
|
-
set_signup_SearchValue = _useState22[1];
|
|
8949
|
-
var _useState23 = useState(false),
|
|
8950
|
-
isSignUpSortingChange = _useState23[0],
|
|
8951
|
-
setSignUpSortingChange = _useState23[1];
|
|
8952
|
-
var _useState24 = useState(false),
|
|
8953
|
-
isSignUpSearchingChange = _useState24[0],
|
|
8954
|
-
setSignUpSearchingChange = _useState24[1];
|
|
8955
|
-
var _useState25 = useState(false),
|
|
8956
|
-
isSignUpSortingChangeTemp = _useState25[0],
|
|
8957
|
-
setSignUpSortingChangeTemp = _useState25[1];
|
|
8958
|
-
var _useState26 = useState(false),
|
|
8959
|
-
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8960
|
-
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8564
|
+
isSignUpSearchingChangeTemp = _useState16[0],
|
|
8565
|
+
setSignUpSearchingChangeTemp = _useState16[1];
|
|
8961
8566
|
var _useSelector3 = useSelector(function (state) {
|
|
8962
8567
|
return state.userList;
|
|
8963
8568
|
}),
|
|
8964
8569
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8965
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
8966
|
-
if (config.routes.notification) {
|
|
8967
|
-
history.push({
|
|
8968
|
-
pathname: config.routes.notification.path
|
|
8969
|
-
});
|
|
8970
|
-
}
|
|
8971
|
-
};
|
|
8972
8570
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8973
8571
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8974
8572
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8975
8573
|
return false;
|
|
8976
8574
|
}
|
|
8977
|
-
|
|
8978
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8979
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8980
|
-
var _selected = Object.values(selected).flat();
|
|
8981
|
-
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8982
|
-
return _selected.includes(item.id.toString());
|
|
8983
|
-
});
|
|
8984
|
-
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8985
|
-
return _selected.includes(item.id.toString());
|
|
8986
|
-
});
|
|
8987
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8988
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8989
|
-
setIsBulkDeactivateModalOpen(true);
|
|
8990
|
-
} else {
|
|
8991
|
-
setOpenDeActivateModalFlag(true);
|
|
8992
|
-
}
|
|
8575
|
+
setOpenDeActivateModalFlag(true);
|
|
8993
8576
|
};
|
|
8994
8577
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8995
8578
|
setOpenDeActivateModalFlag(false);
|
|
8996
8579
|
};
|
|
8997
|
-
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8998
|
-
setIsBulkDeactivateModalOpen(false);
|
|
8999
|
-
};
|
|
9000
8580
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9001
8581
|
history.push(config.routes.users.add.path);
|
|
9002
8582
|
};
|
|
@@ -9009,23 +8589,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9009
8589
|
var handleVerifyUserClick = function handleVerifyUserClick(userId) {
|
|
9010
8590
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
9011
8591
|
};
|
|
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'
|
|
8609
|
+
},
|
|
8610
|
+
onClick: function onClick() {
|
|
8611
|
+
return dispatch(undoneSignUpRejection(id));
|
|
8612
|
+
}
|
|
8613
|
+
}));
|
|
8614
|
+
};
|
|
9012
8615
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
9013
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
|
+
}));
|
|
9014
8623
|
if (res.status === true) {
|
|
9015
|
-
var _res$data;
|
|
9016
|
-
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
9017
|
-
onUndo: function onUndo() {
|
|
9018
|
-
return dispatch(undoneSignUpRejection(userId));
|
|
9019
|
-
},
|
|
9020
|
-
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'
|
|
9021
|
-
}));
|
|
9022
8624
|
dispatch(showDataFetchingStatus());
|
|
9023
8625
|
dispatch(fetchUserSignupRequests({
|
|
9024
8626
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9025
8627
|
length: signup_rowsPerPage,
|
|
9026
8628
|
page: signup_page,
|
|
9027
|
-
search: signup_searchValue.trim()
|
|
9028
|
-
pagename: 'company'
|
|
8629
|
+
search: signup_searchValue.trim()
|
|
9029
8630
|
})).then(function () {
|
|
9030
8631
|
return dispatch(stopDataFetchingStatus());
|
|
9031
8632
|
});
|
|
@@ -9044,25 +8645,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9044
8645
|
};
|
|
9045
8646
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
9046
8647
|
var _extends2;
|
|
9047
|
-
var
|
|
9048
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9049
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9050
|
-
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8648
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
9051
8649
|
return n.is_active;
|
|
8650
|
+
}).map(function (obj) {
|
|
8651
|
+
return obj.id.toString();
|
|
9052
8652
|
});
|
|
9053
|
-
|
|
9054
|
-
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9055
|
-
if (obj.roles.is_approver === true) {
|
|
9056
|
-
_selectedUsersApprover.push(obj);
|
|
9057
|
-
} else if (obj.roles.is_approver === false) {
|
|
9058
|
-
_selectedUsersNotApprover.push(obj);
|
|
9059
|
-
}
|
|
9060
|
-
}
|
|
9061
|
-
selectedId.push(obj.id.toString());
|
|
9062
|
-
});
|
|
9063
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9064
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9065
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8653
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
9066
8654
|
};
|
|
9067
8655
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
9068
8656
|
var _extends3;
|
|
@@ -9089,145 +8677,49 @@ var UserList = function UserList(_ref2) {
|
|
|
9089
8677
|
setSignUpSearchingChange(true);
|
|
9090
8678
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9091
8679
|
};
|
|
9092
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page
|
|
8680
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9093
8681
|
var _extends4;
|
|
9094
8682
|
var selectedTemp = _extends({}, selected);
|
|
9095
8683
|
if (!(page in selectedTemp)) {
|
|
9096
8684
|
selectedTemp[page] = [];
|
|
9097
8685
|
}
|
|
9098
8686
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
9099
|
-
var
|
|
8687
|
+
var newSelected = [];
|
|
9100
8688
|
if (selectedIndex === -1) {
|
|
9101
|
-
|
|
8689
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
9102
8690
|
} else if (selectedIndex === 0) {
|
|
9103
|
-
|
|
8691
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
9104
8692
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
9105
|
-
|
|
8693
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
9106
8694
|
} else if (selectedIndex > 0) {
|
|
9107
|
-
|
|
9108
|
-
}
|
|
9109
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9110
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9111
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9112
|
-
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9113
|
-
return id !== item.id.toString();
|
|
9114
|
-
});
|
|
9115
|
-
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9116
|
-
return item.id.toString() !== id;
|
|
9117
|
-
});
|
|
9118
|
-
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9119
|
-
if (data.roles.is_approver === true) {
|
|
9120
|
-
_SelectedUsersApprover.push(data);
|
|
9121
|
-
} else if (data.roles.is_approver === false) {
|
|
9122
|
-
_SelectedUsersNotApprover.push(data);
|
|
9123
|
-
}
|
|
8695
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9124
8696
|
}
|
|
9125
|
-
|
|
9126
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9127
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8697
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
9128
8698
|
};
|
|
9129
|
-
useEffect(function () {
|
|
9130
|
-
setApproverRole({
|
|
9131
|
-
value: '',
|
|
9132
|
-
label: 'Select approver'
|
|
9133
|
-
});
|
|
9134
|
-
setDefaultId(null);
|
|
9135
|
-
setIsDisabledSubmitBtn(true);
|
|
9136
|
-
setApproveeStatus(false);
|
|
9137
|
-
if (deactivateSingle === true) {
|
|
9138
|
-
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9139
|
-
if (response.data["default"].id) {
|
|
9140
|
-
setDefaultId(response.data["default"].id);
|
|
9141
|
-
setApproverRole({
|
|
9142
|
-
value: '',
|
|
9143
|
-
label: response.data["default"].email
|
|
9144
|
-
});
|
|
9145
|
-
setIsDisabledSubmitBtn(false);
|
|
9146
|
-
setApproveeStatus(response.data["default"].approvee_status);
|
|
9147
|
-
}
|
|
9148
|
-
});
|
|
9149
|
-
}
|
|
9150
|
-
}, [deactivateSingle]);
|
|
9151
8699
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9152
8700
|
setRowsPerPage(+event.target.value);
|
|
9153
8701
|
setPage(1);
|
|
9154
8702
|
setSelected({});
|
|
9155
|
-
setSelectedUsersNotApprover([]);
|
|
9156
|
-
setSelectedUsersApprover([]);
|
|
9157
8703
|
setSortingChange(true);
|
|
9158
8704
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9159
8705
|
};
|
|
9160
8706
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
9161
8707
|
var isActive = e.target.checked;
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
setUser(item);
|
|
9170
|
-
} else {
|
|
9171
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9172
|
-
if (!isActive) {
|
|
9173
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9174
|
-
var _extends5;
|
|
9175
|
-
var selectedTemp = _extends({}, selected);
|
|
9176
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9177
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9178
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9179
|
-
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9180
|
-
return item.id != id;
|
|
9181
|
-
});
|
|
9182
|
-
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9183
|
-
return item.id != id;
|
|
9184
|
-
});
|
|
9185
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9186
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9187
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9188
|
-
}
|
|
9189
|
-
}
|
|
9190
|
-
});
|
|
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)));
|
|
9191
8715
|
}
|
|
9192
8716
|
}
|
|
9193
8717
|
});
|
|
9194
8718
|
};
|
|
9195
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
9196
|
-
var _value = _ref4._value;
|
|
9197
|
-
if (_value.data.approvee_status) {
|
|
9198
|
-
setApproveeStatus(true);
|
|
9199
|
-
} else {
|
|
9200
|
-
setApproveeStatus(false);
|
|
9201
|
-
}
|
|
9202
|
-
setDefaultId(_value.data.id);
|
|
9203
|
-
setApproverRole(_value);
|
|
9204
|
-
setIsDisabledSubmitBtn(false);
|
|
9205
|
-
};
|
|
9206
|
-
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9207
|
-
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9208
|
-
setOpenDeActivateModalFlag(false);
|
|
9209
|
-
setDeactivateSingle(false);
|
|
9210
|
-
setSelected({});
|
|
9211
|
-
setSelectedUsersNotApprover([]);
|
|
9212
|
-
setSelectedUsersApprover([]);
|
|
9213
|
-
};
|
|
9214
8719
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
9215
8720
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
9216
8721
|
setOpenDeActivateModalFlag(false);
|
|
9217
8722
|
setSelected({});
|
|
9218
|
-
setSelectedUsersNotApprover([]);
|
|
9219
|
-
setSelectedUsersApprover([]);
|
|
9220
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9221
|
-
};
|
|
9222
|
-
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9223
|
-
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9224
|
-
return item.id;
|
|
9225
|
-
});
|
|
9226
|
-
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9227
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9228
|
-
setSelected({});
|
|
9229
|
-
setSelectedUsersNotApprover([]);
|
|
9230
|
-
setSelectedUsersApprover([]);
|
|
9231
8723
|
};
|
|
9232
8724
|
var importUserHandler = function importUserHandler() {
|
|
9233
8725
|
setOpenImportUsersModal(true);
|
|
@@ -9239,43 +8731,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9239
8731
|
setOpenImportUsersModal(false);
|
|
9240
8732
|
handleImportPagenavigation(jobId);
|
|
9241
8733
|
};
|
|
9242
|
-
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9243
|
-
dispatch(resetPasswordForUser({
|
|
9244
|
-
email: email
|
|
9245
|
-
}));
|
|
9246
|
-
};
|
|
9247
|
-
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9248
|
-
if (type === undefined) {
|
|
9249
|
-
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9250
|
-
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9251
|
-
return false;
|
|
9252
|
-
}
|
|
9253
|
-
}
|
|
9254
|
-
setUserIds(ids);
|
|
9255
|
-
setUserFirstName(firstName);
|
|
9256
|
-
setUserLastName(lastName);
|
|
9257
|
-
setToggleInviteModal(!showInviteModal);
|
|
9258
|
-
};
|
|
9259
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9260
|
-
setToggleInviteModal(!showInviteModal);
|
|
9261
|
-
};
|
|
9262
|
-
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9263
|
-
var userIdArr = [];
|
|
9264
|
-
if (userIds && !isNaN(userIds)) {
|
|
9265
|
-
userIdArr = [userIds];
|
|
9266
|
-
} else if (Object.keys(selected).length) {
|
|
9267
|
-
Object.values(selected).map(function (val, i) {
|
|
9268
|
-
if (val.length) {
|
|
9269
|
-
val.map(function (idx, i) {
|
|
9270
|
-
userIdArr.push(idx);
|
|
9271
|
-
});
|
|
9272
|
-
}
|
|
9273
|
-
});
|
|
9274
|
-
}
|
|
9275
|
-
setUserIds('');
|
|
9276
|
-
dispatch(resendInviteForUser(userIdArr));
|
|
9277
|
-
setToggleInviteModal(!showInviteModal);
|
|
9278
|
-
};
|
|
9279
8734
|
var handleExportUsers = function handleExportUsers() {
|
|
9280
8735
|
try {
|
|
9281
8736
|
setDownlStatus(true);
|
|
@@ -9315,9 +8770,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9315
8770
|
}, {
|
|
9316
8771
|
label: 'Bulk action history',
|
|
9317
8772
|
handler: handleBulkActionHistoryClick
|
|
9318
|
-
}, {
|
|
9319
|
-
label: 'Resend invite',
|
|
9320
|
-
handler: toggleInviteModal
|
|
9321
8773
|
}];
|
|
9322
8774
|
useEffect(function () {
|
|
9323
8775
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -9329,9 +8781,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9329
8781
|
userId: userId
|
|
9330
8782
|
}));
|
|
9331
8783
|
};
|
|
9332
|
-
var knowMore = function knowMore() {
|
|
9333
|
-
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9334
|
-
};
|
|
9335
8784
|
var dispatch = useDispatch();
|
|
9336
8785
|
useEffect(function () {
|
|
9337
8786
|
if (isTokenVerified === true) {
|
|
@@ -9345,7 +8794,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9345
8794
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9346
8795
|
setSearchingChange(false);
|
|
9347
8796
|
setisApiFetching(false);
|
|
9348
|
-
scrollTo('table-root');
|
|
9349
8797
|
});
|
|
9350
8798
|
}, 1000);
|
|
9351
8799
|
return function () {
|
|
@@ -9359,8 +8807,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9359
8807
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9360
8808
|
length: signup_rowsPerPage,
|
|
9361
8809
|
page: signup_page,
|
|
9362
|
-
search: signup_searchValue.trim()
|
|
9363
|
-
pagename: 'company'
|
|
8810
|
+
search: signup_searchValue.trim()
|
|
9364
8811
|
})).then(function () {
|
|
9365
8812
|
setSignUpSearchingChange(false);
|
|
9366
8813
|
setisApiFetching(false);
|
|
@@ -9372,7 +8819,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9372
8819
|
}
|
|
9373
8820
|
if (isSortingChange) {
|
|
9374
8821
|
setisApiFetching(true);
|
|
9375
|
-
scrollTo('table-root');
|
|
9376
8822
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9377
8823
|
setisApiFetching(false);
|
|
9378
8824
|
setSortingChange(false);
|
|
@@ -9387,8 +8833,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9387
8833
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9388
8834
|
length: signup_rowsPerPage,
|
|
9389
8835
|
page: signup_page,
|
|
9390
|
-
search: signup_searchValue.trim()
|
|
9391
|
-
pagename: 'company'
|
|
8836
|
+
search: signup_searchValue.trim()
|
|
9392
8837
|
})).then(function () {
|
|
9393
8838
|
setisApiFetching(false);
|
|
9394
8839
|
setSignUpSortingChange(false);
|
|
@@ -9404,8 +8849,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9404
8849
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9405
8850
|
length: signup_rowsPerPage,
|
|
9406
8851
|
page: signup_page,
|
|
9407
|
-
search: signup_searchValue.trim()
|
|
9408
|
-
pagename: 'company'
|
|
8852
|
+
search: signup_searchValue.trim()
|
|
9409
8853
|
})).then(function () {
|
|
9410
8854
|
return dispatch(stopDataFetchingStatus());
|
|
9411
8855
|
});
|
|
@@ -9413,89 +8857,15 @@ var UserList = function UserList(_ref2) {
|
|
|
9413
8857
|
}
|
|
9414
8858
|
}
|
|
9415
8859
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9416
|
-
var topRightButtons = function topRightButtons() {
|
|
9417
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9418
|
-
component: "div",
|
|
9419
|
-
className: styles$5.buttonWrapper,
|
|
9420
|
-
display: "flex",
|
|
9421
|
-
justifyContent: "space-between",
|
|
9422
|
-
alignItems: "center",
|
|
9423
|
-
alignSelf: "flex-start"
|
|
9424
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9425
|
-
component: "div",
|
|
9426
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9427
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9428
|
-
buttonText: "Export all users",
|
|
9429
|
-
type: "outlined",
|
|
9430
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9431
|
-
width: "22",
|
|
9432
|
-
height: "22"
|
|
9433
|
-
}),
|
|
9434
|
-
onClick: handleExportUsers
|
|
9435
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9436
|
-
component: "div",
|
|
9437
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9438
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9439
|
-
buttonText: "Bulk actions",
|
|
9440
|
-
type: "outlined",
|
|
9441
|
-
menuListInfo: BulkUploadInfo
|
|
9442
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9443
|
-
component: "div",
|
|
9444
|
-
className: "pageHeader--button-single button-right"
|
|
9445
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9446
|
-
buttonText: "Add user",
|
|
9447
|
-
type: "contained",
|
|
9448
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9449
|
-
width: "9",
|
|
9450
|
-
height: "9",
|
|
9451
|
-
color: "white"
|
|
9452
|
-
}),
|
|
9453
|
-
onClick: handleAddPageNavigation
|
|
9454
|
-
})));
|
|
9455
|
-
};
|
|
9456
8860
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9457
8861
|
component: "div",
|
|
9458
8862
|
className: styles$5.UUIUserManagementList
|
|
9459
|
-
},
|
|
9460
|
-
className: styles$5.scrollOverlayMenu
|
|
9461
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9462
|
-
component: "div",
|
|
9463
|
-
className: clsx(styles$5.pageHeader)
|
|
9464
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9465
|
-
component: "div",
|
|
9466
|
-
display: "flex",
|
|
9467
|
-
justifyContent: "space-between",
|
|
9468
|
-
alignItems: "center",
|
|
9469
|
-
flexWrap: "wrap",
|
|
9470
|
-
style: {
|
|
9471
|
-
gap: '1rem'
|
|
9472
|
-
}
|
|
9473
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9474
|
-
component: "div",
|
|
9475
|
-
display: "flex",
|
|
9476
|
-
flexDirection: "column",
|
|
9477
|
-
style: {
|
|
9478
|
-
gap: '0.5rem'
|
|
9479
|
-
}
|
|
9480
|
-
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9481
|
-
placeholder: "Search by name, email & department",
|
|
9482
|
-
value: searchValue,
|
|
9483
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
9484
|
-
return onSearchHandler(e.target.value);
|
|
9485
|
-
},
|
|
9486
|
-
className: styles$5.overlaysearch
|
|
9487
|
-
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9488
|
-
component: "div",
|
|
9489
|
-
display: "flex",
|
|
9490
|
-
justifyContent: "space-between",
|
|
9491
|
-
alignItems: "center"
|
|
9492
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8863
|
+
}, !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9493
8864
|
open: isFileDownloading || isApiFetching,
|
|
9494
8865
|
className: styles$5.backdrop
|
|
9495
8866
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9496
8867
|
color: "inherit"
|
|
9497
8868
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9498
|
-
id: "table-root",
|
|
9499
8869
|
component: "div",
|
|
9500
8870
|
className: clsx(styles$5.pageHeader)
|
|
9501
8871
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -9520,7 +8890,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9520
8890
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9521
8891
|
variant: "h3",
|
|
9522
8892
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
9523
|
-
}, 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, {
|
|
9524
8931
|
component: "div",
|
|
9525
8932
|
display: "flex",
|
|
9526
8933
|
justifyContent: "space-between",
|
|
@@ -9565,9 +8972,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9565
8972
|
disableRowCheckbox: deactivatedUsers,
|
|
9566
8973
|
searchValue: searchValue,
|
|
9567
8974
|
isILadmin: isILadmin,
|
|
9568
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9569
|
-
onResetPasswordHandler: onResetPasswordHandler,
|
|
9570
|
-
toggleInviteModal: toggleInviteModal
|
|
8975
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9571
8976
|
}))
|
|
9572
8977
|
}, {
|
|
9573
8978
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
@@ -9583,10 +8988,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9583
8988
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9584
8989
|
variant: "body2",
|
|
9585
8990
|
className: clsx(styles$5.description)
|
|
9586
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
9587
|
-
onClick: redirectToNotifications,
|
|
9588
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9589
|
-
}, "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, {
|
|
9590
8992
|
data: signupRequestListInfo,
|
|
9591
8993
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9592
8994
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9618,54 +9020,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9618
9020
|
}))
|
|
9619
9021
|
}]
|
|
9620
9022
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9621
|
-
isOpen: deactivateSingle,
|
|
9622
|
-
closeHandler: function closeHandler() {
|
|
9623
|
-
setDeactivateSingle(false);
|
|
9624
|
-
},
|
|
9625
|
-
cancelLabel: "Cancel",
|
|
9626
|
-
submitLabel: "Deactivate",
|
|
9627
|
-
submitHandler: handleDeactivateUser,
|
|
9628
|
-
headerText: "Deactivate this user?",
|
|
9629
|
-
width: "400px",
|
|
9630
|
-
subHanderText: "",
|
|
9631
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
9632
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9633
|
-
modalClass: "deactivateSingleModal",
|
|
9634
|
-
modalBodyStyle: {
|
|
9635
|
-
overflowY: 'unset'
|
|
9636
|
-
}
|
|
9637
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9638
|
-
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9639
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9640
|
-
className: styles$5.deactivateAlert
|
|
9641
|
-
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9642
|
-
width: "9",
|
|
9643
|
-
height: "9"
|
|
9644
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9645
|
-
variant: "body2"
|
|
9646
|
-
}, /*#__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", {
|
|
9647
|
-
onClick: knowMore,
|
|
9648
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9649
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9650
|
-
className: "iui__mt-15"
|
|
9651
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9652
|
-
isMove: true,
|
|
9653
|
-
additional: {
|
|
9654
|
-
page: 1,
|
|
9655
|
-
product: 'travel',
|
|
9656
|
-
userId: user.id
|
|
9657
|
-
},
|
|
9658
|
-
label: "Transfer approver role to",
|
|
9659
|
-
value: approverRole,
|
|
9660
|
-
onValueChange: selectApprover,
|
|
9661
|
-
loadOption: transferRoleOptions,
|
|
9662
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
9663
|
-
customLoadingText: "No results found"
|
|
9664
|
-
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9665
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9666
|
-
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9667
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9668
|
-
}, "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, {
|
|
9669
9023
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9670
9024
|
closeHandler: closeDeActivateModal,
|
|
9671
9025
|
cancelLabel: "Cancel",
|
|
@@ -9691,124 +9045,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9691
9045
|
className: styles$5.headerText
|
|
9692
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, {
|
|
9693
9047
|
className: styles$5.description
|
|
9694
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(
|
|
9695
|
-
isOpen: isBulkDeactivateModalOpen,
|
|
9696
|
-
closeHandler: closeDeActiveModal,
|
|
9697
|
-
cancelLabel: "Cancel",
|
|
9698
|
-
submitLabel: "Deactivate safe users",
|
|
9699
|
-
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9700
|
-
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9701
|
-
customButtonLabel: "Deactivate all users",
|
|
9702
|
-
customButtonHandler: handleDeactivateUsers,
|
|
9703
|
-
submitHandler: handleDeactivateSafeUsers,
|
|
9704
|
-
width: "640px",
|
|
9705
|
-
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9706
|
-
headerText: "Deactivate users?",
|
|
9707
|
-
modalBodyStyle: {
|
|
9708
|
-
maxHeight: 'calc(100vh - 50vh)'
|
|
9709
|
-
}
|
|
9710
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9711
|
-
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9712
|
-
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9713
|
-
color: "#9A6700",
|
|
9714
|
-
size: "14"
|
|
9715
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9716
|
-
variant: "body2"
|
|
9717
|
-
}, "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", {
|
|
9718
|
-
onClick: knowMore,
|
|
9719
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9720
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9721
|
-
className: "iui__my-15"
|
|
9722
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9723
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9724
|
-
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9725
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9726
|
-
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9727
|
-
var _item$data;
|
|
9728
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9729
|
-
key: index,
|
|
9730
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9731
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9732
|
-
firstName: item.first_name,
|
|
9733
|
-
lastName: item.last_name,
|
|
9734
|
-
isLetterAvatar: "true",
|
|
9735
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9736
|
-
secondaryText: item.email,
|
|
9737
|
-
letterAvatarTextColor: "black",
|
|
9738
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9739
|
-
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9740
|
-
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9741
|
-
color: "#9A6700",
|
|
9742
|
-
size: "14"
|
|
9743
|
-
}));
|
|
9744
|
-
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9745
|
-
style: {
|
|
9746
|
-
borderColor: '#E5E9ED'
|
|
9747
|
-
}
|
|
9748
|
-
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9749
|
-
className: "iui__my-15"
|
|
9750
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9751
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
9752
|
-
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9753
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9754
|
-
}, "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) {
|
|
9755
|
-
var _item$data2;
|
|
9756
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9757
|
-
key: index,
|
|
9758
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9759
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9760
|
-
firstName: item.first_name,
|
|
9761
|
-
lastName: item.last_name,
|
|
9762
|
-
isLetterAvatar: "true",
|
|
9763
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
9764
|
-
secondaryText: item.email,
|
|
9765
|
-
letterAvatarTextColor: "black",
|
|
9766
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9767
|
-
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9768
|
-
}));
|
|
9769
|
-
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9770
|
-
isOpen: showInviteModal,
|
|
9771
|
-
closeHandler: function closeHandler() {
|
|
9772
|
-
return toggleInviteModalClose();
|
|
9773
|
-
},
|
|
9774
|
-
cancelLabel: "Cancel",
|
|
9775
|
-
headerText: "Resend Invites?",
|
|
9776
|
-
submitLabel: "Send",
|
|
9777
|
-
submitHandler: function submitHandler() {
|
|
9778
|
-
return onResendInviteHandler();
|
|
9779
|
-
},
|
|
9780
|
-
width: "400px",
|
|
9781
|
-
modalBodyStyle: {
|
|
9782
|
-
padding: '0px'
|
|
9783
|
-
},
|
|
9784
|
-
footerStyle: {
|
|
9785
|
-
justifyContent: 'center'
|
|
9786
|
-
}
|
|
9787
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9788
|
-
style: {
|
|
9789
|
-
display: 'flex',
|
|
9790
|
-
padding: '16px',
|
|
9791
|
-
margin: '8px 24px',
|
|
9792
|
-
border: '1px solid #FDE047',
|
|
9793
|
-
background: '#FEFCE8',
|
|
9794
|
-
borderRadius: '5px'
|
|
9795
|
-
}
|
|
9796
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9797
|
-
style: {
|
|
9798
|
-
marginRight: '5px'
|
|
9799
|
-
}
|
|
9800
|
-
}, /*#__PURE__*/React.createElement(InviteInfoIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
9801
|
-
style: {
|
|
9802
|
-
fontSize: '14px',
|
|
9803
|
-
color: '#374151'
|
|
9804
|
-
}
|
|
9805
|
-
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9806
|
-
style: {
|
|
9807
|
-
fontSize: '14px',
|
|
9808
|
-
color: '#374151',
|
|
9809
|
-
fontWeight: 'bold'
|
|
9810
|
-
}
|
|
9811
|
-
}, 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, {
|
|
9812
9049
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9813
9050
|
closeImportUsersModal: closeImportUsersModal,
|
|
9814
9051
|
closeImportModal: closeImportModal
|
|
@@ -9817,8 +9054,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9817
9054
|
errMsg: hasVerificationError
|
|
9818
9055
|
}));
|
|
9819
9056
|
};
|
|
9820
|
-
var TabLabelCount = function TabLabelCount(
|
|
9821
|
-
var count =
|
|
9057
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
9058
|
+
var count = _ref3.count;
|
|
9822
9059
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9823
9060
|
className: styles$5.TabLabelCount
|
|
9824
9061
|
}, " ", count, " ");
|
|
@@ -9893,12 +9130,11 @@ function Header(props) {
|
|
|
9893
9130
|
})));
|
|
9894
9131
|
}
|
|
9895
9132
|
|
|
9896
|
-
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"};
|
|
9897
9134
|
|
|
9898
9135
|
function Listview(_ref) {
|
|
9899
9136
|
var data = _ref.data,
|
|
9900
9137
|
name = _ref.name,
|
|
9901
|
-
tableName = _ref.tableName,
|
|
9902
9138
|
handleEditDialog = _ref.handleEditDialog,
|
|
9903
9139
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9904
9140
|
orderBy = _ref.orderBy,
|
|
@@ -9911,87 +9147,21 @@ function Listview(_ref) {
|
|
|
9911
9147
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9912
9148
|
page = _ref.page,
|
|
9913
9149
|
rowsPerPage = _ref.rowsPerPage;
|
|
9914
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9915
|
-
var _data$dept_head_detai;
|
|
9916
|
-
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) {
|
|
9917
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9918
|
-
}
|
|
9919
|
-
};
|
|
9920
9150
|
var columns = [{
|
|
9921
9151
|
id: 'name',
|
|
9922
9152
|
label: name,
|
|
9923
|
-
width: '
|
|
9924
|
-
sortable: true,
|
|
9925
|
-
cell: function cell(row) {
|
|
9926
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9927
|
-
component: "div"
|
|
9928
|
-
}, row.name);
|
|
9929
|
-
}
|
|
9930
|
-
}, {
|
|
9931
|
-
id: 'no_of_users',
|
|
9932
|
-
label: 'Number of users',
|
|
9933
|
-
width: '40%',
|
|
9934
|
-
sortable: true,
|
|
9935
|
-
cell: function cell(row) {
|
|
9936
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9937
|
-
component: "div"
|
|
9938
|
-
}, row.no_of_users);
|
|
9939
|
-
}
|
|
9940
|
-
}, {
|
|
9941
|
-
id: 'actions',
|
|
9942
|
-
label: 'Actions',
|
|
9943
|
-
width: '20%',
|
|
9944
|
-
cell: function cell(row) {
|
|
9945
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9946
|
-
display: "flex"
|
|
9947
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9948
|
-
buttonText: "Edit",
|
|
9949
|
-
className: styles$7.buttonWidth,
|
|
9950
|
-
onClick: function onClick() {
|
|
9951
|
-
return handleEditDialog(row);
|
|
9952
|
-
}
|
|
9953
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9954
|
-
buttonText: "Delete",
|
|
9955
|
-
className: styles$7.buttonWidth,
|
|
9956
|
-
onClick: function onClick() {
|
|
9957
|
-
return handleDeleteDialog(row, true);
|
|
9958
|
-
}
|
|
9959
|
-
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9960
|
-
buttonText: "Delete",
|
|
9961
|
-
className: styles$7.buttonWidth,
|
|
9962
|
-
onClick: function onClick() {
|
|
9963
|
-
return handleDeleteDialog(row, false);
|
|
9964
|
-
}
|
|
9965
|
-
}));
|
|
9966
|
-
}
|
|
9967
|
-
}];
|
|
9968
|
-
var departmentColumns = [{
|
|
9969
|
-
id: 'name',
|
|
9970
|
-
label: name,
|
|
9971
|
-
width: '30%',
|
|
9153
|
+
width: '45%',
|
|
9972
9154
|
sortable: true,
|
|
9973
9155
|
cell: function cell(row) {
|
|
9974
9156
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9975
9157
|
component: "div"
|
|
9976
9158
|
}, row.name);
|
|
9977
9159
|
}
|
|
9978
|
-
}, {
|
|
9979
|
-
id: 'department_head',
|
|
9980
|
-
label: 'Department head',
|
|
9981
|
-
width: '30%',
|
|
9982
|
-
sortable: true,
|
|
9983
|
-
cell: function cell(row) {
|
|
9984
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9985
|
-
component: "div"
|
|
9986
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9987
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9988
|
-
}, "Assigned by default"));
|
|
9989
|
-
}
|
|
9990
9160
|
}, {
|
|
9991
9161
|
id: 'no_of_users',
|
|
9992
9162
|
label: 'Number of users',
|
|
9993
9163
|
width: '45%',
|
|
9994
|
-
sortable:
|
|
9164
|
+
sortable: true,
|
|
9995
9165
|
cell: function cell(row) {
|
|
9996
9166
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9997
9167
|
component: "div"
|
|
@@ -10000,7 +9170,7 @@ function Listview(_ref) {
|
|
|
10000
9170
|
}, {
|
|
10001
9171
|
id: 'actions',
|
|
10002
9172
|
label: 'Actions',
|
|
10003
|
-
width: '
|
|
9173
|
+
width: '10%',
|
|
10004
9174
|
cell: function cell(row) {
|
|
10005
9175
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10006
9176
|
display: "flex"
|
|
@@ -10033,7 +9203,7 @@ function Listview(_ref) {
|
|
|
10033
9203
|
hasFilter: true,
|
|
10034
9204
|
isCheckboxTable: false,
|
|
10035
9205
|
count: data.count,
|
|
10036
|
-
columns:
|
|
9206
|
+
columns: columns,
|
|
10037
9207
|
rows: data.results,
|
|
10038
9208
|
page: page,
|
|
10039
9209
|
handleChangePage: handleChangePage,
|
|
@@ -10090,44 +9260,16 @@ function EditPanelDialog(_ref) {
|
|
|
10090
9260
|
var isOpen = _ref.isOpen,
|
|
10091
9261
|
closeHandler = _ref.closeHandler,
|
|
10092
9262
|
onValueChange = _ref.onValueChange,
|
|
10093
|
-
|
|
9263
|
+
submitHandler = _ref.submitHandler,
|
|
10094
9264
|
isError = _ref.isError,
|
|
10095
9265
|
name = _ref.name,
|
|
10096
9266
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
10097
|
-
validation = _ref.validation
|
|
10098
|
-
rowData = _ref.rowData,
|
|
10099
|
-
tableName = _ref.tableName,
|
|
10100
|
-
config = _ref.config;
|
|
9267
|
+
validation = _ref.validation;
|
|
10101
9268
|
var _useSelector = useSelector(function (state) {
|
|
10102
9269
|
return state.userPanel;
|
|
10103
9270
|
}),
|
|
10104
9271
|
dialogData = _useSelector.dialogData;
|
|
10105
|
-
|
|
10106
|
-
var _data$dept_head_detai;
|
|
10107
|
-
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) {
|
|
10108
|
-
setHead({
|
|
10109
|
-
value: data.dept_head_details[0].id,
|
|
10110
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10111
|
-
});
|
|
10112
|
-
}
|
|
10113
|
-
};
|
|
10114
|
-
var _useState = useState({
|
|
10115
|
-
value: '',
|
|
10116
|
-
label: 'Select'
|
|
10117
|
-
}),
|
|
10118
|
-
head = _useState[0],
|
|
10119
|
-
setHead = _useState[1];
|
|
10120
|
-
useEffect(function () {
|
|
10121
|
-
deptHeadDetails(rowData);
|
|
10122
|
-
}, [rowData]);
|
|
10123
|
-
var history = useHistory();
|
|
10124
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10125
|
-
console.log(rowData);
|
|
10126
|
-
history.push({
|
|
10127
|
-
pathname: config.routes.users.add.path,
|
|
10128
|
-
state: rowData
|
|
10129
|
-
});
|
|
10130
|
-
};
|
|
9272
|
+
|
|
10131
9273
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
10132
9274
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10133
9275
|
isOpen: isOpen,
|
|
@@ -10135,60 +9277,27 @@ function EditPanelDialog(_ref) {
|
|
|
10135
9277
|
headerText: "Edit " + name.toLowerCase(),
|
|
10136
9278
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
10137
9279
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
10138
|
-
submitHandler:
|
|
10139
|
-
|
|
10140
|
-
},
|
|
10141
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9280
|
+
submitHandler: submitHandler,
|
|
9281
|
+
width: "365px",
|
|
10142
9282
|
hideCloseIcon: false,
|
|
10143
9283
|
modalBodyStyle: {
|
|
10144
|
-
|
|
9284
|
+
maxHeight: '400px',
|
|
9285
|
+
overflow: 'auto',
|
|
9286
|
+
margin: '0px'
|
|
10145
9287
|
},
|
|
10146
9288
|
footerStyle: {
|
|
10147
9289
|
justifyContent: 'end'
|
|
10148
9290
|
}
|
|
10149
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10150
|
-
display: "flex",
|
|
10151
|
-
justifyContent: "center",
|
|
10152
|
-
alignItems: "center",
|
|
10153
|
-
flexDirection: "column",
|
|
10154
|
-
style: {
|
|
10155
|
-
marginBottom: '30px'
|
|
10156
|
-
}
|
|
10157
9291
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9292
|
+
component: "div",
|
|
10158
9293
|
display: "flex",
|
|
10159
9294
|
justifyContent: "center",
|
|
10160
9295
|
alignItems: "center",
|
|
10161
9296
|
flexDirection: "column",
|
|
10162
|
-
|
|
10163
|
-
}, /*#__PURE__*/React.createElement(
|
|
10164
|
-
|
|
10165
|
-
|
|
10166
|
-
className: styles$7.iconLayout,
|
|
10167
|
-
style: {
|
|
10168
|
-
paddingTop: '4px'
|
|
10169
|
-
}
|
|
10170
|
-
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10171
|
-
color: "#CA8A04",
|
|
10172
|
-
width: "25",
|
|
10173
|
-
height: "20",
|
|
10174
|
-
className: styles$7.iconStyle
|
|
10175
|
-
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10176
|
-
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.",
|
|
10177
|
-
style: {
|
|
10178
|
-
fontWeight: 'normal'
|
|
10179
|
-
}
|
|
10180
|
-
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10181
|
-
buttonText: "Add user",
|
|
10182
|
-
type: "text",
|
|
10183
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10184
|
-
width: "9",
|
|
10185
|
-
height: "9",
|
|
10186
|
-
color: "#EC5D25"
|
|
10187
|
-
}),
|
|
10188
|
-
onClick: handleAddPageNavigation,
|
|
10189
|
-
className: styles$7.addUserButton
|
|
10190
|
-
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
10191
|
-
label: name + " name",
|
|
9297
|
+
padding: "8px 24px"
|
|
9298
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9299
|
+
label: name + " name"
|
|
9300
|
+
,
|
|
10192
9301
|
name: "name",
|
|
10193
9302
|
defaultValue: dialogData.data.name,
|
|
10194
9303
|
onValueChange: onValueChange,
|
|
@@ -10196,49 +9305,7 @@ function EditPanelDialog(_ref) {
|
|
|
10196
9305
|
isError: isError,
|
|
10197
9306
|
validation: validation,
|
|
10198
9307
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
10199
|
-
required: true
|
|
10200
|
-
style: tableName === 'department' && {
|
|
10201
|
-
width: '350px'
|
|
10202
|
-
}
|
|
10203
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10204
|
-
className: "iui__mt-15",
|
|
10205
|
-
style: {
|
|
10206
|
-
width: '100%'
|
|
10207
|
-
}
|
|
10208
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10209
|
-
label: "Department head",
|
|
10210
|
-
name: "name",
|
|
10211
|
-
defaultValue: head.label,
|
|
10212
|
-
placeholder: "",
|
|
10213
|
-
readOnly: true,
|
|
10214
|
-
style: {
|
|
10215
|
-
width: '350px'
|
|
10216
|
-
}
|
|
10217
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10218
|
-
className: "iui__mt-15",
|
|
10219
|
-
style: {
|
|
10220
|
-
width: '100%'
|
|
10221
|
-
}
|
|
10222
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10223
|
-
noResultsText: true,
|
|
10224
|
-
isMove: true,
|
|
10225
|
-
additional: {
|
|
10226
|
-
page: 1,
|
|
10227
|
-
departmentId: rowData.id
|
|
10228
|
-
},
|
|
10229
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
10230
|
-
label: "Department head",
|
|
10231
|
-
value: head,
|
|
10232
|
-
onValueChange: function onValueChange(_ref2) {
|
|
10233
|
-
var _value = _ref2._value;
|
|
10234
|
-
return setHead(_value);
|
|
10235
|
-
},
|
|
10236
|
-
loadOption: departmentHeadOptions,
|
|
10237
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10238
|
-
customLoadingText: "No users found in this department",
|
|
10239
|
-
customLoadingTextStyle: {
|
|
10240
|
-
color: '#374151'
|
|
10241
|
-
}
|
|
9308
|
+
required: true
|
|
10242
9309
|
})));
|
|
10243
9310
|
}
|
|
10244
9311
|
|
|
@@ -10417,15 +9484,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10417
9484
|
var _useState13 = useState(false),
|
|
10418
9485
|
isSortingChangeTemp = _useState13[0],
|
|
10419
9486
|
setSortingChangeTemp = _useState13[1];
|
|
10420
|
-
var _useState14 = useState(
|
|
10421
|
-
|
|
10422
|
-
|
|
10423
|
-
var _useState15 = useState(
|
|
10424
|
-
|
|
10425
|
-
|
|
10426
|
-
var _useState16 = useState(5),
|
|
10427
|
-
rowsPerPage = _useState16[0],
|
|
10428
|
-
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];
|
|
10429
9493
|
var orderingParam = orderBy;
|
|
10430
9494
|
var _useSelector = useSelector(function (state) {
|
|
10431
9495
|
return state.userPanel;
|
|
@@ -10438,25 +9502,18 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10438
9502
|
}),
|
|
10439
9503
|
isTokenVerified = _useSelector2.isTokenVerified,
|
|
10440
9504
|
hasVerificationError = _useSelector2.hasVerificationError;
|
|
9505
|
+
|
|
10441
9506
|
var onValueChange = function onValueChange(_ref2) {
|
|
10442
9507
|
var _value = _ref2._value;
|
|
10443
9508
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
10444
9509
|
setDataList(validatedValue);
|
|
10445
9510
|
};
|
|
10446
|
-
var _useState17 = useState(70),
|
|
10447
|
-
maxLengthForModal = _useState17[0],
|
|
10448
|
-
setMaxLengthForModal = _useState17[1];
|
|
10449
|
-
useEffect(function () {
|
|
10450
|
-
if (title === 'Business unit') {
|
|
10451
|
-
setMaxLengthForModal(150);
|
|
10452
|
-
}
|
|
10453
|
-
}, []);
|
|
10454
9511
|
var validation = {
|
|
10455
9512
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
10456
9513
|
regexOnBlur: null,
|
|
10457
9514
|
maxLimit: '',
|
|
10458
9515
|
minLimit: '',
|
|
10459
|
-
maxLength:
|
|
9516
|
+
maxLength: 70,
|
|
10460
9517
|
minLength: 0
|
|
10461
9518
|
};
|
|
10462
9519
|
useEffect(function () {
|
|
@@ -10529,7 +9586,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10529
9586
|
submitLabel: 'Save'
|
|
10530
9587
|
}, '', data));
|
|
10531
9588
|
setDataList(data.name);
|
|
10532
|
-
setRowData(data);
|
|
10533
9589
|
setEditModal(true);
|
|
10534
9590
|
};
|
|
10535
9591
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10544,12 +9600,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10544
9600
|
var payload = {
|
|
10545
9601
|
names: [dataList]
|
|
10546
9602
|
};
|
|
10547
|
-
if (tableName === 'department') {
|
|
10548
|
-
payload = {
|
|
10549
|
-
name: dataList,
|
|
10550
|
-
department_head_id: null
|
|
10551
|
-
};
|
|
10552
|
-
}
|
|
10553
9603
|
var message = title + " added successfully.";
|
|
10554
9604
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10555
9605
|
} else {
|
|
@@ -10563,12 +9613,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10563
9613
|
var message = title + " deleted successfully.";
|
|
10564
9614
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10565
9615
|
};
|
|
10566
|
-
|
|
10567
|
-
|
|
10568
|
-
optionalParams = null;
|
|
10569
|
-
}
|
|
9616
|
+
|
|
9617
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10570
9618
|
dispatch(userPanelShowLoader());
|
|
10571
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9619
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10572
9620
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10573
9621
|
dispatch(userPanelStopLoader());
|
|
10574
9622
|
if (type === 'delete') {
|
|
@@ -10610,14 +9658,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10610
9658
|
name: dataList
|
|
10611
9659
|
}]
|
|
10612
9660
|
};
|
|
10613
|
-
if (tableName === 'department') {
|
|
10614
|
-
payload = {
|
|
10615
|
-
name: dataList,
|
|
10616
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10617
|
-
};
|
|
10618
|
-
}
|
|
10619
9661
|
var message = title + " updated successfully.";
|
|
10620
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9662
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
10621
9663
|
setErrorEdit(false);
|
|
10622
9664
|
} else {
|
|
10623
9665
|
setErrorEdit(true);
|
|
@@ -10724,10 +9766,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10724
9766
|
submitHandler: handleEditPanel,
|
|
10725
9767
|
isError: errorEdit,
|
|
10726
9768
|
isDisabledSubmitBtn: loading,
|
|
10727
|
-
validation: validation
|
|
10728
|
-
rowData: rowData,
|
|
10729
|
-
tableName: tableName,
|
|
10730
|
-
config: config
|
|
9769
|
+
validation: validation
|
|
10731
9770
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10732
9771
|
config: config
|
|
10733
9772
|
}));
|