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