@itilite/iui-user-management 0.4.20 → 0.4.21
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 +9 -113
- package/dist/index.js +593 -1999
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +597 -2003
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -4
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup,
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUIDropdownButton, IUITabs } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -9,14 +9,12 @@ import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
|
-
import { useHistory
|
|
13
|
-
import { withStyles
|
|
14
|
-
import Tooltip from '@material-ui/core/Tooltip';
|
|
12
|
+
import { useHistory } from 'react-router-dom';
|
|
13
|
+
import { withStyles } from '@material-ui/core/styles';
|
|
15
14
|
import Switch from '@material-ui/core/Switch';
|
|
16
15
|
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
17
16
|
import Button from '@material-ui/core/Button';
|
|
18
|
-
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography
|
|
19
|
-
import { useScrollPosition } from '@n8tb1t/use-scroll-position';
|
|
17
|
+
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography } from '@material-ui/core';
|
|
20
18
|
|
|
21
19
|
function _extends() {
|
|
22
20
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -32,37 +30,6 @@ function _extends() {
|
|
|
32
30
|
};
|
|
33
31
|
return _extends.apply(this, arguments);
|
|
34
32
|
}
|
|
35
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
36
|
-
if (!o) return;
|
|
37
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
38
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
39
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
40
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
41
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
42
|
-
}
|
|
43
|
-
function _arrayLikeToArray(arr, len) {
|
|
44
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
45
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
46
|
-
return arr2;
|
|
47
|
-
}
|
|
48
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
49
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
50
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
51
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
52
|
-
if (it) o = it;
|
|
53
|
-
var i = 0;
|
|
54
|
-
return function () {
|
|
55
|
-
if (i >= o.length) return {
|
|
56
|
-
done: true
|
|
57
|
-
};
|
|
58
|
-
return {
|
|
59
|
-
done: false,
|
|
60
|
-
value: o[i++]
|
|
61
|
-
};
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
65
|
-
}
|
|
66
33
|
|
|
67
34
|
var _Pact = /*#__PURE__*/function () {
|
|
68
35
|
function _Pact() {}
|
|
@@ -100,6 +67,7 @@ var _Pact = /*#__PURE__*/function () {
|
|
|
100
67
|
};
|
|
101
68
|
return _Pact;
|
|
102
69
|
}();
|
|
70
|
+
|
|
103
71
|
function _settle(pact, state, value) {
|
|
104
72
|
if (!pact.s) {
|
|
105
73
|
if (value instanceof _Pact) {
|
|
@@ -128,6 +96,7 @@ function _settle(pact, state, value) {
|
|
|
128
96
|
function _isSettledPact(thenable) {
|
|
129
97
|
return thenable instanceof _Pact && thenable.s & 1;
|
|
130
98
|
}
|
|
99
|
+
|
|
131
100
|
function _forTo(array, body, check) {
|
|
132
101
|
var i = -1,
|
|
133
102
|
pact,
|
|
@@ -159,6 +128,7 @@ function _forTo(array, body, check) {
|
|
|
159
128
|
}
|
|
160
129
|
var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
161
130
|
var _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
131
|
+
|
|
162
132
|
function _catch(body, recover) {
|
|
163
133
|
try {
|
|
164
134
|
var result = body();
|
|
@@ -177,11 +147,17 @@ function r(e) {
|
|
|
177
147
|
var t,
|
|
178
148
|
f,
|
|
179
149
|
n = "";
|
|
180
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
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
|
+
}
|
|
181
155
|
return n;
|
|
182
156
|
}
|
|
183
157
|
function clsx() {
|
|
184
|
-
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
|
+
}
|
|
185
161
|
return n;
|
|
186
162
|
}
|
|
187
163
|
|
|
@@ -385,9 +361,6 @@ var userAddEditUrl = {
|
|
|
385
361
|
approversSearch: function approversSearch() {
|
|
386
362
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
387
363
|
},
|
|
388
|
-
transferAppover: function transferAppover() {
|
|
389
|
-
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
390
|
-
},
|
|
391
364
|
preSignedUrl: function preSignedUrl() {
|
|
392
365
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
393
366
|
},
|
|
@@ -420,12 +393,6 @@ var userAddEditUrl = {
|
|
|
420
393
|
},
|
|
421
394
|
undoRejectUserVerification: function undoRejectUserVerification(userId) {
|
|
422
395
|
return "api/v1/onboarding/user-signup-reject/" + userId + "?action=undo";
|
|
423
|
-
},
|
|
424
|
-
cardsEditUserDetails: function cardsEditUserDetails(userId) {
|
|
425
|
-
return env.getCardsapiURL() + "/authorization/user/" + userId;
|
|
426
|
-
},
|
|
427
|
-
cardsAddUsersDetails: function cardsAddUsersDetails() {
|
|
428
|
-
return env.getCardsapiURL() + "/authorization/company/" + IUILocalStorageService.getCompanyId() + "/roles";
|
|
429
396
|
}
|
|
430
397
|
};
|
|
431
398
|
var userListUrl = {
|
|
@@ -481,23 +448,15 @@ var userPanelUrl = {
|
|
|
481
448
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
482
449
|
},
|
|
483
450
|
getUnit: function getUnit(tableName, length, sort) {
|
|
484
|
-
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;
|
|
485
452
|
},
|
|
486
453
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
487
|
-
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;
|
|
488
455
|
},
|
|
489
456
|
moveUnit: function moveUnit() {
|
|
490
457
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
491
458
|
}
|
|
492
459
|
};
|
|
493
|
-
var departmentUrl = {
|
|
494
|
-
departmentUrl: function departmentUrl() {
|
|
495
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
496
|
-
},
|
|
497
|
-
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
498
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
460
|
|
|
502
461
|
var api = configs.api;
|
|
503
462
|
var NAoptionConfig = {
|
|
@@ -507,6 +466,7 @@ var NAoptionConfig = {
|
|
|
507
466
|
},
|
|
508
467
|
applyFor: ['employee_level', 'department']
|
|
509
468
|
};
|
|
469
|
+
|
|
510
470
|
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
511
471
|
var page = _ref.page,
|
|
512
472
|
tabelName = _ref.tabelName,
|
|
@@ -639,53 +599,11 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
639
599
|
return Promise.reject(e);
|
|
640
600
|
}
|
|
641
601
|
};
|
|
642
|
-
var
|
|
602
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
643
603
|
var page = _ref4.page,
|
|
644
604
|
product = _ref4.product,
|
|
645
|
-
userId = _ref4.userId
|
|
646
|
-
|
|
647
|
-
return Promise.resolve(_catch(function () {
|
|
648
|
-
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
649
|
-
return res.data;
|
|
650
|
-
})).then(function (response) {
|
|
651
|
-
var mappedValue = response.results.map(function (item) {
|
|
652
|
-
return {
|
|
653
|
-
value: item.email,
|
|
654
|
-
label: item.email,
|
|
655
|
-
type: 'detailed',
|
|
656
|
-
data: item
|
|
657
|
-
};
|
|
658
|
-
});
|
|
659
|
-
return {
|
|
660
|
-
options: mappedValue,
|
|
661
|
-
hasMore: !!response.next,
|
|
662
|
-
additional: {
|
|
663
|
-
page: page + 1,
|
|
664
|
-
product: product,
|
|
665
|
-
userId: userId
|
|
666
|
-
}
|
|
667
|
-
};
|
|
668
|
-
});
|
|
669
|
-
}, function () {
|
|
670
|
-
return {
|
|
671
|
-
options: [],
|
|
672
|
-
hasMore: false,
|
|
673
|
-
additional: {
|
|
674
|
-
page: 1,
|
|
675
|
-
product: product,
|
|
676
|
-
userId: userId
|
|
677
|
-
}
|
|
678
|
-
};
|
|
679
|
-
}));
|
|
680
|
-
} catch (e) {
|
|
681
|
-
return Promise.reject(e);
|
|
682
|
-
}
|
|
683
|
-
};
|
|
684
|
-
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
685
|
-
var page = _ref5.page,
|
|
686
|
-
product = _ref5.product,
|
|
687
|
-
userId = _ref5.userId,
|
|
688
|
-
placeholder = _ref5.placeholder;
|
|
605
|
+
userId = _ref4.userId,
|
|
606
|
+
placeholder = _ref4.placeholder;
|
|
689
607
|
try {
|
|
690
608
|
return Promise.resolve(_catch(function () {
|
|
691
609
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -731,9 +649,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
|
731
649
|
return Promise.reject(e);
|
|
732
650
|
}
|
|
733
651
|
};
|
|
734
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
735
|
-
var page =
|
|
736
|
-
tabelName =
|
|
652
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
653
|
+
var page = _ref5.page,
|
|
654
|
+
tabelName = _ref5.tabelName;
|
|
737
655
|
try {
|
|
738
656
|
return Promise.resolve(_catch(function () {
|
|
739
657
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -745,6 +663,7 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
745
663
|
label: item[tabelName]
|
|
746
664
|
};
|
|
747
665
|
});
|
|
666
|
+
|
|
748
667
|
return {
|
|
749
668
|
options: mappedValue,
|
|
750
669
|
hasMore: !!response.next,
|
|
@@ -768,45 +687,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
|
768
687
|
return Promise.reject(e);
|
|
769
688
|
}
|
|
770
689
|
};
|
|
771
|
-
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
772
|
-
var page = _ref7.page,
|
|
773
|
-
departmentId = _ref7.departmentId;
|
|
774
|
-
try {
|
|
775
|
-
return Promise.resolve(_catch(function () {
|
|
776
|
-
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
777
|
-
return res.data;
|
|
778
|
-
})).then(function (response) {
|
|
779
|
-
var mappedValue = response.results.map(function (item) {
|
|
780
|
-
return {
|
|
781
|
-
value: item.id,
|
|
782
|
-
label: item.first_name + ' ' + item.last_name,
|
|
783
|
-
type: 'detailed',
|
|
784
|
-
data: item
|
|
785
|
-
};
|
|
786
|
-
});
|
|
787
|
-
return {
|
|
788
|
-
options: mappedValue,
|
|
789
|
-
hasMore: !!response.next,
|
|
790
|
-
additional: {
|
|
791
|
-
page: page + 1,
|
|
792
|
-
departmentId: departmentId
|
|
793
|
-
}
|
|
794
|
-
};
|
|
795
|
-
});
|
|
796
|
-
}, function () {
|
|
797
|
-
return {
|
|
798
|
-
options: [],
|
|
799
|
-
hasMore: false,
|
|
800
|
-
additional: {
|
|
801
|
-
page: 1,
|
|
802
|
-
departmentId: departmentId
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
}));
|
|
806
|
-
} catch (e) {
|
|
807
|
-
return Promise.reject(e);
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
690
|
|
|
811
691
|
var UserRole = function UserRole(_ref) {
|
|
812
692
|
var _ref$list = _ref.list,
|
|
@@ -828,7 +708,6 @@ var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expi
|
|
|
828
708
|
var SHOW_LOADER = 'SHOW_LOADER';
|
|
829
709
|
var STOP_LOADER = 'STOP_LOADER';
|
|
830
710
|
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
831
|
-
var SET_CARDS_DETAILS = 'SET_CARDS_DETAILS';
|
|
832
711
|
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
833
712
|
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
834
713
|
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
@@ -873,15 +752,9 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
873
752
|
if (payload.productAccess.expense) {
|
|
874
753
|
product.expense = payload.expenseRole || null;
|
|
875
754
|
}
|
|
876
|
-
if (payload.productAccess.card) {
|
|
877
|
-
var splitRole = payload.cardsRole.split(":");
|
|
878
|
-
var cardsUsmRole = splitRole[2];
|
|
879
|
-
product.card = cardsUsmRole || null;
|
|
880
|
-
}
|
|
881
755
|
return product;
|
|
882
756
|
}(),
|
|
883
|
-
approvers: {}
|
|
884
|
-
requested_user_is_admin: payload.isCardsAdmin
|
|
757
|
+
approvers: {}
|
|
885
758
|
};
|
|
886
759
|
var userTags = [];
|
|
887
760
|
for (var key in payload.userTagType) {
|
|
@@ -892,6 +765,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
892
765
|
if (userTags.length) {
|
|
893
766
|
res.user_tags = userTags;
|
|
894
767
|
}
|
|
768
|
+
|
|
895
769
|
if (payload.productAccess.travel) {
|
|
896
770
|
var _payload$passportInfo, _payload$passportInfo2, _payload$passportInfo3, _payload$passportInfo4, _payload$membershipIn, _payload$uploadedFile;
|
|
897
771
|
res.approvers.travel = [];
|
|
@@ -903,12 +777,14 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
903
777
|
});
|
|
904
778
|
}
|
|
905
779
|
}
|
|
780
|
+
|
|
906
781
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
907
782
|
res.approvers.travel.push({
|
|
908
783
|
email: payload.travelFYI.value,
|
|
909
784
|
sequence: 'fyi'
|
|
910
785
|
});
|
|
911
786
|
}
|
|
787
|
+
|
|
912
788
|
res.user_travel_info = {
|
|
913
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,
|
|
914
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,
|
|
@@ -947,6 +823,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
947
823
|
res.files = [];
|
|
948
824
|
}
|
|
949
825
|
}
|
|
826
|
+
|
|
950
827
|
if (payload.productAccess.expense) {
|
|
951
828
|
res.approvers.expense = [];
|
|
952
829
|
for (var _key2 in payload.expenseApproversInput) {
|
|
@@ -957,6 +834,7 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
957
834
|
});
|
|
958
835
|
}
|
|
959
836
|
}
|
|
837
|
+
|
|
960
838
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
961
839
|
res.approvers.expense.push({
|
|
962
840
|
email: payload.expenseFYI.value,
|
|
@@ -973,20 +851,13 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
973
851
|
var res = {
|
|
974
852
|
fields: {
|
|
975
853
|
user_personal_info: {},
|
|
976
|
-
employee_info: {}
|
|
977
|
-
requested_user_is_admin: payload.isCardsAdmin
|
|
854
|
+
employee_info: {}
|
|
978
855
|
}
|
|
979
856
|
};
|
|
980
857
|
if (!env$1.isProfilePage()) {
|
|
981
858
|
res.fields.product = function () {
|
|
982
|
-
if (payload.productAccess.travel && payload.productAccess.expense
|
|
983
|
-
return 'expense+travel+card';
|
|
984
|
-
} else if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
859
|
+
if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
985
860
|
return 'expense+travel';
|
|
986
|
-
} else if (payload.productAccess.expense && payload.productAccess.card) {
|
|
987
|
-
return 'expense+card';
|
|
988
|
-
} else if (payload.productAccess.travel && payload.productAccess.card) {
|
|
989
|
-
return 'travel+card';
|
|
990
861
|
} else if (payload.productAccess.travel) {
|
|
991
862
|
return 'travel';
|
|
992
863
|
} else {
|
|
@@ -1001,11 +872,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1001
872
|
if (payload.productAccess.expense) {
|
|
1002
873
|
roles.expense = payload.expenseRole;
|
|
1003
874
|
}
|
|
1004
|
-
if (payload.productAccess.card) {
|
|
1005
|
-
var splitRole = payload.cardsRole.split(":");
|
|
1006
|
-
var cardsUsmRole = splitRole[2];
|
|
1007
|
-
roles.card = cardsUsmRole;
|
|
1008
|
-
}
|
|
1009
875
|
return roles;
|
|
1010
876
|
}();
|
|
1011
877
|
res.fields.custom_attributes = payload.customFieldsInput;
|
|
@@ -1076,6 +942,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1076
942
|
});
|
|
1077
943
|
}
|
|
1078
944
|
}
|
|
945
|
+
|
|
1079
946
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
1080
947
|
res.fields.approvers.travel.push({
|
|
1081
948
|
email: payload.travelFYI.value,
|
|
@@ -1152,6 +1019,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1152
1019
|
res.fields.user_travel_info.redress_number = payload.secureTravelInputInfo.redress_number || null;
|
|
1153
1020
|
}
|
|
1154
1021
|
}
|
|
1022
|
+
|
|
1155
1023
|
if (payload.productAccess.expense) {
|
|
1156
1024
|
if (!env$1.isProfilePage()) {
|
|
1157
1025
|
res.fields.approvers.expense = [];
|
|
@@ -1163,6 +1031,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1163
1031
|
});
|
|
1164
1032
|
}
|
|
1165
1033
|
}
|
|
1034
|
+
|
|
1166
1035
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
1167
1036
|
res.fields.approvers.expense.push({
|
|
1168
1037
|
email: payload.expenseFYI.value,
|
|
@@ -1294,19 +1163,10 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1294
1163
|
payload: tabId
|
|
1295
1164
|
};
|
|
1296
1165
|
};
|
|
1297
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1298
|
-
if (roleTransfer === void 0) {
|
|
1299
|
-
roleTransfer = false;
|
|
1300
|
-
}
|
|
1301
|
-
var _payload = {
|
|
1302
|
-
role_transfer: roleTransfer
|
|
1303
|
-
};
|
|
1304
|
-
if (roleTransfer) {
|
|
1305
|
-
_payload.new_approver_user_id = newApproverUserId;
|
|
1306
|
-
}
|
|
1166
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1307
1167
|
return function (dispatch) {
|
|
1308
1168
|
return new Promise(function (resolve, reject) {
|
|
1309
|
-
api$1.
|
|
1169
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1310
1170
|
dispatch(setUserActiveStatus({
|
|
1311
1171
|
is_active: activateVal !== 0,
|
|
1312
1172
|
id: id
|
|
@@ -1344,12 +1204,6 @@ var setRenderFields = function setRenderFields(payload) {
|
|
|
1344
1204
|
payload: payload
|
|
1345
1205
|
};
|
|
1346
1206
|
};
|
|
1347
|
-
var setCardsDetails = function setCardsDetails(payload) {
|
|
1348
|
-
return {
|
|
1349
|
-
type: SET_CARDS_DETAILS,
|
|
1350
|
-
payload: payload
|
|
1351
|
-
};
|
|
1352
|
-
};
|
|
1353
1207
|
var setCustomField = function setCustomField(payload) {
|
|
1354
1208
|
return {
|
|
1355
1209
|
type: SET_CUSTOM_FIELD,
|
|
@@ -1409,6 +1263,7 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1409
1263
|
var _res$data;
|
|
1410
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.');
|
|
1411
1265
|
dispatch(stopLoader());
|
|
1266
|
+
reject();
|
|
1412
1267
|
}
|
|
1413
1268
|
})["catch"](function (err) {
|
|
1414
1269
|
reject(err);
|
|
@@ -1421,7 +1276,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1421
1276
|
return new Promise(function (resolve, reject) {
|
|
1422
1277
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1423
1278
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1424
|
-
resolve(
|
|
1279
|
+
resolve('success');
|
|
1425
1280
|
})["catch"](function (err) {
|
|
1426
1281
|
reject(err);
|
|
1427
1282
|
})["finally"](function () {});
|
|
@@ -1580,9 +1435,11 @@ var createUser = function createUser(payload) {
|
|
|
1580
1435
|
} else {
|
|
1581
1436
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1582
1437
|
reject(res.data.errors);
|
|
1438
|
+
return;
|
|
1583
1439
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1584
1440
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1585
1441
|
}
|
|
1442
|
+
reject();
|
|
1586
1443
|
}
|
|
1587
1444
|
})["catch"](function (err) {
|
|
1588
1445
|
var _err$response6;
|
|
@@ -1628,13 +1485,17 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1628
1485
|
});
|
|
1629
1486
|
};
|
|
1630
1487
|
};
|
|
1488
|
+
|
|
1631
1489
|
var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
1632
1490
|
return new Promise(function (resolve, reject) {
|
|
1633
1491
|
var formData = new FormData();
|
|
1492
|
+
|
|
1634
1493
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
1635
1494
|
formData.append(key, presignedPostData.fields[key]);
|
|
1636
1495
|
});
|
|
1496
|
+
|
|
1637
1497
|
formData.append('file', file);
|
|
1498
|
+
|
|
1638
1499
|
axios.post(presignedPostData.url, formData, {
|
|
1639
1500
|
headers: {
|
|
1640
1501
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1679,43 +1540,20 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1679
1540
|
});
|
|
1680
1541
|
};
|
|
1681
1542
|
};
|
|
1682
|
-
var
|
|
1683
|
-
return function (dispatch) {
|
|
1684
|
-
return new Promise(function (resolve, reject) {
|
|
1685
|
-
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1686
|
-
email: data.email
|
|
1687
|
-
}).then(function (res) {
|
|
1688
|
-
IUIToastMessageService$1.sNotify("The link to reset the password has been sent to the user's email address. Check your \"junk mail\" or \"spam\" folders in case it's not received.");
|
|
1689
|
-
resolve();
|
|
1690
|
-
})["catch"](function (err) {
|
|
1691
|
-
var _err$response9, _err$response9$data;
|
|
1692
|
-
if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
|
|
1693
|
-
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1694
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : (_err$response10$data$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
|
|
1695
|
-
reject(err);
|
|
1696
|
-
return;
|
|
1697
|
-
}
|
|
1698
|
-
reject(err);
|
|
1699
|
-
});
|
|
1700
|
-
});
|
|
1701
|
-
};
|
|
1702
|
-
};
|
|
1703
|
-
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1543
|
+
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1704
1544
|
return function (dispatch) {
|
|
1705
1545
|
return new Promise(function (resolve, reject) {
|
|
1706
|
-
api$2.
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1546
|
+
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1547
|
+
dispatch(fetchUserSignupRequests({
|
|
1548
|
+
ordering: 'asc',
|
|
1549
|
+
length: 5,
|
|
1550
|
+
page: 1,
|
|
1551
|
+
search: ''
|
|
1552
|
+
}));
|
|
1710
1553
|
resolve();
|
|
1711
1554
|
})["catch"](function (err) {
|
|
1712
|
-
var _err$
|
|
1713
|
-
|
|
1714
|
-
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1715
|
-
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : (_err$response12$data$ = _err$response12$data.message) === null || _err$response12$data$ === void 0 ? void 0 : _err$response12$data$.email[0]);
|
|
1716
|
-
reject(err);
|
|
1717
|
-
return;
|
|
1718
|
-
}
|
|
1555
|
+
var _err$response8, _err$response8$data;
|
|
1556
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
|
|
1719
1557
|
reject(err);
|
|
1720
1558
|
});
|
|
1721
1559
|
});
|
|
@@ -1857,7 +1695,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1857
1695
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1858
1696
|
return function (dispatch) {
|
|
1859
1697
|
return new Promise(function (resolve, reject) {
|
|
1860
|
-
api$2.post(
|
|
1698
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1861
1699
|
resolve(res);
|
|
1862
1700
|
})["catch"](function (err) {
|
|
1863
1701
|
var _err$response17, _err$response17$data;
|
|
@@ -1893,7 +1731,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1893
1731
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1894
1732
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1895
1733
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1896
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1897
1734
|
|
|
1898
1735
|
var api$3 = configs.api;
|
|
1899
1736
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1940,17 +1777,18 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1940
1777
|
});
|
|
1941
1778
|
};
|
|
1942
1779
|
};
|
|
1780
|
+
|
|
1943
1781
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1944
1782
|
return function (dispatch) {
|
|
1945
1783
|
return new Promise(function (resolve, reject) {
|
|
1946
|
-
api$3.post(
|
|
1784
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1947
1785
|
dispatch(getUserPanalData(getParam));
|
|
1948
1786
|
dispatch(closeDialog());
|
|
1949
1787
|
resolve(res);
|
|
1950
1788
|
})["catch"](function (err) {
|
|
1951
|
-
var _err$
|
|
1789
|
+
var _err$response2, _err$response2$data;
|
|
1952
1790
|
dispatch(userPanelStopLoader());
|
|
1953
|
-
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.');
|
|
1954
1792
|
});
|
|
1955
1793
|
});
|
|
1956
1794
|
};
|
|
@@ -1964,37 +1802,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1964
1802
|
dispatch(userPanelStopLoader());
|
|
1965
1803
|
resolve();
|
|
1966
1804
|
})["catch"](function (err) {
|
|
1967
|
-
var _err$
|
|
1968
|
-
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.');
|
|
1969
1807
|
dispatch(userPanelStopLoader());
|
|
1970
1808
|
});
|
|
1971
1809
|
});
|
|
1972
1810
|
};
|
|
1973
1811
|
};
|
|
1974
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1812
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1975
1813
|
return function (dispatch) {
|
|
1976
1814
|
return new Promise(function (resolve, reject) {
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
});
|
|
1987
|
-
} else {
|
|
1988
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1989
|
-
dispatch(getUserPanalData(getParam));
|
|
1990
|
-
dispatch(closeDialog());
|
|
1991
|
-
resolve();
|
|
1992
|
-
})["catch"](function (err) {
|
|
1993
|
-
var _err$response6, _err$response6$data;
|
|
1994
|
-
dispatch(userPanelStopLoader());
|
|
1995
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1996
|
-
});
|
|
1997
|
-
}
|
|
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
|
+
});
|
|
1998
1824
|
});
|
|
1999
1825
|
};
|
|
2000
1826
|
};
|
|
@@ -2006,8 +1832,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
2006
1832
|
dispatch(closeDialog());
|
|
2007
1833
|
resolve(res);
|
|
2008
1834
|
})["catch"](function (err) {
|
|
2009
|
-
var _err$
|
|
2010
|
-
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.');
|
|
2011
1837
|
});
|
|
2012
1838
|
});
|
|
2013
1839
|
};
|
|
@@ -2327,7 +2153,7 @@ var PaymentCards = function PaymentCards(_ref3) {
|
|
|
2327
2153
|
isDefaultCard: !!+card.metadata.default_card,
|
|
2328
2154
|
pg: paymentDetails.pg
|
|
2329
2155
|
});
|
|
2330
|
-
}), (!paymentDetails.cards || paymentDetails.cards.length <
|
|
2156
|
+
}), (!paymentDetails.cards || paymentDetails.cards.length < 6) && paymentDetails.pg.gateway.toLowerCase() === 'stripe' && paymentDetails.pg.save_card_enable === 1 && /*#__PURE__*/React.createElement(AddCard, {
|
|
2331
2157
|
pg: paymentDetails.pg
|
|
2332
2158
|
}))))));
|
|
2333
2159
|
};
|
|
@@ -2495,6 +2321,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2495
2321
|
setOpenEditAproverModalFlag(false);
|
|
2496
2322
|
});
|
|
2497
2323
|
};
|
|
2324
|
+
|
|
2498
2325
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
2499
2326
|
container: true,
|
|
2500
2327
|
className: (styles.headingPadding)
|
|
@@ -2642,7 +2469,8 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2642
2469
|
headerText: "Edit approver field",
|
|
2643
2470
|
cancelLabel: "Cancel",
|
|
2644
2471
|
submitLabel: "Save",
|
|
2645
|
-
submitHandler: handleEditAproverLabel
|
|
2472
|
+
submitHandler: handleEditAproverLabel
|
|
2473
|
+
,
|
|
2646
2474
|
width: "420px",
|
|
2647
2475
|
modalBodyStyle: {
|
|
2648
2476
|
maxHeight: '600px',
|
|
@@ -3096,8 +2924,8 @@ var workInfo = [{
|
|
|
3096
2924
|
validation: {
|
|
3097
2925
|
regexOnChange: null,
|
|
3098
2926
|
regexOnBlur: [{
|
|
3099
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
3100
|
-
message: "Only alphabets, numbers
|
|
2927
|
+
regex: /^[(A-Z)(a-z)(0-9)\-& ]*$/,
|
|
2928
|
+
message: "Only alphabets, numbers and - & are allowed."
|
|
3101
2929
|
}],
|
|
3102
2930
|
maxLimit: '',
|
|
3103
2931
|
minLimit: '',
|
|
@@ -3185,8 +3013,8 @@ var workInfo = [{
|
|
|
3185
3013
|
validation: {
|
|
3186
3014
|
regexOnChange: null,
|
|
3187
3015
|
regexOnBlur: [{
|
|
3188
|
-
regex: /^[A-Za-z0-9
|
|
3189
|
-
message: "Only alphabets, numbers & special characters . & ' ( )
|
|
3016
|
+
regex: /^[A-Za-z0-9 \-.,&'()\/]*$/,
|
|
3017
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3190
3018
|
}, {
|
|
3191
3019
|
regex: /^[a-zA-Z]/,
|
|
3192
3020
|
message: 'Designation should start with alphabets'
|
|
@@ -3197,7 +3025,8 @@ var workInfo = [{
|
|
|
3197
3025
|
minLength: 0
|
|
3198
3026
|
},
|
|
3199
3027
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3200
|
-
},
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3201
3030
|
id: 9,
|
|
3202
3031
|
label: 'Base location',
|
|
3203
3032
|
name: 'base_location',
|
|
@@ -3252,12 +3081,6 @@ var products = [{
|
|
|
3252
3081
|
name: 'expense',
|
|
3253
3082
|
type: 'checkbox',
|
|
3254
3083
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3255
|
-
}, {
|
|
3256
|
-
id: 3,
|
|
3257
|
-
label: 'Card',
|
|
3258
|
-
name: 'card',
|
|
3259
|
-
type: 'checkbox',
|
|
3260
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3261
3084
|
}];
|
|
3262
3085
|
var dropdownList = {
|
|
3263
3086
|
gender: [{
|
|
@@ -3428,34 +3251,6 @@ var expenseConstants = {
|
|
|
3428
3251
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3429
3252
|
}]
|
|
3430
3253
|
};
|
|
3431
|
-
var cardsConstants = {
|
|
3432
|
-
heading: 'Card specific information',
|
|
3433
|
-
roleHeading: 'Card role',
|
|
3434
|
-
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3435
|
-
roles: [{
|
|
3436
|
-
id: 1,
|
|
3437
|
-
label: 'Card holder',
|
|
3438
|
-
description: 'Can view own cards and transactions.',
|
|
3439
|
-
value: '',
|
|
3440
|
-
name: '',
|
|
3441
|
-
type: 'radio',
|
|
3442
|
-
isAssigned: false,
|
|
3443
|
-
fullWidth: false,
|
|
3444
|
-
visibility: true,
|
|
3445
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3446
|
-
}, {
|
|
3447
|
-
id: 2,
|
|
3448
|
-
label: 'Card admin',
|
|
3449
|
-
description: 'Has full administrative access to the card program. Can issue cards, set card limits, add users, has visibility into all transactions, statements and balances.',
|
|
3450
|
-
value: '',
|
|
3451
|
-
name: '',
|
|
3452
|
-
type: 'radio',
|
|
3453
|
-
isAssigned: false,
|
|
3454
|
-
fullWidth: false,
|
|
3455
|
-
visibility: true,
|
|
3456
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3457
|
-
}]
|
|
3458
|
-
};
|
|
3459
3254
|
var passportInfo = [{
|
|
3460
3255
|
id: 1,
|
|
3461
3256
|
label: 'Passport issuing country',
|
|
@@ -3685,12 +3480,6 @@ var initialState = {
|
|
|
3685
3480
|
travelConstants: travelConstants,
|
|
3686
3481
|
expenseConstants: expenseConstants
|
|
3687
3482
|
},
|
|
3688
|
-
isCardsDetailsRendered: false,
|
|
3689
|
-
isCardsAdmin: false,
|
|
3690
|
-
cardsDetails: {
|
|
3691
|
-
cardsRoles: cardsConstants.roles,
|
|
3692
|
-
cardsConstants: cardsConstants
|
|
3693
|
-
},
|
|
3694
3483
|
dropdownList: dropdownList,
|
|
3695
3484
|
maxTravelApprovers: 10,
|
|
3696
3485
|
maxExpenseApprovers: 10,
|
|
@@ -3857,37 +3646,11 @@ var reducer = function reducer(state, action) {
|
|
|
3857
3646
|
isRendered: true
|
|
3858
3647
|
});
|
|
3859
3648
|
}
|
|
3860
|
-
case SET_CARDS_DETAILS:
|
|
3861
|
-
{
|
|
3862
|
-
var _action$payload8, _action$payload8$role, _action$payload9;
|
|
3863
|
-
var cardsDetails = _extends({}, state.cardsDetails);
|
|
3864
|
-
if (action !== null && action !== void 0 && (_action$payload8 = action.payload) !== null && _action$payload8 !== void 0 && (_action$payload8$role = _action$payload8.roles) !== null && _action$payload8$role !== void 0 && _action$payload8$role.length) {
|
|
3865
|
-
cardsDetails.cardsRoles = action.payload.roles.map(function (role) {
|
|
3866
|
-
return {
|
|
3867
|
-
id: role.id,
|
|
3868
|
-
label: role.name,
|
|
3869
|
-
description: role.description,
|
|
3870
|
-
value: role.value,
|
|
3871
|
-
isAssigned: role.is_assigned,
|
|
3872
|
-
name: role.value,
|
|
3873
|
-
type: 'radio',
|
|
3874
|
-
fullWidth: false,
|
|
3875
|
-
visibility: true,
|
|
3876
|
-
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3877
|
-
};
|
|
3878
|
-
});
|
|
3879
|
-
}
|
|
3880
|
-
return _extends({}, state, {
|
|
3881
|
-
cardsDetails: cardsDetails,
|
|
3882
|
-
isCardsDetailsRendered: true,
|
|
3883
|
-
isCardsAdmin: action === null || action === void 0 ? void 0 : (_action$payload9 = action.payload) === null || _action$payload9 === void 0 ? void 0 : _action$payload9.requested_user_is_admin
|
|
3884
|
-
});
|
|
3885
|
-
}
|
|
3886
3649
|
case SET_STATIC_FIELDS_VISIBILITY:
|
|
3887
3650
|
{
|
|
3888
3651
|
var _personalInfo = state.renderFields.personalInfo.map(function (input) {
|
|
3889
|
-
var _action$
|
|
3890
|
-
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$
|
|
3652
|
+
var _action$payload8;
|
|
3653
|
+
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$payload8 = action.payload) !== null && _action$payload8 !== void 0 && _action$payload8[input.name]) {
|
|
3891
3654
|
if (Object.hasOwnProperty.call(action.payload[input.name], 'readOnly')) {
|
|
3892
3655
|
input.readOnly = action.payload[input.name].readOnly;
|
|
3893
3656
|
}
|
|
@@ -4098,6 +3861,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
4098
3861
|
_userListInfo.results[i].is_active = action.payload.is_active;
|
|
4099
3862
|
}
|
|
4100
3863
|
});
|
|
3864
|
+
|
|
4101
3865
|
var _deactivatedUsers = _userListInfo.results.length > 0 ? _userListInfo.results.filter(function (val) {
|
|
4102
3866
|
return !val.is_active;
|
|
4103
3867
|
}).map(function (obj) {
|
|
@@ -4120,6 +3884,7 @@ var reducer$1 = function reducer(state, action) {
|
|
|
4120
3884
|
}
|
|
4121
3885
|
});
|
|
4122
3886
|
});
|
|
3887
|
+
|
|
4123
3888
|
var _deactivatedUsers2 = _userListInfo2.results.length > 0 ? _userListInfo2.results.filter(function (val) {
|
|
4124
3889
|
return !val.is_active;
|
|
4125
3890
|
}).map(function (obj) {
|
|
@@ -4173,7 +3938,6 @@ var initialState$2 = {
|
|
|
4173
3938
|
previous: null,
|
|
4174
3939
|
results: []
|
|
4175
3940
|
},
|
|
4176
|
-
deptUsers: [],
|
|
4177
3941
|
loading: false
|
|
4178
3942
|
};
|
|
4179
3943
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4243,12 +4007,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4243
4007
|
loading: false
|
|
4244
4008
|
});
|
|
4245
4009
|
}
|
|
4246
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4247
|
-
{
|
|
4248
|
-
return _extends({}, state, {
|
|
4249
|
-
deptUsers: action.payload
|
|
4250
|
-
});
|
|
4251
|
-
}
|
|
4252
4010
|
default:
|
|
4253
4011
|
return state;
|
|
4254
4012
|
}
|
|
@@ -4435,7 +4193,8 @@ var rootReducer = combineReducers({
|
|
|
4435
4193
|
customFields: reducer$5
|
|
4436
4194
|
});
|
|
4437
4195
|
|
|
4438
|
-
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4196
|
+
var store = createStore(rootReducer, composeWithDevTools(applyMiddleware(thunk)
|
|
4197
|
+
));
|
|
4439
4198
|
|
|
4440
4199
|
function withStore(Component) {
|
|
4441
4200
|
function WrappedComponent(props) {
|
|
@@ -4940,9 +4699,7 @@ var ErrorMessages = {
|
|
|
4940
4699
|
passport_expiry_date: 'Please enter passport expiry date.',
|
|
4941
4700
|
passport_photo: 'Please attach passport photo.',
|
|
4942
4701
|
travel_docs: 'Please attach travel docs.',
|
|
4943
|
-
products: 'Please select atleast one product access.'
|
|
4944
|
-
only_cards_products: 'Currently, Card cannot be selected as a standalone option. Please add at least one more product.',
|
|
4945
|
-
none_products: 'Select at least one product. If opting for card, please choose at least one additional product.'
|
|
4702
|
+
products: 'Please select atleast one product access.'
|
|
4946
4703
|
};
|
|
4947
4704
|
|
|
4948
4705
|
function AddPanelDialog(_ref) {
|
|
@@ -4980,7 +4737,8 @@ function AddPanelDialog(_ref) {
|
|
|
4980
4737
|
flexDirection: "column",
|
|
4981
4738
|
padding: "8px 20px"
|
|
4982
4739
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4983
|
-
label: name + " name"
|
|
4740
|
+
label: name + " name"
|
|
4741
|
+
,
|
|
4984
4742
|
name: "name",
|
|
4985
4743
|
defaultValue: "",
|
|
4986
4744
|
onValueChange: onValueChange,
|
|
@@ -4992,73 +4750,7 @@ function AddPanelDialog(_ref) {
|
|
|
4992
4750
|
})));
|
|
4993
4751
|
}
|
|
4994
4752
|
|
|
4995
|
-
var
|
|
4996
|
-
var cardsConstants = props.cardsConstants,
|
|
4997
|
-
_props$onRoleChange = props.onRoleChange,
|
|
4998
|
-
onRoleChange = _props$onRoleChange === void 0 ? function () {} : _props$onRoleChange,
|
|
4999
|
-
_props$roleValue = props.roleValue,
|
|
5000
|
-
roleValue = _props$roleValue === void 0 ? '' : _props$roleValue,
|
|
5001
|
-
_props$isProfile = props.isProfile,
|
|
5002
|
-
isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
|
|
5003
|
-
_props$roles = props.roles,
|
|
5004
|
-
roles = _props$roles === void 0 ? [] : _props$roles,
|
|
5005
|
-
_props$cardsAdmin = props.cardsAdmin,
|
|
5006
|
-
cardsAdmin = _props$cardsAdmin === void 0 ? false : _props$cardsAdmin,
|
|
5007
|
-
editUserId = props.editUserId,
|
|
5008
|
-
loggedInUserId = props.loggedInUserId;
|
|
5009
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5010
|
-
container: true,
|
|
5011
|
-
className: (styles.headingPadding)
|
|
5012
|
-
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
5013
|
-
variant: "h3",
|
|
5014
|
-
className: clsx(styles.heading, styles.headingMedium)
|
|
5015
|
-
}, cardsConstants.heading)), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
5016
|
-
className: styles.dividerColor
|
|
5017
|
-
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5018
|
-
container: true,
|
|
5019
|
-
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
5020
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5021
|
-
item: true,
|
|
5022
|
-
sm: 12,
|
|
5023
|
-
md: 4
|
|
5024
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
5025
|
-
label: cardsConstants.roleHeading,
|
|
5026
|
-
headerType: true,
|
|
5027
|
-
description: cardsConstants.roleDescription
|
|
5028
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5029
|
-
item: true,
|
|
5030
|
-
sm: 12,
|
|
5031
|
-
md: 8,
|
|
5032
|
-
lg: 8,
|
|
5033
|
-
xl: 6
|
|
5034
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5035
|
-
container: true,
|
|
5036
|
-
className: styles.formFieldsWrapper
|
|
5037
|
-
}, isProfile || loggedInUserId === editUserId ? /*#__PURE__*/React.createElement(UserRole, {
|
|
5038
|
-
list: roles,
|
|
5039
|
-
value: roleValue
|
|
5040
|
-
}) : /*#__PURE__*/React.createElement(IUIRadio, {
|
|
5041
|
-
list: roles,
|
|
5042
|
-
value: roleValue,
|
|
5043
|
-
onValueChange: onRoleChange,
|
|
5044
|
-
disabled: cardsAdmin ? false : true
|
|
5045
|
-
})), !cardsAdmin && !isProfile && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
5046
|
-
item: true,
|
|
5047
|
-
sm: 12,
|
|
5048
|
-
md: 12,
|
|
5049
|
-
lg: 12,
|
|
5050
|
-
style: {
|
|
5051
|
-
marginTop: "24px"
|
|
5052
|
-
}
|
|
5053
|
-
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
5054
|
-
variant: "body2",
|
|
5055
|
-
component: "span",
|
|
5056
|
-
className: styles.errorTextCls
|
|
5057
|
-
}, editUserId ? "Only Card admin can change the Card role." : "Only Card admin can change card roles. By default this user will have Card Holder role.")))));
|
|
5058
|
-
};
|
|
5059
|
-
|
|
5060
|
-
var IUIToastMessageService$4 = services.IUIToastMessageService,
|
|
5061
|
-
IUILocalStorageService$5 = services.IUILocalStorageService;
|
|
4753
|
+
var IUIToastMessageService$4 = services.IUIToastMessageService;
|
|
5062
4754
|
var env$4 = configs.env;
|
|
5063
4755
|
var UserAddEdit = function UserAddEdit(props) {
|
|
5064
4756
|
var isEditMode = props.isEditMode,
|
|
@@ -5085,10 +4777,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5085
4777
|
isRendered = _useSelector.isRendered,
|
|
5086
4778
|
maxTravelApprovers = _useSelector.maxTravelApprovers,
|
|
5087
4779
|
maxExpenseApprovers = _useSelector.maxExpenseApprovers,
|
|
5088
|
-
maxMembershipInput = _useSelector.maxMembershipInput
|
|
5089
|
-
isCardsDetailsRendered = _useSelector.isCardsDetailsRendered,
|
|
5090
|
-
isCardsAdmin = _useSelector.isCardsAdmin,
|
|
5091
|
-
cardsDetails = _useSelector.cardsDetails;
|
|
4780
|
+
maxMembershipInput = _useSelector.maxMembershipInput;
|
|
5092
4781
|
var _useSelector2 = useSelector(function (state) {
|
|
5093
4782
|
return state.common;
|
|
5094
4783
|
}),
|
|
@@ -5098,11 +4787,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5098
4787
|
isILadmin = _useSelector2.isILadmin,
|
|
5099
4788
|
companyName = _useSelector2.companyName;
|
|
5100
4789
|
var history = useHistory();
|
|
5101
|
-
var location = useLocation();
|
|
5102
4790
|
var _useState = useState({
|
|
5103
4791
|
travel: false,
|
|
5104
|
-
expense: false
|
|
5105
|
-
card: false
|
|
4792
|
+
expense: false
|
|
5106
4793
|
}),
|
|
5107
4794
|
productAccess = _useState[0],
|
|
5108
4795
|
setProductAccess = _useState[1];
|
|
@@ -5113,13 +4800,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5113
4800
|
errorMsgs.products = '';
|
|
5114
4801
|
var _productAccess = _extends({}, productAccess);
|
|
5115
4802
|
_productAccess[value] = !_productAccess[value];
|
|
5116
|
-
if (_productAccess.travel === false && _productAccess.expense === false
|
|
4803
|
+
if (_productAccess.travel === false && _productAccess.expense === false) {
|
|
5117
4804
|
var _errorArray = [].concat(errorArray);
|
|
5118
4805
|
var _errorMsgs = _extends({}, errorMsgs);
|
|
5119
4806
|
if (_errorArray.indexOf('products') === -1) {
|
|
5120
4807
|
_errorArray.push('products');
|
|
5121
4808
|
}
|
|
5122
|
-
_errorMsgs.products = ErrorMessages.
|
|
4809
|
+
_errorMsgs.products = ErrorMessages.products;
|
|
5123
4810
|
setErrorArray(_errorArray);
|
|
5124
4811
|
setErrorMsgs(_errorMsgs);
|
|
5125
4812
|
var el = document.getElementById('products');
|
|
@@ -5129,202 +4816,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5129
4816
|
block: 'center'
|
|
5130
4817
|
});
|
|
5131
4818
|
}
|
|
5132
|
-
} else if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.card === false) {
|
|
5133
|
-
var _errorArray2 = [].concat(errorArray);
|
|
5134
|
-
var _errorMsgs2 = _extends({}, errorMsgs);
|
|
5135
|
-
if (_errorArray2.indexOf('products') === -1) {
|
|
5136
|
-
_errorArray2.push('products');
|
|
5137
|
-
}
|
|
5138
|
-
_errorMsgs2.products = ErrorMessages.products;
|
|
5139
|
-
setErrorArray(_errorArray2);
|
|
5140
|
-
setErrorMsgs(_errorMsgs2);
|
|
5141
|
-
var _el = document.getElementById('products');
|
|
5142
|
-
if (_el) {
|
|
5143
|
-
_el.scrollIntoView({
|
|
5144
|
-
behavior: 'smooth',
|
|
5145
|
-
block: 'center'
|
|
5146
|
-
});
|
|
5147
|
-
}
|
|
5148
4819
|
} else {
|
|
5149
4820
|
setErrorArray(errorArray);
|
|
5150
4821
|
setErrorMsgs(errorMsgs);
|
|
5151
4822
|
}
|
|
5152
4823
|
setProductAccess(_productAccess);
|
|
5153
4824
|
};
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
setNewCountryCode = _useState2[1];
|
|
5157
|
-
var _useState3 = useState(),
|
|
5158
|
-
countryDialCode = _useState3[0],
|
|
5159
|
-
setCountryDialCode = _useState3[1];
|
|
5160
|
-
var _useState4 = useState([]),
|
|
5161
|
-
countryContactCode = _useState4[0],
|
|
5162
|
-
setCountryContactCode = _useState4[1];
|
|
5163
|
-
var updateUserApiCall = function updateUserApiCall(payload, inputChangeLog) {
|
|
5164
|
-
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5165
|
-
if (isProfile) {
|
|
5166
|
-
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5167
|
-
(config === null || config === void 0 ? void 0 : (_config$routes = config.routes) === null || _config$routes === void 0 ? void 0 : (_config$routes$profil = _config$routes.profile) === null || _config$routes$profil === void 0 ? void 0 : (_config$routes$profil2 = _config$routes$profil.redirectUrl) === null || _config$routes$profil2 === void 0 ? void 0 : _config$routes$profil2.submit) && history.push(config.routes.profile.redirectUrl.submit);
|
|
5168
|
-
} else {
|
|
5169
|
-
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5170
|
-
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
5171
|
-
}
|
|
5172
|
-
setFilesForDelete([]);
|
|
5173
|
-
setProfilePicDelete([]);
|
|
5174
|
-
})["catch"](function (err) {
|
|
5175
|
-
if (typeof err === 'object') {
|
|
5176
|
-
if (err.country_code) {
|
|
5177
|
-
err.contact_number = err.country_code;
|
|
5178
|
-
}
|
|
5179
|
-
if (err.contact_country_code) {
|
|
5180
|
-
err.contact_number = err.contact_country_code;
|
|
5181
|
-
}
|
|
5182
|
-
if (err.passport) {
|
|
5183
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5184
|
-
delete err.passport;
|
|
5185
|
-
}
|
|
5186
|
-
setErrorArray(Object.keys(err));
|
|
5187
|
-
setErrorMsgs(err);
|
|
5188
|
-
var _loop = function _loop() {
|
|
5189
|
-
if (Object.hasOwnProperty.call(err, key)) {
|
|
5190
|
-
if (err[key]) {
|
|
5191
|
-
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5192
|
-
setAdditionalInfoFlag('open');
|
|
5193
|
-
}
|
|
5194
|
-
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5195
|
-
if (el) {
|
|
5196
|
-
setTimeout(function () {
|
|
5197
|
-
el.scrollIntoView({
|
|
5198
|
-
behavior: 'smooth',
|
|
5199
|
-
block: 'center'
|
|
5200
|
-
});
|
|
5201
|
-
}, 500);
|
|
5202
|
-
return 1;
|
|
5203
|
-
}
|
|
5204
|
-
}
|
|
5205
|
-
}
|
|
5206
|
-
};
|
|
5207
|
-
for (var key in err) {
|
|
5208
|
-
if (_loop()) break;
|
|
5209
|
-
}
|
|
5210
|
-
} else if (typeof err === 'string') {
|
|
5211
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
5212
|
-
} else {
|
|
5213
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5214
|
-
}
|
|
5215
|
-
})["finally"](function () {
|
|
5216
|
-
dispatch(stopLoader());
|
|
5217
|
-
});
|
|
5218
|
-
};
|
|
5219
|
-
var createUserApiCall = function createUserApiCall(payload) {
|
|
5220
|
-
dispatch(createUser(payload)).then(function (res) {
|
|
5221
|
-
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5222
|
-
if (config !== null && config !== void 0 && (_config$routes3 = config.routes) !== null && _config$routes3 !== void 0 && (_config$routes3$users = _config$routes3.users) !== null && _config$routes3$users !== void 0 && (_config$routes3$users2 = _config$routes3$users.list) !== null && _config$routes3$users2 !== void 0 && _config$routes3$users2.path) {
|
|
5223
|
-
history.push({
|
|
5224
|
-
pathname: config.routes.users.list.path
|
|
5225
|
-
});
|
|
5226
|
-
}
|
|
5227
|
-
})["catch"](function (err) {
|
|
5228
|
-
if (typeof err === 'object') {
|
|
5229
|
-
if (err.country_code) {
|
|
5230
|
-
err.contact_number = err.country_code;
|
|
5231
|
-
}
|
|
5232
|
-
if (err.contact_country_code) {
|
|
5233
|
-
err.contact_number = err.contact_country_code;
|
|
5234
|
-
}
|
|
5235
|
-
if (err.passport) {
|
|
5236
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5237
|
-
delete err.passport;
|
|
5238
|
-
}
|
|
5239
|
-
setErrorArray(Object.keys(err));
|
|
5240
|
-
setErrorMsgs(err);
|
|
5241
|
-
var _loop2 = function _loop2() {
|
|
5242
|
-
if (Object.hasOwnProperty.call(err, key)) {
|
|
5243
|
-
if (err[key]) {
|
|
5244
|
-
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5245
|
-
setAdditionalInfoFlag('open');
|
|
5246
|
-
}
|
|
5247
|
-
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5248
|
-
if (el) {
|
|
5249
|
-
setTimeout(function () {
|
|
5250
|
-
el.scrollIntoView({
|
|
5251
|
-
behavior: 'smooth',
|
|
5252
|
-
block: 'center'
|
|
5253
|
-
});
|
|
5254
|
-
}, 500);
|
|
5255
|
-
return 1;
|
|
5256
|
-
}
|
|
5257
|
-
}
|
|
5258
|
-
}
|
|
5259
|
-
};
|
|
5260
|
-
for (var key in err) {
|
|
5261
|
-
if (_loop2()) break;
|
|
5262
|
-
}
|
|
5263
|
-
} else if (typeof err === 'string') {
|
|
5264
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
5265
|
-
} else {
|
|
5266
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5267
|
-
}
|
|
5268
|
-
})["finally"](function () {
|
|
5269
|
-
dispatch(stopLoader());
|
|
5270
|
-
});
|
|
5271
|
-
};
|
|
5272
|
-
var fetchEditUserCardsDetails = function fetchEditUserCardsDetails(editUserId) {
|
|
5273
|
-
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
5274
|
-
method: 'GET',
|
|
5275
|
-
headers: {
|
|
5276
|
-
'Content-Type': 'application/json',
|
|
5277
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5278
|
-
}
|
|
5279
|
-
}).then(function (response) {
|
|
5280
|
-
return response.json();
|
|
5281
|
-
}).then(function (res) {
|
|
5282
|
-
var _res$roles;
|
|
5283
|
-
if (res !== null && res !== void 0 && (_res$roles = res.roles) !== null && _res$roles !== void 0 && _res$roles.length) {
|
|
5284
|
-
dispatch(setCardsDetails(res));
|
|
5285
|
-
} else {
|
|
5286
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5287
|
-
}
|
|
5288
|
-
})["catch"](function (error) {
|
|
5289
|
-
console.log("errorrr", error);
|
|
5290
|
-
});
|
|
5291
|
-
};
|
|
5292
|
-
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
5293
|
-
fetch(userAddEditUrl.cardsAddUsersDetails(), {
|
|
5294
|
-
method: 'GET',
|
|
5295
|
-
headers: {
|
|
5296
|
-
'Content-Type': 'application/json',
|
|
5297
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5298
|
-
}
|
|
5299
|
-
}).then(function (response) {
|
|
5300
|
-
return response.json();
|
|
5301
|
-
}).then(function (res) {
|
|
5302
|
-
var _res$roles2;
|
|
5303
|
-
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
5304
|
-
dispatch(setCardsDetails(res));
|
|
5305
|
-
} else {
|
|
5306
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5307
|
-
}
|
|
5308
|
-
})["catch"](function (error) {
|
|
5309
|
-
console.log("errorrr", error);
|
|
5310
|
-
});
|
|
5311
|
-
};
|
|
5312
|
-
useEffect(function () {
|
|
5313
|
-
var countryObject = countryContactCode.find(function (t) {
|
|
5314
|
-
return t.dial_code === countryDialCode;
|
|
5315
|
-
});
|
|
5316
|
-
if (countryObject) {
|
|
5317
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5318
|
-
country_code: countryObject.code
|
|
5319
|
-
}));
|
|
5320
|
-
}
|
|
5321
|
-
}, [countryDialCode]);
|
|
5322
|
-
useEffect(function () {
|
|
5323
|
-
var extractedNumber = newCountryCode.substring(1);
|
|
5324
|
-
var convertedNumber = parseInt(extractedNumber);
|
|
5325
|
-
setCountryDialCode(convertedNumber);
|
|
5326
|
-
}, [newCountryCode]);
|
|
5327
|
-
var _useState5 = useState({
|
|
4825
|
+
|
|
4826
|
+
var _useState2 = useState({
|
|
5328
4827
|
first_name: '',
|
|
5329
4828
|
last_name: '',
|
|
5330
4829
|
email: '',
|
|
@@ -5335,9 +4834,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5335
4834
|
contact_country_code: '',
|
|
5336
4835
|
profile_pic: []
|
|
5337
4836
|
}),
|
|
5338
|
-
personalInfoInput =
|
|
5339
|
-
setPersonalInfoInput =
|
|
5340
|
-
var
|
|
4837
|
+
personalInfoInput = _useState2[0],
|
|
4838
|
+
setPersonalInfoInput = _useState2[1];
|
|
4839
|
+
var _useState3 = useState({
|
|
5341
4840
|
emp_level: {
|
|
5342
4841
|
value: '',
|
|
5343
4842
|
label: 'Select employee level'
|
|
@@ -5357,72 +4856,62 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5357
4856
|
},
|
|
5358
4857
|
designation: '',
|
|
5359
4858
|
base_location: '',
|
|
5360
|
-
manager_id: {
|
|
5361
|
-
value: '',
|
|
5362
|
-
label: 'Select Manager'
|
|
5363
|
-
},
|
|
5364
|
-
skip_manager_id: {
|
|
5365
|
-
value: '',
|
|
5366
|
-
label: 'Select Manager'
|
|
5367
|
-
},
|
|
5368
4859
|
currency: {
|
|
5369
4860
|
value: defaultCurrency,
|
|
5370
4861
|
label: defaultCurrency
|
|
5371
4862
|
}
|
|
5372
4863
|
}),
|
|
5373
|
-
employeeInfoInput =
|
|
5374
|
-
setEmployeeInfoInput =
|
|
5375
|
-
var
|
|
4864
|
+
employeeInfoInput = _useState3[0],
|
|
4865
|
+
setEmployeeInfoInput = _useState3[1];
|
|
4866
|
+
var _useState4 = useState({
|
|
5376
4867
|
emp_level: 0,
|
|
5377
4868
|
entity: 0,
|
|
5378
4869
|
business_unit: 0,
|
|
5379
4870
|
department: 0,
|
|
5380
|
-
currency: 0
|
|
5381
|
-
manager_id: 0,
|
|
5382
|
-
skip_manager_id: 0
|
|
4871
|
+
currency: 0
|
|
5383
4872
|
}),
|
|
5384
|
-
cacheForAsyncDropdown =
|
|
5385
|
-
clearCacheForAsyncDropdown =
|
|
5386
|
-
var
|
|
5387
|
-
userTagType =
|
|
5388
|
-
setUserTagType =
|
|
5389
|
-
var
|
|
5390
|
-
scroll =
|
|
5391
|
-
setScroll =
|
|
5392
|
-
var
|
|
5393
|
-
customFieldsInput =
|
|
5394
|
-
setCustomFieldsInput =
|
|
5395
|
-
var
|
|
5396
|
-
travelRole =
|
|
5397
|
-
setTravelRole =
|
|
5398
|
-
var
|
|
5399
|
-
travelApproversInput =
|
|
5400
|
-
setTravelApproversInput =
|
|
5401
|
-
var
|
|
4873
|
+
cacheForAsyncDropdown = _useState4[0],
|
|
4874
|
+
clearCacheForAsyncDropdown = _useState4[1];
|
|
4875
|
+
var _useState5 = useState({}),
|
|
4876
|
+
userTagType = _useState5[0],
|
|
4877
|
+
setUserTagType = _useState5[1];
|
|
4878
|
+
var _useState6 = useState(false),
|
|
4879
|
+
scroll = _useState6[0],
|
|
4880
|
+
setScroll = _useState6[1];
|
|
4881
|
+
var _useState7 = useState({}),
|
|
4882
|
+
customFieldsInput = _useState7[0],
|
|
4883
|
+
setCustomFieldsInput = _useState7[1];
|
|
4884
|
+
var _useState8 = useState('traveler'),
|
|
4885
|
+
travelRole = _useState8[0],
|
|
4886
|
+
setTravelRole = _useState8[1];
|
|
4887
|
+
var _useState9 = useState({}),
|
|
4888
|
+
travelApproversInput = _useState9[0],
|
|
4889
|
+
setTravelApproversInput = _useState9[1];
|
|
4890
|
+
var _useState10 = useState({
|
|
5402
4891
|
value: '',
|
|
5403
4892
|
label: 'Select approver'
|
|
5404
4893
|
}),
|
|
5405
|
-
travelFYI =
|
|
5406
|
-
setTravelFYI =
|
|
5407
|
-
var
|
|
5408
|
-
membershipInfoInput =
|
|
5409
|
-
setMembershipInfoInput =
|
|
5410
|
-
var
|
|
5411
|
-
removedMembershipInfoInput =
|
|
5412
|
-
setRemovedMembershipInfoInput =
|
|
5413
|
-
var
|
|
4894
|
+
travelFYI = _useState10[0],
|
|
4895
|
+
setTravelFYI = _useState10[1];
|
|
4896
|
+
var _useState11 = useState([]),
|
|
4897
|
+
membershipInfoInput = _useState11[0],
|
|
4898
|
+
setMembershipInfoInput = _useState11[1];
|
|
4899
|
+
var _useState12 = useState([]),
|
|
4900
|
+
removedMembershipInfoInput = _useState12[0],
|
|
4901
|
+
setRemovedMembershipInfoInput = _useState12[1];
|
|
4902
|
+
var _useState13 = useState({
|
|
5414
4903
|
flight_seat_preference: '',
|
|
5415
4904
|
meal_preference: ''
|
|
5416
4905
|
}),
|
|
5417
|
-
travelPreferenceInfo =
|
|
5418
|
-
settravelPreferenceInfo =
|
|
5419
|
-
var
|
|
4906
|
+
travelPreferenceInfo = _useState13[0],
|
|
4907
|
+
settravelPreferenceInfo = _useState13[1];
|
|
4908
|
+
var _useState14 = useState({
|
|
5420
4909
|
trusted_traveller: '',
|
|
5421
4910
|
redress_number: ''
|
|
5422
4911
|
}),
|
|
5423
|
-
secureTravelInputInfo =
|
|
5424
|
-
setSecureTravelInputInfo =
|
|
5425
|
-
var
|
|
4912
|
+
secureTravelInputInfo = _useState14[0],
|
|
4913
|
+
setSecureTravelInputInfo = _useState14[1];
|
|
4914
|
+
var _useState15 = useState({
|
|
5426
4915
|
passport_issue_country: {
|
|
5427
4916
|
value: '',
|
|
5428
4917
|
label: 'Select country'
|
|
@@ -5437,76 +4926,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5437
4926
|
passport_photo: [],
|
|
5438
4927
|
travel_docs: []
|
|
5439
4928
|
}),
|
|
5440
|
-
passportInfoInput =
|
|
5441
|
-
setPassportInfoInput =
|
|
5442
|
-
var
|
|
5443
|
-
filesForDelete =
|
|
5444
|
-
setFilesForDelete =
|
|
5445
|
-
var
|
|
5446
|
-
profilePicDelete =
|
|
5447
|
-
setProfilePicDelete =
|
|
5448
|
-
var
|
|
5449
|
-
isAdditionalInfoExpanded =
|
|
5450
|
-
setAdditionalInfoFlag =
|
|
5451
|
-
var
|
|
5452
|
-
expenseRole =
|
|
5453
|
-
setExpenseRole =
|
|
5454
|
-
var
|
|
5455
|
-
expenseApproversInput =
|
|
5456
|
-
setExpenseApproversInput =
|
|
5457
|
-
var
|
|
4929
|
+
passportInfoInput = _useState15[0],
|
|
4930
|
+
setPassportInfoInput = _useState15[1];
|
|
4931
|
+
var _useState16 = useState([]),
|
|
4932
|
+
filesForDelete = _useState16[0],
|
|
4933
|
+
setFilesForDelete = _useState16[1];
|
|
4934
|
+
var _useState17 = useState([]),
|
|
4935
|
+
profilePicDelete = _useState17[0],
|
|
4936
|
+
setProfilePicDelete = _useState17[1];
|
|
4937
|
+
var _useState18 = useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
4938
|
+
isAdditionalInfoExpanded = _useState18[0],
|
|
4939
|
+
setAdditionalInfoFlag = _useState18[1];
|
|
4940
|
+
var _useState19 = useState('submitter'),
|
|
4941
|
+
expenseRole = _useState19[0],
|
|
4942
|
+
setExpenseRole = _useState19[1];
|
|
4943
|
+
var _useState20 = useState({}),
|
|
4944
|
+
expenseApproversInput = _useState20[0],
|
|
4945
|
+
setExpenseApproversInput = _useState20[1];
|
|
4946
|
+
var _useState21 = useState({
|
|
5458
4947
|
value: '',
|
|
5459
4948
|
label: 'Select approver'
|
|
5460
4949
|
}),
|
|
5461
|
-
expenseFYI =
|
|
5462
|
-
setExpenseFYI =
|
|
5463
|
-
var _useState25 = useState(''),
|
|
5464
|
-
cardsRole = _useState25[0],
|
|
5465
|
-
setCardsRole = _useState25[1];
|
|
5466
|
-
useEffect(function () {
|
|
5467
|
-
if (productAccess.card === false) {
|
|
5468
|
-
setCardsRole('');
|
|
5469
|
-
}
|
|
5470
|
-
}, [productAccess.card]);
|
|
5471
|
-
useEffect(function () {
|
|
5472
|
-
if (isCardsDetailsRendered && !isProfile && productAccess.card) {
|
|
5473
|
-
var selectedRole = cardsDetails.cardsRoles.find(function (role) {
|
|
5474
|
-
return role.isAssigned;
|
|
5475
|
-
});
|
|
5476
|
-
if (selectedRole) {
|
|
5477
|
-
setCardsRole(selectedRole.value);
|
|
5478
|
-
} else {
|
|
5479
|
-
var defaultRole = cardsDetails.cardsRoles.find(function (role) {
|
|
5480
|
-
var splitRoleVal = role.value.split(':');
|
|
5481
|
-
return splitRoleVal[2] === 'card-holder';
|
|
5482
|
-
});
|
|
5483
|
-
if (defaultRole) {
|
|
5484
|
-
setCardsRole(defaultRole.value);
|
|
5485
|
-
}
|
|
5486
|
-
}
|
|
5487
|
-
} else if (isCardsDetailsRendered && isProfile && productAccess.card) {
|
|
5488
|
-
var targetRole = isCardsAdmin ? 'card-admin' : 'card-holder';
|
|
5489
|
-
for (var _iterator = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step; !(_step = _iterator()).done;) {
|
|
5490
|
-
var role = _step.value;
|
|
5491
|
-
var splitRoleVal = role.value.split(':');
|
|
5492
|
-
var profileRole = splitRoleVal[2];
|
|
5493
|
-
if (profileRole === targetRole) {
|
|
5494
|
-
setCardsRole(role.value);
|
|
5495
|
-
break;
|
|
5496
|
-
}
|
|
5497
|
-
}
|
|
5498
|
-
}
|
|
5499
|
-
}, [isCardsDetailsRendered, cardsDetails, isProfile, productAccess.card, isCardsAdmin]);
|
|
4950
|
+
expenseFYI = _useState21[0],
|
|
4951
|
+
setExpenseFYI = _useState21[1];
|
|
5500
4952
|
var asyncSelectRefs = useRef({
|
|
5501
4953
|
emp_level: useRef(null),
|
|
5502
4954
|
entity: useRef(null),
|
|
5503
4955
|
business_unit: useRef(null),
|
|
5504
4956
|
department: useRef(null)
|
|
5505
4957
|
});
|
|
5506
|
-
var
|
|
5507
|
-
errorArray =
|
|
5508
|
-
setErrorArray =
|
|
5509
|
-
var
|
|
4958
|
+
var _useState22 = useState([]),
|
|
4959
|
+
errorArray = _useState22[0],
|
|
4960
|
+
setErrorArray = _useState22[1];
|
|
4961
|
+
var _useState23 = useState({
|
|
5510
4962
|
first_name: '',
|
|
5511
4963
|
last_name: '',
|
|
5512
4964
|
email: '',
|
|
@@ -5536,9 +4988,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5536
4988
|
userTagType: '',
|
|
5537
4989
|
profile_pic: ''
|
|
5538
4990
|
}),
|
|
5539
|
-
errorMsgs =
|
|
5540
|
-
setErrorMsgs =
|
|
5541
|
-
var
|
|
4991
|
+
errorMsgs = _useState23[0],
|
|
4992
|
+
setErrorMsgs = _useState23[1];
|
|
4993
|
+
var _useState24 = useState({
|
|
5542
4994
|
first_name: false,
|
|
5543
4995
|
last_name: false,
|
|
5544
4996
|
email: false,
|
|
@@ -5565,14 +5017,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5565
5017
|
userTagType: false,
|
|
5566
5018
|
profile_pic: false
|
|
5567
5019
|
}),
|
|
5568
|
-
inputChangeLog =
|
|
5569
|
-
updateInputChangeLog =
|
|
5570
|
-
var
|
|
5571
|
-
uploadedFiles =
|
|
5572
|
-
setUploadedFiles =
|
|
5573
|
-
var _useState30 = useState(70),
|
|
5574
|
-
maxLengthForModal = _useState30[0],
|
|
5575
|
-
setMaxLengthForModal = _useState30[1];
|
|
5020
|
+
inputChangeLog = _useState24[0],
|
|
5021
|
+
updateInputChangeLog = _useState24[1];
|
|
5022
|
+
var _useState25 = useState([]),
|
|
5023
|
+
uploadedFiles = _useState25[0],
|
|
5024
|
+
setUploadedFiles = _useState25[1];
|
|
5576
5025
|
var defaultAddModalData = {
|
|
5577
5026
|
isOpen: false,
|
|
5578
5027
|
isError: false,
|
|
@@ -5585,41 +5034,25 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5585
5034
|
regexOnBlur: null,
|
|
5586
5035
|
maxLimit: '',
|
|
5587
5036
|
minLimit: '',
|
|
5588
|
-
maxLength:
|
|
5037
|
+
maxLength: 70,
|
|
5589
5038
|
minLength: 0
|
|
5590
5039
|
};
|
|
5591
|
-
var
|
|
5592
|
-
addModalData =
|
|
5593
|
-
setAddModalData =
|
|
5040
|
+
var _useState26 = useState(defaultAddModalData),
|
|
5041
|
+
addModalData = _useState26[0],
|
|
5042
|
+
setAddModalData = _useState26[1];
|
|
5594
5043
|
var onAddModalClose = function onAddModalClose() {
|
|
5595
5044
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5596
5045
|
};
|
|
5597
|
-
useEffect(function () {
|
|
5598
|
-
var _location$state, _location$state2;
|
|
5599
|
-
if (location !== null && location !== void 0 && (_location$state = location.state) !== null && _location$state !== void 0 && _location$state.id && location !== null && location !== void 0 && (_location$state2 = location.state) !== null && _location$state2 !== void 0 && _location$state2.name) {
|
|
5600
|
-
var _location$state3, _location$state4;
|
|
5601
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5602
|
-
department: {
|
|
5603
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5604
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5605
|
-
}
|
|
5606
|
-
}));
|
|
5607
|
-
}
|
|
5608
|
-
}, []);
|
|
5609
5046
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5610
5047
|
var title = '';
|
|
5611
5048
|
if (id === 'entity') {
|
|
5612
5049
|
title = 'Entity';
|
|
5613
|
-
setMaxLengthForModal(70);
|
|
5614
5050
|
} else if (id === 'department') {
|
|
5615
5051
|
title = 'Department';
|
|
5616
|
-
setMaxLengthForModal(70);
|
|
5617
5052
|
} else if (id === 'business_unit') {
|
|
5618
|
-
setMaxLengthForModal(150);
|
|
5619
5053
|
title = 'Business unit';
|
|
5620
5054
|
} else if (id === 'employee_level') {
|
|
5621
5055
|
title = 'Employee level';
|
|
5622
|
-
setMaxLengthForModal(70);
|
|
5623
5056
|
}
|
|
5624
5057
|
setAddModalData(_extends({}, addModalData, {
|
|
5625
5058
|
isOpen: true,
|
|
@@ -5635,42 +5068,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5635
5068
|
}));
|
|
5636
5069
|
} else {
|
|
5637
5070
|
dispatch(showLoader());
|
|
5638
|
-
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
department_head_id: null
|
|
5643
|
-
};
|
|
5644
|
-
} else {
|
|
5645
|
-
dataObj = {
|
|
5646
|
-
names: [validatedValue]
|
|
5647
|
-
};
|
|
5648
|
-
}
|
|
5649
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5650
|
-
var _extends4;
|
|
5071
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5072
|
+
names: [validatedValue]
|
|
5073
|
+
})).then(function (res) {
|
|
5074
|
+
var _extends2;
|
|
5651
5075
|
setAddModalData(_extends({}, addModalData, {
|
|
5652
5076
|
isOpen: false
|
|
5653
5077
|
}));
|
|
5654
5078
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5655
5079
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
label: res.data.result.name
|
|
5661
|
-
}, _extends2)));
|
|
5662
|
-
} else {
|
|
5663
|
-
var _extends3;
|
|
5664
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5665
|
-
value: res.data.value,
|
|
5666
|
-
label: res.data.label
|
|
5667
|
-
}, _extends3)));
|
|
5668
|
-
}
|
|
5669
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5080
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5081
|
+
value: res.data.value,
|
|
5082
|
+
label: res.data.label
|
|
5083
|
+
}, _extends2)));
|
|
5670
5084
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5671
5085
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5672
|
-
var
|
|
5673
|
-
return _extends({}, prevState, (
|
|
5086
|
+
var _extends3;
|
|
5087
|
+
return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
|
|
5674
5088
|
});
|
|
5675
5089
|
dispatch(stopLoader());
|
|
5676
5090
|
});
|
|
@@ -5687,10 +5101,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5687
5101
|
};
|
|
5688
5102
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5689
5103
|
try {
|
|
5690
|
-
var
|
|
5104
|
+
var _temp6 = function _temp6() {
|
|
5691
5105
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5692
|
-
var
|
|
5693
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5106
|
+
var _extends4;
|
|
5107
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[_name] = true, _extends4)));
|
|
5694
5108
|
}
|
|
5695
5109
|
};
|
|
5696
5110
|
var _name = args._name,
|
|
@@ -5701,7 +5115,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5701
5115
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5702
5116
|
_args$_obj = args._obj,
|
|
5703
5117
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5704
|
-
var
|
|
5118
|
+
var _temp7 = function () {
|
|
5705
5119
|
if (_name === 'contact_number') {
|
|
5706
5120
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5707
5121
|
contact_number: _value.trim(),
|
|
@@ -5712,14 +5126,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5712
5126
|
updateError('country_code', _isError, _errorMsg);
|
|
5713
5127
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5714
5128
|
} else {
|
|
5715
|
-
var
|
|
5716
|
-
var
|
|
5717
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5129
|
+
var _temp8 = function _temp8() {
|
|
5130
|
+
var _extends5;
|
|
5131
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends5 = {}, _extends5[_name] = _value, _extends5)));
|
|
5718
5132
|
updateError(_name, _isError, _errorMsg);
|
|
5719
5133
|
};
|
|
5720
|
-
var
|
|
5134
|
+
var _temp9 = function () {
|
|
5721
5135
|
if (_name === 'profile_pic') {
|
|
5722
|
-
var
|
|
5136
|
+
var _temp10 = function () {
|
|
5723
5137
|
if (_obj.isUpload) {
|
|
5724
5138
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5725
5139
|
_value = _value.map(function (_val) {
|
|
@@ -5750,28 +5164,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5750
5164
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5751
5165
|
}
|
|
5752
5166
|
}();
|
|
5753
|
-
if (
|
|
5167
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5754
5168
|
}
|
|
5755
5169
|
}();
|
|
5756
|
-
return
|
|
5170
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5757
5171
|
}
|
|
5758
5172
|
}();
|
|
5759
|
-
return Promise.resolve(
|
|
5173
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5760
5174
|
} catch (e) {
|
|
5761
5175
|
return Promise.reject(e);
|
|
5762
5176
|
}
|
|
5763
5177
|
};
|
|
5764
5178
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5765
|
-
var
|
|
5179
|
+
var _extends6;
|
|
5766
5180
|
var _name = args._name,
|
|
5767
5181
|
_value = args._value,
|
|
5768
5182
|
_isError = args._isError,
|
|
5769
5183
|
_errorMsg = args._errorMsg;
|
|
5770
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5184
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5771
5185
|
updateError(_name, _isError, _errorMsg);
|
|
5772
5186
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5773
|
-
var
|
|
5774
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5187
|
+
var _extends7;
|
|
5188
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends7 = {}, _extends7[_name] = true, _extends7)));
|
|
5775
5189
|
}
|
|
5776
5190
|
};
|
|
5777
5191
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5781,9 +5195,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5781
5195
|
return tag.id;
|
|
5782
5196
|
};
|
|
5783
5197
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5784
|
-
var
|
|
5198
|
+
var _extends8;
|
|
5785
5199
|
var e = args._event;
|
|
5786
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5200
|
+
setUserTagType(_extends({}, userTagType, (_extends8 = {}, _extends8[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends8)));
|
|
5787
5201
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5788
5202
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5789
5203
|
userTagType: true
|
|
@@ -5791,22 +5205,22 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5791
5205
|
}
|
|
5792
5206
|
};
|
|
5793
5207
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5794
|
-
var
|
|
5208
|
+
var _extends9;
|
|
5795
5209
|
var _name = _ref2._name,
|
|
5796
5210
|
_value = _ref2._value;
|
|
5797
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5211
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends9 = {}, _extends9[_name] = _value, _extends9)));
|
|
5798
5212
|
};
|
|
5799
5213
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5800
|
-
var
|
|
5214
|
+
var _extends10;
|
|
5801
5215
|
var _name = _ref3._name,
|
|
5802
5216
|
_value = _ref3._value;
|
|
5803
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (
|
|
5217
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5804
5218
|
};
|
|
5805
5219
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5806
|
-
var
|
|
5220
|
+
var _extends11;
|
|
5807
5221
|
var _name = _ref4._name,
|
|
5808
5222
|
_value = _ref4._value;
|
|
5809
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5223
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5810
5224
|
};
|
|
5811
5225
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5812
5226
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5840,39 +5254,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5840
5254
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5841
5255
|
};
|
|
5842
5256
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5843
|
-
var
|
|
5257
|
+
var _extends12;
|
|
5844
5258
|
var _name = args._name,
|
|
5845
5259
|
_value = args._value,
|
|
5846
5260
|
_isError = args._isError,
|
|
5847
5261
|
_errorMsg = args._errorMsg;
|
|
5848
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5262
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5849
5263
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5850
|
-
var
|
|
5851
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5264
|
+
var _extends13;
|
|
5265
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends13 = {}, _extends13[_name] = true, _extends13)));
|
|
5852
5266
|
}
|
|
5853
5267
|
updateError(_name, _isError, _errorMsg);
|
|
5854
5268
|
};
|
|
5855
5269
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5856
|
-
var
|
|
5270
|
+
var _extends14;
|
|
5857
5271
|
var _name = args._name,
|
|
5858
5272
|
_value = args._value,
|
|
5859
5273
|
_isError = args._isError,
|
|
5860
5274
|
_errorMsg = args._errorMsg;
|
|
5861
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5275
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5862
5276
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5863
|
-
var
|
|
5864
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5277
|
+
var _extends15;
|
|
5278
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5865
5279
|
}
|
|
5866
5280
|
updateError(_name, _isError, _errorMsg);
|
|
5867
5281
|
};
|
|
5868
5282
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5869
5283
|
try {
|
|
5870
|
-
var
|
|
5871
|
-
var
|
|
5872
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5284
|
+
var _temp14 = function _temp14() {
|
|
5285
|
+
var _extends16;
|
|
5286
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5873
5287
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5874
|
-
var
|
|
5875
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5288
|
+
var _extends17;
|
|
5289
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5876
5290
|
}
|
|
5877
5291
|
updateError(_name, _isError, _errorMsg);
|
|
5878
5292
|
};
|
|
@@ -5910,9 +5324,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5910
5324
|
}
|
|
5911
5325
|
return Promise.resolve();
|
|
5912
5326
|
}
|
|
5913
|
-
var
|
|
5327
|
+
var _temp15 = function () {
|
|
5914
5328
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5915
|
-
var
|
|
5329
|
+
var _temp16 = function () {
|
|
5916
5330
|
if (_obj.isUpload) {
|
|
5917
5331
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5918
5332
|
if (_name === 'passport_photo') {
|
|
@@ -5956,10 +5370,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5956
5370
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5957
5371
|
}
|
|
5958
5372
|
}();
|
|
5959
|
-
if (
|
|
5373
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5960
5374
|
}
|
|
5961
5375
|
}();
|
|
5962
|
-
return Promise.resolve(
|
|
5376
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5963
5377
|
} catch (e) {
|
|
5964
5378
|
return Promise.reject(e);
|
|
5965
5379
|
}
|
|
@@ -5978,8 +5392,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5978
5392
|
return _errorArray;
|
|
5979
5393
|
});
|
|
5980
5394
|
setErrorMsgs(function (prevState) {
|
|
5981
|
-
var
|
|
5982
|
-
return _extends({}, prevState, (
|
|
5395
|
+
var _extends18;
|
|
5396
|
+
return _extends({}, prevState, (_extends18 = {}, _extends18[_name] = _errorMsg, _extends18));
|
|
5983
5397
|
});
|
|
5984
5398
|
};
|
|
5985
5399
|
var dispatch = useDispatch();
|
|
@@ -6001,11 +5415,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6001
5415
|
}, [isTokenVerified]);
|
|
6002
5416
|
useEffect(function () {
|
|
6003
5417
|
if (isRendered === true) {
|
|
6004
|
-
renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
|
|
6005
|
-
if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
|
|
6006
|
-
editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
|
|
6007
|
-
}
|
|
6008
|
-
});
|
|
6009
5418
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
6010
5419
|
country_code: countryCode
|
|
6011
5420
|
}));
|
|
@@ -6016,7 +5425,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6016
5425
|
}
|
|
6017
5426
|
}));
|
|
6018
5427
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
6019
|
-
setCountryContactCode(_res);
|
|
6020
5428
|
if (isEditMode) {
|
|
6021
5429
|
if (!isProfile && !editUserId) return false;
|
|
6022
5430
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -6059,20 +5467,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6059
5467
|
value: '',
|
|
6060
5468
|
label: 'Select employee level'
|
|
6061
5469
|
},
|
|
6062
|
-
manager_id: res.employee_info.manager ? {
|
|
6063
|
-
value: res.employee_info.manager,
|
|
6064
|
-
label: res.employee_info.manager
|
|
6065
|
-
} : {
|
|
6066
|
-
value: '',
|
|
6067
|
-
label: 'Select Manager'
|
|
6068
|
-
},
|
|
6069
|
-
skip_manager_id: res.employee_info.skip_manager ? {
|
|
6070
|
-
value: res.employee_info.skip_manager,
|
|
6071
|
-
label: res.employee_info.skip_manager
|
|
6072
|
-
} : {
|
|
6073
|
-
value: '',
|
|
6074
|
-
label: 'Select Manager'
|
|
6075
|
-
},
|
|
6076
5470
|
employee_id: res.employee_info.employee_id || '',
|
|
6077
5471
|
entity: res.employee_info.entity ? {
|
|
6078
5472
|
value: res.employee_info.entity.id,
|
|
@@ -6127,8 +5521,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6127
5521
|
var products = res.user_product.split('+');
|
|
6128
5522
|
setProductAccess({
|
|
6129
5523
|
travel: products.includes('travel'),
|
|
6130
|
-
expense: products.includes('expense')
|
|
6131
|
-
card: products.includes('card')
|
|
5524
|
+
expense: products.includes('expense')
|
|
6132
5525
|
});
|
|
6133
5526
|
if (products.includes('travel')) {
|
|
6134
5527
|
var _res$travel_info, _res$travel_info2, _res$travel_info3, _res$travel_info4, _res$travel_info5, _res$travel_info6;
|
|
@@ -6259,6 +5652,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6259
5652
|
required: true
|
|
6260
5653
|
}
|
|
6261
5654
|
}));
|
|
5655
|
+
|
|
6262
5656
|
var _productAccess = _extends({}, productAccess);
|
|
6263
5657
|
renderFields.products.forEach(function (product) {
|
|
6264
5658
|
_productAccess[product.name] = true;
|
|
@@ -6306,7 +5700,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6306
5700
|
}, [renderFields.expenseApprovers]);
|
|
6307
5701
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
6308
5702
|
try {
|
|
6309
|
-
var
|
|
5703
|
+
var _temp19 = function _temp19() {
|
|
6310
5704
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
6311
5705
|
dispatch(stopLoader());
|
|
6312
5706
|
return data;
|
|
@@ -6322,12 +5716,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6322
5716
|
userID: editUserId
|
|
6323
5717
|
});
|
|
6324
5718
|
});
|
|
6325
|
-
var
|
|
5719
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
6326
5720
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
6327
5721
|
data.push(res);
|
|
6328
5722
|
});
|
|
6329
5723
|
});
|
|
6330
|
-
return Promise.resolve(
|
|
5724
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
6331
5725
|
} catch (e) {
|
|
6332
5726
|
return Promise.reject(e);
|
|
6333
5727
|
}
|
|
@@ -6339,15 +5733,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6339
5733
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
6340
5734
|
return Promise.resolve();
|
|
6341
5735
|
}
|
|
6342
|
-
if (employeeInfoInput.manager_id.value !== '') {
|
|
6343
|
-
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
6344
|
-
}
|
|
6345
|
-
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
6346
|
-
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
6347
|
-
}
|
|
6348
|
-
var cardsPayload = {
|
|
6349
|
-
"roles": [cardsRole]
|
|
6350
|
-
};
|
|
6351
5736
|
var payload = {
|
|
6352
5737
|
personalInfoInput: personalInfoInput,
|
|
6353
5738
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6366,9 +5751,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6366
5751
|
uploadedFiles: uploadedFiles,
|
|
6367
5752
|
filesForDelete: filesForDelete,
|
|
6368
5753
|
profilePicDelete: profilePicDelete,
|
|
6369
|
-
userTagType: userTagType
|
|
6370
|
-
cardsRole: cardsRole,
|
|
6371
|
-
isCardsAdmin: isCardsAdmin
|
|
5754
|
+
userTagType: userTagType
|
|
6372
5755
|
};
|
|
6373
5756
|
if (verifyUserId) {
|
|
6374
5757
|
payload.verifyUserId = verifyUserId;
|
|
@@ -6466,7 +5849,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6466
5849
|
}
|
|
6467
5850
|
_errorMsgs.passport_issue_date = '';
|
|
6468
5851
|
}
|
|
6469
|
-
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5852
|
+
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5853
|
+
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6470
5854
|
_isError = true;
|
|
6471
5855
|
if (_errorArray.indexOf('passport_photo') === -1) {
|
|
6472
5856
|
_errorArray.push('passport_photo');
|
|
@@ -6478,7 +5862,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6478
5862
|
}
|
|
6479
5863
|
_errorMsgs.passport_photo = '';
|
|
6480
5864
|
}
|
|
6481
|
-
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5865
|
+
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5866
|
+
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
6482
5867
|
_isError = true;
|
|
6483
5868
|
if (_errorArray.indexOf('travel_docs') === -1) {
|
|
6484
5869
|
_errorArray.push('travel_docs');
|
|
@@ -6494,130 +5879,133 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6494
5879
|
if (_isError) {
|
|
6495
5880
|
setErrorArray(_errorArray);
|
|
6496
5881
|
setErrorMsgs(_errorMsgs);
|
|
6497
|
-
var
|
|
5882
|
+
for (var _key3 in _errorMsgs) {
|
|
6498
5883
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6499
5884
|
if (_errorMsgs[_key3]) {
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
5885
|
+
var _ret = function () {
|
|
5886
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5887
|
+
setAdditionalInfoFlag('open');
|
|
5888
|
+
}
|
|
5889
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5890
|
+
if (el) {
|
|
5891
|
+
setTimeout(function () {
|
|
5892
|
+
el.scrollIntoView({
|
|
5893
|
+
behavior: 'smooth',
|
|
5894
|
+
block: 'center'
|
|
5895
|
+
});
|
|
5896
|
+
}, 500);
|
|
5897
|
+
return "break";
|
|
5898
|
+
}
|
|
5899
|
+
}();
|
|
5900
|
+
if (_ret === "break") break;
|
|
6513
5901
|
}
|
|
6514
5902
|
}
|
|
6515
|
-
};
|
|
6516
|
-
for (var _key3 in _errorMsgs) {
|
|
6517
|
-
if (_loop3()) break;
|
|
6518
5903
|
}
|
|
5904
|
+
return Promise.resolve();
|
|
6519
5905
|
}
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
if (!_isError) {
|
|
6527
|
-
if (isEditMode && editUserId || isProfile) {
|
|
6528
|
-
dispatch(showLoader());
|
|
6529
|
-
if (cardApiflag && !isProfile && editUserId !== (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
6530
|
-
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
6531
|
-
method: 'POST',
|
|
6532
|
-
body: JSON.stringify(cardsPayload),
|
|
6533
|
-
headers: {
|
|
6534
|
-
'Content-Type': 'application/json',
|
|
6535
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6536
|
-
}
|
|
6537
|
-
}).then(function (response) {
|
|
6538
|
-
if (response.status === 200) {
|
|
6539
|
-
updateUserApiCall(payload, inputChangeLog);
|
|
6540
|
-
} else {
|
|
6541
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6542
|
-
}
|
|
6543
|
-
})["catch"](function (error) {
|
|
6544
|
-
console.log("errorrr", error);
|
|
6545
|
-
})["finally"](function () {
|
|
6546
|
-
dispatch(stopLoader());
|
|
6547
|
-
});
|
|
5906
|
+
if (isEditMode && editUserId || isProfile) {
|
|
5907
|
+
dispatch(showLoader());
|
|
5908
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5909
|
+
if (isProfile) {
|
|
5910
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5911
|
+
(config === null || config === void 0 ? void 0 : (_config$routes = config.routes) === null || _config$routes === void 0 ? void 0 : (_config$routes$profil = _config$routes.profile) === null || _config$routes$profil === void 0 ? void 0 : (_config$routes$profil2 = _config$routes$profil.redirectUrl) === null || _config$routes$profil2 === void 0 ? void 0 : _config$routes$profil2.submit) && history.push(config.routes.profile.redirectUrl.submit);
|
|
6548
5912
|
} else {
|
|
6549
|
-
|
|
5913
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5914
|
+
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
6550
5915
|
}
|
|
6551
|
-
}
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
5916
|
+
})["catch"](function (err) {
|
|
5917
|
+
if (typeof err === 'object') {
|
|
5918
|
+
if (err.country_code) {
|
|
5919
|
+
err.contact_number = err.country_code;
|
|
5920
|
+
}
|
|
5921
|
+
if (err.contact_country_code) {
|
|
5922
|
+
err.contact_number = err.contact_country_code;
|
|
5923
|
+
}
|
|
5924
|
+
if (err.passport) {
|
|
5925
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5926
|
+
delete err.passport;
|
|
5927
|
+
}
|
|
5928
|
+
setErrorArray(Object.keys(err));
|
|
5929
|
+
setErrorMsgs(err);
|
|
5930
|
+
for (var _key4 in err) {
|
|
5931
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5932
|
+
if (err[_key4]) {
|
|
5933
|
+
var _ret2 = function () {
|
|
5934
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
5935
|
+
setAdditionalInfoFlag('open');
|
|
5936
|
+
}
|
|
5937
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
5938
|
+
if (el) {
|
|
5939
|
+
setTimeout(function () {
|
|
5940
|
+
el.scrollIntoView({
|
|
5941
|
+
behavior: 'smooth',
|
|
5942
|
+
block: 'center'
|
|
5943
|
+
});
|
|
5944
|
+
}, 500);
|
|
5945
|
+
return "break";
|
|
5946
|
+
}
|
|
5947
|
+
}();
|
|
5948
|
+
if (_ret2 === "break") break;
|
|
6584
5949
|
}
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
5950
|
+
}
|
|
5951
|
+
}
|
|
5952
|
+
} else if (typeof err === 'string') {
|
|
5953
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5954
|
+
} else {
|
|
5955
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5956
|
+
}
|
|
5957
|
+
})["finally"](function () {
|
|
5958
|
+
dispatch(stopLoader());
|
|
5959
|
+
});
|
|
5960
|
+
} else {
|
|
5961
|
+
dispatch(showLoader());
|
|
5962
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
5963
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5964
|
+
(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);
|
|
5965
|
+
})["catch"](function (err) {
|
|
5966
|
+
if (typeof err === 'object') {
|
|
5967
|
+
if (err.country_code) {
|
|
5968
|
+
err.contact_number = err.country_code;
|
|
5969
|
+
}
|
|
5970
|
+
if (err.contact_country_code) {
|
|
5971
|
+
err.contact_number = err.contact_country_code;
|
|
5972
|
+
}
|
|
5973
|
+
if (err.passport) {
|
|
5974
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5975
|
+
delete err.passport;
|
|
5976
|
+
}
|
|
5977
|
+
setErrorArray(Object.keys(err));
|
|
5978
|
+
setErrorMsgs(err);
|
|
5979
|
+
for (var _key5 in err) {
|
|
5980
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
5981
|
+
if (err[_key5]) {
|
|
5982
|
+
var _ret3 = function () {
|
|
5983
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
5984
|
+
setAdditionalInfoFlag('open');
|
|
6603
5985
|
}
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
5986
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
5987
|
+
if (el) {
|
|
5988
|
+
setTimeout(function () {
|
|
5989
|
+
el.scrollIntoView({
|
|
5990
|
+
behavior: 'smooth',
|
|
5991
|
+
block: 'center'
|
|
5992
|
+
});
|
|
5993
|
+
}, 500);
|
|
5994
|
+
return "break";
|
|
5995
|
+
}
|
|
5996
|
+
}();
|
|
5997
|
+
if (_ret3 === "break") break;
|
|
6608
5998
|
}
|
|
6609
|
-
} else if (typeof err === 'string') {
|
|
6610
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6611
|
-
} else {
|
|
6612
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6613
5999
|
}
|
|
6614
|
-
}
|
|
6615
|
-
|
|
6616
|
-
|
|
6000
|
+
}
|
|
6001
|
+
} else if (typeof err === 'string') {
|
|
6002
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6617
6003
|
} else {
|
|
6618
|
-
|
|
6004
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6619
6005
|
}
|
|
6620
|
-
}
|
|
6006
|
+
})["finally"](function () {
|
|
6007
|
+
dispatch(stopLoader());
|
|
6008
|
+
});
|
|
6621
6009
|
}
|
|
6622
6010
|
return Promise.resolve();
|
|
6623
6011
|
} catch (e) {
|
|
@@ -6633,9 +6021,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6633
6021
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6634
6022
|
}
|
|
6635
6023
|
}
|
|
6636
|
-
}
|
|
6637
|
-
|
|
6638
|
-
|
|
6024
|
+
}
|
|
6025
|
+
else {
|
|
6026
|
+
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
6027
|
+
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$users = _config$routes4.users) === null || _config$routes4$users === void 0 ? void 0 : (_config$routes4$users2 = _config$routes4$users.list) === null || _config$routes4$users2 === void 0 ? void 0 : _config$routes4$users2.path) && history.push(config.routes.users.list.path);
|
|
6639
6028
|
}
|
|
6640
6029
|
};
|
|
6641
6030
|
var handleCustomFieldsNavigation = function handleCustomFieldsNavigation() {
|
|
@@ -6655,13 +6044,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6655
6044
|
if (verifyUserId) {
|
|
6656
6045
|
dispatch(showLoader());
|
|
6657
6046
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6658
|
-
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6659
6047
|
setPersonalInfoInput(function (prevState) {
|
|
6660
6048
|
return _extends({}, prevState, {
|
|
6661
|
-
first_name: res.
|
|
6662
|
-
last_name: res.
|
|
6049
|
+
first_name: res.fname,
|
|
6050
|
+
last_name: res.lname,
|
|
6663
6051
|
email: res.email,
|
|
6664
|
-
contact_number: res
|
|
6052
|
+
contact_number: res.phone,
|
|
6053
|
+
dob: function () {
|
|
6054
|
+
var dt = new Date(res.dob);
|
|
6055
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6056
|
+
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6057
|
+
}(),
|
|
6058
|
+
|
|
6665
6059
|
gender: function () {
|
|
6666
6060
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6667
6061
|
}()
|
|
@@ -6706,6 +6100,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6706
6100
|
}()
|
|
6707
6101
|
});
|
|
6708
6102
|
});
|
|
6103
|
+
|
|
6709
6104
|
if (res.client_admin) {
|
|
6710
6105
|
setTravelApproversInput(function (prevState) {
|
|
6711
6106
|
var nextState = _extends({}, prevState);
|
|
@@ -6739,6 +6134,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6739
6134
|
});
|
|
6740
6135
|
}
|
|
6741
6136
|
};
|
|
6137
|
+
|
|
6742
6138
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6743
6139
|
component: "div",
|
|
6744
6140
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6755,7 +6151,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6755
6151
|
className: styles.breadcrumb
|
|
6756
6152
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6757
6153
|
breadCrumbs: [{
|
|
6758
|
-
href:
|
|
6154
|
+
href:
|
|
6155
|
+
config.routes.users.list.path,
|
|
6759
6156
|
label: 'Users',
|
|
6760
6157
|
hasLink: true
|
|
6761
6158
|
}]
|
|
@@ -6824,9 +6221,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6824
6221
|
if (!p.visibility) {
|
|
6825
6222
|
return null;
|
|
6826
6223
|
}
|
|
6827
|
-
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6828
|
-
return null;
|
|
6829
|
-
}
|
|
6830
6224
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6831
6225
|
item: true,
|
|
6832
6226
|
sm: 12,
|
|
@@ -6948,13 +6342,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6948
6342
|
className: styles.productContainerGap
|
|
6949
6343
|
}, renderFields.products.map(function (p, i) {
|
|
6950
6344
|
p.readOnly = isProfile;
|
|
6951
|
-
if (p.id === 3 && !isCardsAdmin && !isProfile) {
|
|
6952
|
-
p.readOnly = true;
|
|
6953
|
-
p.disableText = "Only card admin can change this access.";
|
|
6954
|
-
} else if (p.id === 3 && editUserId === (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
6955
|
-
p.readOnly = true;
|
|
6956
|
-
p.disableText = "You cannot update your own Card product";
|
|
6957
|
-
}
|
|
6958
6345
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6959
6346
|
item: true,
|
|
6960
6347
|
sm: 12,
|
|
@@ -7047,21 +6434,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7047
6434
|
isProfile: isProfile,
|
|
7048
6435
|
editUserId: editUserId,
|
|
7049
6436
|
roles: renderFields.expenseRoles
|
|
7050
|
-
}), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
7051
|
-
className: styles.dividerColor
|
|
7052
|
-
}), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React.createElement(CardsField, {
|
|
7053
|
-
cardsConstants: cardsDetails.cardsConstants,
|
|
7054
|
-
type: "card",
|
|
7055
|
-
isProfile: isProfile,
|
|
7056
|
-
onRoleChange: function onRoleChange(_ref7) {
|
|
7057
|
-
var _value = _ref7._value;
|
|
7058
|
-
return setCardsRole(_value);
|
|
7059
|
-
},
|
|
7060
|
-
roleValue: cardsRole,
|
|
7061
|
-
roles: cardsDetails.cardsRoles,
|
|
7062
|
-
cardsAdmin: isCardsAdmin,
|
|
7063
|
-
editUserId: editUserId,
|
|
7064
|
-
loggedInUserId: id === null || id === void 0 ? void 0 : id.toString()
|
|
7065
6437
|
}))) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
7066
6438
|
config: config,
|
|
7067
6439
|
errMsg: hasVerificationError
|
|
@@ -7227,13 +6599,17 @@ var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
|
7227
6599
|
});
|
|
7228
6600
|
};
|
|
7229
6601
|
};
|
|
6602
|
+
|
|
7230
6603
|
var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
7231
6604
|
return new Promise(function (resolve, reject) {
|
|
7232
6605
|
var formData = new FormData();
|
|
6606
|
+
|
|
7233
6607
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
7234
6608
|
formData.append(key, presignedPostData.fields[key]);
|
|
7235
6609
|
});
|
|
6610
|
+
|
|
7236
6611
|
formData.append('file', file);
|
|
6612
|
+
|
|
7237
6613
|
axios.post(presignedPostData.url, formData, {
|
|
7238
6614
|
headers: {
|
|
7239
6615
|
'Content-Type': 'multipart/form-data'
|
|
@@ -7350,7 +6726,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
7350
6726
|
};
|
|
7351
6727
|
};
|
|
7352
6728
|
|
|
7353
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","
|
|
6729
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
7354
6730
|
|
|
7355
6731
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
7356
6732
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7419,7 +6795,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7419
6795
|
file: doc
|
|
7420
6796
|
});
|
|
7421
6797
|
});
|
|
7422
|
-
var
|
|
6798
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
7423
6799
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
7424
6800
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
7425
6801
|
if (validatedRes.data.status) {
|
|
@@ -7459,7 +6835,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
7459
6835
|
})).then(function () {});
|
|
7460
6836
|
});
|
|
7461
6837
|
});
|
|
7462
|
-
return Promise.resolve(
|
|
6838
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7463
6839
|
} catch (e) {
|
|
7464
6840
|
return Promise.reject(e);
|
|
7465
6841
|
}
|
|
@@ -7634,6 +7010,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7634
7010
|
setOpenImportUsersModal(false);
|
|
7635
7011
|
handleImportPagenavigation(jobId);
|
|
7636
7012
|
};
|
|
7013
|
+
|
|
7637
7014
|
var handleDownloadRecords = function handleDownloadRecords(type) {
|
|
7638
7015
|
try {
|
|
7639
7016
|
setDownlStatus(true);
|
|
@@ -8659,6 +8036,7 @@ var DropdownBtn = function DropdownBtn(props) {
|
|
|
8659
8036
|
if (val.disable) return false;
|
|
8660
8037
|
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
8661
8038
|
};
|
|
8039
|
+
|
|
8662
8040
|
var prevOpen = React.useRef(open);
|
|
8663
8041
|
React.useEffect(function () {
|
|
8664
8042
|
if (prevOpen.current === true && open === false) {
|
|
@@ -8773,10 +8151,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8773
8151
|
selected = props.selected,
|
|
8774
8152
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8775
8153
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8776
|
-
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8777
|
-
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8778
|
-
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8779
|
-
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8780
8154
|
orderBy = props.orderBy,
|
|
8781
8155
|
order = props.order,
|
|
8782
8156
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8794,21 +8168,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8794
8168
|
searchValue = props.searchValue,
|
|
8795
8169
|
_props$isILadmin = props.isILadmin,
|
|
8796
8170
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8797
|
-
var useStyles = makeStyles(function (theme) {
|
|
8798
|
-
return {
|
|
8799
|
-
tooltip: {
|
|
8800
|
-
background: '#1F2937',
|
|
8801
|
-
fontSize: '14px',
|
|
8802
|
-
color: '#ffffff',
|
|
8803
|
-
padding: '12px 16px',
|
|
8804
|
-
borderRadius: '6px'
|
|
8805
|
-
},
|
|
8806
|
-
arrow: {
|
|
8807
|
-
color: '#1F2937'
|
|
8808
|
-
}
|
|
8809
|
-
};
|
|
8810
|
-
});
|
|
8811
|
-
var classes = useStyles();
|
|
8812
8171
|
var columns = [{
|
|
8813
8172
|
id: 'first_name',
|
|
8814
8173
|
label: 'Name',
|
|
@@ -8828,27 +8187,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8828
8187
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic = row.profile_pic) === null || _row$profile_pic === void 0 ? void 0 : _row$profile_pic.presigned_url
|
|
8829
8188
|
}));
|
|
8830
8189
|
}
|
|
8831
|
-
}, {
|
|
8832
|
-
id: 'first_name',
|
|
8833
|
-
label: '',
|
|
8834
|
-
minWidth: 60,
|
|
8835
|
-
sortable: false,
|
|
8836
|
-
cell: function cell(row) {
|
|
8837
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8838
|
-
component: "div",
|
|
8839
|
-
width: 80
|
|
8840
|
-
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8841
|
-
title: "This user hasn't logged in to the platform yet",
|
|
8842
|
-
arrow: true,
|
|
8843
|
-
classes: {
|
|
8844
|
-
arrow: classes.arrow,
|
|
8845
|
-
tooltip: classes.tooltip
|
|
8846
|
-
},
|
|
8847
|
-
placement: "top-start"
|
|
8848
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
8849
|
-
className: clsx(styles$5.tooltipTextDiv)
|
|
8850
|
-
}, "Invited")) : null);
|
|
8851
|
-
}
|
|
8852
8190
|
}, {
|
|
8853
8191
|
id: 'emp_info__department__name',
|
|
8854
8192
|
label: 'Department',
|
|
@@ -8870,7 +8208,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8870
8208
|
cell: function cell(row) {
|
|
8871
8209
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8872
8210
|
component: "div"
|
|
8873
|
-
}, row.products.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
8211
|
+
}, row.products.length > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8874
8212
|
component: "div",
|
|
8875
8213
|
display: "flex"
|
|
8876
8214
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
@@ -8883,7 +8221,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8883
8221
|
style: {
|
|
8884
8222
|
whiteSpace: 'nowrap'
|
|
8885
8223
|
}
|
|
8886
|
-
}, "\xA0" + row.products[0].role))
|
|
8224
|
+
}, "\xA0" + row.products[0].role)), row.products[1] && /*#__PURE__*/React.createElement(IUIBox, {
|
|
8887
8225
|
component: "div",
|
|
8888
8226
|
display: "flex"
|
|
8889
8227
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
@@ -8896,20 +8234,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8896
8234
|
style: {
|
|
8897
8235
|
whiteSpace: 'nowrap'
|
|
8898
8236
|
}
|
|
8899
|
-
}, "\xA0" + row.products[1].role))
|
|
8900
|
-
component: "div",
|
|
8901
|
-
display: "flex"
|
|
8902
|
-
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8903
|
-
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor),
|
|
8904
|
-
style: {
|
|
8905
|
-
whiteSpace: 'nowrap'
|
|
8906
|
-
}
|
|
8907
|
-
}, row.products[2].name + ' / '), /*#__PURE__*/React.createElement(IUITypography, {
|
|
8908
|
-
className: clsx(styles$5.rowText, styles$5.textTransform),
|
|
8909
|
-
style: {
|
|
8910
|
-
whiteSpace: 'nowrap'
|
|
8911
|
-
}
|
|
8912
|
-
}, "\xA0" + row.products[2].role))) : '');
|
|
8237
|
+
}, "\xA0" + row.products[1].role))) : '');
|
|
8913
8238
|
}
|
|
8914
8239
|
}, {
|
|
8915
8240
|
id: 'status',
|
|
@@ -8949,21 +8274,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8949
8274
|
return onEditHandler(row.id);
|
|
8950
8275
|
}
|
|
8951
8276
|
}];
|
|
8952
|
-
if (row && row.has_visited && row.is_active) {
|
|
8953
|
-
options.push({
|
|
8954
|
-
label: 'Reset password',
|
|
8955
|
-
handler: function handler() {
|
|
8956
|
-
return onResetPasswordHandler(row.email);
|
|
8957
|
-
}
|
|
8958
|
-
});
|
|
8959
|
-
} else if (row && row.is_active) {
|
|
8960
|
-
options.push({
|
|
8961
|
-
label: 'Resend invite',
|
|
8962
|
-
handler: function handler() {
|
|
8963
|
-
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8964
|
-
}
|
|
8965
|
-
});
|
|
8966
|
-
}
|
|
8967
8277
|
if (isILadmin) {
|
|
8968
8278
|
options.push({
|
|
8969
8279
|
label: 'Make primary admin',
|
|
@@ -8987,7 +8297,6 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8987
8297
|
endIcon: null,
|
|
8988
8298
|
outlinedBtn: false,
|
|
8989
8299
|
className: "threedotMenuBtn",
|
|
8990
|
-
MoreHorizIcon: true,
|
|
8991
8300
|
placement: "bottom-end"
|
|
8992
8301
|
}));
|
|
8993
8302
|
},
|
|
@@ -8995,6 +8304,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8995
8304
|
paddingLeft: '40px'
|
|
8996
8305
|
}
|
|
8997
8306
|
}];
|
|
8307
|
+
|
|
8998
8308
|
return /*#__PURE__*/React.createElement(IUITable, {
|
|
8999
8309
|
searchPlaceholder: "Search by name, email & department",
|
|
9000
8310
|
isCheckboxTable: true,
|
|
@@ -9017,8 +8327,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
9017
8327
|
isDataFetching: isDataFetching,
|
|
9018
8328
|
disableRowCheckbox: disableRowCheckbox,
|
|
9019
8329
|
searchBoxWidth: "400px",
|
|
9020
|
-
searchValue: searchValue
|
|
9021
|
-
hideTopPagination: false
|
|
8330
|
+
searchValue: searchValue
|
|
9022
8331
|
});
|
|
9023
8332
|
};
|
|
9024
8333
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -9049,18 +8358,20 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9049
8358
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
9050
8359
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
9051
8360
|
};
|
|
8361
|
+
|
|
9052
8362
|
var columns = [{
|
|
9053
|
-
id: '
|
|
8363
|
+
id: 'fname',
|
|
9054
8364
|
label: 'Name',
|
|
9055
8365
|
minWidth: 250,
|
|
9056
8366
|
sortable: true,
|
|
9057
8367
|
cell: function cell(row) {
|
|
9058
8368
|
var _row$profile_pic2;
|
|
9059
8369
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9060
|
-
firstName: row.
|
|
9061
|
-
lastName: row.
|
|
9062
|
-
isLetterAvatar:
|
|
9063
|
-
|
|
8370
|
+
firstName: row.fname,
|
|
8371
|
+
lastName: row.lname,
|
|
8372
|
+
isLetterAvatar:
|
|
8373
|
+
row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8374
|
+
primaryText: row.fname + ' ' + row.lname,
|
|
9064
8375
|
secondaryText: row.email,
|
|
9065
8376
|
letterAvatarTextColor: "black",
|
|
9066
8377
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -9069,7 +8380,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9069
8380
|
}));
|
|
9070
8381
|
}
|
|
9071
8382
|
}, {
|
|
9072
|
-
id: '
|
|
8383
|
+
id: 'created',
|
|
9073
8384
|
label: 'Requested on',
|
|
9074
8385
|
minWidth: 100,
|
|
9075
8386
|
sortable: true,
|
|
@@ -9079,7 +8390,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9079
8390
|
width: 100
|
|
9080
8391
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9081
8392
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
9082
|
-
}, formatDate(row.
|
|
8393
|
+
}, formatDate(row.created)));
|
|
9083
8394
|
}
|
|
9084
8395
|
}, {
|
|
9085
8396
|
id: 'actions',
|
|
@@ -9133,89 +8444,11 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
9133
8444
|
});
|
|
9134
8445
|
};
|
|
9135
8446
|
|
|
9136
|
-
function InfoYellowIcon(props) {
|
|
9137
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
9138
|
-
width: props.width,
|
|
9139
|
-
height: props.height,
|
|
9140
|
-
viewBox: "0 0 20 20",
|
|
9141
|
-
fill: "none",
|
|
9142
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9143
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
9144
|
-
d: "M11 4.99951C11 5.5518 10.5523 5.99951 10 5.99951C9.44771 5.99951 9 5.5518 9 4.99951C9 4.44723 9.44771 3.99951 10 3.99951C10.5523 3.99951 11 4.44723 11 4.99951Z",
|
|
9145
|
-
fill: "#CA8A04"
|
|
9146
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
9147
|
-
d: "M8 7.99951C7.44772 7.99951 7 8.44723 7 8.99951C7 9.5518 7.44772 9.99951 8 9.99951H9V12.9995H8C7.44772 12.9995 7 13.4472 7 13.9995C7 14.5518 7.44772 14.9995 8 14.9995H12C12.5523 14.9995 13 14.5518 13 13.9995C13 13.4472 12.5523 12.9995 12 12.9995H11V8.99951C11 8.44723 10.5523 7.99951 10 7.99951H8Z",
|
|
9148
|
-
fill: "#CA8A04"
|
|
9149
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
9150
|
-
d: "M0 9.99951C0 15.5224 4.47715 19.9995 10 19.9995C15.5228 19.9995 20 15.5224 20 9.99951C20 4.47666 15.5228 -0.000488281 10 -0.000488281C4.47715 -0.000488281 0 4.47666 0 9.99951ZM10 1.99951C14.4183 1.99951 18 5.58123 18 9.99951C18 14.4178 14.4183 17.9995 10 17.9995C5.58172 17.9995 2 14.4178 2 9.99951C2 5.58123 5.58172 1.99951 10 1.99951Z",
|
|
9151
|
-
fill: "#CA8A04"
|
|
9152
|
-
}));
|
|
9153
|
-
}
|
|
9154
|
-
|
|
9155
|
-
function RedWarningIcon(props) {
|
|
9156
|
-
var _props$color = props.color,
|
|
9157
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
9158
|
-
_props$size = props.size,
|
|
9159
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
9160
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
9161
|
-
width: size,
|
|
9162
|
-
height: size,
|
|
9163
|
-
viewBox: "0 0 14 14",
|
|
9164
|
-
fill: color,
|
|
9165
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
9166
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
9167
|
-
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM6 4C6 3.44772 6.44772 3 7 3C7.55229 3 8 3.44772 8 4V6C8 6.55229 7.55229 7 7 7C6.44772 7 6 6.55229 6 6V4ZM6 10C6 9.44771 6.44772 9 7 9C7.55229 9 8 9.44771 8 10C8 10.5523 7.55229 11 7 11C6.44772 11 6 10.5523 6 10Z",
|
|
9168
|
-
fill: color
|
|
9169
|
-
}));
|
|
9170
|
-
}
|
|
9171
|
-
|
|
9172
|
-
function InviteInfoIcon() {
|
|
9173
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
9174
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
9175
|
-
width: "20",
|
|
9176
|
-
height: "20",
|
|
9177
|
-
fill: "none",
|
|
9178
|
-
viewBox: "0 0 20 20"
|
|
9179
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
9180
|
-
fill: "#CA8A04",
|
|
9181
|
-
d: "M11 5a1 1 0 11-2 0 1 1 0 012 0zM8 8a1 1 0 000 2h1v3H8a1 1 0 100 2h4a1 1 0 100-2h-1V9a1 1 0 00-1-1H8z"
|
|
9182
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
9183
|
-
fill: "#CA8A04",
|
|
9184
|
-
d: "M0 10c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10S0 4.477 0 10zm10-8a8 8 0 110 16 8 8 0 010-16z"
|
|
9185
|
-
}));
|
|
9186
|
-
}
|
|
9187
|
-
|
|
9188
8447
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
9189
|
-
var env$7 = configs.env
|
|
9190
|
-
|
|
9191
|
-
var
|
|
9192
|
-
|
|
9193
|
-
msg = _ref.msg;
|
|
9194
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
9195
|
-
style: {
|
|
9196
|
-
display: 'flex',
|
|
9197
|
-
flexDirection: 'row',
|
|
9198
|
-
width: '270px',
|
|
9199
|
-
justifyContent: 'space-between'
|
|
9200
|
-
}
|
|
9201
|
-
}, /*#__PURE__*/React.createElement("p", {
|
|
9202
|
-
style: {
|
|
9203
|
-
whiteSpace: 'nowrap',
|
|
9204
|
-
paddingTop: '8px'
|
|
9205
|
-
}
|
|
9206
|
-
}, msg), /*#__PURE__*/React.createElement("p", {
|
|
9207
|
-
onClick: onUndo,
|
|
9208
|
-
style: {
|
|
9209
|
-
whiteSpace: 'nowrap',
|
|
9210
|
-
fontWeight: '600',
|
|
9211
|
-
fontSize: '1rem',
|
|
9212
|
-
padding: '8px 20px 0'
|
|
9213
|
-
}
|
|
9214
|
-
}, "UNDO"));
|
|
9215
|
-
};
|
|
9216
|
-
var UserList = function UserList(_ref2) {
|
|
9217
|
-
var config = _ref2.config,
|
|
9218
|
-
isProfile = _ref2.isProfile;
|
|
8448
|
+
var env$7 = configs.env;
|
|
8449
|
+
var UserList = function UserList(_ref) {
|
|
8450
|
+
var config = _ref.config,
|
|
8451
|
+
isProfile = _ref.isProfile;
|
|
9219
8452
|
env$7.init(config, isProfile);
|
|
9220
8453
|
var history = useHistory();
|
|
9221
8454
|
var _useSelector = useSelector(function (state) {
|
|
@@ -9225,49 +8458,27 @@ var UserList = function UserList(_ref2) {
|
|
|
9225
8458
|
isDataFetching = _useSelector.isDataFetching,
|
|
9226
8459
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
9227
8460
|
tabValue = _useSelector.tabValue;
|
|
9228
|
-
var
|
|
9229
|
-
|
|
9230
|
-
|
|
9231
|
-
|
|
9232
|
-
|
|
9233
|
-
|
|
9234
|
-
|
|
9235
|
-
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9242
|
-
|
|
9243
|
-
|
|
8461
|
+
var _React$useState = React.useState(1),
|
|
8462
|
+
page = _React$useState[0],
|
|
8463
|
+
setPage = _React$useState[1];
|
|
8464
|
+
var _useState = useState(5),
|
|
8465
|
+
rowsPerPage = _useState[0],
|
|
8466
|
+
setRowsPerPage = _useState[1];
|
|
8467
|
+
var _React$useState2 = React.useState({}),
|
|
8468
|
+
selected = _React$useState2[0],
|
|
8469
|
+
setSelected = _React$useState2[1];
|
|
8470
|
+
var _React$useState3 = React.useState('asc'),
|
|
8471
|
+
order = _React$useState3[0],
|
|
8472
|
+
setOrder = _React$useState3[1];
|
|
8473
|
+
var _React$useState4 = React.useState('first_name'),
|
|
8474
|
+
orderBy = _React$useState4[0],
|
|
8475
|
+
setOrderBy = _React$useState4[1];
|
|
8476
|
+
var _useState2 = useState(''),
|
|
8477
|
+
searchValue = _useState2[0],
|
|
8478
|
+
setSearchValue = _useState2[1];
|
|
9244
8479
|
var _useState3 = useState(false),
|
|
9245
|
-
|
|
9246
|
-
|
|
9247
|
-
var _React$useState4 = React.useState(''),
|
|
9248
|
-
user = _React$useState4[0],
|
|
9249
|
-
setUser = _React$useState4[1];
|
|
9250
|
-
var _useState4 = useState(10),
|
|
9251
|
-
rowsPerPage = _useState4[0],
|
|
9252
|
-
setRowsPerPage = _useState4[1];
|
|
9253
|
-
var _React$useState5 = React.useState({}),
|
|
9254
|
-
selected = _React$useState5[0],
|
|
9255
|
-
setSelected = _React$useState5[1];
|
|
9256
|
-
var _React$useState6 = React.useState('asc'),
|
|
9257
|
-
order = _React$useState6[0],
|
|
9258
|
-
setOrder = _React$useState6[1];
|
|
9259
|
-
var _React$useState7 = React.useState(false),
|
|
9260
|
-
deactivateSingle = _React$useState7[0],
|
|
9261
|
-
setDeactivateSingle = _React$useState7[1];
|
|
9262
|
-
var _React$useState8 = React.useState('first_name'),
|
|
9263
|
-
orderBy = _React$useState8[0],
|
|
9264
|
-
setOrderBy = _React$useState8[1];
|
|
9265
|
-
var _useState5 = useState(''),
|
|
9266
|
-
searchValue = _useState5[0],
|
|
9267
|
-
setSearchValue = _useState5[1];
|
|
9268
|
-
var _useState6 = useState(false),
|
|
9269
|
-
isOpenDeActivateModal = _useState6[0],
|
|
9270
|
-
setOpenDeActivateModalFlag = _useState6[1];
|
|
8480
|
+
isOpenDeActivateModal = _useState3[0],
|
|
8481
|
+
setOpenDeActivateModalFlag = _useState3[1];
|
|
9271
8482
|
var _useSelector2 = useSelector(function (state) {
|
|
9272
8483
|
return state.common;
|
|
9273
8484
|
}),
|
|
@@ -9275,140 +8486,69 @@ var UserList = function UserList(_ref2) {
|
|
|
9275
8486
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
9276
8487
|
isILadmin = _useSelector2.isILadmin,
|
|
9277
8488
|
companyName = _useSelector2.companyName;
|
|
8489
|
+
var _useState4 = useState(false),
|
|
8490
|
+
isOpenImportUsersModal = _useState4[0],
|
|
8491
|
+
setOpenImportUsersModal = _useState4[1];
|
|
8492
|
+
var _useState5 = useState(false),
|
|
8493
|
+
isFileDownloading = _useState5[0],
|
|
8494
|
+
setDownlStatus = _useState5[1];
|
|
8495
|
+
var _useState6 = useState(false),
|
|
8496
|
+
isSortingChange = _useState6[0],
|
|
8497
|
+
setSortingChange = _useState6[1];
|
|
9278
8498
|
var _useState7 = useState(false),
|
|
9279
|
-
|
|
9280
|
-
|
|
8499
|
+
isSearchingChange = _useState7[0],
|
|
8500
|
+
setSearchingChange = _useState7[1];
|
|
9281
8501
|
var _useState8 = useState(false),
|
|
9282
|
-
|
|
9283
|
-
|
|
8502
|
+
isSortingChangeTemp = _useState8[0],
|
|
8503
|
+
setSortingChangeTemp = _useState8[1];
|
|
9284
8504
|
var _useState9 = useState(false),
|
|
9285
|
-
|
|
9286
|
-
|
|
8505
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8506
|
+
setSearchingChangeTemp = _useState9[1];
|
|
9287
8507
|
var _useState10 = useState(false),
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
8508
|
+
isApiFetching = _useState10[0],
|
|
8509
|
+
setisApiFetching = _useState10[1];
|
|
8510
|
+
|
|
8511
|
+
var _React$useState5 = React.useState(1),
|
|
8512
|
+
signup_page = _React$useState5[0],
|
|
8513
|
+
setSignUpPage = _React$useState5[1];
|
|
8514
|
+
var _useState11 = useState(5),
|
|
8515
|
+
signup_rowsPerPage = _useState11[0],
|
|
8516
|
+
setSignUpRowsPerPage = _useState11[1];
|
|
8517
|
+
var _React$useState6 = React.useState('asc'),
|
|
8518
|
+
signup_order = _React$useState6[0],
|
|
8519
|
+
setSignUpOrder = _React$useState6[1];
|
|
8520
|
+
var _React$useState7 = React.useState('fname'),
|
|
8521
|
+
signup_orderBy = _React$useState7[0],
|
|
8522
|
+
setSignUpOrderBy = _React$useState7[1];
|
|
8523
|
+
var _useState12 = useState(''),
|
|
8524
|
+
signup_searchValue = _useState12[0],
|
|
8525
|
+
set_signup_SearchValue = _useState12[1];
|
|
9296
8526
|
var _useState13 = useState(false),
|
|
9297
|
-
|
|
9298
|
-
|
|
8527
|
+
isSignUpSortingChange = _useState13[0],
|
|
8528
|
+
setSignUpSortingChange = _useState13[1];
|
|
9299
8529
|
var _useState14 = useState(false),
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
var _useState15 = useState(
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
}),
|
|
9306
|
-
approverRole = _useState15[0],
|
|
9307
|
-
setApproverRole = _useState15[1];
|
|
8530
|
+
isSignUpSearchingChange = _useState14[0],
|
|
8531
|
+
setSignUpSearchingChange = _useState14[1];
|
|
8532
|
+
var _useState15 = useState(false),
|
|
8533
|
+
isSignUpSortingChangeTemp = _useState15[0],
|
|
8534
|
+
setSignUpSortingChangeTemp = _useState15[1];
|
|
9308
8535
|
var _useState16 = useState(false),
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
var _useState17 = useState(''),
|
|
9312
|
-
userIds = _useState17[0],
|
|
9313
|
-
setUserIds = _useState17[1];
|
|
9314
|
-
var _React$useState9 = React.useState(false),
|
|
9315
|
-
overlayMenu = _React$useState9[0],
|
|
9316
|
-
setOverlayMenu = _React$useState9[1];
|
|
9317
|
-
var _useState18 = useState(''),
|
|
9318
|
-
userFirstName = _useState18[0],
|
|
9319
|
-
setUserFirstName = _useState18[1];
|
|
9320
|
-
var _useState19 = useState(''),
|
|
9321
|
-
userLastName = _useState19[0],
|
|
9322
|
-
setUserLastName = _useState19[1];
|
|
9323
|
-
var _useState20 = useState(true),
|
|
9324
|
-
isDisabledSubmitBtn = _useState20[0],
|
|
9325
|
-
setIsDisabledSubmitBtn = _useState20[1];
|
|
9326
|
-
useScrollPosition(function (_ref3) {
|
|
9327
|
-
var prevPos = _ref3.prevPos,
|
|
9328
|
-
currPos = _ref3.currPos;
|
|
9329
|
-
if (prevPos.y - currPos.y > 0) {
|
|
9330
|
-
if (currPos.y <= -275) {
|
|
9331
|
-
setOverlayMenu(true);
|
|
9332
|
-
}
|
|
9333
|
-
} else {
|
|
9334
|
-
if (currPos.y > -295) {
|
|
9335
|
-
setOverlayMenu(false);
|
|
9336
|
-
}
|
|
9337
|
-
}
|
|
9338
|
-
}, [overlayMenu]);
|
|
9339
|
-
var scrollTo = function scrollTo(id) {
|
|
9340
|
-
var el = document.getElementById(id);
|
|
9341
|
-
window.scrollTo({
|
|
9342
|
-
top: el.offsetTop,
|
|
9343
|
-
behavior: 'smooth'
|
|
9344
|
-
});
|
|
9345
|
-
};
|
|
9346
|
-
var _React$useState10 = React.useState(1),
|
|
9347
|
-
signup_page = _React$useState10[0],
|
|
9348
|
-
setSignUpPage = _React$useState10[1];
|
|
9349
|
-
var _useState21 = useState(5),
|
|
9350
|
-
signup_rowsPerPage = _useState21[0],
|
|
9351
|
-
setSignUpRowsPerPage = _useState21[1];
|
|
9352
|
-
var _React$useState11 = React.useState('asc'),
|
|
9353
|
-
signup_order = _React$useState11[0],
|
|
9354
|
-
setSignUpOrder = _React$useState11[1];
|
|
9355
|
-
var _React$useState12 = React.useState('first_name'),
|
|
9356
|
-
signup_orderBy = _React$useState12[0],
|
|
9357
|
-
setSignUpOrderBy = _React$useState12[1];
|
|
9358
|
-
var _useState22 = useState(''),
|
|
9359
|
-
signup_searchValue = _useState22[0],
|
|
9360
|
-
set_signup_SearchValue = _useState22[1];
|
|
9361
|
-
var _useState23 = useState(false),
|
|
9362
|
-
isSignUpSortingChange = _useState23[0],
|
|
9363
|
-
setSignUpSortingChange = _useState23[1];
|
|
9364
|
-
var _useState24 = useState(false),
|
|
9365
|
-
isSignUpSearchingChange = _useState24[0],
|
|
9366
|
-
setSignUpSearchingChange = _useState24[1];
|
|
9367
|
-
var _useState25 = useState(false),
|
|
9368
|
-
isSignUpSortingChangeTemp = _useState25[0],
|
|
9369
|
-
setSignUpSortingChangeTemp = _useState25[1];
|
|
9370
|
-
var _useState26 = useState(false),
|
|
9371
|
-
isSignUpSearchingChangeTemp = _useState26[0],
|
|
9372
|
-
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8536
|
+
isSignUpSearchingChangeTemp = _useState16[0],
|
|
8537
|
+
setSignUpSearchingChangeTemp = _useState16[1];
|
|
9373
8538
|
var _useSelector3 = useSelector(function (state) {
|
|
9374
8539
|
return state.userList;
|
|
9375
8540
|
}),
|
|
9376
8541
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
9377
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
9378
|
-
if (config.routes.notification) {
|
|
9379
|
-
history.push({
|
|
9380
|
-
pathname: config.routes.notification.path
|
|
9381
|
-
});
|
|
9382
|
-
}
|
|
9383
|
-
};
|
|
9384
8542
|
var openDeactivateModal = function openDeactivateModal() {
|
|
9385
8543
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9386
8544
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
9387
8545
|
return false;
|
|
9388
8546
|
}
|
|
9389
|
-
|
|
9390
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9391
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9392
|
-
var _selected = Object.values(selected).flat();
|
|
9393
|
-
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
9394
|
-
return _selected.includes(item.id.toString());
|
|
9395
|
-
});
|
|
9396
|
-
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
9397
|
-
return _selected.includes(item.id.toString());
|
|
9398
|
-
});
|
|
9399
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9400
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9401
|
-
setIsBulkDeactivateModalOpen(true);
|
|
9402
|
-
} else {
|
|
9403
|
-
setOpenDeActivateModalFlag(true);
|
|
9404
|
-
}
|
|
8547
|
+
setOpenDeActivateModalFlag(true);
|
|
9405
8548
|
};
|
|
9406
8549
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
9407
8550
|
setOpenDeActivateModalFlag(false);
|
|
9408
8551
|
};
|
|
9409
|
-
var closeDeActiveModal = function closeDeActiveModal() {
|
|
9410
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9411
|
-
};
|
|
9412
8552
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9413
8553
|
history.push(config.routes.users.add.path);
|
|
9414
8554
|
};
|
|
@@ -9421,32 +8561,49 @@ var UserList = function UserList(_ref2) {
|
|
|
9421
8561
|
var handleVerifyUserClick = function handleVerifyUserClick(userId) {
|
|
9422
8562
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
9423
8563
|
};
|
|
9424
|
-
var
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
8564
|
+
var UndoButton = function UndoButton(_ref2) {
|
|
8565
|
+
var msg = _ref2.msg,
|
|
8566
|
+
id = _ref2.id;
|
|
8567
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8568
|
+
display: "flex",
|
|
8569
|
+
flexDirection: "row",
|
|
8570
|
+
width: "270px"
|
|
8571
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8572
|
+
style: {
|
|
8573
|
+
whiteSpace: 'nowrap',
|
|
8574
|
+
paddingTop: '8px'
|
|
8575
|
+
}
|
|
8576
|
+
}, msg), /*#__PURE__*/React.createElement(IUIButton, {
|
|
8577
|
+
type: "text",
|
|
8578
|
+
buttonText: "UNDO",
|
|
8579
|
+
style: {
|
|
8580
|
+
color: '#FFFFFF'
|
|
9428
8581
|
},
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
8582
|
+
onClick: function onClick() {
|
|
8583
|
+
return dispatch(undoneSignUpRejection(id));
|
|
8584
|
+
}
|
|
8585
|
+
}));
|
|
8586
|
+
};
|
|
8587
|
+
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8588
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8589
|
+
var _res$data;
|
|
8590
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
8591
|
+
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',
|
|
8592
|
+
id: userId
|
|
8593
|
+
}));
|
|
8594
|
+
if (res.status === true) {
|
|
8595
|
+
dispatch(showDataFetchingStatus());
|
|
8596
|
+
dispatch(fetchUserSignupRequests({
|
|
8597
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8598
|
+
length: signup_rowsPerPage,
|
|
8599
|
+
page: signup_page,
|
|
8600
|
+
search: signup_searchValue.trim()
|
|
8601
|
+
})).then(function () {
|
|
8602
|
+
return dispatch(stopDataFetchingStatus());
|
|
9447
8603
|
});
|
|
9448
8604
|
}
|
|
9449
|
-
|
|
8605
|
+
})["catch"](function (err) {
|
|
8606
|
+
console.log(err);
|
|
9450
8607
|
});
|
|
9451
8608
|
};
|
|
9452
8609
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -9459,25 +8616,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9459
8616
|
};
|
|
9460
8617
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
9461
8618
|
var _extends2;
|
|
9462
|
-
var
|
|
9463
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9464
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9465
|
-
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8619
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
9466
8620
|
return n.is_active;
|
|
8621
|
+
}).map(function (obj) {
|
|
8622
|
+
return obj.id.toString();
|
|
9467
8623
|
});
|
|
9468
|
-
|
|
9469
|
-
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9470
|
-
if (obj.roles.is_approver === true) {
|
|
9471
|
-
_selectedUsersApprover.push(obj);
|
|
9472
|
-
} else if (obj.roles.is_approver === false) {
|
|
9473
|
-
_selectedUsersNotApprover.push(obj);
|
|
9474
|
-
}
|
|
9475
|
-
}
|
|
9476
|
-
selectedId.push(obj.id.toString());
|
|
9477
|
-
});
|
|
9478
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9479
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9480
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8624
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
9481
8625
|
};
|
|
9482
8626
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
9483
8627
|
var _extends3;
|
|
@@ -9495,156 +8639,58 @@ var UserList = function UserList(_ref2) {
|
|
|
9495
8639
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9496
8640
|
};
|
|
9497
8641
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9498
|
-
setPage(1);
|
|
9499
8642
|
setSearchValue(value);
|
|
9500
8643
|
setSearchingChange(true);
|
|
9501
8644
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
9502
8645
|
};
|
|
9503
8646
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9504
|
-
setPage(1);
|
|
9505
8647
|
set_signup_SearchValue(value);
|
|
9506
8648
|
setSignUpSearchingChange(true);
|
|
9507
8649
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
9508
8650
|
};
|
|
9509
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page
|
|
8651
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9510
8652
|
var _extends4;
|
|
9511
8653
|
var selectedTemp = _extends({}, selected);
|
|
9512
8654
|
if (!(page in selectedTemp)) {
|
|
9513
8655
|
selectedTemp[page] = [];
|
|
9514
8656
|
}
|
|
9515
8657
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
9516
|
-
var
|
|
8658
|
+
var newSelected = [];
|
|
9517
8659
|
if (selectedIndex === -1) {
|
|
9518
|
-
|
|
8660
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
9519
8661
|
} else if (selectedIndex === 0) {
|
|
9520
|
-
|
|
8662
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
9521
8663
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
9522
|
-
|
|
8664
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
9523
8665
|
} else if (selectedIndex > 0) {
|
|
9524
|
-
|
|
9525
|
-
}
|
|
9526
|
-
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9527
|
-
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9528
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9529
|
-
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9530
|
-
return id !== item.id.toString();
|
|
9531
|
-
});
|
|
9532
|
-
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9533
|
-
return item.id.toString() !== id;
|
|
9534
|
-
});
|
|
9535
|
-
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9536
|
-
if (data.roles.is_approver === true) {
|
|
9537
|
-
_SelectedUsersApprover.push(data);
|
|
9538
|
-
} else if (data.roles.is_approver === false) {
|
|
9539
|
-
_SelectedUsersNotApprover.push(data);
|
|
9540
|
-
}
|
|
8666
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9541
8667
|
}
|
|
9542
|
-
|
|
9543
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9544
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8668
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
9545
8669
|
};
|
|
9546
|
-
useEffect(function () {
|
|
9547
|
-
setApproverRole({
|
|
9548
|
-
value: '',
|
|
9549
|
-
label: 'Select approver'
|
|
9550
|
-
});
|
|
9551
|
-
setDefaultId(null);
|
|
9552
|
-
setIsDisabledSubmitBtn(true);
|
|
9553
|
-
setApproveeStatus(false);
|
|
9554
|
-
if (deactivateSingle === true) {
|
|
9555
|
-
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9556
|
-
if (response.data["default"].id) {
|
|
9557
|
-
setDefaultId(response.data["default"].id);
|
|
9558
|
-
setApproverRole({
|
|
9559
|
-
value: '',
|
|
9560
|
-
label: response.data["default"].email
|
|
9561
|
-
});
|
|
9562
|
-
setIsDisabledSubmitBtn(false);
|
|
9563
|
-
setApproveeStatus(response.data["default"].approvee_status);
|
|
9564
|
-
}
|
|
9565
|
-
});
|
|
9566
|
-
}
|
|
9567
|
-
}, [deactivateSingle]);
|
|
9568
8670
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
9569
8671
|
setRowsPerPage(+event.target.value);
|
|
9570
8672
|
setPage(1);
|
|
9571
8673
|
setSelected({});
|
|
9572
|
-
setSelectedUsersNotApprover([]);
|
|
9573
|
-
setSelectedUsersApprover([]);
|
|
9574
8674
|
setSortingChange(true);
|
|
9575
8675
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
9576
8676
|
};
|
|
9577
8677
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
9578
8678
|
var isActive = e.target.checked;
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
setUser(item);
|
|
9587
|
-
} else {
|
|
9588
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9589
|
-
if (!isActive) {
|
|
9590
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9591
|
-
var _extends5;
|
|
9592
|
-
var selectedTemp = _extends({}, selected);
|
|
9593
|
-
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9594
|
-
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9595
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9596
|
-
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9597
|
-
return item.id != id;
|
|
9598
|
-
});
|
|
9599
|
-
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9600
|
-
return item.id != id;
|
|
9601
|
-
});
|
|
9602
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9603
|
-
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9604
|
-
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9605
|
-
}
|
|
9606
|
-
}
|
|
9607
|
-
});
|
|
8679
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8680
|
+
if (!isActive) {
|
|
8681
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8682
|
+
var _extends5;
|
|
8683
|
+
var selectedTemp = _extends({}, selected);
|
|
8684
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8685
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9608
8686
|
}
|
|
9609
8687
|
}
|
|
9610
8688
|
});
|
|
9611
8689
|
};
|
|
9612
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
9613
|
-
var _value = _ref4._value;
|
|
9614
|
-
if (_value.data.approvee_status) {
|
|
9615
|
-
setApproveeStatus(true);
|
|
9616
|
-
} else {
|
|
9617
|
-
setApproveeStatus(false);
|
|
9618
|
-
}
|
|
9619
|
-
setDefaultId(_value.data.id);
|
|
9620
|
-
setApproverRole(_value);
|
|
9621
|
-
setIsDisabledSubmitBtn(false);
|
|
9622
|
-
};
|
|
9623
|
-
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9624
|
-
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9625
|
-
setOpenDeActivateModalFlag(false);
|
|
9626
|
-
setDeactivateSingle(false);
|
|
9627
|
-
setSelected({});
|
|
9628
|
-
setSelectedUsersNotApprover([]);
|
|
9629
|
-
setSelectedUsersApprover([]);
|
|
9630
|
-
};
|
|
9631
8690
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
9632
8691
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
9633
8692
|
setOpenDeActivateModalFlag(false);
|
|
9634
8693
|
setSelected({});
|
|
9635
|
-
setSelectedUsersNotApprover([]);
|
|
9636
|
-
setSelectedUsersApprover([]);
|
|
9637
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9638
|
-
};
|
|
9639
|
-
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9640
|
-
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9641
|
-
return item.id;
|
|
9642
|
-
});
|
|
9643
|
-
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9644
|
-
setIsBulkDeactivateModalOpen(false);
|
|
9645
|
-
setSelected({});
|
|
9646
|
-
setSelectedUsersNotApprover([]);
|
|
9647
|
-
setSelectedUsersApprover([]);
|
|
9648
8694
|
};
|
|
9649
8695
|
var importUserHandler = function importUserHandler() {
|
|
9650
8696
|
setOpenImportUsersModal(true);
|
|
@@ -9656,43 +8702,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9656
8702
|
setOpenImportUsersModal(false);
|
|
9657
8703
|
handleImportPagenavigation(jobId);
|
|
9658
8704
|
};
|
|
9659
|
-
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9660
|
-
dispatch(resetPasswordForUser({
|
|
9661
|
-
email: email
|
|
9662
|
-
}));
|
|
9663
|
-
};
|
|
9664
|
-
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9665
|
-
if (type === undefined) {
|
|
9666
|
-
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9667
|
-
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9668
|
-
return false;
|
|
9669
|
-
}
|
|
9670
|
-
}
|
|
9671
|
-
setUserIds(ids);
|
|
9672
|
-
setUserFirstName(firstName);
|
|
9673
|
-
setUserLastName(lastName);
|
|
9674
|
-
setToggleInviteModal(!showInviteModal);
|
|
9675
|
-
};
|
|
9676
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9677
|
-
setToggleInviteModal(!showInviteModal);
|
|
9678
|
-
};
|
|
9679
|
-
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9680
|
-
var userIdArr = [];
|
|
9681
|
-
if (userIds && !isNaN(userIds)) {
|
|
9682
|
-
userIdArr = [userIds];
|
|
9683
|
-
} else if (Object.keys(selected).length) {
|
|
9684
|
-
Object.values(selected).map(function (val, i) {
|
|
9685
|
-
if (val.length) {
|
|
9686
|
-
val.map(function (idx, i) {
|
|
9687
|
-
userIdArr.push(idx);
|
|
9688
|
-
});
|
|
9689
|
-
}
|
|
9690
|
-
});
|
|
9691
|
-
}
|
|
9692
|
-
setUserIds('');
|
|
9693
|
-
dispatch(resendInviteForUser(userIdArr));
|
|
9694
|
-
setToggleInviteModal(!showInviteModal);
|
|
9695
|
-
};
|
|
9696
8705
|
var handleExportUsers = function handleExportUsers() {
|
|
9697
8706
|
try {
|
|
9698
8707
|
setDownlStatus(true);
|
|
@@ -9732,9 +8741,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9732
8741
|
}, {
|
|
9733
8742
|
label: 'Bulk action history',
|
|
9734
8743
|
handler: handleBulkActionHistoryClick
|
|
9735
|
-
}, {
|
|
9736
|
-
label: 'Resend invite',
|
|
9737
|
-
handler: toggleInviteModal
|
|
9738
8744
|
}];
|
|
9739
8745
|
useEffect(function () {
|
|
9740
8746
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -9746,9 +8752,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9746
8752
|
userId: userId
|
|
9747
8753
|
}));
|
|
9748
8754
|
};
|
|
9749
|
-
var knowMore = function knowMore() {
|
|
9750
|
-
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9751
|
-
};
|
|
9752
8755
|
var dispatch = useDispatch();
|
|
9753
8756
|
useEffect(function () {
|
|
9754
8757
|
if (isTokenVerified === true) {
|
|
@@ -9762,7 +8765,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9762
8765
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9763
8766
|
setSearchingChange(false);
|
|
9764
8767
|
setisApiFetching(false);
|
|
9765
|
-
scrollTo('table-root');
|
|
9766
8768
|
});
|
|
9767
8769
|
}, 1000);
|
|
9768
8770
|
return function () {
|
|
@@ -9776,8 +8778,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9776
8778
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9777
8779
|
length: signup_rowsPerPage,
|
|
9778
8780
|
page: signup_page,
|
|
9779
|
-
search: signup_searchValue.trim()
|
|
9780
|
-
pagename: 'company'
|
|
8781
|
+
search: signup_searchValue.trim()
|
|
9781
8782
|
})).then(function () {
|
|
9782
8783
|
setSignUpSearchingChange(false);
|
|
9783
8784
|
setisApiFetching(false);
|
|
@@ -9789,7 +8790,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9789
8790
|
}
|
|
9790
8791
|
if (isSortingChange) {
|
|
9791
8792
|
setisApiFetching(true);
|
|
9792
|
-
scrollTo('table-root');
|
|
9793
8793
|
dispatch(fetchUsersList(url)).then(function () {
|
|
9794
8794
|
setisApiFetching(false);
|
|
9795
8795
|
setSortingChange(false);
|
|
@@ -9804,8 +8804,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9804
8804
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9805
8805
|
length: signup_rowsPerPage,
|
|
9806
8806
|
page: signup_page,
|
|
9807
|
-
search: signup_searchValue.trim()
|
|
9808
|
-
pagename: 'company'
|
|
8807
|
+
search: signup_searchValue.trim()
|
|
9809
8808
|
})).then(function () {
|
|
9810
8809
|
setisApiFetching(false);
|
|
9811
8810
|
setSignUpSortingChange(false);
|
|
@@ -9821,8 +8820,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9821
8820
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
9822
8821
|
length: signup_rowsPerPage,
|
|
9823
8822
|
page: signup_page,
|
|
9824
|
-
search: signup_searchValue.trim()
|
|
9825
|
-
pagename: 'company'
|
|
8823
|
+
search: signup_searchValue.trim()
|
|
9826
8824
|
})).then(function () {
|
|
9827
8825
|
return dispatch(stopDataFetchingStatus());
|
|
9828
8826
|
});
|
|
@@ -9830,89 +8828,15 @@ var UserList = function UserList(_ref2) {
|
|
|
9830
8828
|
}
|
|
9831
8829
|
}
|
|
9832
8830
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9833
|
-
var topRightButtons = function topRightButtons() {
|
|
9834
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9835
|
-
component: "div",
|
|
9836
|
-
className: styles$5.buttonWrapper,
|
|
9837
|
-
display: "flex",
|
|
9838
|
-
justifyContent: "space-between",
|
|
9839
|
-
alignItems: "center",
|
|
9840
|
-
alignSelf: "flex-start"
|
|
9841
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9842
|
-
component: "div",
|
|
9843
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9844
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9845
|
-
buttonText: "Export all users",
|
|
9846
|
-
type: "outlined",
|
|
9847
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9848
|
-
width: "22",
|
|
9849
|
-
height: "22"
|
|
9850
|
-
}),
|
|
9851
|
-
onClick: handleExportUsers
|
|
9852
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9853
|
-
component: "div",
|
|
9854
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9855
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9856
|
-
buttonText: "Bulk actions",
|
|
9857
|
-
type: "outlined",
|
|
9858
|
-
menuListInfo: BulkUploadInfo
|
|
9859
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9860
|
-
component: "div",
|
|
9861
|
-
className: "pageHeader--button-single button-right"
|
|
9862
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9863
|
-
buttonText: "Add user",
|
|
9864
|
-
type: "contained",
|
|
9865
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9866
|
-
width: "9",
|
|
9867
|
-
height: "9",
|
|
9868
|
-
color: "white"
|
|
9869
|
-
}),
|
|
9870
|
-
onClick: handleAddPageNavigation
|
|
9871
|
-
})));
|
|
9872
|
-
};
|
|
9873
8831
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9874
8832
|
component: "div",
|
|
9875
8833
|
className: styles$5.UUIUserManagementList
|
|
9876
|
-
},
|
|
9877
|
-
className: styles$5.scrollOverlayMenu
|
|
9878
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9879
|
-
component: "div",
|
|
9880
|
-
className: clsx(styles$5.pageHeader)
|
|
9881
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9882
|
-
component: "div",
|
|
9883
|
-
display: "flex",
|
|
9884
|
-
justifyContent: "space-between",
|
|
9885
|
-
alignItems: "center",
|
|
9886
|
-
flexWrap: "wrap",
|
|
9887
|
-
style: {
|
|
9888
|
-
gap: '1rem'
|
|
9889
|
-
}
|
|
9890
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9891
|
-
component: "div",
|
|
9892
|
-
display: "flex",
|
|
9893
|
-
flexDirection: "column",
|
|
9894
|
-
style: {
|
|
9895
|
-
gap: '0.5rem'
|
|
9896
|
-
}
|
|
9897
|
-
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9898
|
-
placeholder: "Search by name, email & department",
|
|
9899
|
-
value: searchValue,
|
|
9900
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
9901
|
-
return onSearchHandler(e.target.value);
|
|
9902
|
-
},
|
|
9903
|
-
className: styles$5.overlaysearch
|
|
9904
|
-
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9905
|
-
component: "div",
|
|
9906
|
-
display: "flex",
|
|
9907
|
-
justifyContent: "space-between",
|
|
9908
|
-
alignItems: "center"
|
|
9909
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8834
|
+
}, !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
9910
8835
|
open: isFileDownloading || isApiFetching,
|
|
9911
8836
|
className: styles$5.backdrop
|
|
9912
8837
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
9913
8838
|
color: "inherit"
|
|
9914
8839
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9915
|
-
id: "table-root",
|
|
9916
8840
|
component: "div",
|
|
9917
8841
|
className: clsx(styles$5.pageHeader)
|
|
9918
8842
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -9937,7 +8861,44 @@ var UserList = function UserList(_ref2) {
|
|
|
9937
8861
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9938
8862
|
variant: "h3",
|
|
9939
8863
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
9940
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))),
|
|
8864
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8865
|
+
component: "div",
|
|
8866
|
+
className: styles$5.buttonWrapper,
|
|
8867
|
+
display: "flex",
|
|
8868
|
+
justifyContent: "space-between",
|
|
8869
|
+
alignItems: "center",
|
|
8870
|
+
alignSelf: "flex-start"
|
|
8871
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8872
|
+
component: "div",
|
|
8873
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8874
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8875
|
+
buttonText: "Export all users",
|
|
8876
|
+
type: "outlined",
|
|
8877
|
+
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
8878
|
+
width: "22",
|
|
8879
|
+
height: "22"
|
|
8880
|
+
}),
|
|
8881
|
+
onClick: handleExportUsers
|
|
8882
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8883
|
+
component: "div",
|
|
8884
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8885
|
+
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
8886
|
+
buttonText: "Bulk actions",
|
|
8887
|
+
type: "outlined",
|
|
8888
|
+
menuListInfo: BulkUploadInfo
|
|
8889
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8890
|
+
component: "div",
|
|
8891
|
+
className: "pageHeader--button-single button-right"
|
|
8892
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
8893
|
+
buttonText: "Add user",
|
|
8894
|
+
type: "contained",
|
|
8895
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
8896
|
+
width: "9",
|
|
8897
|
+
height: "9",
|
|
8898
|
+
color: "white"
|
|
8899
|
+
}),
|
|
8900
|
+
onClick: handleAddPageNavigation
|
|
8901
|
+
})))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9941
8902
|
component: "div",
|
|
9942
8903
|
display: "flex",
|
|
9943
8904
|
justifyContent: "space-between",
|
|
@@ -9982,9 +8943,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9982
8943
|
disableRowCheckbox: deactivatedUsers,
|
|
9983
8944
|
searchValue: searchValue,
|
|
9984
8945
|
isILadmin: isILadmin,
|
|
9985
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9986
|
-
onResetPasswordHandler: onResetPasswordHandler,
|
|
9987
|
-
toggleInviteModal: toggleInviteModal
|
|
8946
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9988
8947
|
}))
|
|
9989
8948
|
}, {
|
|
9990
8949
|
label: /*#__PURE__*/React.createElement(IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React.createElement(TabLabelCount, {
|
|
@@ -10000,10 +8959,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10000
8959
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
10001
8960
|
variant: "body2",
|
|
10002
8961
|
className: clsx(styles$5.description)
|
|
10003
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
10004
|
-
onClick: redirectToNotifications,
|
|
10005
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
10006
|
-
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
8962
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in Notifications.")), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
10007
8963
|
data: signupRequestListInfo,
|
|
10008
8964
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
10009
8965
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -10035,54 +8991,6 @@ var UserList = function UserList(_ref2) {
|
|
|
10035
8991
|
}))
|
|
10036
8992
|
}]
|
|
10037
8993
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
10038
|
-
isOpen: deactivateSingle,
|
|
10039
|
-
closeHandler: function closeHandler() {
|
|
10040
|
-
setDeactivateSingle(false);
|
|
10041
|
-
},
|
|
10042
|
-
cancelLabel: "Cancel",
|
|
10043
|
-
submitLabel: "Deactivate",
|
|
10044
|
-
submitHandler: handleDeactivateUser,
|
|
10045
|
-
headerText: "Deactivate this user?",
|
|
10046
|
-
width: "400px",
|
|
10047
|
-
subHanderText: "",
|
|
10048
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
10049
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10050
|
-
modalClass: "deactivateSingleModal",
|
|
10051
|
-
modalBodyStyle: {
|
|
10052
|
-
overflowY: 'unset'
|
|
10053
|
-
}
|
|
10054
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10055
|
-
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
10056
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10057
|
-
className: styles$5.deactivateAlert
|
|
10058
|
-
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
10059
|
-
width: "9",
|
|
10060
|
-
height: "9"
|
|
10061
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
10062
|
-
variant: "body2"
|
|
10063
|
-
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
10064
|
-
onClick: knowMore,
|
|
10065
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
10066
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10067
|
-
className: "iui__mt-15"
|
|
10068
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10069
|
-
isMove: true,
|
|
10070
|
-
additional: {
|
|
10071
|
-
page: 1,
|
|
10072
|
-
product: 'travel',
|
|
10073
|
-
userId: user.id
|
|
10074
|
-
},
|
|
10075
|
-
label: "Transfer approver role to",
|
|
10076
|
-
value: approverRole,
|
|
10077
|
-
onValueChange: selectApprover,
|
|
10078
|
-
loadOption: transferRoleOptions,
|
|
10079
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10080
|
-
customLoadingText: "No results found"
|
|
10081
|
-
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10082
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
10083
|
-
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10084
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
10085
|
-
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
10086
8994
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
10087
8995
|
closeHandler: closeDeActivateModal,
|
|
10088
8996
|
cancelLabel: "Cancel",
|
|
@@ -10108,124 +9016,7 @@ var UserList = function UserList(_ref2) {
|
|
|
10108
9016
|
className: styles$5.headerText
|
|
10109
9017
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
10110
9018
|
className: styles$5.description
|
|
10111
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(
|
|
10112
|
-
isOpen: isBulkDeactivateModalOpen,
|
|
10113
|
-
closeHandler: closeDeActiveModal,
|
|
10114
|
-
cancelLabel: "Cancel",
|
|
10115
|
-
submitLabel: "Deactivate safe users",
|
|
10116
|
-
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
10117
|
-
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
10118
|
-
customButtonLabel: "Deactivate all users",
|
|
10119
|
-
customButtonHandler: handleDeactivateUsers,
|
|
10120
|
-
submitHandler: handleDeactivateSafeUsers,
|
|
10121
|
-
width: "640px",
|
|
10122
|
-
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
10123
|
-
headerText: "Deactivate users?",
|
|
10124
|
-
modalBodyStyle: {
|
|
10125
|
-
maxHeight: 'calc(100vh - 50vh)'
|
|
10126
|
-
}
|
|
10127
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10128
|
-
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
10129
|
-
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
10130
|
-
color: "#9A6700",
|
|
10131
|
-
size: "14"
|
|
10132
|
-
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
10133
|
-
variant: "body2"
|
|
10134
|
-
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
10135
|
-
onClick: knowMore,
|
|
10136
|
-
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
10137
|
-
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10138
|
-
className: "iui__my-15"
|
|
10139
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10140
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
10141
|
-
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10142
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
10143
|
-
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
10144
|
-
var _item$data;
|
|
10145
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10146
|
-
key: index,
|
|
10147
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
10148
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
10149
|
-
firstName: item.first_name,
|
|
10150
|
-
lastName: item.last_name,
|
|
10151
|
-
isLetterAvatar: "true",
|
|
10152
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
10153
|
-
secondaryText: item.email,
|
|
10154
|
-
letterAvatarTextColor: "black",
|
|
10155
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
10156
|
-
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
10157
|
-
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
10158
|
-
color: "#9A6700",
|
|
10159
|
-
size: "14"
|
|
10160
|
-
}));
|
|
10161
|
-
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
10162
|
-
style: {
|
|
10163
|
-
borderColor: '#E5E9ED'
|
|
10164
|
-
}
|
|
10165
|
-
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10166
|
-
className: "iui__my-15"
|
|
10167
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10168
|
-
className: "iui__font--para-large iui__font--weight-medium"
|
|
10169
|
-
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
10170
|
-
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
10171
|
-
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
10172
|
-
var _item$data2;
|
|
10173
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10174
|
-
key: index,
|
|
10175
|
-
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
10176
|
-
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
10177
|
-
firstName: item.first_name,
|
|
10178
|
-
lastName: item.last_name,
|
|
10179
|
-
isLetterAvatar: "true",
|
|
10180
|
-
primaryText: item.first_name + ' ' + item.last_name,
|
|
10181
|
-
secondaryText: item.email,
|
|
10182
|
-
letterAvatarTextColor: "black",
|
|
10183
|
-
letterAvatarBackgroundColor: "#d3d3d3",
|
|
10184
|
-
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
10185
|
-
}));
|
|
10186
|
-
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
10187
|
-
isOpen: showInviteModal,
|
|
10188
|
-
closeHandler: function closeHandler() {
|
|
10189
|
-
return toggleInviteModalClose();
|
|
10190
|
-
},
|
|
10191
|
-
cancelLabel: "Cancel",
|
|
10192
|
-
headerText: "Resend Invites?",
|
|
10193
|
-
submitLabel: "Send",
|
|
10194
|
-
submitHandler: function submitHandler() {
|
|
10195
|
-
return onResendInviteHandler();
|
|
10196
|
-
},
|
|
10197
|
-
width: "400px",
|
|
10198
|
-
modalBodyStyle: {
|
|
10199
|
-
padding: '0px'
|
|
10200
|
-
},
|
|
10201
|
-
footerStyle: {
|
|
10202
|
-
justifyContent: 'center'
|
|
10203
|
-
}
|
|
10204
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
10205
|
-
style: {
|
|
10206
|
-
display: 'flex',
|
|
10207
|
-
padding: '16px',
|
|
10208
|
-
margin: '8px 24px',
|
|
10209
|
-
border: '1px solid #FDE047',
|
|
10210
|
-
background: '#FEFCE8',
|
|
10211
|
-
borderRadius: '5px'
|
|
10212
|
-
}
|
|
10213
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
10214
|
-
style: {
|
|
10215
|
-
marginRight: '5px'
|
|
10216
|
-
}
|
|
10217
|
-
}, /*#__PURE__*/React.createElement(InviteInfoIcon, null)), /*#__PURE__*/React.createElement("div", {
|
|
10218
|
-
style: {
|
|
10219
|
-
fontSize: '14px',
|
|
10220
|
-
color: '#374151'
|
|
10221
|
-
}
|
|
10222
|
-
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
10223
|
-
style: {
|
|
10224
|
-
fontSize: '14px',
|
|
10225
|
-
color: '#374151',
|
|
10226
|
-
fontWeight: 'bold'
|
|
10227
|
-
}
|
|
10228
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9019
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
10229
9020
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
10230
9021
|
closeImportUsersModal: closeImportUsersModal,
|
|
10231
9022
|
closeImportModal: closeImportModal
|
|
@@ -10234,8 +9025,8 @@ var UserList = function UserList(_ref2) {
|
|
|
10234
9025
|
errMsg: hasVerificationError
|
|
10235
9026
|
}));
|
|
10236
9027
|
};
|
|
10237
|
-
var TabLabelCount = function TabLabelCount(
|
|
10238
|
-
var count =
|
|
9028
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
9029
|
+
var count = _ref3.count;
|
|
10239
9030
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10240
9031
|
className: styles$5.TabLabelCount
|
|
10241
9032
|
}, " ", count, " ");
|
|
@@ -10310,12 +9101,11 @@ function Header(props) {
|
|
|
10310
9101
|
})));
|
|
10311
9102
|
}
|
|
10312
9103
|
|
|
10313
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","
|
|
9104
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","buttonWidth":"_13tv0","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
10314
9105
|
|
|
10315
9106
|
function Listview(_ref) {
|
|
10316
9107
|
var data = _ref.data,
|
|
10317
9108
|
name = _ref.name,
|
|
10318
|
-
tableName = _ref.tableName,
|
|
10319
9109
|
handleEditDialog = _ref.handleEditDialog,
|
|
10320
9110
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
10321
9111
|
orderBy = _ref.orderBy,
|
|
@@ -10328,87 +9118,21 @@ function Listview(_ref) {
|
|
|
10328
9118
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
10329
9119
|
page = _ref.page,
|
|
10330
9120
|
rowsPerPage = _ref.rowsPerPage;
|
|
10331
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10332
|
-
var _data$dept_head_detai;
|
|
10333
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
10334
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
10335
|
-
}
|
|
10336
|
-
};
|
|
10337
9121
|
var columns = [{
|
|
10338
9122
|
id: 'name',
|
|
10339
9123
|
label: name,
|
|
10340
|
-
width: '
|
|
10341
|
-
sortable: true,
|
|
10342
|
-
cell: function cell(row) {
|
|
10343
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10344
|
-
component: "div"
|
|
10345
|
-
}, row.name);
|
|
10346
|
-
}
|
|
10347
|
-
}, {
|
|
10348
|
-
id: 'no_of_users',
|
|
10349
|
-
label: 'Number of users',
|
|
10350
|
-
width: '40%',
|
|
10351
|
-
sortable: true,
|
|
10352
|
-
cell: function cell(row) {
|
|
10353
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10354
|
-
component: "div"
|
|
10355
|
-
}, row.no_of_users);
|
|
10356
|
-
}
|
|
10357
|
-
}, {
|
|
10358
|
-
id: 'actions',
|
|
10359
|
-
label: 'Actions',
|
|
10360
|
-
width: '20%',
|
|
10361
|
-
cell: function cell(row) {
|
|
10362
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10363
|
-
display: "flex"
|
|
10364
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
10365
|
-
buttonText: "Edit",
|
|
10366
|
-
className: styles$7.buttonWidth,
|
|
10367
|
-
onClick: function onClick() {
|
|
10368
|
-
return handleEditDialog(row);
|
|
10369
|
-
}
|
|
10370
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
10371
|
-
buttonText: "Delete",
|
|
10372
|
-
className: styles$7.buttonWidth,
|
|
10373
|
-
onClick: function onClick() {
|
|
10374
|
-
return handleDeleteDialog(row, true);
|
|
10375
|
-
}
|
|
10376
|
-
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
10377
|
-
buttonText: "Delete",
|
|
10378
|
-
className: styles$7.buttonWidth,
|
|
10379
|
-
onClick: function onClick() {
|
|
10380
|
-
return handleDeleteDialog(row, false);
|
|
10381
|
-
}
|
|
10382
|
-
}));
|
|
10383
|
-
}
|
|
10384
|
-
}];
|
|
10385
|
-
var departmentColumns = [{
|
|
10386
|
-
id: 'name',
|
|
10387
|
-
label: name,
|
|
10388
|
-
width: '30%',
|
|
9124
|
+
width: '45%',
|
|
10389
9125
|
sortable: true,
|
|
10390
9126
|
cell: function cell(row) {
|
|
10391
9127
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10392
9128
|
component: "div"
|
|
10393
9129
|
}, row.name);
|
|
10394
9130
|
}
|
|
10395
|
-
}, {
|
|
10396
|
-
id: 'department_head',
|
|
10397
|
-
label: 'Department head',
|
|
10398
|
-
width: '30%',
|
|
10399
|
-
sortable: true,
|
|
10400
|
-
cell: function cell(row) {
|
|
10401
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10402
|
-
component: "div"
|
|
10403
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
10404
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
10405
|
-
}, "Assigned by default"));
|
|
10406
|
-
}
|
|
10407
9131
|
}, {
|
|
10408
9132
|
id: 'no_of_users',
|
|
10409
9133
|
label: 'Number of users',
|
|
10410
9134
|
width: '45%',
|
|
10411
|
-
sortable:
|
|
9135
|
+
sortable: true,
|
|
10412
9136
|
cell: function cell(row) {
|
|
10413
9137
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
10414
9138
|
component: "div"
|
|
@@ -10417,7 +9141,7 @@ function Listview(_ref) {
|
|
|
10417
9141
|
}, {
|
|
10418
9142
|
id: 'actions',
|
|
10419
9143
|
label: 'Actions',
|
|
10420
|
-
width: '
|
|
9144
|
+
width: '10%',
|
|
10421
9145
|
cell: function cell(row) {
|
|
10422
9146
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10423
9147
|
display: "flex"
|
|
@@ -10450,7 +9174,7 @@ function Listview(_ref) {
|
|
|
10450
9174
|
hasFilter: true,
|
|
10451
9175
|
isCheckboxTable: false,
|
|
10452
9176
|
count: data.count,
|
|
10453
|
-
columns:
|
|
9177
|
+
columns: columns,
|
|
10454
9178
|
rows: data.results,
|
|
10455
9179
|
page: page,
|
|
10456
9180
|
handleChangePage: handleChangePage,
|
|
@@ -10507,43 +9231,16 @@ function EditPanelDialog(_ref) {
|
|
|
10507
9231
|
var isOpen = _ref.isOpen,
|
|
10508
9232
|
closeHandler = _ref.closeHandler,
|
|
10509
9233
|
onValueChange = _ref.onValueChange,
|
|
10510
|
-
|
|
9234
|
+
submitHandler = _ref.submitHandler,
|
|
10511
9235
|
isError = _ref.isError,
|
|
10512
9236
|
name = _ref.name,
|
|
10513
9237
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
10514
|
-
validation = _ref.validation
|
|
10515
|
-
rowData = _ref.rowData,
|
|
10516
|
-
tableName = _ref.tableName,
|
|
10517
|
-
config = _ref.config;
|
|
9238
|
+
validation = _ref.validation;
|
|
10518
9239
|
var _useSelector = useSelector(function (state) {
|
|
10519
9240
|
return state.userPanel;
|
|
10520
9241
|
}),
|
|
10521
9242
|
dialogData = _useSelector.dialogData;
|
|
10522
|
-
|
|
10523
|
-
var _data$dept_head_detai;
|
|
10524
|
-
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
10525
|
-
setHead({
|
|
10526
|
-
value: data.dept_head_details[0].id,
|
|
10527
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10528
|
-
});
|
|
10529
|
-
}
|
|
10530
|
-
};
|
|
10531
|
-
var _useState = useState({
|
|
10532
|
-
value: '',
|
|
10533
|
-
label: 'Select'
|
|
10534
|
-
}),
|
|
10535
|
-
head = _useState[0],
|
|
10536
|
-
setHead = _useState[1];
|
|
10537
|
-
useEffect(function () {
|
|
10538
|
-
deptHeadDetails(rowData);
|
|
10539
|
-
}, [rowData]);
|
|
10540
|
-
var history = useHistory();
|
|
10541
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10542
|
-
history.push({
|
|
10543
|
-
pathname: config.routes.users.add.path,
|
|
10544
|
-
state: rowData
|
|
10545
|
-
});
|
|
10546
|
-
};
|
|
9243
|
+
|
|
10547
9244
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
10548
9245
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
10549
9246
|
isOpen: isOpen,
|
|
@@ -10551,60 +9248,27 @@ function EditPanelDialog(_ref) {
|
|
|
10551
9248
|
headerText: "Edit " + name.toLowerCase(),
|
|
10552
9249
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
10553
9250
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
10554
|
-
submitHandler:
|
|
10555
|
-
|
|
10556
|
-
},
|
|
10557
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9251
|
+
submitHandler: submitHandler,
|
|
9252
|
+
width: "365px",
|
|
10558
9253
|
hideCloseIcon: false,
|
|
10559
9254
|
modalBodyStyle: {
|
|
10560
|
-
|
|
9255
|
+
maxHeight: '400px',
|
|
9256
|
+
overflow: 'auto',
|
|
9257
|
+
margin: '0px'
|
|
10561
9258
|
},
|
|
10562
9259
|
footerStyle: {
|
|
10563
9260
|
justifyContent: 'end'
|
|
10564
9261
|
}
|
|
10565
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10566
|
-
display: "flex",
|
|
10567
|
-
justifyContent: "center",
|
|
10568
|
-
alignItems: "center",
|
|
10569
|
-
flexDirection: "column",
|
|
10570
|
-
style: {
|
|
10571
|
-
marginBottom: '30px'
|
|
10572
|
-
}
|
|
10573
9262
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9263
|
+
component: "div",
|
|
10574
9264
|
display: "flex",
|
|
10575
9265
|
justifyContent: "center",
|
|
10576
9266
|
alignItems: "center",
|
|
10577
9267
|
flexDirection: "column",
|
|
10578
|
-
|
|
10579
|
-
}, /*#__PURE__*/React.createElement(
|
|
10580
|
-
|
|
10581
|
-
|
|
10582
|
-
className: styles$7.iconLayout,
|
|
10583
|
-
style: {
|
|
10584
|
-
paddingTop: '4px'
|
|
10585
|
-
}
|
|
10586
|
-
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10587
|
-
color: "#CA8A04",
|
|
10588
|
-
width: "25",
|
|
10589
|
-
height: "20",
|
|
10590
|
-
className: styles$7.iconStyle
|
|
10591
|
-
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10592
|
-
label: "By default, the primary admin gets assigned as the department head. This department has no users, so to change department head, add a new user.",
|
|
10593
|
-
style: {
|
|
10594
|
-
fontWeight: 'normal'
|
|
10595
|
-
}
|
|
10596
|
-
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10597
|
-
buttonText: "Add user",
|
|
10598
|
-
type: "text",
|
|
10599
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10600
|
-
width: "9",
|
|
10601
|
-
height: "9",
|
|
10602
|
-
color: "#EC5D25"
|
|
10603
|
-
}),
|
|
10604
|
-
onClick: handleAddPageNavigation,
|
|
10605
|
-
className: styles$7.addUserButton
|
|
10606
|
-
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
10607
|
-
label: name + " name",
|
|
9268
|
+
padding: "8px 24px"
|
|
9269
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9270
|
+
label: name + " name"
|
|
9271
|
+
,
|
|
10608
9272
|
name: "name",
|
|
10609
9273
|
defaultValue: dialogData.data.name,
|
|
10610
9274
|
onValueChange: onValueChange,
|
|
@@ -10612,49 +9276,7 @@ function EditPanelDialog(_ref) {
|
|
|
10612
9276
|
isError: isError,
|
|
10613
9277
|
validation: validation,
|
|
10614
9278
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
10615
|
-
required: true
|
|
10616
|
-
style: tableName === 'department' && {
|
|
10617
|
-
width: '350px'
|
|
10618
|
-
}
|
|
10619
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10620
|
-
className: "iui__mt-15",
|
|
10621
|
-
style: {
|
|
10622
|
-
width: '100%'
|
|
10623
|
-
}
|
|
10624
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10625
|
-
label: "Department head",
|
|
10626
|
-
name: "name",
|
|
10627
|
-
defaultValue: head.label,
|
|
10628
|
-
placeholder: "",
|
|
10629
|
-
readOnly: true,
|
|
10630
|
-
style: {
|
|
10631
|
-
width: '350px'
|
|
10632
|
-
}
|
|
10633
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10634
|
-
className: "iui__mt-15",
|
|
10635
|
-
style: {
|
|
10636
|
-
width: '100%'
|
|
10637
|
-
}
|
|
10638
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10639
|
-
noResultsText: true,
|
|
10640
|
-
isMove: true,
|
|
10641
|
-
additional: {
|
|
10642
|
-
page: 1,
|
|
10643
|
-
departmentId: rowData.id
|
|
10644
|
-
},
|
|
10645
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
10646
|
-
label: "Department head",
|
|
10647
|
-
value: head,
|
|
10648
|
-
onValueChange: function onValueChange(_ref2) {
|
|
10649
|
-
var _value = _ref2._value;
|
|
10650
|
-
return setHead(_value);
|
|
10651
|
-
},
|
|
10652
|
-
loadOption: departmentHeadOptions,
|
|
10653
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
10654
|
-
customLoadingText: "No users found in this department",
|
|
10655
|
-
customLoadingTextStyle: {
|
|
10656
|
-
color: '#374151'
|
|
10657
|
-
}
|
|
9279
|
+
required: true
|
|
10658
9280
|
})));
|
|
10659
9281
|
}
|
|
10660
9282
|
|
|
@@ -10833,15 +9455,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10833
9455
|
var _useState13 = useState(false),
|
|
10834
9456
|
isSortingChangeTemp = _useState13[0],
|
|
10835
9457
|
setSortingChangeTemp = _useState13[1];
|
|
10836
|
-
var _useState14 = useState(
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
var _useState15 = useState(
|
|
10840
|
-
|
|
10841
|
-
|
|
10842
|
-
var _useState16 = useState(5),
|
|
10843
|
-
rowsPerPage = _useState16[0],
|
|
10844
|
-
setRowsPerPage = _useState16[1];
|
|
9458
|
+
var _useState14 = useState(1),
|
|
9459
|
+
page = _useState14[0],
|
|
9460
|
+
setPage = _useState14[1];
|
|
9461
|
+
var _useState15 = useState(5),
|
|
9462
|
+
rowsPerPage = _useState15[0],
|
|
9463
|
+
setRowsPerPage = _useState15[1];
|
|
10845
9464
|
var orderingParam = orderBy;
|
|
10846
9465
|
var _useSelector = useSelector(function (state) {
|
|
10847
9466
|
return state.userPanel;
|
|
@@ -10854,25 +9473,18 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10854
9473
|
}),
|
|
10855
9474
|
isTokenVerified = _useSelector2.isTokenVerified,
|
|
10856
9475
|
hasVerificationError = _useSelector2.hasVerificationError;
|
|
9476
|
+
|
|
10857
9477
|
var onValueChange = function onValueChange(_ref2) {
|
|
10858
9478
|
var _value = _ref2._value;
|
|
10859
9479
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
10860
9480
|
setDataList(validatedValue);
|
|
10861
9481
|
};
|
|
10862
|
-
var _useState17 = useState(70),
|
|
10863
|
-
maxLengthForModal = _useState17[0],
|
|
10864
|
-
setMaxLengthForModal = _useState17[1];
|
|
10865
|
-
useEffect(function () {
|
|
10866
|
-
if (title === 'Business unit') {
|
|
10867
|
-
setMaxLengthForModal(150);
|
|
10868
|
-
}
|
|
10869
|
-
}, []);
|
|
10870
9482
|
var validation = {
|
|
10871
9483
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
10872
9484
|
regexOnBlur: null,
|
|
10873
9485
|
maxLimit: '',
|
|
10874
9486
|
minLimit: '',
|
|
10875
|
-
maxLength:
|
|
9487
|
+
maxLength: 70,
|
|
10876
9488
|
minLength: 0
|
|
10877
9489
|
};
|
|
10878
9490
|
useEffect(function () {
|
|
@@ -10945,7 +9557,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10945
9557
|
submitLabel: 'Save'
|
|
10946
9558
|
}, '', data));
|
|
10947
9559
|
setDataList(data.name);
|
|
10948
|
-
setRowData(data);
|
|
10949
9560
|
setEditModal(true);
|
|
10950
9561
|
};
|
|
10951
9562
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10960,12 +9571,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10960
9571
|
var payload = {
|
|
10961
9572
|
names: [dataList]
|
|
10962
9573
|
};
|
|
10963
|
-
if (tableName === 'department') {
|
|
10964
|
-
payload = {
|
|
10965
|
-
name: dataList,
|
|
10966
|
-
department_head_id: null
|
|
10967
|
-
};
|
|
10968
|
-
}
|
|
10969
9574
|
var message = title + " added successfully.";
|
|
10970
9575
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10971
9576
|
} else {
|
|
@@ -10979,12 +9584,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10979
9584
|
var message = title + " deleted successfully.";
|
|
10980
9585
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10981
9586
|
};
|
|
10982
|
-
|
|
10983
|
-
|
|
10984
|
-
optionalParams = null;
|
|
10985
|
-
}
|
|
9587
|
+
|
|
9588
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10986
9589
|
dispatch(userPanelShowLoader());
|
|
10987
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9590
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10988
9591
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10989
9592
|
dispatch(userPanelStopLoader());
|
|
10990
9593
|
if (type === 'delete') {
|
|
@@ -11026,14 +9629,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11026
9629
|
name: dataList
|
|
11027
9630
|
}]
|
|
11028
9631
|
};
|
|
11029
|
-
if (tableName === 'department') {
|
|
11030
|
-
payload = {
|
|
11031
|
-
name: dataList,
|
|
11032
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
11033
|
-
};
|
|
11034
|
-
}
|
|
11035
9632
|
var message = title + " updated successfully.";
|
|
11036
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9633
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
11037
9634
|
setErrorEdit(false);
|
|
11038
9635
|
} else {
|
|
11039
9636
|
setErrorEdit(true);
|
|
@@ -11140,10 +9737,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
11140
9737
|
submitHandler: handleEditPanel,
|
|
11141
9738
|
isError: errorEdit,
|
|
11142
9739
|
isDisabledSubmitBtn: loading,
|
|
11143
|
-
validation: validation
|
|
11144
|
-
rowData: rowData,
|
|
11145
|
-
tableName: tableName,
|
|
11146
|
-
config: config
|
|
9740
|
+
validation: validation
|
|
11147
9741
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
11148
9742
|
config: config
|
|
11149
9743
|
}));
|