@itilite/iui-user-management 0.4.203 → 0.4.205
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +212 -5
- package/dist/index.js +1299 -447
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1302 -450
- package/dist/index.modern.js.map +1 -1
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -14,7 +14,12 @@ 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'));
|
|
17
18
|
var Switch = _interopDefault(require('@material-ui/core/Switch'));
|
|
19
|
+
var MoreHorizIcon = _interopDefault(require('@material-ui/icons/MoreHoriz'));
|
|
20
|
+
var Button = _interopDefault(require('@material-ui/core/Button'));
|
|
21
|
+
var core = require('@material-ui/core');
|
|
22
|
+
var useScrollPosition = require('@n8tb1t/use-scroll-position');
|
|
18
23
|
|
|
19
24
|
function _extends() {
|
|
20
25
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -67,7 +72,6 @@ var _Pact = /*#__PURE__*/function () {
|
|
|
67
72
|
};
|
|
68
73
|
return _Pact;
|
|
69
74
|
}();
|
|
70
|
-
|
|
71
75
|
function _settle(pact, state, value) {
|
|
72
76
|
if (!pact.s) {
|
|
73
77
|
if (value instanceof _Pact) {
|
|
@@ -96,7 +100,6 @@ function _settle(pact, state, value) {
|
|
|
96
100
|
function _isSettledPact(thenable) {
|
|
97
101
|
return thenable instanceof _Pact && thenable.s & 1;
|
|
98
102
|
}
|
|
99
|
-
|
|
100
103
|
function _forTo(array, body, check) {
|
|
101
104
|
var i = -1,
|
|
102
105
|
pact,
|
|
@@ -128,7 +131,6 @@ function _forTo(array, body, check) {
|
|
|
128
131
|
}
|
|
129
132
|
var _iteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.iterator || (Symbol.iterator = Symbol("Symbol.iterator")) : "@@iterator";
|
|
130
133
|
var _asyncIteratorSymbol = /*#__PURE__*/typeof Symbol !== "undefined" ? Symbol.asyncIterator || (Symbol.asyncIterator = Symbol("Symbol.asyncIterator")) : "@@asyncIterator";
|
|
131
|
-
|
|
132
134
|
function _catch(body, recover) {
|
|
133
135
|
try {
|
|
134
136
|
var result = body();
|
|
@@ -147,17 +149,11 @@ function r(e) {
|
|
|
147
149
|
var t,
|
|
148
150
|
f,
|
|
149
151
|
n = "";
|
|
150
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
151
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
152
|
-
} else for (t in e) {
|
|
153
|
-
e[t] && (n && (n += " "), n += t);
|
|
154
|
-
}
|
|
152
|
+
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++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
155
153
|
return n;
|
|
156
154
|
}
|
|
157
155
|
function clsx() {
|
|
158
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
159
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
160
|
-
}
|
|
156
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
161
157
|
return n;
|
|
162
158
|
}
|
|
163
159
|
|
|
@@ -361,12 +357,24 @@ var userAddEditUrl = {
|
|
|
361
357
|
approversSearch: function approversSearch() {
|
|
362
358
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
363
359
|
},
|
|
360
|
+
_approversSearch: function _approversSearch() {
|
|
361
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
362
|
+
},
|
|
364
363
|
preSignedUrl: function preSignedUrl() {
|
|
365
364
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
366
365
|
},
|
|
367
366
|
editUser: function editUser(userId) {
|
|
368
367
|
return "api/v1/user-management/users/" + userId;
|
|
369
368
|
},
|
|
369
|
+
primaryAdmin: function primaryAdmin(userId) {
|
|
370
|
+
return "api/v1/user-management/mark-primary/" + userId;
|
|
371
|
+
},
|
|
372
|
+
resetPasswordForUserApi: function resetPasswordForUserApi() {
|
|
373
|
+
return "account/auth/password-reset/";
|
|
374
|
+
},
|
|
375
|
+
resendInviteForUserApi: function resendInviteForUserApi() {
|
|
376
|
+
return "api/v1/user-management/resend-welcome-email";
|
|
377
|
+
},
|
|
370
378
|
deletePaymentCard: function deletePaymentCard(pmId, vendorId) {
|
|
371
379
|
return env.getPaymentUrl() + "/api/v1/card/delete/" + pmId + "/" + vendorId + "/1";
|
|
372
380
|
},
|
|
@@ -439,15 +447,23 @@ var userPanelUrl = {
|
|
|
439
447
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
440
448
|
},
|
|
441
449
|
getUnit: function getUnit(tableName, length, sort) {
|
|
442
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
450
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&ordering=" + sort;
|
|
443
451
|
},
|
|
444
452
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
445
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
453
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&ordering=" + sort;
|
|
446
454
|
},
|
|
447
455
|
moveUnit: function moveUnit() {
|
|
448
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
449
457
|
}
|
|
450
458
|
};
|
|
459
|
+
var departmentUrl = {
|
|
460
|
+
departmentUrl: function departmentUrl() {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
462
|
+
},
|
|
463
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
451
467
|
|
|
452
468
|
var api = utils.configs.api;
|
|
453
469
|
var NAoptionConfig = {
|
|
@@ -457,7 +473,6 @@ var NAoptionConfig = {
|
|
|
457
473
|
},
|
|
458
474
|
applyFor: ['employee_level', 'department']
|
|
459
475
|
};
|
|
460
|
-
|
|
461
476
|
var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref) {
|
|
462
477
|
var page = _ref.page,
|
|
463
478
|
tabelName = _ref.tabelName,
|
|
@@ -593,28 +608,20 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
593
608
|
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
594
609
|
var page = _ref4.page,
|
|
595
610
|
product = _ref4.product,
|
|
596
|
-
userId = _ref4.userId
|
|
597
|
-
placeholder = _ref4.placeholder;
|
|
611
|
+
userId = _ref4.userId;
|
|
598
612
|
try {
|
|
599
613
|
return Promise.resolve(_catch(function () {
|
|
600
|
-
return Promise.resolve(api.get(userAddEditUrl.
|
|
614
|
+
return Promise.resolve(api.get(userAddEditUrl._approversSearch() + "user_id=" + userId + "&page=" + page).then(function (res) {
|
|
601
615
|
return res.data;
|
|
602
616
|
})).then(function (response) {
|
|
603
617
|
var mappedValue = response.results.map(function (item) {
|
|
604
618
|
return {
|
|
605
|
-
value: item.
|
|
606
|
-
label: item.
|
|
619
|
+
value: item.email,
|
|
620
|
+
label: item.email,
|
|
607
621
|
type: 'detailed',
|
|
608
|
-
data: item
|
|
622
|
+
data: item
|
|
609
623
|
};
|
|
610
624
|
});
|
|
611
|
-
if (page === 1) {
|
|
612
|
-
var placeholderLbl = {
|
|
613
|
-
value: '',
|
|
614
|
-
label: placeholder
|
|
615
|
-
};
|
|
616
|
-
mappedValue.unshift(placeholderLbl);
|
|
617
|
-
}
|
|
618
625
|
return {
|
|
619
626
|
options: mappedValue,
|
|
620
627
|
hasMore: !!response.next,
|
|
@@ -654,7 +661,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
654
661
|
label: item[tabelName]
|
|
655
662
|
};
|
|
656
663
|
});
|
|
657
|
-
|
|
658
664
|
return {
|
|
659
665
|
options: mappedValue,
|
|
660
666
|
hasMore: !!response.next,
|
|
@@ -678,6 +684,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
678
684
|
return Promise.reject(e);
|
|
679
685
|
}
|
|
680
686
|
};
|
|
687
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
|
|
688
|
+
var page = _ref6.page,
|
|
689
|
+
departmentId = _ref6.departmentId;
|
|
690
|
+
try {
|
|
691
|
+
return Promise.resolve(_catch(function () {
|
|
692
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
693
|
+
return res.data;
|
|
694
|
+
})).then(function (response) {
|
|
695
|
+
var mappedValue = response.results.map(function (item) {
|
|
696
|
+
return {
|
|
697
|
+
value: item.id,
|
|
698
|
+
label: item.first_name + ' ' + item.last_name,
|
|
699
|
+
type: 'detailed',
|
|
700
|
+
data: item
|
|
701
|
+
};
|
|
702
|
+
});
|
|
703
|
+
console.log(response.next);
|
|
704
|
+
return {
|
|
705
|
+
options: mappedValue,
|
|
706
|
+
hasMore: !!response.next,
|
|
707
|
+
additional: {
|
|
708
|
+
page: page + 1,
|
|
709
|
+
departmentId: departmentId
|
|
710
|
+
}
|
|
711
|
+
};
|
|
712
|
+
});
|
|
713
|
+
}, function () {
|
|
714
|
+
return {
|
|
715
|
+
options: [],
|
|
716
|
+
hasMore: false,
|
|
717
|
+
additional: {
|
|
718
|
+
page: 1,
|
|
719
|
+
departmentId: departmentId
|
|
720
|
+
}
|
|
721
|
+
};
|
|
722
|
+
}));
|
|
723
|
+
} catch (e) {
|
|
724
|
+
return Promise.reject(e);
|
|
725
|
+
}
|
|
726
|
+
};
|
|
681
727
|
|
|
682
728
|
var UserRole = function UserRole(_ref) {
|
|
683
729
|
var _ref$list = _ref.list,
|
|
@@ -756,7 +802,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
756
802
|
if (userTags.length) {
|
|
757
803
|
res.user_tags = userTags;
|
|
758
804
|
}
|
|
759
|
-
|
|
760
805
|
if (payload.productAccess.travel) {
|
|
761
806
|
var _payload$passportInfo, _payload$passportInfo2, _payload$passportInfo3, _payload$passportInfo4, _payload$membershipIn, _payload$uploadedFile;
|
|
762
807
|
res.approvers.travel = [];
|
|
@@ -768,14 +813,12 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
768
813
|
});
|
|
769
814
|
}
|
|
770
815
|
}
|
|
771
|
-
|
|
772
816
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
773
817
|
res.approvers.travel.push({
|
|
774
818
|
email: payload.travelFYI.value,
|
|
775
819
|
sequence: 'fyi'
|
|
776
820
|
});
|
|
777
821
|
}
|
|
778
|
-
|
|
779
822
|
res.user_travel_info = {
|
|
780
823
|
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,
|
|
781
824
|
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,
|
|
@@ -814,7 +857,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
814
857
|
res.files = [];
|
|
815
858
|
}
|
|
816
859
|
}
|
|
817
|
-
|
|
818
860
|
if (payload.productAccess.expense) {
|
|
819
861
|
res.approvers.expense = [];
|
|
820
862
|
for (var _key2 in payload.expenseApproversInput) {
|
|
@@ -825,7 +867,6 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
825
867
|
});
|
|
826
868
|
}
|
|
827
869
|
}
|
|
828
|
-
|
|
829
870
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
830
871
|
res.approvers.expense.push({
|
|
831
872
|
email: payload.expenseFYI.value,
|
|
@@ -933,7 +974,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
933
974
|
});
|
|
934
975
|
}
|
|
935
976
|
}
|
|
936
|
-
|
|
937
977
|
if (payload.travelFYI && payload.travelFYI.value) {
|
|
938
978
|
res.fields.approvers.travel.push({
|
|
939
979
|
email: payload.travelFYI.value,
|
|
@@ -1010,7 +1050,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1010
1050
|
res.fields.user_travel_info.redress_number = payload.secureTravelInputInfo.redress_number || null;
|
|
1011
1051
|
}
|
|
1012
1052
|
}
|
|
1013
|
-
|
|
1014
1053
|
if (payload.productAccess.expense) {
|
|
1015
1054
|
if (!env$1.isProfilePage()) {
|
|
1016
1055
|
res.fields.approvers.expense = [];
|
|
@@ -1022,7 +1061,6 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1022
1061
|
});
|
|
1023
1062
|
}
|
|
1024
1063
|
}
|
|
1025
|
-
|
|
1026
1064
|
if (payload.expenseFYI && payload.expenseFYI.value) {
|
|
1027
1065
|
res.fields.approvers.expense.push({
|
|
1028
1066
|
email: payload.expenseFYI.value,
|
|
@@ -1062,12 +1100,6 @@ var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
|
1062
1100
|
payload: payload
|
|
1063
1101
|
};
|
|
1064
1102
|
};
|
|
1065
|
-
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1066
|
-
return {
|
|
1067
|
-
type: SET_BULK_DEACTIVATED_USERS,
|
|
1068
|
-
payload: payload
|
|
1069
|
-
};
|
|
1070
|
-
};
|
|
1071
1103
|
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1072
1104
|
return {
|
|
1073
1105
|
type: SHOW_LOADER$1,
|
|
@@ -1128,36 +1160,25 @@ var exportUsers = function exportUsers(payload) {
|
|
|
1128
1160
|
});
|
|
1129
1161
|
};
|
|
1130
1162
|
};
|
|
1131
|
-
var deActivateUsers = function deActivateUsers(ids) {
|
|
1132
|
-
return function (dispatch) {
|
|
1133
|
-
return new Promise(function (resolve, reject) {
|
|
1134
|
-
api$1.post("" + userListUrl.bulkDeactivate(), {
|
|
1135
|
-
user_ids: ids
|
|
1136
|
-
}).then(function (res) {
|
|
1137
|
-
dispatch(setBulkDeactivatedUsers(ids));
|
|
1138
|
-
IUIToastMessageService.sNotify(ids.length + ' Users deactivated successfully');
|
|
1139
|
-
resolve();
|
|
1140
|
-
})["catch"](function (err) {
|
|
1141
|
-
if (!err.response.data.status) {
|
|
1142
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1143
|
-
reject(err);
|
|
1144
|
-
return;
|
|
1145
|
-
}
|
|
1146
|
-
reject(err);
|
|
1147
|
-
});
|
|
1148
|
-
});
|
|
1149
|
-
};
|
|
1150
|
-
};
|
|
1151
1163
|
var updateTabValue = function updateTabValue(tabId) {
|
|
1152
1164
|
return {
|
|
1153
1165
|
type: SET_TAB_VALUE,
|
|
1154
1166
|
payload: tabId
|
|
1155
1167
|
};
|
|
1156
1168
|
};
|
|
1157
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1169
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1170
|
+
if (roleTransfer === void 0) {
|
|
1171
|
+
roleTransfer = false;
|
|
1172
|
+
}
|
|
1173
|
+
var _payload = {
|
|
1174
|
+
role_transfer: roleTransfer
|
|
1175
|
+
};
|
|
1176
|
+
if (roleTransfer) {
|
|
1177
|
+
_payload['new_approver_user_id'] = newApproverUserId;
|
|
1178
|
+
}
|
|
1158
1179
|
return function (dispatch) {
|
|
1159
1180
|
return new Promise(function (resolve, reject) {
|
|
1160
|
-
api$1.
|
|
1181
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1161
1182
|
dispatch(setUserActiveStatus({
|
|
1162
1183
|
is_active: activateVal !== 0,
|
|
1163
1184
|
id: id
|
|
@@ -1254,7 +1275,6 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1254
1275
|
var _res$data;
|
|
1255
1276
|
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.');
|
|
1256
1277
|
dispatch(stopLoader());
|
|
1257
|
-
reject();
|
|
1258
1278
|
}
|
|
1259
1279
|
})["catch"](function (err) {
|
|
1260
1280
|
reject(err);
|
|
@@ -1328,6 +1348,35 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1328
1348
|
});
|
|
1329
1349
|
};
|
|
1330
1350
|
};
|
|
1351
|
+
var addManagerApproverField = function addManagerApproverField() {
|
|
1352
|
+
return function (dispatch, getState) {
|
|
1353
|
+
return new Promise(function (resolve, reject) {
|
|
1354
|
+
api$2.post(userAddEditUrl.approverField(), {
|
|
1355
|
+
label: 'Manager'
|
|
1356
|
+
}).then(function (res) {
|
|
1357
|
+
dispatch(setTravelApproverField({
|
|
1358
|
+
id: 7,
|
|
1359
|
+
label: 'Manager',
|
|
1360
|
+
name: 'manager',
|
|
1361
|
+
required: false,
|
|
1362
|
+
type: 'async_select',
|
|
1363
|
+
fullWidth: false,
|
|
1364
|
+
visibility: true,
|
|
1365
|
+
sequence: res.data.sequence,
|
|
1366
|
+
placeholder: 'Select manager',
|
|
1367
|
+
loadOption: approversOptions
|
|
1368
|
+
}));
|
|
1369
|
+
resolve();
|
|
1370
|
+
})["catch"](function (err) {
|
|
1371
|
+
var _err$response3, _err$response3$data;
|
|
1372
|
+
if (err !== null && err !== void 0 && (_err$response3 = err.response) !== null && _err$response3 !== void 0 && (_err$response3$data = _err$response3.data) !== null && _err$response3$data !== void 0 && _err$response3$data.message) {
|
|
1373
|
+
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1374
|
+
}
|
|
1375
|
+
reject(err);
|
|
1376
|
+
});
|
|
1377
|
+
});
|
|
1378
|
+
};
|
|
1379
|
+
};
|
|
1331
1380
|
var addExpenseApproverField = function addExpenseApproverField() {
|
|
1332
1381
|
return function (dispatch, getState) {
|
|
1333
1382
|
return new Promise(function (resolve, reject) {
|
|
@@ -1359,8 +1408,8 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1359
1408
|
}));
|
|
1360
1409
|
resolve();
|
|
1361
1410
|
})["catch"](function (err) {
|
|
1362
|
-
var _err$
|
|
1363
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1411
|
+
var _err$response4, _err$response4$data;
|
|
1412
|
+
if (err !== null && err !== void 0 && (_err$response4 = err.response) !== null && _err$response4 !== void 0 && (_err$response4$data = _err$response4.data) !== null && _err$response4$data !== void 0 && _err$response4$data.message) {
|
|
1364
1413
|
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1365
1414
|
}
|
|
1366
1415
|
reject(err);
|
|
@@ -1378,8 +1427,8 @@ var editApproverLabel = function editApproverLabel(payload) {
|
|
|
1378
1427
|
dispatch(payload.product === 'travel' ? setEditedTravelApproverField(payload) : setEditedExpenseApproverField(payload));
|
|
1379
1428
|
resolve();
|
|
1380
1429
|
})["catch"](function (err) {
|
|
1381
|
-
var _err$
|
|
1382
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1430
|
+
var _err$response5, _err$response5$data;
|
|
1431
|
+
if (err !== null && err !== void 0 && (_err$response5 = err.response) !== null && _err$response5 !== void 0 && (_err$response5$data = _err$response5.data) !== null && _err$response5$data !== void 0 && _err$response5$data.message) {
|
|
1383
1432
|
IUIToastMessageService$1.warningNotify(err.response.data.message);
|
|
1384
1433
|
}
|
|
1385
1434
|
reject(err);
|
|
@@ -1397,16 +1446,14 @@ var createUser = function createUser(payload) {
|
|
|
1397
1446
|
} else {
|
|
1398
1447
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1399
1448
|
reject(res.data.errors);
|
|
1400
|
-
return;
|
|
1401
1449
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1402
1450
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1403
1451
|
}
|
|
1404
|
-
reject();
|
|
1405
1452
|
}
|
|
1406
1453
|
})["catch"](function (err) {
|
|
1407
|
-
var _err$
|
|
1454
|
+
var _err$response6;
|
|
1408
1455
|
var error = 'Opps, Something went error.';
|
|
1409
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1456
|
+
if (err !== null && err !== void 0 && (_err$response6 = err.response) !== null && _err$response6 !== void 0 && _err$response6.data) {
|
|
1410
1457
|
if (err.response.data.errors && typeof err.response.data.errors === 'object' && Object.keys(err.response.data.errors).length) {
|
|
1411
1458
|
reject(err.response.data.errors);
|
|
1412
1459
|
return;
|
|
@@ -1447,17 +1494,13 @@ var uploadSingleDocumnet = function uploadSingleDocumnet(payload) {
|
|
|
1447
1494
|
});
|
|
1448
1495
|
};
|
|
1449
1496
|
};
|
|
1450
|
-
|
|
1451
1497
|
var uploadFileToS3 = function uploadFileToS3(presignedPostData, file) {
|
|
1452
1498
|
return new Promise(function (resolve, reject) {
|
|
1453
1499
|
var formData = new FormData();
|
|
1454
|
-
|
|
1455
1500
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
1456
1501
|
formData.append(key, presignedPostData.fields[key]);
|
|
1457
1502
|
});
|
|
1458
|
-
|
|
1459
1503
|
formData.append('file', file);
|
|
1460
|
-
|
|
1461
1504
|
axios.post(presignedPostData.url, formData, {
|
|
1462
1505
|
headers: {
|
|
1463
1506
|
'Content-Type': 'multipart/form-data'
|
|
@@ -1484,6 +1527,24 @@ var fetchUserDetails = function fetchUserDetails(payload) {
|
|
|
1484
1527
|
});
|
|
1485
1528
|
};
|
|
1486
1529
|
};
|
|
1530
|
+
var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
1531
|
+
return function (dispatch) {
|
|
1532
|
+
return new Promise(function (resolve, reject) {
|
|
1533
|
+
api$2.put(userAddEditUrl.primaryAdmin(payload.userId)).then(function (res) {
|
|
1534
|
+
if (res) {
|
|
1535
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1536
|
+
resolve();
|
|
1537
|
+
} else {
|
|
1538
|
+
reject(res);
|
|
1539
|
+
}
|
|
1540
|
+
})["catch"](function (err) {
|
|
1541
|
+
var _err$response7, _err$response7$data;
|
|
1542
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1543
|
+
reject(err);
|
|
1544
|
+
});
|
|
1545
|
+
});
|
|
1546
|
+
};
|
|
1547
|
+
};
|
|
1487
1548
|
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1488
1549
|
return function (dispatch) {
|
|
1489
1550
|
return new Promise(function (resolve, reject) {
|
|
@@ -1496,8 +1557,50 @@ var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
|
1496
1557
|
}));
|
|
1497
1558
|
resolve();
|
|
1498
1559
|
})["catch"](function (err) {
|
|
1499
|
-
var _err$
|
|
1500
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1560
|
+
var _err$response8, _err$response8$data;
|
|
1561
|
+
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.');
|
|
1562
|
+
reject(err);
|
|
1563
|
+
});
|
|
1564
|
+
});
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1568
|
+
return function (dispatch) {
|
|
1569
|
+
return new Promise(function (resolve, reject) {
|
|
1570
|
+
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1571
|
+
email: data.email
|
|
1572
|
+
}).then(function (res) {
|
|
1573
|
+
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.");
|
|
1574
|
+
resolve();
|
|
1575
|
+
})["catch"](function (err) {
|
|
1576
|
+
var _err$response9, _err$response9$data;
|
|
1577
|
+
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)) {
|
|
1578
|
+
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1579
|
+
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]);
|
|
1580
|
+
reject(err);
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
reject(err);
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
};
|
|
1587
|
+
};
|
|
1588
|
+
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1589
|
+
return function (dispatch) {
|
|
1590
|
+
return new Promise(function (resolve, reject) {
|
|
1591
|
+
api$2.post(userAddEditUrl.resendInviteForUserApi(), {
|
|
1592
|
+
user_ids: data
|
|
1593
|
+
}).then(function (res) {
|
|
1594
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1595
|
+
resolve();
|
|
1596
|
+
})["catch"](function (err) {
|
|
1597
|
+
var _err$response11, _err$response11$data;
|
|
1598
|
+
if (!(err !== null && err !== void 0 && (_err$response11 = err.response) !== null && _err$response11 !== void 0 && (_err$response11$data = _err$response11.data) !== null && _err$response11$data !== void 0 && _err$response11$data.status)) {
|
|
1599
|
+
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1600
|
+
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]);
|
|
1601
|
+
reject(err);
|
|
1602
|
+
return;
|
|
1603
|
+
}
|
|
1501
1604
|
reject(err);
|
|
1502
1605
|
});
|
|
1503
1606
|
});
|
|
@@ -1517,9 +1620,9 @@ var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
|
1517
1620
|
reject(res.data.errors);
|
|
1518
1621
|
}
|
|
1519
1622
|
})["catch"](function (err) {
|
|
1520
|
-
var _err$
|
|
1623
|
+
var _err$response13;
|
|
1521
1624
|
var error = 'Opps, Something went error.';
|
|
1522
|
-
if (err !== null && err !== void 0 && (_err$
|
|
1625
|
+
if (err !== null && err !== void 0 && (_err$response13 = err.response) !== null && _err$response13 !== void 0 && _err$response13.data) {
|
|
1523
1626
|
if (err.response.data.errors && typeof err.response.data.errors === 'object' && Object.keys(err.response.data.errors).length) {
|
|
1524
1627
|
reject(err.response.data.errors);
|
|
1525
1628
|
return;
|
|
@@ -1566,8 +1669,8 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1566
1669
|
reject(res);
|
|
1567
1670
|
}
|
|
1568
1671
|
})["catch"](function (err) {
|
|
1569
|
-
var _err$
|
|
1570
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1672
|
+
var _err$response14, _err$response14$data;
|
|
1673
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response14 = err.response) === null || _err$response14 === void 0 ? void 0 : (_err$response14$data = _err$response14.data) === null || _err$response14$data === void 0 ? void 0 : _err$response14$data.message) || 'Opps, Something went wrong.');
|
|
1571
1674
|
reject(err);
|
|
1572
1675
|
})["finally"](function () {
|
|
1573
1676
|
dispatch(stopLoader());
|
|
@@ -1602,8 +1705,8 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1602
1705
|
reject(res);
|
|
1603
1706
|
}
|
|
1604
1707
|
})["catch"](function (err) {
|
|
1605
|
-
var _err$
|
|
1606
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1708
|
+
var _err$response15, _err$response15$data;
|
|
1709
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response15 = err.response) === null || _err$response15 === void 0 ? void 0 : (_err$response15$data = _err$response15.data) === null || _err$response15$data === void 0 ? void 0 : _err$response15$data.message) || 'Opps, Something went wrong.');
|
|
1607
1710
|
reject(err);
|
|
1608
1711
|
})["finally"](function () {
|
|
1609
1712
|
dispatch(stopLoader());
|
|
@@ -1626,8 +1729,8 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1626
1729
|
reject(res);
|
|
1627
1730
|
}
|
|
1628
1731
|
})["catch"](function (err) {
|
|
1629
|
-
var _err$
|
|
1630
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1732
|
+
var _err$response16, _err$response16$data;
|
|
1733
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response16 = err.response) === null || _err$response16 === void 0 ? void 0 : (_err$response16$data = _err$response16.data) === null || _err$response16$data === void 0 ? void 0 : _err$response16$data.message) || 'Opps, Unable to fetch user info.');
|
|
1631
1734
|
setTimeout(function () {
|
|
1632
1735
|
window.history.back();
|
|
1633
1736
|
}, 1000);
|
|
@@ -1639,11 +1742,11 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1639
1742
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1640
1743
|
return function (dispatch) {
|
|
1641
1744
|
return new Promise(function (resolve, reject) {
|
|
1642
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1745
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1643
1746
|
resolve(res);
|
|
1644
1747
|
})["catch"](function (err) {
|
|
1645
|
-
var _err$
|
|
1646
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1748
|
+
var _err$response17, _err$response17$data;
|
|
1749
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response17 = err.response) === null || _err$response17 === void 0 ? void 0 : (_err$response17$data = _err$response17.data) === null || _err$response17$data === void 0 ? void 0 : _err$response17$data.message) || 'Opps, Something went wrong.');
|
|
1647
1750
|
dispatch(stopLoader());
|
|
1648
1751
|
});
|
|
1649
1752
|
});
|
|
@@ -1653,7 +1756,6 @@ var rejectUserVerification = function rejectUserVerification(userId) {
|
|
|
1653
1756
|
return function (dispatch) {
|
|
1654
1757
|
return new Promise(function (resolve, reject) {
|
|
1655
1758
|
api$2.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
1656
|
-
console.log(res);
|
|
1657
1759
|
if (res.data.status === true) {
|
|
1658
1760
|
resolve(res.data);
|
|
1659
1761
|
} else {
|
|
@@ -1662,9 +1764,8 @@ var rejectUserVerification = function rejectUserVerification(userId) {
|
|
|
1662
1764
|
reject(res);
|
|
1663
1765
|
}
|
|
1664
1766
|
})["catch"](function (err) {
|
|
1665
|
-
var _err$
|
|
1666
|
-
|
|
1667
|
-
IUIToastMessageService$1.warningNotify((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.message) || 'Opps, Unable to reject user.');
|
|
1767
|
+
var _err$response18, _err$response18$data;
|
|
1768
|
+
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response18 = err.response) === null || _err$response18 === void 0 ? void 0 : (_err$response18$data = _err$response18.data) === null || _err$response18$data === void 0 ? void 0 : _err$response18$data.message) || 'Opps, Unable to reject user.');
|
|
1668
1769
|
reject(err);
|
|
1669
1770
|
});
|
|
1670
1771
|
});
|
|
@@ -1677,6 +1778,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1677
1778
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1678
1779
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1679
1780
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1781
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1680
1782
|
|
|
1681
1783
|
var api$3 = utils.configs.api;
|
|
1682
1784
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1723,18 +1825,17 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1723
1825
|
});
|
|
1724
1826
|
};
|
|
1725
1827
|
};
|
|
1726
|
-
|
|
1727
1828
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1728
1829
|
return function (dispatch) {
|
|
1729
1830
|
return new Promise(function (resolve, reject) {
|
|
1730
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1831
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1731
1832
|
dispatch(getUserPanalData(getParam));
|
|
1732
1833
|
dispatch(closeDialog());
|
|
1733
1834
|
resolve(res);
|
|
1734
1835
|
})["catch"](function (err) {
|
|
1735
|
-
var _err$
|
|
1836
|
+
var _err$response3, _err$response3$data;
|
|
1736
1837
|
dispatch(userPanelStopLoader());
|
|
1737
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1838
|
+
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.');
|
|
1738
1839
|
});
|
|
1739
1840
|
});
|
|
1740
1841
|
};
|
|
@@ -1748,25 +1849,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1748
1849
|
dispatch(userPanelStopLoader());
|
|
1749
1850
|
resolve();
|
|
1750
1851
|
})["catch"](function (err) {
|
|
1751
|
-
var _err$
|
|
1752
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1852
|
+
var _err$response4, _err$response4$data;
|
|
1853
|
+
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.');
|
|
1753
1854
|
dispatch(userPanelStopLoader());
|
|
1754
1855
|
});
|
|
1755
1856
|
});
|
|
1756
1857
|
};
|
|
1757
1858
|
};
|
|
1758
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1859
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1759
1860
|
return function (dispatch) {
|
|
1760
1861
|
return new Promise(function (resolve, reject) {
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1862
|
+
if (tableName === 'department') {
|
|
1863
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1864
|
+
dispatch(getUserPanalData(getParam));
|
|
1865
|
+
dispatch(closeDialog());
|
|
1866
|
+
resolve();
|
|
1867
|
+
})["catch"](function (err) {
|
|
1868
|
+
var _err$response5, _err$response5$data;
|
|
1869
|
+
dispatch(userPanelStopLoader());
|
|
1870
|
+
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.');
|
|
1871
|
+
});
|
|
1872
|
+
} else {
|
|
1873
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1874
|
+
dispatch(getUserPanalData(getParam));
|
|
1875
|
+
dispatch(closeDialog());
|
|
1876
|
+
resolve();
|
|
1877
|
+
})["catch"](function (err) {
|
|
1878
|
+
var _err$response6, _err$response6$data;
|
|
1879
|
+
dispatch(userPanelStopLoader());
|
|
1880
|
+
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.');
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1770
1883
|
});
|
|
1771
1884
|
};
|
|
1772
1885
|
};
|
|
@@ -1778,8 +1891,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1778
1891
|
dispatch(closeDialog());
|
|
1779
1892
|
resolve(res);
|
|
1780
1893
|
})["catch"](function (err) {
|
|
1781
|
-
var _err$
|
|
1782
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1894
|
+
var _err$response7, _err$response7$data;
|
|
1895
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1783
1896
|
});
|
|
1784
1897
|
});
|
|
1785
1898
|
};
|
|
@@ -2267,7 +2380,6 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2267
2380
|
setOpenEditAproverModalFlag(false);
|
|
2268
2381
|
});
|
|
2269
2382
|
};
|
|
2270
|
-
|
|
2271
2383
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
2272
2384
|
container: true,
|
|
2273
2385
|
className: (styles.headingPadding)
|
|
@@ -2415,8 +2527,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2415
2527
|
headerText: "Edit approver field",
|
|
2416
2528
|
cancelLabel: "Cancel",
|
|
2417
2529
|
submitLabel: "Save",
|
|
2418
|
-
submitHandler: handleEditAproverLabel
|
|
2419
|
-
,
|
|
2530
|
+
submitHandler: handleEditAproverLabel,
|
|
2420
2531
|
width: "420px",
|
|
2421
2532
|
modalBodyStyle: {
|
|
2422
2533
|
maxHeight: '600px',
|
|
@@ -2972,7 +3083,7 @@ var workInfo = [{
|
|
|
2972
3083
|
},
|
|
2973
3084
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2974
3085
|
}, {
|
|
2975
|
-
id:
|
|
3086
|
+
id: 9,
|
|
2976
3087
|
label: 'Base location',
|
|
2977
3088
|
name: 'base_location',
|
|
2978
3089
|
required: false,
|
|
@@ -2997,7 +3108,7 @@ var workInfo = [{
|
|
|
2997
3108
|
},
|
|
2998
3109
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
2999
3110
|
}, {
|
|
3000
|
-
id:
|
|
3111
|
+
id: 10,
|
|
3001
3112
|
label: 'Default currency',
|
|
3002
3113
|
name: 'currency',
|
|
3003
3114
|
required: false,
|
|
@@ -3011,7 +3122,7 @@ var workInfo = [{
|
|
|
3011
3122
|
tooltip: 'This only changes the currency for this user',
|
|
3012
3123
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3013
3124
|
}, {
|
|
3014
|
-
id:
|
|
3125
|
+
id: 11,
|
|
3015
3126
|
empty: true
|
|
3016
3127
|
}];
|
|
3017
3128
|
var products = [{
|
|
@@ -3381,6 +3492,7 @@ var userAddPageFormLabels = {
|
|
|
3381
3492
|
business_unit: 'Business unit',
|
|
3382
3493
|
department: 'Department',
|
|
3383
3494
|
designation: 'Designation',
|
|
3495
|
+
manager: 'Manager',
|
|
3384
3496
|
base_location: 'Base location',
|
|
3385
3497
|
currency: 'Default currency'
|
|
3386
3498
|
},
|
|
@@ -3805,7 +3917,6 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3805
3917
|
_userListInfo.results[i].is_active = action.payload.is_active;
|
|
3806
3918
|
}
|
|
3807
3919
|
});
|
|
3808
|
-
|
|
3809
3920
|
var _deactivatedUsers = _userListInfo.results.length > 0 ? _userListInfo.results.filter(function (val) {
|
|
3810
3921
|
return !val.is_active;
|
|
3811
3922
|
}).map(function (obj) {
|
|
@@ -3828,7 +3939,6 @@ var reducer$1 = function reducer(state, action) {
|
|
|
3828
3939
|
}
|
|
3829
3940
|
});
|
|
3830
3941
|
});
|
|
3831
|
-
|
|
3832
3942
|
var _deactivatedUsers2 = _userListInfo2.results.length > 0 ? _userListInfo2.results.filter(function (val) {
|
|
3833
3943
|
return !val.is_active;
|
|
3834
3944
|
}).map(function (obj) {
|
|
@@ -3882,6 +3992,7 @@ var initialState$2 = {
|
|
|
3882
3992
|
previous: null,
|
|
3883
3993
|
results: []
|
|
3884
3994
|
},
|
|
3995
|
+
deptUsers: [],
|
|
3885
3996
|
loading: false
|
|
3886
3997
|
};
|
|
3887
3998
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -3951,6 +4062,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
3951
4062
|
loading: false
|
|
3952
4063
|
});
|
|
3953
4064
|
}
|
|
4065
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4066
|
+
{
|
|
4067
|
+
return _extends({}, state, {
|
|
4068
|
+
deptUsers: action.payload
|
|
4069
|
+
});
|
|
4070
|
+
}
|
|
3954
4071
|
default:
|
|
3955
4072
|
return state;
|
|
3956
4073
|
}
|
|
@@ -4137,8 +4254,7 @@ var rootReducer = redux.combineReducers({
|
|
|
4137
4254
|
customFields: reducer$5
|
|
4138
4255
|
});
|
|
4139
4256
|
|
|
4140
|
-
var store = redux.createStore(rootReducer, reduxDevtoolsExtension.composeWithDevTools(redux.applyMiddleware(thunk)
|
|
4141
|
-
));
|
|
4257
|
+
var store = redux.createStore(rootReducer, reduxDevtoolsExtension.composeWithDevTools(redux.applyMiddleware(thunk)));
|
|
4142
4258
|
|
|
4143
4259
|
function withStore(Component) {
|
|
4144
4260
|
function WrappedComponent(props) {
|
|
@@ -4681,8 +4797,7 @@ function AddPanelDialog(_ref) {
|
|
|
4681
4797
|
flexDirection: "column",
|
|
4682
4798
|
padding: "8px 20px"
|
|
4683
4799
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
4684
|
-
label: name + " name"
|
|
4685
|
-
,
|
|
4800
|
+
label: name + " name",
|
|
4686
4801
|
name: "name",
|
|
4687
4802
|
defaultValue: "",
|
|
4688
4803
|
onValueChange: onValueChange,
|
|
@@ -4731,6 +4846,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4731
4846
|
isILadmin = _useSelector2.isILadmin,
|
|
4732
4847
|
companyName = _useSelector2.companyName;
|
|
4733
4848
|
var history = reactRouterDom.useHistory();
|
|
4849
|
+
var location = reactRouterDom.useLocation();
|
|
4734
4850
|
var _useState = React.useState({
|
|
4735
4851
|
travel: false,
|
|
4736
4852
|
expense: false
|
|
@@ -4766,7 +4882,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4766
4882
|
}
|
|
4767
4883
|
setProductAccess(_productAccess);
|
|
4768
4884
|
};
|
|
4769
|
-
|
|
4770
4885
|
var _useState2 = React.useState({
|
|
4771
4886
|
first_name: '',
|
|
4772
4887
|
last_name: '',
|
|
@@ -4987,8 +5102,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4987
5102
|
var onAddModalClose = function onAddModalClose() {
|
|
4988
5103
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
4989
5104
|
};
|
|
5105
|
+
React.useEffect(function () {
|
|
5106
|
+
var _location$state, _location$state2;
|
|
5107
|
+
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) {
|
|
5108
|
+
var _location$state3, _location$state4;
|
|
5109
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5110
|
+
department: {
|
|
5111
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5112
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5113
|
+
}
|
|
5114
|
+
}));
|
|
5115
|
+
}
|
|
5116
|
+
}, []);
|
|
4990
5117
|
var onModalOpen = function onModalOpen(e, id) {
|
|
4991
|
-
console.log('onModalOpen', e, id);
|
|
4992
5118
|
var title = '';
|
|
4993
5119
|
if (id === 'entity') {
|
|
4994
5120
|
title = 'Entity';
|
|
@@ -5013,23 +5139,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5013
5139
|
}));
|
|
5014
5140
|
} else {
|
|
5015
5141
|
dispatch(showLoader());
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5142
|
+
var dataObj;
|
|
5143
|
+
if (addModalData.id === 'department') {
|
|
5144
|
+
dataObj = {
|
|
5145
|
+
name: validatedValue,
|
|
5146
|
+
department_head_id: null
|
|
5147
|
+
};
|
|
5148
|
+
} else {
|
|
5149
|
+
dataObj = {
|
|
5150
|
+
names: [validatedValue]
|
|
5151
|
+
};
|
|
5152
|
+
}
|
|
5153
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5154
|
+
var _extends4;
|
|
5020
5155
|
setAddModalData(_extends({}, addModalData, {
|
|
5021
5156
|
isOpen: false
|
|
5022
5157
|
}));
|
|
5023
5158
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5024
5159
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5160
|
+
if (addModalData.id === 'department') {
|
|
5161
|
+
var _extends2;
|
|
5162
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5163
|
+
value: res.data.result.id,
|
|
5164
|
+
label: res.data.result.name
|
|
5165
|
+
}, _extends2)));
|
|
5166
|
+
} else {
|
|
5167
|
+
var _extends3;
|
|
5168
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5169
|
+
value: res.data.value,
|
|
5170
|
+
label: res.data.label
|
|
5171
|
+
}, _extends3)));
|
|
5172
|
+
}
|
|
5173
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5029
5174
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5030
5175
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5031
|
-
var
|
|
5032
|
-
return _extends({}, prevState, (
|
|
5176
|
+
var _extends5;
|
|
5177
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5033
5178
|
});
|
|
5034
5179
|
dispatch(stopLoader());
|
|
5035
5180
|
});
|
|
@@ -5046,10 +5191,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5046
5191
|
};
|
|
5047
5192
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5048
5193
|
try {
|
|
5049
|
-
var
|
|
5194
|
+
var _temp5 = function _temp5() {
|
|
5050
5195
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5051
|
-
var
|
|
5052
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5196
|
+
var _extends6;
|
|
5197
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5053
5198
|
}
|
|
5054
5199
|
};
|
|
5055
5200
|
var _name = args._name,
|
|
@@ -5060,7 +5205,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5060
5205
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5061
5206
|
_args$_obj = args._obj,
|
|
5062
5207
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5063
|
-
var
|
|
5208
|
+
var _temp4 = function () {
|
|
5064
5209
|
if (_name === 'contact_number') {
|
|
5065
5210
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5066
5211
|
contact_number: _value.trim(),
|
|
@@ -5071,14 +5216,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5071
5216
|
updateError('country_code', _isError, _errorMsg);
|
|
5072
5217
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5073
5218
|
} else {
|
|
5074
|
-
var
|
|
5075
|
-
var
|
|
5076
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5219
|
+
var _temp3 = function _temp3() {
|
|
5220
|
+
var _extends7;
|
|
5221
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5077
5222
|
updateError(_name, _isError, _errorMsg);
|
|
5078
5223
|
};
|
|
5079
|
-
var
|
|
5224
|
+
var _temp2 = function () {
|
|
5080
5225
|
if (_name === 'profile_pic') {
|
|
5081
|
-
var
|
|
5226
|
+
var _temp = function () {
|
|
5082
5227
|
if (_obj.isUpload) {
|
|
5083
5228
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5084
5229
|
_value = _value.map(function (_val) {
|
|
@@ -5109,28 +5254,32 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5109
5254
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5110
5255
|
}
|
|
5111
5256
|
}();
|
|
5112
|
-
if (
|
|
5257
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
5113
5258
|
}
|
|
5114
5259
|
}();
|
|
5115
|
-
return
|
|
5260
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
5116
5261
|
}
|
|
5117
5262
|
}();
|
|
5118
|
-
return Promise.resolve(
|
|
5263
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
|
5119
5264
|
} catch (e) {
|
|
5120
5265
|
return Promise.reject(e);
|
|
5121
5266
|
}
|
|
5122
5267
|
};
|
|
5123
5268
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5124
|
-
var
|
|
5269
|
+
var _extends8;
|
|
5125
5270
|
var _name = args._name,
|
|
5126
5271
|
_value = args._value,
|
|
5127
5272
|
_isError = args._isError,
|
|
5128
5273
|
_errorMsg = args._errorMsg;
|
|
5129
|
-
|
|
5274
|
+
console.log({
|
|
5275
|
+
_name: _name,
|
|
5276
|
+
_value: _value
|
|
5277
|
+
});
|
|
5278
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5130
5279
|
updateError(_name, _isError, _errorMsg);
|
|
5131
5280
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5132
|
-
var
|
|
5133
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5281
|
+
var _extends9;
|
|
5282
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5134
5283
|
}
|
|
5135
5284
|
};
|
|
5136
5285
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5140,9 +5289,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5140
5289
|
return tag.id;
|
|
5141
5290
|
};
|
|
5142
5291
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5143
|
-
var
|
|
5292
|
+
var _extends10;
|
|
5144
5293
|
var e = args._event;
|
|
5145
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5294
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5146
5295
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5147
5296
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5148
5297
|
userTagType: true
|
|
@@ -5150,22 +5299,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5150
5299
|
}
|
|
5151
5300
|
};
|
|
5152
5301
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5153
|
-
var
|
|
5302
|
+
var _extends11;
|
|
5154
5303
|
var _name = _ref2._name,
|
|
5155
5304
|
_value = _ref2._value;
|
|
5156
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5305
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5157
5306
|
};
|
|
5158
5307
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5159
|
-
var
|
|
5308
|
+
var _extends12;
|
|
5160
5309
|
var _name = _ref3._name,
|
|
5161
5310
|
_value = _ref3._value;
|
|
5162
|
-
|
|
5311
|
+
console.log(_name, _value, 'travel');
|
|
5312
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5163
5313
|
};
|
|
5164
5314
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5165
|
-
var
|
|
5315
|
+
var _extends13;
|
|
5166
5316
|
var _name = _ref4._name,
|
|
5167
5317
|
_value = _ref4._value;
|
|
5168
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5318
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5169
5319
|
};
|
|
5170
5320
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5171
5321
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5199,39 +5349,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5199
5349
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5200
5350
|
};
|
|
5201
5351
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5202
|
-
var
|
|
5352
|
+
var _extends14;
|
|
5203
5353
|
var _name = args._name,
|
|
5204
5354
|
_value = args._value,
|
|
5205
5355
|
_isError = args._isError,
|
|
5206
5356
|
_errorMsg = args._errorMsg;
|
|
5207
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5357
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5208
5358
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5209
|
-
var
|
|
5210
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5359
|
+
var _extends15;
|
|
5360
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5211
5361
|
}
|
|
5212
5362
|
updateError(_name, _isError, _errorMsg);
|
|
5213
5363
|
};
|
|
5214
5364
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5215
|
-
var
|
|
5365
|
+
var _extends16;
|
|
5216
5366
|
var _name = args._name,
|
|
5217
5367
|
_value = args._value,
|
|
5218
5368
|
_isError = args._isError,
|
|
5219
5369
|
_errorMsg = args._errorMsg;
|
|
5220
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5370
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5221
5371
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5222
|
-
var
|
|
5223
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5372
|
+
var _extends17;
|
|
5373
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5224
5374
|
}
|
|
5225
5375
|
updateError(_name, _isError, _errorMsg);
|
|
5226
5376
|
};
|
|
5227
5377
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5228
5378
|
try {
|
|
5229
|
-
var
|
|
5230
|
-
var
|
|
5231
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5379
|
+
var _temp8 = function _temp8() {
|
|
5380
|
+
var _extends18;
|
|
5381
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5232
5382
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5233
|
-
var
|
|
5234
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5383
|
+
var _extends19;
|
|
5384
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5235
5385
|
}
|
|
5236
5386
|
updateError(_name, _isError, _errorMsg);
|
|
5237
5387
|
};
|
|
@@ -5269,9 +5419,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5269
5419
|
}
|
|
5270
5420
|
return Promise.resolve();
|
|
5271
5421
|
}
|
|
5272
|
-
var
|
|
5422
|
+
var _temp7 = function () {
|
|
5273
5423
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5274
|
-
var
|
|
5424
|
+
var _temp6 = function () {
|
|
5275
5425
|
if (_obj.isUpload) {
|
|
5276
5426
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5277
5427
|
if (_name === 'passport_photo') {
|
|
@@ -5315,10 +5465,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5315
5465
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5316
5466
|
}
|
|
5317
5467
|
}();
|
|
5318
|
-
if (
|
|
5468
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
5319
5469
|
}
|
|
5320
5470
|
}();
|
|
5321
|
-
return Promise.resolve(
|
|
5471
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
|
5322
5472
|
} catch (e) {
|
|
5323
5473
|
return Promise.reject(e);
|
|
5324
5474
|
}
|
|
@@ -5337,8 +5487,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5337
5487
|
return _errorArray;
|
|
5338
5488
|
});
|
|
5339
5489
|
setErrorMsgs(function (prevState) {
|
|
5340
|
-
var
|
|
5341
|
-
return _extends({}, prevState, (
|
|
5490
|
+
var _extends20;
|
|
5491
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5342
5492
|
});
|
|
5343
5493
|
};
|
|
5344
5494
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5597,7 +5747,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5597
5747
|
required: true
|
|
5598
5748
|
}
|
|
5599
5749
|
}));
|
|
5600
|
-
|
|
5601
5750
|
var _productAccess = _extends({}, productAccess);
|
|
5602
5751
|
renderFields.products.forEach(function (product) {
|
|
5603
5752
|
_productAccess[product.name] = true;
|
|
@@ -5645,7 +5794,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5645
5794
|
}, [renderFields.expenseApprovers]);
|
|
5646
5795
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5647
5796
|
try {
|
|
5648
|
-
var
|
|
5797
|
+
var _temp10 = function _temp10() {
|
|
5649
5798
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5650
5799
|
dispatch(stopLoader());
|
|
5651
5800
|
return data;
|
|
@@ -5661,12 +5810,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5661
5810
|
userID: editUserId
|
|
5662
5811
|
});
|
|
5663
5812
|
});
|
|
5664
|
-
var
|
|
5813
|
+
var _temp9 = _forTo(docs, function (i) {
|
|
5665
5814
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5666
5815
|
data.push(res);
|
|
5667
5816
|
});
|
|
5668
5817
|
});
|
|
5669
|
-
return Promise.resolve(
|
|
5818
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9));
|
|
5670
5819
|
} catch (e) {
|
|
5671
5820
|
return Promise.reject(e);
|
|
5672
5821
|
}
|
|
@@ -5794,8 +5943,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5794
5943
|
}
|
|
5795
5944
|
_errorMsgs.passport_issue_date = '';
|
|
5796
5945
|
}
|
|
5797
|
-
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false &&
|
|
5798
|
-
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5946
|
+
if (passportInfoInput.passport_photo.length === 0 && userTravelInfo.file_name === false && fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5799
5947
|
_isError = true;
|
|
5800
5948
|
if (_errorArray.indexOf('passport_photo') === -1) {
|
|
5801
5949
|
_errorArray.push('passport_photo');
|
|
@@ -5807,8 +5955,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5807
5955
|
}
|
|
5808
5956
|
_errorMsgs.passport_photo = '';
|
|
5809
5957
|
}
|
|
5810
|
-
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false &&
|
|
5811
|
-
fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5958
|
+
if (passportInfoInput.travel_docs.length === 0 && userTravelInfo.file_name === false && fieldsVisibility.user_travel_info.file_name !== 2) {
|
|
5812
5959
|
_isError = true;
|
|
5813
5960
|
if (_errorArray.indexOf('travel_docs') === -1) {
|
|
5814
5961
|
_errorArray.push('travel_docs');
|
|
@@ -5824,27 +5971,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5824
5971
|
if (_isError) {
|
|
5825
5972
|
setErrorArray(_errorArray);
|
|
5826
5973
|
setErrorMsgs(_errorMsgs);
|
|
5827
|
-
|
|
5974
|
+
var _loop = function _loop() {
|
|
5828
5975
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
5829
5976
|
if (_errorMsgs[_key3]) {
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
}
|
|
5844
|
-
}();
|
|
5845
|
-
if (_ret === "break") break;
|
|
5977
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5978
|
+
setAdditionalInfoFlag('open');
|
|
5979
|
+
}
|
|
5980
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5981
|
+
if (el) {
|
|
5982
|
+
setTimeout(function () {
|
|
5983
|
+
el.scrollIntoView({
|
|
5984
|
+
behavior: 'smooth',
|
|
5985
|
+
block: 'center'
|
|
5986
|
+
});
|
|
5987
|
+
}, 500);
|
|
5988
|
+
return "break";
|
|
5989
|
+
}
|
|
5846
5990
|
}
|
|
5847
5991
|
}
|
|
5992
|
+
};
|
|
5993
|
+
for (var _key3 in _errorMsgs) {
|
|
5994
|
+
var _ret = _loop();
|
|
5995
|
+
if (_ret === "break") break;
|
|
5848
5996
|
}
|
|
5849
5997
|
return Promise.resolve();
|
|
5850
5998
|
}
|
|
@@ -5858,6 +6006,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5858
6006
|
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5859
6007
|
(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);
|
|
5860
6008
|
}
|
|
6009
|
+
setFilesForDelete([]);
|
|
6010
|
+
setProfilePicDelete([]);
|
|
5861
6011
|
})["catch"](function (err) {
|
|
5862
6012
|
if (typeof err === 'object') {
|
|
5863
6013
|
if (err.country_code) {
|
|
@@ -5872,27 +6022,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5872
6022
|
}
|
|
5873
6023
|
setErrorArray(Object.keys(err));
|
|
5874
6024
|
setErrorMsgs(err);
|
|
5875
|
-
|
|
6025
|
+
var _loop2 = function _loop2() {
|
|
5876
6026
|
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5877
6027
|
if (err[_key4]) {
|
|
5878
|
-
|
|
5879
|
-
|
|
5880
|
-
|
|
5881
|
-
|
|
5882
|
-
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
}
|
|
5892
|
-
}();
|
|
5893
|
-
if (_ret2 === "break") break;
|
|
6028
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6029
|
+
setAdditionalInfoFlag('open');
|
|
6030
|
+
}
|
|
6031
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6032
|
+
if (el) {
|
|
6033
|
+
setTimeout(function () {
|
|
6034
|
+
el.scrollIntoView({
|
|
6035
|
+
behavior: 'smooth',
|
|
6036
|
+
block: 'center'
|
|
6037
|
+
});
|
|
6038
|
+
}, 500);
|
|
6039
|
+
return "break";
|
|
6040
|
+
}
|
|
5894
6041
|
}
|
|
5895
6042
|
}
|
|
6043
|
+
};
|
|
6044
|
+
for (var _key4 in err) {
|
|
6045
|
+
var _ret2 = _loop2();
|
|
6046
|
+
if (_ret2 === "break") break;
|
|
5896
6047
|
}
|
|
5897
6048
|
} else if (typeof err === 'string') {
|
|
5898
6049
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5921,27 +6072,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5921
6072
|
}
|
|
5922
6073
|
setErrorArray(Object.keys(err));
|
|
5923
6074
|
setErrorMsgs(err);
|
|
5924
|
-
|
|
6075
|
+
var _loop3 = function _loop3() {
|
|
5925
6076
|
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
5926
6077
|
if (err[_key5]) {
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
5933
|
-
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
}
|
|
5941
|
-
}();
|
|
5942
|
-
if (_ret3 === "break") break;
|
|
6078
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6079
|
+
setAdditionalInfoFlag('open');
|
|
6080
|
+
}
|
|
6081
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6082
|
+
if (el) {
|
|
6083
|
+
setTimeout(function () {
|
|
6084
|
+
el.scrollIntoView({
|
|
6085
|
+
behavior: 'smooth',
|
|
6086
|
+
block: 'center'
|
|
6087
|
+
});
|
|
6088
|
+
}, 500);
|
|
6089
|
+
return "break";
|
|
6090
|
+
}
|
|
5943
6091
|
}
|
|
5944
6092
|
}
|
|
6093
|
+
};
|
|
6094
|
+
for (var _key5 in err) {
|
|
6095
|
+
var _ret3 = _loop3();
|
|
6096
|
+
if (_ret3 === "break") break;
|
|
5945
6097
|
}
|
|
5946
6098
|
} else if (typeof err === 'string') {
|
|
5947
6099
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5966,8 +6118,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5966
6118
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
5967
6119
|
}
|
|
5968
6120
|
}
|
|
5969
|
-
}
|
|
5970
|
-
else {
|
|
6121
|
+
} else {
|
|
5971
6122
|
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
5972
6123
|
(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);
|
|
5973
6124
|
}
|
|
@@ -6000,7 +6151,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6000
6151
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6001
6152
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6002
6153
|
}(),
|
|
6003
|
-
|
|
6004
6154
|
gender: function () {
|
|
6005
6155
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6006
6156
|
}()
|
|
@@ -6045,7 +6195,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6045
6195
|
}()
|
|
6046
6196
|
});
|
|
6047
6197
|
});
|
|
6048
|
-
|
|
6049
6198
|
if (res.client_admin) {
|
|
6050
6199
|
setTravelApproversInput(function (prevState) {
|
|
6051
6200
|
var nextState = _extends({}, prevState);
|
|
@@ -6079,7 +6228,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6079
6228
|
});
|
|
6080
6229
|
}
|
|
6081
6230
|
};
|
|
6082
|
-
|
|
6083
6231
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
6084
6232
|
component: "div",
|
|
6085
6233
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6096,8 +6244,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6096
6244
|
className: styles.breadcrumb
|
|
6097
6245
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBreadCrumb, {
|
|
6098
6246
|
breadCrumbs: [{
|
|
6099
|
-
href:
|
|
6100
|
-
config.routes.users.list.path,
|
|
6247
|
+
href: config.routes.users.list.path,
|
|
6101
6248
|
label: 'Users',
|
|
6102
6249
|
hasLink: true
|
|
6103
6250
|
}]
|
|
@@ -6166,6 +6313,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6166
6313
|
if (!p.visibility) {
|
|
6167
6314
|
return null;
|
|
6168
6315
|
}
|
|
6316
|
+
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6317
|
+
return null;
|
|
6318
|
+
}
|
|
6169
6319
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
6170
6320
|
item: true,
|
|
6171
6321
|
sm: 12,
|
|
@@ -6318,6 +6468,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6318
6468
|
addFields: function addFields() {
|
|
6319
6469
|
return dispatch(addTravelApproverField());
|
|
6320
6470
|
},
|
|
6471
|
+
addManager: function addManager() {
|
|
6472
|
+
return dispatch(addManagerApproverField);
|
|
6473
|
+
},
|
|
6321
6474
|
onRoleChange: function onRoleChange(_ref5) {
|
|
6322
6475
|
var _value = _ref5._value;
|
|
6323
6476
|
return setTravelRole(_value);
|
|
@@ -6359,6 +6512,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6359
6512
|
addFields: function addFields() {
|
|
6360
6513
|
return dispatch(addExpenseApproverField());
|
|
6361
6514
|
},
|
|
6515
|
+
addManager: function addManager() {
|
|
6516
|
+
return dispatch(addManagerApproverField);
|
|
6517
|
+
},
|
|
6362
6518
|
onRoleChange: function onRoleChange(_ref6) {
|
|
6363
6519
|
var _value = _ref6._value;
|
|
6364
6520
|
return setExpenseRole(_value);
|
|
@@ -6538,17 +6694,13 @@ var uploadBulkUsersFile = function uploadBulkUsersFile(payload) {
|
|
|
6538
6694
|
});
|
|
6539
6695
|
};
|
|
6540
6696
|
};
|
|
6541
|
-
|
|
6542
6697
|
var uploadFileToS3$1 = function uploadFileToS3(presignedPostData, file) {
|
|
6543
6698
|
return new Promise(function (resolve, reject) {
|
|
6544
6699
|
var formData = new FormData();
|
|
6545
|
-
|
|
6546
6700
|
Object.keys(presignedPostData.fields).forEach(function (key) {
|
|
6547
6701
|
formData.append(key, presignedPostData.fields[key]);
|
|
6548
6702
|
});
|
|
6549
|
-
|
|
6550
6703
|
formData.append('file', file);
|
|
6551
|
-
|
|
6552
6704
|
axios.post(presignedPostData.url, formData, {
|
|
6553
6705
|
headers: {
|
|
6554
6706
|
'Content-Type': 'multipart/form-data'
|
|
@@ -6665,7 +6817,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6665
6817
|
};
|
|
6666
6818
|
};
|
|
6667
6819
|
|
|
6668
|
-
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","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"};
|
|
6820
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","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","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6669
6821
|
|
|
6670
6822
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6671
6823
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6734,7 +6886,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6734
6886
|
file: doc
|
|
6735
6887
|
});
|
|
6736
6888
|
});
|
|
6737
|
-
var
|
|
6889
|
+
var _temp = _forTo(docs, function (i) {
|
|
6738
6890
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6739
6891
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6740
6892
|
if (validatedRes.data.status) {
|
|
@@ -6774,7 +6926,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6774
6926
|
})).then(function () {});
|
|
6775
6927
|
});
|
|
6776
6928
|
});
|
|
6777
|
-
return Promise.resolve(
|
|
6929
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
6778
6930
|
} catch (e) {
|
|
6779
6931
|
return Promise.reject(e);
|
|
6780
6932
|
}
|
|
@@ -6949,7 +7101,6 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6949
7101
|
setOpenImportUsersModal(false);
|
|
6950
7102
|
handleImportPagenavigation(jobId);
|
|
6951
7103
|
};
|
|
6952
|
-
|
|
6953
7104
|
var handleDownloadRecords = function handleDownloadRecords(type) {
|
|
6954
7105
|
try {
|
|
6955
7106
|
setDownlStatus(true);
|
|
@@ -7925,6 +8076,120 @@ var BulkDownloadIcon = function BulkDownloadIcon(props) {
|
|
|
7925
8076
|
}));
|
|
7926
8077
|
};
|
|
7927
8078
|
|
|
8079
|
+
var classes = {"containedBtn":"_2A4_u","customMiniBox":"_QGIKG","muiBtn":"_3iFbO","outlinedBtn":"_3lQYD","menuList":"_1C8bJ","menuListContainer":"_1N83W","menuItemContainer":"_3VtcE","menuItemtext":"_2xqnU","subTxt":"_3CVzX"};
|
|
8080
|
+
|
|
8081
|
+
var DropdownBtn = function DropdownBtn(props) {
|
|
8082
|
+
var _clsx;
|
|
8083
|
+
var _props$buttonText = props.buttonText,
|
|
8084
|
+
buttonText = _props$buttonText === void 0 ? '' : _props$buttonText,
|
|
8085
|
+
_props$disableRipple = props.disableRipple,
|
|
8086
|
+
disableRipple = _props$disableRipple === void 0 ? true : _props$disableRipple,
|
|
8087
|
+
_props$onClickHandler = props.onClickHandler,
|
|
8088
|
+
onClickHandler = _props$onClickHandler === void 0 ? function () {} : _props$onClickHandler,
|
|
8089
|
+
_props$menuListInfo = props.menuListInfo,
|
|
8090
|
+
menuListInfo = _props$menuListInfo === void 0 ? [] : _props$menuListInfo,
|
|
8091
|
+
_props$endIcon = props.endIcon,
|
|
8092
|
+
endIcon = _props$endIcon === void 0 ? /*#__PURE__*/React__default.createElement(ExpandMoreIcon, {
|
|
8093
|
+
width: "10",
|
|
8094
|
+
height: "10"
|
|
8095
|
+
}) : _props$endIcon,
|
|
8096
|
+
_props$outlinedBtn = props.outlinedBtn,
|
|
8097
|
+
outlinedBtn = _props$outlinedBtn === void 0 ? true : _props$outlinedBtn,
|
|
8098
|
+
_props$placement = props.placement,
|
|
8099
|
+
placement = _props$placement === void 0 ? 'auto-center' : _props$placement,
|
|
8100
|
+
className = props.className,
|
|
8101
|
+
menuListClass = props.menuListClass;
|
|
8102
|
+
var _React$useState = React__default.useState(false),
|
|
8103
|
+
open = _React$useState[0],
|
|
8104
|
+
setOpen = _React$useState[1];
|
|
8105
|
+
var anchorRef = React__default.useRef(null);
|
|
8106
|
+
var handleToggle = function handleToggle() {
|
|
8107
|
+
setOpen(function (prevOpen) {
|
|
8108
|
+
return !prevOpen;
|
|
8109
|
+
});
|
|
8110
|
+
};
|
|
8111
|
+
var handleClose = function handleClose(event) {
|
|
8112
|
+
if (anchorRef.current && anchorRef.current.contains(event.target)) {
|
|
8113
|
+
return;
|
|
8114
|
+
}
|
|
8115
|
+
setOpen(false);
|
|
8116
|
+
onClickHandler(event);
|
|
8117
|
+
};
|
|
8118
|
+
var handleListKeyDown = function handleListKeyDown(event) {
|
|
8119
|
+
if (event.key === 'Tab') {
|
|
8120
|
+
event.preventDefault();
|
|
8121
|
+
setOpen(false);
|
|
8122
|
+
}
|
|
8123
|
+
};
|
|
8124
|
+
var handleMenuClick = function handleMenuClick(val) {
|
|
8125
|
+
setOpen(false);
|
|
8126
|
+
if (val.disable) return false;
|
|
8127
|
+
if (val.handler && typeof val.handler === 'function') val.handler();
|
|
8128
|
+
};
|
|
8129
|
+
var prevOpen = React__default.useRef(open);
|
|
8130
|
+
React__default.useEffect(function () {
|
|
8131
|
+
if (prevOpen.current === true && open === false) {
|
|
8132
|
+
anchorRef.current.focus();
|
|
8133
|
+
}
|
|
8134
|
+
prevOpen.current = open;
|
|
8135
|
+
}, [open]);
|
|
8136
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Button, {
|
|
8137
|
+
endIcon: endIcon,
|
|
8138
|
+
className: clsx(classes.muiBtn, className, (_clsx = {}, _clsx[classes.outlinedBtn] = outlinedBtn, _clsx)),
|
|
8139
|
+
disableRipple: disableRipple,
|
|
8140
|
+
variant: "outlined",
|
|
8141
|
+
ref: anchorRef,
|
|
8142
|
+
"aria-controls": open ? 'menu-list-grow' : undefined,
|
|
8143
|
+
"aria-haspopup": "true",
|
|
8144
|
+
onClick: handleToggle
|
|
8145
|
+
}, buttonText), /*#__PURE__*/React__default.createElement(core.Popper, {
|
|
8146
|
+
open: open,
|
|
8147
|
+
anchorEl: anchorRef.current,
|
|
8148
|
+
role: undefined,
|
|
8149
|
+
transition: true,
|
|
8150
|
+
disablePortal: true,
|
|
8151
|
+
style: {
|
|
8152
|
+
zIndex: '9'
|
|
8153
|
+
},
|
|
8154
|
+
placement: placement
|
|
8155
|
+
}, function (_ref) {
|
|
8156
|
+
var _clsx2;
|
|
8157
|
+
var TransitionProps = _ref.TransitionProps,
|
|
8158
|
+
placement = _ref.placement;
|
|
8159
|
+
return /*#__PURE__*/React__default.createElement(core.Grow, _extends({}, TransitionProps, {
|
|
8160
|
+
style: {
|
|
8161
|
+
transformOrigin: placement === 'bottom' ? 'center top' : 'center bottom'
|
|
8162
|
+
}
|
|
8163
|
+
}), /*#__PURE__*/React__default.createElement(core.Paper, {
|
|
8164
|
+
className: classes.menuListContainer,
|
|
8165
|
+
elevation: 0
|
|
8166
|
+
}, /*#__PURE__*/React__default.createElement(core.ClickAwayListener, {
|
|
8167
|
+
onClickAway: handleClose
|
|
8168
|
+
}, /*#__PURE__*/React__default.createElement(core.MenuList, {
|
|
8169
|
+
autoFocusItem: open,
|
|
8170
|
+
className: clsx(classes.menuList, (_clsx2 = {}, _clsx2[classes.outlinedBtn] = outlinedBtn, _clsx2), menuListClass),
|
|
8171
|
+
id: "menu-list-grow",
|
|
8172
|
+
onKeyDown: function onKeyDown(e) {
|
|
8173
|
+
return handleListKeyDown(e);
|
|
8174
|
+
}
|
|
8175
|
+
}, menuListInfo.map(function (val, _i) {
|
|
8176
|
+
return /*#__PURE__*/React__default.createElement(core.MenuItem, {
|
|
8177
|
+
onClick: function onClick() {
|
|
8178
|
+
return handleMenuClick(val);
|
|
8179
|
+
},
|
|
8180
|
+
key: _i,
|
|
8181
|
+
className: clsx(classes.menuItemContainer, val.disable && 'iui__cursor-not-allowed'),
|
|
8182
|
+
disableRipple: true
|
|
8183
|
+
}, /*#__PURE__*/React__default.createElement(core.Typography, {
|
|
8184
|
+
className: clsx(classes.menuItemtext, val && val.disable && 'iui__opacity--60')
|
|
8185
|
+
}, val.label), val.subText && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8186
|
+
variant: "subtitle2",
|
|
8187
|
+
className: clsx(classes.menuItemtext, classes.subTxt)
|
|
8188
|
+
}, val.subText));
|
|
8189
|
+
})))));
|
|
8190
|
+
}));
|
|
8191
|
+
};
|
|
8192
|
+
|
|
7928
8193
|
var AntSwitch = styles$8.withStyles(function (theme) {
|
|
7929
8194
|
return {
|
|
7930
8195
|
root: {
|
|
@@ -7975,6 +8240,10 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
7975
8240
|
selected = props.selected,
|
|
7976
8241
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
7977
8242
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8243
|
+
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8244
|
+
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8245
|
+
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8246
|
+
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
7978
8247
|
orderBy = props.orderBy,
|
|
7979
8248
|
order = props.order,
|
|
7980
8249
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -7983,11 +8252,30 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
7983
8252
|
onSearchHandler = _props$onSearchHandle === void 0 ? function () {} : _props$onSearchHandle,
|
|
7984
8253
|
_props$onEditHandler = props.onEditHandler,
|
|
7985
8254
|
onEditHandler = _props$onEditHandler === void 0 ? function () {} : _props$onEditHandler,
|
|
8255
|
+
_props$onPrimaryAdmin = props.onPrimaryAdminHandler,
|
|
8256
|
+
onPrimaryAdminHandler = _props$onPrimaryAdmin === void 0 ? function () {} : _props$onPrimaryAdmin,
|
|
7986
8257
|
_props$isDataFetching = props.isDataFetching,
|
|
7987
8258
|
isDataFetching = _props$isDataFetching === void 0 ? false : _props$isDataFetching,
|
|
7988
8259
|
_props$disableRowChec = props.disableRowCheckbox,
|
|
7989
8260
|
disableRowCheckbox = _props$disableRowChec === void 0 ? false : _props$disableRowChec,
|
|
7990
|
-
searchValue = props.searchValue
|
|
8261
|
+
searchValue = props.searchValue,
|
|
8262
|
+
_props$isILadmin = props.isILadmin,
|
|
8263
|
+
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8264
|
+
var useStyles = styles$8.makeStyles(function (theme) {
|
|
8265
|
+
return {
|
|
8266
|
+
tooltip: {
|
|
8267
|
+
background: '#1F2937',
|
|
8268
|
+
fontSize: '14px',
|
|
8269
|
+
color: '#ffffff',
|
|
8270
|
+
padding: '12px 16px',
|
|
8271
|
+
borderRadius: '6px'
|
|
8272
|
+
},
|
|
8273
|
+
arrow: {
|
|
8274
|
+
color: '#1F2937'
|
|
8275
|
+
}
|
|
8276
|
+
};
|
|
8277
|
+
});
|
|
8278
|
+
var classes = useStyles();
|
|
7991
8279
|
var columns = [{
|
|
7992
8280
|
id: 'first_name',
|
|
7993
8281
|
label: 'Name',
|
|
@@ -7998,8 +8286,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
7998
8286
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
7999
8287
|
firstName: row.first_name,
|
|
8000
8288
|
lastName: row.last_name,
|
|
8001
|
-
isLetterAvatar:
|
|
8002
|
-
row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8289
|
+
isLetterAvatar: !(row.profile_pic && row.profile_pic.presigned_url),
|
|
8003
8290
|
primaryText: row.first_name + ' ' + row.last_name,
|
|
8004
8291
|
secondaryText: row.email,
|
|
8005
8292
|
letterAvatarTextColor: "black",
|
|
@@ -8008,10 +8295,31 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8008
8295
|
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
|
|
8009
8296
|
}));
|
|
8010
8297
|
}
|
|
8298
|
+
}, {
|
|
8299
|
+
id: 'first_name',
|
|
8300
|
+
label: '',
|
|
8301
|
+
minWidth: 60,
|
|
8302
|
+
sortable: false,
|
|
8303
|
+
cell: function cell(row) {
|
|
8304
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8305
|
+
component: "div",
|
|
8306
|
+
width: 60
|
|
8307
|
+
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8308
|
+
title: "This user hasn't logged on to the platform yet",
|
|
8309
|
+
arrow: true,
|
|
8310
|
+
classes: {
|
|
8311
|
+
arrow: classes.arrow,
|
|
8312
|
+
tooltip: classes.tooltip
|
|
8313
|
+
},
|
|
8314
|
+
placement: "top-start"
|
|
8315
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8316
|
+
className: clsx(styles$5.tooltipText)
|
|
8317
|
+
}, "Invited")) : null);
|
|
8318
|
+
}
|
|
8011
8319
|
}, {
|
|
8012
8320
|
id: 'emp_info__department__name',
|
|
8013
8321
|
label: 'Department',
|
|
8014
|
-
minWidth:
|
|
8322
|
+
minWidth: 80,
|
|
8015
8323
|
sortable: true,
|
|
8016
8324
|
cell: function cell(row) {
|
|
8017
8325
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8024,7 +8332,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8024
8332
|
}, {
|
|
8025
8333
|
id: 'productusermapping__role',
|
|
8026
8334
|
label: 'Product roles',
|
|
8027
|
-
minWidth:
|
|
8335
|
+
minWidth: 125,
|
|
8028
8336
|
sortable: true,
|
|
8029
8337
|
cell: function cell(row) {
|
|
8030
8338
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8060,7 +8368,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8060
8368
|
}, {
|
|
8061
8369
|
id: 'status',
|
|
8062
8370
|
label: 'Status',
|
|
8063
|
-
minWidth:
|
|
8371
|
+
minWidth: 160,
|
|
8064
8372
|
cell: function cell(row) {
|
|
8065
8373
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIFormGroup, null, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8066
8374
|
component: "div",
|
|
@@ -8086,15 +8394,55 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8086
8394
|
}, {
|
|
8087
8395
|
id: 'actions',
|
|
8088
8396
|
label: 'Actions',
|
|
8089
|
-
minWidth:
|
|
8397
|
+
minWidth: 70,
|
|
8090
8398
|
align: 'left',
|
|
8091
8399
|
cell: function cell(row) {
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8400
|
+
var options = [{
|
|
8401
|
+
label: 'Edit details',
|
|
8402
|
+
handler: function handler() {
|
|
8095
8403
|
return onEditHandler(row.id);
|
|
8096
8404
|
}
|
|
8097
|
-
}
|
|
8405
|
+
}];
|
|
8406
|
+
if (row && row.has_visited && row.is_active) {
|
|
8407
|
+
options.push({
|
|
8408
|
+
label: 'Reset password',
|
|
8409
|
+
handler: function handler() {
|
|
8410
|
+
return onResetPasswordHandler(row.email);
|
|
8411
|
+
}
|
|
8412
|
+
});
|
|
8413
|
+
} else if (row && row.is_active) {
|
|
8414
|
+
options.push({
|
|
8415
|
+
label: 'Resend invite',
|
|
8416
|
+
handler: function handler() {
|
|
8417
|
+
return toggleInviteModal(row.id, 'single');
|
|
8418
|
+
}
|
|
8419
|
+
});
|
|
8420
|
+
}
|
|
8421
|
+
if (isILadmin) {
|
|
8422
|
+
options.push({
|
|
8423
|
+
label: 'Make primary admin',
|
|
8424
|
+
handler: function handler() {
|
|
8425
|
+
return onPrimaryAdminHandler(row.id);
|
|
8426
|
+
}
|
|
8427
|
+
});
|
|
8428
|
+
}
|
|
8429
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
8430
|
+
style: {
|
|
8431
|
+
marginLeft: '50px'
|
|
8432
|
+
}
|
|
8433
|
+
}, /*#__PURE__*/React__default.createElement(DropdownBtn, {
|
|
8434
|
+
buttonText: /*#__PURE__*/React__default.createElement(MoreHorizIcon, {
|
|
8435
|
+
fontSize: "medium",
|
|
8436
|
+
color: "#6B7280"
|
|
8437
|
+
}),
|
|
8438
|
+
disableRipple: false,
|
|
8439
|
+
menuListInfo: options,
|
|
8440
|
+
menuListClass: "menuClass",
|
|
8441
|
+
endIcon: null,
|
|
8442
|
+
outlinedBtn: false,
|
|
8443
|
+
className: "threedotMenuBtn",
|
|
8444
|
+
placement: "bottom-end"
|
|
8445
|
+
}));
|
|
8098
8446
|
},
|
|
8099
8447
|
style: {
|
|
8100
8448
|
paddingLeft: '40px'
|
|
@@ -8122,7 +8470,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8122
8470
|
isDataFetching: isDataFetching,
|
|
8123
8471
|
disableRowCheckbox: disableRowCheckbox,
|
|
8124
8472
|
searchBoxWidth: "400px",
|
|
8125
|
-
searchValue: searchValue
|
|
8473
|
+
searchValue: searchValue,
|
|
8474
|
+
hideTopPagination: false
|
|
8126
8475
|
});
|
|
8127
8476
|
};
|
|
8128
8477
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8153,7 +8502,6 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8153
8502
|
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
8154
8503
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8155
8504
|
};
|
|
8156
|
-
|
|
8157
8505
|
var columns = [{
|
|
8158
8506
|
id: 'fname',
|
|
8159
8507
|
label: 'Name',
|
|
@@ -8164,8 +8512,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8164
8512
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
8165
8513
|
firstName: row.fname,
|
|
8166
8514
|
lastName: row.lname,
|
|
8167
|
-
isLetterAvatar:
|
|
8168
|
-
row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8515
|
+
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8169
8516
|
primaryText: row.fname + ' ' + row.lname,
|
|
8170
8517
|
secondaryText: row.email,
|
|
8171
8518
|
letterAvatarTextColor: "black",
|
|
@@ -8239,11 +8586,89 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8239
8586
|
});
|
|
8240
8587
|
};
|
|
8241
8588
|
|
|
8589
|
+
function InfoYellowIcon(props) {
|
|
8590
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8591
|
+
width: props.width,
|
|
8592
|
+
height: props.height,
|
|
8593
|
+
viewBox: "0 0 20 20",
|
|
8594
|
+
fill: "none",
|
|
8595
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8596
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8597
|
+
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",
|
|
8598
|
+
fill: "#CA8A04"
|
|
8599
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8600
|
+
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",
|
|
8601
|
+
fill: "#CA8A04"
|
|
8602
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8603
|
+
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",
|
|
8604
|
+
fill: "#CA8A04"
|
|
8605
|
+
}));
|
|
8606
|
+
}
|
|
8607
|
+
|
|
8608
|
+
function RedWarningIcon(props) {
|
|
8609
|
+
var _props$color = props.color,
|
|
8610
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8611
|
+
_props$size = props.size,
|
|
8612
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8613
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8614
|
+
width: size,
|
|
8615
|
+
height: size,
|
|
8616
|
+
viewBox: "0 0 14 14",
|
|
8617
|
+
fill: color,
|
|
8618
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8619
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8620
|
+
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",
|
|
8621
|
+
fill: color
|
|
8622
|
+
}));
|
|
8623
|
+
}
|
|
8624
|
+
|
|
8625
|
+
function InviteInfoIcon() {
|
|
8626
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8627
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8628
|
+
width: "20",
|
|
8629
|
+
height: "20",
|
|
8630
|
+
fill: "none",
|
|
8631
|
+
viewBox: "0 0 20 20"
|
|
8632
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8633
|
+
fill: "#CA8A04",
|
|
8634
|
+
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"
|
|
8635
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8636
|
+
fill: "#CA8A04",
|
|
8637
|
+
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"
|
|
8638
|
+
}));
|
|
8639
|
+
}
|
|
8640
|
+
|
|
8242
8641
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8243
|
-
var env$7 = utils.configs.env
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8642
|
+
var env$7 = utils.configs.env,
|
|
8643
|
+
api$7 = utils.configs.api;
|
|
8644
|
+
var UndoButton = function UndoButton(_ref) {
|
|
8645
|
+
var onUndo = _ref.onUndo,
|
|
8646
|
+
msg = _ref.msg;
|
|
8647
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
8648
|
+
style: {
|
|
8649
|
+
display: 'flex',
|
|
8650
|
+
flexDirection: 'row',
|
|
8651
|
+
width: '270px',
|
|
8652
|
+
justifyContent: 'space-between'
|
|
8653
|
+
}
|
|
8654
|
+
}, /*#__PURE__*/React__default.createElement("p", {
|
|
8655
|
+
style: {
|
|
8656
|
+
whiteSpace: 'nowrap',
|
|
8657
|
+
paddingTop: '8px'
|
|
8658
|
+
}
|
|
8659
|
+
}, msg), /*#__PURE__*/React__default.createElement("p", {
|
|
8660
|
+
onClick: onUndo,
|
|
8661
|
+
style: {
|
|
8662
|
+
whiteSpace: 'nowrap',
|
|
8663
|
+
fontWeight: '600',
|
|
8664
|
+
fontSize: '1rem',
|
|
8665
|
+
padding: '8px 20px 0'
|
|
8666
|
+
}
|
|
8667
|
+
}, "UNDO"));
|
|
8668
|
+
};
|
|
8669
|
+
var UserList = function UserList(_ref2) {
|
|
8670
|
+
var config = _ref2.config,
|
|
8671
|
+
isProfile = _ref2.isProfile;
|
|
8247
8672
|
env$7.init(config, isProfile);
|
|
8248
8673
|
var history = reactRouterDom.useHistory();
|
|
8249
8674
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
@@ -8253,21 +8678,33 @@ var UserList = function UserList(_ref) {
|
|
|
8253
8678
|
isDataFetching = _useSelector.isDataFetching,
|
|
8254
8679
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8255
8680
|
tabValue = _useSelector.tabValue;
|
|
8256
|
-
var
|
|
8257
|
-
|
|
8258
|
-
|
|
8259
|
-
|
|
8681
|
+
var newSelecteds = userListInfo.results;
|
|
8682
|
+
var _React$useState = React__default.useState(''),
|
|
8683
|
+
deactivateUser = _React$useState[0],
|
|
8684
|
+
setDeactivateUser = _React$useState[1];
|
|
8685
|
+
var _React$useState2 = React__default.useState(null),
|
|
8686
|
+
setDefaultId = _React$useState2[1];
|
|
8687
|
+
var _React$useState3 = React__default.useState(1),
|
|
8688
|
+
page = _React$useState3[0],
|
|
8689
|
+
setPage = _React$useState3[1];
|
|
8690
|
+
var _React$useState4 = React__default.useState(''),
|
|
8691
|
+
user = _React$useState4[0],
|
|
8692
|
+
setUser = _React$useState4[1];
|
|
8693
|
+
var _useState = React.useState(10),
|
|
8260
8694
|
rowsPerPage = _useState[0],
|
|
8261
8695
|
setRowsPerPage = _useState[1];
|
|
8262
|
-
var _React$
|
|
8263
|
-
selected = _React$
|
|
8264
|
-
setSelected = _React$
|
|
8265
|
-
var _React$
|
|
8266
|
-
order = _React$
|
|
8267
|
-
setOrder = _React$
|
|
8268
|
-
var _React$
|
|
8269
|
-
|
|
8270
|
-
|
|
8696
|
+
var _React$useState5 = React__default.useState({}),
|
|
8697
|
+
selected = _React$useState5[0],
|
|
8698
|
+
setSelected = _React$useState5[1];
|
|
8699
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8700
|
+
order = _React$useState6[0],
|
|
8701
|
+
setOrder = _React$useState6[1];
|
|
8702
|
+
var _React$useState7 = React__default.useState(false),
|
|
8703
|
+
deactivateSingle = _React$useState7[0],
|
|
8704
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8705
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8706
|
+
orderBy = _React$useState8[0],
|
|
8707
|
+
setOrderBy = _React$useState8[1];
|
|
8271
8708
|
var _useState2 = React.useState(''),
|
|
8272
8709
|
searchValue = _useState2[0],
|
|
8273
8710
|
setSearchValue = _useState2[1];
|
|
@@ -8285,51 +8722,91 @@ var UserList = function UserList(_ref) {
|
|
|
8285
8722
|
isOpenImportUsersModal = _useState4[0],
|
|
8286
8723
|
setOpenImportUsersModal = _useState4[1];
|
|
8287
8724
|
var _useState5 = React.useState(false),
|
|
8288
|
-
|
|
8289
|
-
|
|
8725
|
+
approveeStatus = _useState5[0],
|
|
8726
|
+
setApproveeStatus = _useState5[1];
|
|
8290
8727
|
var _useState6 = React.useState(false),
|
|
8291
|
-
|
|
8292
|
-
|
|
8728
|
+
isFileDownloading = _useState6[0],
|
|
8729
|
+
setDownlStatus = _useState6[1];
|
|
8293
8730
|
var _useState7 = React.useState(false),
|
|
8294
|
-
|
|
8295
|
-
|
|
8731
|
+
isSortingChange = _useState7[0],
|
|
8732
|
+
setSortingChange = _useState7[1];
|
|
8296
8733
|
var _useState8 = React.useState(false),
|
|
8297
|
-
|
|
8298
|
-
|
|
8734
|
+
isSearchingChange = _useState8[0],
|
|
8735
|
+
setSearchingChange = _useState8[1];
|
|
8299
8736
|
var _useState9 = React.useState(false),
|
|
8300
|
-
|
|
8301
|
-
|
|
8737
|
+
isSortingChangeTemp = _useState9[0],
|
|
8738
|
+
setSortingChangeTemp = _useState9[1];
|
|
8302
8739
|
var _useState10 = React.useState(false),
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
|
|
8306
|
-
|
|
8307
|
-
|
|
8308
|
-
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
setSignUpOrder = _React$useState6[1];
|
|
8315
|
-
var _React$useState7 = React__default.useState('fname'),
|
|
8316
|
-
signup_orderBy = _React$useState7[0],
|
|
8317
|
-
setSignUpOrderBy = _React$useState7[1];
|
|
8318
|
-
var _useState12 = React.useState(''),
|
|
8319
|
-
signup_searchValue = _useState12[0],
|
|
8320
|
-
set_signup_SearchValue = _useState12[1];
|
|
8740
|
+
isSearchingChangeTemp = _useState10[0],
|
|
8741
|
+
setSearchingChangeTemp = _useState10[1];
|
|
8742
|
+
var _useState11 = React.useState(false),
|
|
8743
|
+
isApiFetching = _useState11[0],
|
|
8744
|
+
setisApiFetching = _useState11[1];
|
|
8745
|
+
var _useState12 = React.useState({
|
|
8746
|
+
value: '',
|
|
8747
|
+
label: 'Select approver'
|
|
8748
|
+
}),
|
|
8749
|
+
approverRole = _useState12[0],
|
|
8750
|
+
setApproverRole = _useState12[1];
|
|
8321
8751
|
var _useState13 = React.useState(false),
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
var _useState14 = React.useState(
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
var
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
var
|
|
8331
|
-
|
|
8332
|
-
|
|
8752
|
+
showInviteModal = _useState13[0],
|
|
8753
|
+
setToggleInviteModal = _useState13[1];
|
|
8754
|
+
var _useState14 = React.useState(''),
|
|
8755
|
+
userIds = _useState14[0],
|
|
8756
|
+
setUserIds = _useState14[1];
|
|
8757
|
+
var _React$useState9 = React__default.useState(false),
|
|
8758
|
+
overlayMenu = _React$useState9[0],
|
|
8759
|
+
setOverlayMenu = _React$useState9[1];
|
|
8760
|
+
var _useState15 = React.useState(true),
|
|
8761
|
+
isDisabledSubmitBtn = _useState15[0],
|
|
8762
|
+
setIsDisabledSubmitBtn = _useState15[1];
|
|
8763
|
+
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8764
|
+
var prevPos = _ref3.prevPos,
|
|
8765
|
+
currPos = _ref3.currPos;
|
|
8766
|
+
if (prevPos.y - currPos.y > 0) {
|
|
8767
|
+
if (currPos.y <= -275) {
|
|
8768
|
+
setOverlayMenu(true);
|
|
8769
|
+
}
|
|
8770
|
+
} else {
|
|
8771
|
+
if (currPos.y > -295) {
|
|
8772
|
+
setOverlayMenu(false);
|
|
8773
|
+
}
|
|
8774
|
+
}
|
|
8775
|
+
}, [overlayMenu]);
|
|
8776
|
+
var scrollTo = function scrollTo(id) {
|
|
8777
|
+
var el = document.getElementById(id);
|
|
8778
|
+
window.scrollTo({
|
|
8779
|
+
top: el.offsetTop,
|
|
8780
|
+
behavior: 'smooth'
|
|
8781
|
+
});
|
|
8782
|
+
};
|
|
8783
|
+
var _React$useState10 = React__default.useState(1),
|
|
8784
|
+
signup_page = _React$useState10[0],
|
|
8785
|
+
setSignUpPage = _React$useState10[1];
|
|
8786
|
+
var _useState16 = React.useState(5),
|
|
8787
|
+
signup_rowsPerPage = _useState16[0],
|
|
8788
|
+
setSignUpRowsPerPage = _useState16[1];
|
|
8789
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8790
|
+
signup_order = _React$useState11[0],
|
|
8791
|
+
setSignUpOrder = _React$useState11[1];
|
|
8792
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8793
|
+
signup_orderBy = _React$useState12[0],
|
|
8794
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8795
|
+
var _useState17 = React.useState(''),
|
|
8796
|
+
signup_searchValue = _useState17[0],
|
|
8797
|
+
set_signup_SearchValue = _useState17[1];
|
|
8798
|
+
var _useState18 = React.useState(false),
|
|
8799
|
+
isSignUpSortingChange = _useState18[0],
|
|
8800
|
+
setSignUpSortingChange = _useState18[1];
|
|
8801
|
+
var _useState19 = React.useState(false),
|
|
8802
|
+
isSignUpSearchingChange = _useState19[0],
|
|
8803
|
+
setSignUpSearchingChange = _useState19[1];
|
|
8804
|
+
var _useState20 = React.useState(false),
|
|
8805
|
+
isSignUpSortingChangeTemp = _useState20[0],
|
|
8806
|
+
setSignUpSortingChangeTemp = _useState20[1];
|
|
8807
|
+
var _useState21 = React.useState(false),
|
|
8808
|
+
isSignUpSearchingChangeTemp = _useState21[0],
|
|
8809
|
+
setSignUpSearchingChangeTemp = _useState21[1];
|
|
8333
8810
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8334
8811
|
return state.userList;
|
|
8335
8812
|
}),
|
|
@@ -8356,44 +8833,23 @@ var UserList = function UserList(_ref) {
|
|
|
8356
8833
|
var handleVerifyUserClick = function handleVerifyUserClick(userId) {
|
|
8357
8834
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8358
8835
|
};
|
|
8359
|
-
var UndoButton = function UndoButton(_ref2) {
|
|
8360
|
-
var msg = _ref2.msg,
|
|
8361
|
-
id = _ref2.id;
|
|
8362
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8363
|
-
display: "flex",
|
|
8364
|
-
flexDirection: "row",
|
|
8365
|
-
width: "270px"
|
|
8366
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8367
|
-
style: {
|
|
8368
|
-
whiteSpace: 'nowrap',
|
|
8369
|
-
paddingTop: '8px'
|
|
8370
|
-
}
|
|
8371
|
-
}, msg), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8372
|
-
type: "text",
|
|
8373
|
-
buttonText: "UNDO",
|
|
8374
|
-
style: {
|
|
8375
|
-
color: '#FFFFFF'
|
|
8376
|
-
},
|
|
8377
|
-
onClick: function onClick() {
|
|
8378
|
-
return dispatch(undoneSignUpRejection(id));
|
|
8379
|
-
}
|
|
8380
|
-
}));
|
|
8381
|
-
};
|
|
8382
8836
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8383
8837
|
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8384
|
-
var _res$data;
|
|
8385
|
-
console.log(res);
|
|
8386
|
-
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React__default.createElement(UndoButton, {
|
|
8387
|
-
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',
|
|
8388
|
-
id: userId
|
|
8389
|
-
}));
|
|
8390
8838
|
if (res.status === true) {
|
|
8839
|
+
var _res$data;
|
|
8840
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React__default.createElement(UndoButton, {
|
|
8841
|
+
onUndo: function onUndo() {
|
|
8842
|
+
return dispatch(undoneSignUpRejection(userId));
|
|
8843
|
+
},
|
|
8844
|
+
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'
|
|
8845
|
+
}));
|
|
8391
8846
|
dispatch(showDataFetchingStatus());
|
|
8392
8847
|
dispatch(fetchUserSignupRequests({
|
|
8393
8848
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8394
8849
|
length: signup_rowsPerPage,
|
|
8395
8850
|
page: signup_page,
|
|
8396
|
-
search: signup_searchValue.trim()
|
|
8851
|
+
search: signup_searchValue.trim(),
|
|
8852
|
+
pagename: 'company'
|
|
8397
8853
|
})).then(function () {
|
|
8398
8854
|
return dispatch(stopDataFetchingStatus());
|
|
8399
8855
|
});
|
|
@@ -8412,12 +8868,12 @@ var UserList = function UserList(_ref) {
|
|
|
8412
8868
|
};
|
|
8413
8869
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8414
8870
|
var _extends2;
|
|
8415
|
-
var
|
|
8871
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8416
8872
|
return n.is_active;
|
|
8417
8873
|
}).map(function (obj) {
|
|
8418
8874
|
return obj.id.toString();
|
|
8419
8875
|
});
|
|
8420
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] =
|
|
8876
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = _newSelecteds, _extends2)));
|
|
8421
8877
|
};
|
|
8422
8878
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8423
8879
|
var _extends3;
|
|
@@ -8451,18 +8907,43 @@ var UserList = function UserList(_ref) {
|
|
|
8451
8907
|
selectedTemp[page] = [];
|
|
8452
8908
|
}
|
|
8453
8909
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8454
|
-
var
|
|
8910
|
+
var _newSelected = [];
|
|
8455
8911
|
if (selectedIndex === -1) {
|
|
8456
|
-
|
|
8912
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8457
8913
|
} else if (selectedIndex === 0) {
|
|
8458
|
-
|
|
8914
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8459
8915
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8460
|
-
|
|
8916
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8461
8917
|
} else if (selectedIndex > 0) {
|
|
8462
|
-
|
|
8918
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8463
8919
|
}
|
|
8464
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] =
|
|
8920
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8465
8921
|
};
|
|
8922
|
+
React.useEffect(function () {
|
|
8923
|
+
setApproverRole({
|
|
8924
|
+
value: '',
|
|
8925
|
+
label: 'Select approver'
|
|
8926
|
+
});
|
|
8927
|
+
setIsDisabledSubmitBtn(true);
|
|
8928
|
+
setApproveeStatus(false);
|
|
8929
|
+
if (deactivateSingle === true) {
|
|
8930
|
+
api$7.get(userAddEditUrl._approversSearch() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
8931
|
+
setDefaultId(response.data["default"].id);
|
|
8932
|
+
response.data.results.map(function (item) {
|
|
8933
|
+
if (response.data["default"].id === item.id) {
|
|
8934
|
+
setApproverRole({
|
|
8935
|
+
value: '',
|
|
8936
|
+
label: item.email
|
|
8937
|
+
});
|
|
8938
|
+
setIsDisabledSubmitBtn(false);
|
|
8939
|
+
if (item.approvee_status) {
|
|
8940
|
+
setApproveeStatus(true);
|
|
8941
|
+
}
|
|
8942
|
+
}
|
|
8943
|
+
});
|
|
8944
|
+
});
|
|
8945
|
+
}
|
|
8946
|
+
}, [deactivateSingle]);
|
|
8466
8947
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8467
8948
|
setRowsPerPage(+event.target.value);
|
|
8468
8949
|
setPage(1);
|
|
@@ -8472,20 +8953,43 @@ var UserList = function UserList(_ref) {
|
|
|
8472
8953
|
};
|
|
8473
8954
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8474
8955
|
var isActive = e.target.checked;
|
|
8475
|
-
|
|
8476
|
-
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8956
|
+
var _isApprover;
|
|
8957
|
+
newSelecteds.map(function (item) {
|
|
8958
|
+
if (item.id === id) {
|
|
8959
|
+
_isApprover = item.roles.is_approver;
|
|
8960
|
+
if (_isApprover === true && isActive === false) {
|
|
8961
|
+
setDeactivateSingle(true);
|
|
8962
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
8963
|
+
setUser(item);
|
|
8964
|
+
} else {
|
|
8965
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
8966
|
+
if (!isActive) {
|
|
8967
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8968
|
+
var _extends5;
|
|
8969
|
+
var selectedTemp = _extends({}, selected);
|
|
8970
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8971
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
8972
|
+
}
|
|
8973
|
+
}
|
|
8974
|
+
});
|
|
8482
8975
|
}
|
|
8483
8976
|
}
|
|
8484
8977
|
});
|
|
8485
8978
|
};
|
|
8979
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
8980
|
+
var _value = _ref4._value;
|
|
8981
|
+
if (_value.data.approvee_status) {
|
|
8982
|
+
setApproveeStatus(true);
|
|
8983
|
+
} else {
|
|
8984
|
+
setApproveeStatus(false);
|
|
8985
|
+
}
|
|
8986
|
+
setApproverRole(_value);
|
|
8987
|
+
setIsDisabledSubmitBtn(false);
|
|
8988
|
+
};
|
|
8486
8989
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8487
|
-
dispatch(
|
|
8990
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, approverRole.data.id));
|
|
8488
8991
|
setOpenDeActivateModalFlag(false);
|
|
8992
|
+
setDeactivateSingle(false);
|
|
8489
8993
|
setSelected({});
|
|
8490
8994
|
};
|
|
8491
8995
|
var importUserHandler = function importUserHandler() {
|
|
@@ -8498,6 +9002,37 @@ var UserList = function UserList(_ref) {
|
|
|
8498
9002
|
setOpenImportUsersModal(false);
|
|
8499
9003
|
handleImportPagenavigation(jobId);
|
|
8500
9004
|
};
|
|
9005
|
+
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
9006
|
+
dispatch(resetPasswordForUser({
|
|
9007
|
+
email: email
|
|
9008
|
+
}));
|
|
9009
|
+
};
|
|
9010
|
+
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
9011
|
+
console.log(type);
|
|
9012
|
+
if (!type && (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined)) {
|
|
9013
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9014
|
+
return false;
|
|
9015
|
+
}
|
|
9016
|
+
setUserIds(ids);
|
|
9017
|
+
setToggleInviteModal(!showInviteModal);
|
|
9018
|
+
};
|
|
9019
|
+
var onResendInviteHandler = function onResendInviteHandler() {
|
|
9020
|
+
var userIdArr = [];
|
|
9021
|
+
if (userIds && !isNaN(userIds)) {
|
|
9022
|
+
userIdArr = [userIds];
|
|
9023
|
+
} else if (Object.keys(selected).length) {
|
|
9024
|
+
Object.values(selected).map(function (val, i) {
|
|
9025
|
+
if (val.length) {
|
|
9026
|
+
val.map(function (idx, i) {
|
|
9027
|
+
userIdArr.push(idx);
|
|
9028
|
+
});
|
|
9029
|
+
}
|
|
9030
|
+
});
|
|
9031
|
+
}
|
|
9032
|
+
setUserIds('');
|
|
9033
|
+
dispatch(resendInviteForUser(userIdArr));
|
|
9034
|
+
setToggleInviteModal(!showInviteModal);
|
|
9035
|
+
};
|
|
8501
9036
|
var handleExportUsers = function handleExportUsers() {
|
|
8502
9037
|
try {
|
|
8503
9038
|
setDownlStatus(true);
|
|
@@ -8537,12 +9072,20 @@ var UserList = function UserList(_ref) {
|
|
|
8537
9072
|
}, {
|
|
8538
9073
|
label: 'Bulk action history',
|
|
8539
9074
|
handler: handleBulkActionHistoryClick
|
|
9075
|
+
}, {
|
|
9076
|
+
label: 'Resend invite',
|
|
9077
|
+
handler: toggleInviteModal
|
|
8540
9078
|
}];
|
|
8541
9079
|
React.useEffect(function () {
|
|
8542
9080
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
8543
9081
|
dispatch(showDataFetchingStatus());
|
|
8544
9082
|
dispatch(verifyAccessToken(roleCanAccess));
|
|
8545
9083
|
}, []);
|
|
9084
|
+
var onPrimaryAdminHandler = function onPrimaryAdminHandler(userId) {
|
|
9085
|
+
dispatch(makePrimaryAdmin({
|
|
9086
|
+
userId: userId
|
|
9087
|
+
}));
|
|
9088
|
+
};
|
|
8546
9089
|
var dispatch = reactRedux.useDispatch();
|
|
8547
9090
|
React.useEffect(function () {
|
|
8548
9091
|
if (isTokenVerified === true) {
|
|
@@ -8556,6 +9099,7 @@ var UserList = function UserList(_ref) {
|
|
|
8556
9099
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8557
9100
|
setSearchingChange(false);
|
|
8558
9101
|
setisApiFetching(false);
|
|
9102
|
+
scrollTo('table-root');
|
|
8559
9103
|
});
|
|
8560
9104
|
}, 1000);
|
|
8561
9105
|
return function () {
|
|
@@ -8569,7 +9113,8 @@ var UserList = function UserList(_ref) {
|
|
|
8569
9113
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8570
9114
|
length: signup_rowsPerPage,
|
|
8571
9115
|
page: signup_page,
|
|
8572
|
-
search: signup_searchValue.trim()
|
|
9116
|
+
search: signup_searchValue.trim(),
|
|
9117
|
+
pagename: 'company'
|
|
8573
9118
|
})).then(function () {
|
|
8574
9119
|
setSignUpSearchingChange(false);
|
|
8575
9120
|
setisApiFetching(false);
|
|
@@ -8581,6 +9126,7 @@ var UserList = function UserList(_ref) {
|
|
|
8581
9126
|
}
|
|
8582
9127
|
if (isSortingChange) {
|
|
8583
9128
|
setisApiFetching(true);
|
|
9129
|
+
scrollTo('table-root');
|
|
8584
9130
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8585
9131
|
setisApiFetching(false);
|
|
8586
9132
|
setSortingChange(false);
|
|
@@ -8595,7 +9141,8 @@ var UserList = function UserList(_ref) {
|
|
|
8595
9141
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8596
9142
|
length: signup_rowsPerPage,
|
|
8597
9143
|
page: signup_page,
|
|
8598
|
-
search: signup_searchValue.trim()
|
|
9144
|
+
search: signup_searchValue.trim(),
|
|
9145
|
+
pagename: 'company'
|
|
8599
9146
|
})).then(function () {
|
|
8600
9147
|
setisApiFetching(false);
|
|
8601
9148
|
setSignUpSortingChange(false);
|
|
@@ -8611,7 +9158,8 @@ var UserList = function UserList(_ref) {
|
|
|
8611
9158
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8612
9159
|
length: signup_rowsPerPage,
|
|
8613
9160
|
page: signup_page,
|
|
8614
|
-
search: signup_searchValue.trim()
|
|
9161
|
+
search: signup_searchValue.trim(),
|
|
9162
|
+
pagename: 'company'
|
|
8615
9163
|
})).then(function () {
|
|
8616
9164
|
return dispatch(stopDataFetchingStatus());
|
|
8617
9165
|
});
|
|
@@ -8619,15 +9167,89 @@ var UserList = function UserList(_ref) {
|
|
|
8619
9167
|
}
|
|
8620
9168
|
}
|
|
8621
9169
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9170
|
+
var topRightButtons = function topRightButtons() {
|
|
9171
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9172
|
+
component: "div",
|
|
9173
|
+
className: styles$5.buttonWrapper,
|
|
9174
|
+
display: "flex",
|
|
9175
|
+
justifyContent: "space-between",
|
|
9176
|
+
alignItems: "center",
|
|
9177
|
+
alignSelf: "flex-start"
|
|
9178
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9179
|
+
component: "div",
|
|
9180
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9181
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9182
|
+
buttonText: "Export all users",
|
|
9183
|
+
type: "outlined",
|
|
9184
|
+
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9185
|
+
width: "22",
|
|
9186
|
+
height: "22"
|
|
9187
|
+
}),
|
|
9188
|
+
onClick: handleExportUsers
|
|
9189
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9190
|
+
component: "div",
|
|
9191
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9192
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9193
|
+
buttonText: "Bulk actions",
|
|
9194
|
+
type: "outlined",
|
|
9195
|
+
menuListInfo: BulkUploadInfo
|
|
9196
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9197
|
+
component: "div",
|
|
9198
|
+
className: "pageHeader--button-single button-right"
|
|
9199
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9200
|
+
buttonText: "Add user",
|
|
9201
|
+
type: "contained",
|
|
9202
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9203
|
+
width: "9",
|
|
9204
|
+
height: "9",
|
|
9205
|
+
color: "white"
|
|
9206
|
+
}),
|
|
9207
|
+
onClick: handleAddPageNavigation
|
|
9208
|
+
})));
|
|
9209
|
+
};
|
|
8622
9210
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8623
9211
|
component: "div",
|
|
8624
9212
|
className: styles$5.UUIUserManagementList
|
|
8625
|
-
},
|
|
9213
|
+
}, overlayMenu ? /*#__PURE__*/React__default.createElement(core.Box, {
|
|
9214
|
+
className: styles$5.scrollOverlayMenu
|
|
9215
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9216
|
+
component: "div",
|
|
9217
|
+
className: clsx(styles$5.pageHeader)
|
|
9218
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9219
|
+
component: "div",
|
|
9220
|
+
display: "flex",
|
|
9221
|
+
justifyContent: "space-between",
|
|
9222
|
+
alignItems: "center",
|
|
9223
|
+
flexWrap: "wrap",
|
|
9224
|
+
style: {
|
|
9225
|
+
gap: '1rem'
|
|
9226
|
+
}
|
|
9227
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9228
|
+
component: "div",
|
|
9229
|
+
display: "flex",
|
|
9230
|
+
flexDirection: "column",
|
|
9231
|
+
style: {
|
|
9232
|
+
gap: '0.5rem'
|
|
9233
|
+
}
|
|
9234
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
|
|
9235
|
+
placeholder: "Search by name, email & department",
|
|
9236
|
+
value: searchValue,
|
|
9237
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
9238
|
+
return onSearchHandler(e.target.value);
|
|
9239
|
+
},
|
|
9240
|
+
className: styles$5.overlaysearch
|
|
9241
|
+
})), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9242
|
+
component: "div",
|
|
9243
|
+
display: "flex",
|
|
9244
|
+
justifyContent: "space-between",
|
|
9245
|
+
alignItems: "center"
|
|
9246
|
+
}))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8626
9247
|
open: isFileDownloading || isApiFetching,
|
|
8627
9248
|
className: styles$5.backdrop
|
|
8628
9249
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
|
|
8629
9250
|
color: "inherit"
|
|
8630
9251
|
})), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9252
|
+
id: "table-root",
|
|
8631
9253
|
component: "div",
|
|
8632
9254
|
className: clsx(styles$5.pageHeader)
|
|
8633
9255
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8652,44 +9274,7 @@ var UserList = function UserList(_ref) {
|
|
|
8652
9274
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8653
9275
|
variant: "h3",
|
|
8654
9276
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8655
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8656
|
-
component: "div",
|
|
8657
|
-
className: styles$5.buttonWrapper,
|
|
8658
|
-
display: "flex",
|
|
8659
|
-
justifyContent: "space-between",
|
|
8660
|
-
alignItems: "center",
|
|
8661
|
-
alignSelf: "flex-start"
|
|
8662
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8663
|
-
component: "div",
|
|
8664
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8665
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8666
|
-
buttonText: "Export all users",
|
|
8667
|
-
type: "outlined",
|
|
8668
|
-
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
8669
|
-
width: "22",
|
|
8670
|
-
height: "22"
|
|
8671
|
-
}),
|
|
8672
|
-
onClick: handleExportUsers
|
|
8673
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8674
|
-
component: "div",
|
|
8675
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8676
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
8677
|
-
buttonText: "Bulk actions",
|
|
8678
|
-
type: "outlined",
|
|
8679
|
-
menuListInfo: BulkUploadInfo
|
|
8680
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8681
|
-
component: "div",
|
|
8682
|
-
className: "pageHeader--button-single button-right"
|
|
8683
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8684
|
-
buttonText: "Add user",
|
|
8685
|
-
type: "contained",
|
|
8686
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
8687
|
-
width: "9",
|
|
8688
|
-
height: "9",
|
|
8689
|
-
color: "white"
|
|
8690
|
-
}),
|
|
8691
|
-
onClick: handleAddPageNavigation
|
|
8692
|
-
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9277
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8693
9278
|
component: "div",
|
|
8694
9279
|
display: "flex",
|
|
8695
9280
|
justifyContent: "space-between",
|
|
@@ -8732,7 +9317,11 @@ var UserList = function UserList(_ref) {
|
|
|
8732
9317
|
onSearchHandler: onSearchHandler,
|
|
8733
9318
|
onEditHandler: handleEditUserClick,
|
|
8734
9319
|
disableRowCheckbox: deactivatedUsers,
|
|
8735
|
-
searchValue: searchValue
|
|
9320
|
+
searchValue: searchValue,
|
|
9321
|
+
isILadmin: isILadmin,
|
|
9322
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler,
|
|
9323
|
+
onResetPasswordHandler: onResetPasswordHandler,
|
|
9324
|
+
toggleInviteModal: toggleInviteModal
|
|
8736
9325
|
}))
|
|
8737
9326
|
}, {
|
|
8738
9327
|
label: /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React__default.createElement(TabLabelCount, {
|
|
@@ -8780,6 +9369,45 @@ var UserList = function UserList(_ref) {
|
|
|
8780
9369
|
}))
|
|
8781
9370
|
}]
|
|
8782
9371
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9372
|
+
isOpen: deactivateSingle,
|
|
9373
|
+
closeHandler: function closeHandler() {
|
|
9374
|
+
setDeactivateSingle(false);
|
|
9375
|
+
},
|
|
9376
|
+
cancelLabel: "Cancel",
|
|
9377
|
+
submitLabel: "Deactivate",
|
|
9378
|
+
submitHandler: handleDeactivateUsers,
|
|
9379
|
+
headerText: "Deactivate this user?",
|
|
9380
|
+
width: "400px",
|
|
9381
|
+
subHanderText: "",
|
|
9382
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9383
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn
|
|
9384
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9385
|
+
className: styles$5.deactivateSingle
|
|
9386
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9387
|
+
className: styles$5.deactivateAlert
|
|
9388
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9389
|
+
width: "9",
|
|
9390
|
+
height: "9"
|
|
9391
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, null, /*#__PURE__*/React__default.createElement("b", null, deactivateUser), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9392
|
+
className: "iui__my-15"
|
|
9393
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9394
|
+
isMove: true,
|
|
9395
|
+
additional: {
|
|
9396
|
+
page: 1,
|
|
9397
|
+
product: 'travel',
|
|
9398
|
+
userId: user.id
|
|
9399
|
+
},
|
|
9400
|
+
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
9401
|
+
label: "Transfer approver role to",
|
|
9402
|
+
value: approverRole,
|
|
9403
|
+
onValueChange: selectApprover,
|
|
9404
|
+
loadOption: approversOptions,
|
|
9405
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9406
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9407
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9408
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9409
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9410
|
+
}, "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, {
|
|
8783
9411
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
8784
9412
|
closeHandler: closeDeActivateModal,
|
|
8785
9413
|
cancelLabel: "Cancel",
|
|
@@ -8805,7 +9433,41 @@ var UserList = function UserList(_ref) {
|
|
|
8805
9433
|
className: styles$5.headerText
|
|
8806
9434
|
}, '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, {
|
|
8807
9435
|
className: styles$5.description
|
|
8808
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(
|
|
9436
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9437
|
+
isOpen: showInviteModal,
|
|
9438
|
+
closeHandler: toggleInviteModal,
|
|
9439
|
+
cancelLabel: "Cancel",
|
|
9440
|
+
headerText: "Resend Invites?",
|
|
9441
|
+
submitLabel: "Send",
|
|
9442
|
+
submitHandler: function submitHandler() {
|
|
9443
|
+
return onResendInviteHandler();
|
|
9444
|
+
},
|
|
9445
|
+
width: "400px",
|
|
9446
|
+
modalBodyStyle: {
|
|
9447
|
+
padding: '0px'
|
|
9448
|
+
},
|
|
9449
|
+
footerStyle: {
|
|
9450
|
+
justifyContent: 'center'
|
|
9451
|
+
}
|
|
9452
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9453
|
+
style: {
|
|
9454
|
+
display: 'flex',
|
|
9455
|
+
padding: '16px',
|
|
9456
|
+
margin: '8px 24px',
|
|
9457
|
+
border: '1px solid #FDE047',
|
|
9458
|
+
background: '#FEFCE8',
|
|
9459
|
+
borderRadius: '5px'
|
|
9460
|
+
}
|
|
9461
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9462
|
+
style: {
|
|
9463
|
+
marginRight: '5px'
|
|
9464
|
+
}
|
|
9465
|
+
}, /*#__PURE__*/React__default.createElement(InviteInfoIcon, null)), /*#__PURE__*/React__default.createElement("div", {
|
|
9466
|
+
style: {
|
|
9467
|
+
fontSize: '14px',
|
|
9468
|
+
color: '#374151'
|
|
9469
|
+
}
|
|
9470
|
+
}, "This invitation will be sent to users who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
8809
9471
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
8810
9472
|
closeImportUsersModal: closeImportUsersModal,
|
|
8811
9473
|
closeImportModal: closeImportModal
|
|
@@ -8814,8 +9476,8 @@ var UserList = function UserList(_ref) {
|
|
|
8814
9476
|
errMsg: hasVerificationError
|
|
8815
9477
|
}));
|
|
8816
9478
|
};
|
|
8817
|
-
var TabLabelCount = function TabLabelCount(
|
|
8818
|
-
var count =
|
|
9479
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9480
|
+
var count = _ref5.count;
|
|
8819
9481
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8820
9482
|
className: styles$5.TabLabelCount
|
|
8821
9483
|
}, " ", count, " ");
|
|
@@ -8890,11 +9552,12 @@ function Header(props) {
|
|
|
8890
9552
|
})));
|
|
8891
9553
|
}
|
|
8892
9554
|
|
|
8893
|
-
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"};
|
|
9555
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","rowText":"_2XKxl","lightColor":"_3uyfh","buttonWidth":"_13tv0","readOnlyInput":"_3yYuQ","addUserButton":"_1zbr_","alertDescContainer":"_3h8DM","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
8894
9556
|
|
|
8895
9557
|
function Listview(_ref) {
|
|
8896
9558
|
var data = _ref.data,
|
|
8897
9559
|
name = _ref.name,
|
|
9560
|
+
tableName = _ref.tableName,
|
|
8898
9561
|
handleEditDialog = _ref.handleEditDialog,
|
|
8899
9562
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
8900
9563
|
orderBy = _ref.orderBy,
|
|
@@ -8907,10 +9570,16 @@ function Listview(_ref) {
|
|
|
8907
9570
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
8908
9571
|
page = _ref.page,
|
|
8909
9572
|
rowsPerPage = _ref.rowsPerPage;
|
|
9573
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9574
|
+
var _data$dept_head_detai;
|
|
9575
|
+
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) {
|
|
9576
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9577
|
+
}
|
|
9578
|
+
};
|
|
8910
9579
|
var columns = [{
|
|
8911
9580
|
id: 'name',
|
|
8912
9581
|
label: name,
|
|
8913
|
-
width: '
|
|
9582
|
+
width: '40%',
|
|
8914
9583
|
sortable: true,
|
|
8915
9584
|
cell: function cell(row) {
|
|
8916
9585
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8920,7 +9589,7 @@ function Listview(_ref) {
|
|
|
8920
9589
|
}, {
|
|
8921
9590
|
id: 'no_of_users',
|
|
8922
9591
|
label: 'Number of users',
|
|
8923
|
-
width: '
|
|
9592
|
+
width: '40%',
|
|
8924
9593
|
sortable: true,
|
|
8925
9594
|
cell: function cell(row) {
|
|
8926
9595
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8930,7 +9599,67 @@ function Listview(_ref) {
|
|
|
8930
9599
|
}, {
|
|
8931
9600
|
id: 'actions',
|
|
8932
9601
|
label: 'Actions',
|
|
8933
|
-
width: '
|
|
9602
|
+
width: '20%',
|
|
9603
|
+
cell: function cell(row) {
|
|
9604
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9605
|
+
display: "flex"
|
|
9606
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9607
|
+
buttonText: "Edit",
|
|
9608
|
+
className: styles$7.buttonWidth,
|
|
9609
|
+
onClick: function onClick() {
|
|
9610
|
+
return handleEditDialog(row);
|
|
9611
|
+
}
|
|
9612
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9613
|
+
buttonText: "Delete",
|
|
9614
|
+
className: styles$7.buttonWidth,
|
|
9615
|
+
onClick: function onClick() {
|
|
9616
|
+
return handleDeleteDialog(row, true);
|
|
9617
|
+
}
|
|
9618
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9619
|
+
buttonText: "Delete",
|
|
9620
|
+
className: styles$7.buttonWidth,
|
|
9621
|
+
onClick: function onClick() {
|
|
9622
|
+
return handleDeleteDialog(row, false);
|
|
9623
|
+
}
|
|
9624
|
+
}));
|
|
9625
|
+
}
|
|
9626
|
+
}];
|
|
9627
|
+
var departmentColumns = [{
|
|
9628
|
+
id: 'name',
|
|
9629
|
+
label: name,
|
|
9630
|
+
width: '30%',
|
|
9631
|
+
sortable: true,
|
|
9632
|
+
cell: function cell(row) {
|
|
9633
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9634
|
+
component: "div"
|
|
9635
|
+
}, row.name);
|
|
9636
|
+
}
|
|
9637
|
+
}, {
|
|
9638
|
+
id: 'department_head',
|
|
9639
|
+
label: 'Department head',
|
|
9640
|
+
width: '30%',
|
|
9641
|
+
sortable: true,
|
|
9642
|
+
cell: function cell(row) {
|
|
9643
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9644
|
+
component: "div"
|
|
9645
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9646
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9647
|
+
}, "Assigned by default"));
|
|
9648
|
+
}
|
|
9649
|
+
}, {
|
|
9650
|
+
id: 'no_of_users',
|
|
9651
|
+
label: 'Number of users',
|
|
9652
|
+
width: '45%',
|
|
9653
|
+
sortable: false,
|
|
9654
|
+
cell: function cell(row) {
|
|
9655
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9656
|
+
component: "div"
|
|
9657
|
+
}, row.no_of_users);
|
|
9658
|
+
}
|
|
9659
|
+
}, {
|
|
9660
|
+
id: 'actions',
|
|
9661
|
+
label: 'Actions',
|
|
9662
|
+
width: '15%',
|
|
8934
9663
|
cell: function cell(row) {
|
|
8935
9664
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8936
9665
|
display: "flex"
|
|
@@ -8963,7 +9692,7 @@ function Listview(_ref) {
|
|
|
8963
9692
|
hasFilter: true,
|
|
8964
9693
|
isCheckboxTable: false,
|
|
8965
9694
|
count: data.count,
|
|
8966
|
-
columns: columns,
|
|
9695
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
8967
9696
|
rows: data.results,
|
|
8968
9697
|
page: page,
|
|
8969
9698
|
handleChangePage: handleChangePage,
|
|
@@ -9020,16 +9749,44 @@ function EditPanelDialog(_ref) {
|
|
|
9020
9749
|
var isOpen = _ref.isOpen,
|
|
9021
9750
|
closeHandler = _ref.closeHandler,
|
|
9022
9751
|
onValueChange = _ref.onValueChange,
|
|
9023
|
-
|
|
9752
|
+
_submitHandler = _ref.submitHandler,
|
|
9024
9753
|
isError = _ref.isError,
|
|
9025
9754
|
name = _ref.name,
|
|
9026
9755
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9027
|
-
validation = _ref.validation
|
|
9756
|
+
validation = _ref.validation,
|
|
9757
|
+
rowData = _ref.rowData,
|
|
9758
|
+
tableName = _ref.tableName,
|
|
9759
|
+
config = _ref.config;
|
|
9028
9760
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9029
9761
|
return state.userPanel;
|
|
9030
9762
|
}),
|
|
9031
9763
|
dialogData = _useSelector.dialogData;
|
|
9032
|
-
|
|
9764
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9765
|
+
var _data$dept_head_detai;
|
|
9766
|
+
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) {
|
|
9767
|
+
setHead({
|
|
9768
|
+
value: data.dept_head_details[0].id,
|
|
9769
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9770
|
+
});
|
|
9771
|
+
}
|
|
9772
|
+
};
|
|
9773
|
+
var _useState = React.useState({
|
|
9774
|
+
value: '',
|
|
9775
|
+
label: 'Select'
|
|
9776
|
+
}),
|
|
9777
|
+
head = _useState[0],
|
|
9778
|
+
setHead = _useState[1];
|
|
9779
|
+
React.useEffect(function () {
|
|
9780
|
+
deptHeadDetails(rowData);
|
|
9781
|
+
}, [rowData]);
|
|
9782
|
+
var history = reactRouterDom.useHistory();
|
|
9783
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9784
|
+
console.log(rowData);
|
|
9785
|
+
history.push({
|
|
9786
|
+
pathname: config.routes.users.add.path,
|
|
9787
|
+
state: rowData
|
|
9788
|
+
});
|
|
9789
|
+
};
|
|
9033
9790
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9034
9791
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9035
9792
|
isOpen: isOpen,
|
|
@@ -9037,27 +9794,60 @@ function EditPanelDialog(_ref) {
|
|
|
9037
9794
|
headerText: "Edit " + name.toLowerCase(),
|
|
9038
9795
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9039
9796
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9040
|
-
submitHandler: submitHandler
|
|
9041
|
-
|
|
9797
|
+
submitHandler: function submitHandler() {
|
|
9798
|
+
return _submitHandler(head);
|
|
9799
|
+
},
|
|
9800
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9042
9801
|
hideCloseIcon: false,
|
|
9043
9802
|
modalBodyStyle: {
|
|
9044
|
-
|
|
9045
|
-
overflow: 'auto',
|
|
9046
|
-
margin: '0px'
|
|
9803
|
+
overflowY: 'visible'
|
|
9047
9804
|
},
|
|
9048
9805
|
footerStyle: {
|
|
9049
9806
|
justifyContent: 'end'
|
|
9050
9807
|
}
|
|
9808
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9809
|
+
display: "flex",
|
|
9810
|
+
justifyContent: "center",
|
|
9811
|
+
alignItems: "center",
|
|
9812
|
+
flexDirection: "column",
|
|
9813
|
+
style: {
|
|
9814
|
+
marginBottom: '30px'
|
|
9815
|
+
}
|
|
9051
9816
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9052
|
-
component: "div",
|
|
9053
9817
|
display: "flex",
|
|
9054
9818
|
justifyContent: "center",
|
|
9055
9819
|
alignItems: "center",
|
|
9056
9820
|
flexDirection: "column",
|
|
9057
|
-
|
|
9058
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
9059
|
-
|
|
9060
|
-
|
|
9821
|
+
className: styles$7.baseAlert
|
|
9822
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9823
|
+
className: styles$7.alertDescContainer
|
|
9824
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9825
|
+
className: styles$7.iconLayout,
|
|
9826
|
+
style: {
|
|
9827
|
+
paddingTop: '4px'
|
|
9828
|
+
}
|
|
9829
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
9830
|
+
color: "#CA8A04",
|
|
9831
|
+
width: "25",
|
|
9832
|
+
height: "20",
|
|
9833
|
+
className: styles$7.iconStyle
|
|
9834
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
9835
|
+
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.",
|
|
9836
|
+
style: {
|
|
9837
|
+
fontWeight: 'normal'
|
|
9838
|
+
}
|
|
9839
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9840
|
+
buttonText: "Add user",
|
|
9841
|
+
type: "text",
|
|
9842
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9843
|
+
width: "9",
|
|
9844
|
+
height: "9",
|
|
9845
|
+
color: "#EC5D25"
|
|
9846
|
+
}),
|
|
9847
|
+
onClick: handleAddPageNavigation,
|
|
9848
|
+
className: styles$7.addUserButton
|
|
9849
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9850
|
+
label: name + " name",
|
|
9061
9851
|
name: "name",
|
|
9062
9852
|
defaultValue: dialogData.data.name,
|
|
9063
9853
|
onValueChange: onValueChange,
|
|
@@ -9065,7 +9855,49 @@ function EditPanelDialog(_ref) {
|
|
|
9065
9855
|
isError: isError,
|
|
9066
9856
|
validation: validation,
|
|
9067
9857
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9068
|
-
required: true
|
|
9858
|
+
required: true,
|
|
9859
|
+
style: tableName === 'department' && {
|
|
9860
|
+
width: '350px'
|
|
9861
|
+
}
|
|
9862
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9863
|
+
className: "iui__mt-15",
|
|
9864
|
+
style: {
|
|
9865
|
+
width: '100%'
|
|
9866
|
+
}
|
|
9867
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9868
|
+
label: "Department head",
|
|
9869
|
+
name: "name",
|
|
9870
|
+
defaultValue: head.label,
|
|
9871
|
+
placeholder: "",
|
|
9872
|
+
readOnly: true,
|
|
9873
|
+
style: {
|
|
9874
|
+
width: '350px'
|
|
9875
|
+
}
|
|
9876
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9877
|
+
className: "iui__mt-15",
|
|
9878
|
+
style: {
|
|
9879
|
+
width: '100%'
|
|
9880
|
+
}
|
|
9881
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9882
|
+
noResultsText: true,
|
|
9883
|
+
isMove: true,
|
|
9884
|
+
additional: {
|
|
9885
|
+
page: 1,
|
|
9886
|
+
departmentId: rowData.id
|
|
9887
|
+
},
|
|
9888
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9889
|
+
label: "Department head",
|
|
9890
|
+
value: head,
|
|
9891
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9892
|
+
var _value = _ref2._value;
|
|
9893
|
+
return setHead(_value);
|
|
9894
|
+
},
|
|
9895
|
+
loadOption: departmentHeadOptions,
|
|
9896
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9897
|
+
customLoadingText: "No users found in this department",
|
|
9898
|
+
customLoadingTextStyle: {
|
|
9899
|
+
color: '#374151'
|
|
9900
|
+
}
|
|
9069
9901
|
})));
|
|
9070
9902
|
}
|
|
9071
9903
|
|
|
@@ -9244,12 +10076,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9244
10076
|
var _useState13 = React.useState(false),
|
|
9245
10077
|
isSortingChangeTemp = _useState13[0],
|
|
9246
10078
|
setSortingChangeTemp = _useState13[1];
|
|
9247
|
-
var _useState14 = React.useState(
|
|
9248
|
-
|
|
9249
|
-
|
|
9250
|
-
var _useState15 = React.useState(
|
|
9251
|
-
|
|
9252
|
-
|
|
10079
|
+
var _useState14 = React.useState([]),
|
|
10080
|
+
rowData = _useState14[0],
|
|
10081
|
+
setRowData = _useState14[1];
|
|
10082
|
+
var _useState15 = React.useState(1),
|
|
10083
|
+
page = _useState15[0],
|
|
10084
|
+
setPage = _useState15[1];
|
|
10085
|
+
var _useState16 = React.useState(5),
|
|
10086
|
+
rowsPerPage = _useState16[0],
|
|
10087
|
+
setRowsPerPage = _useState16[1];
|
|
9253
10088
|
var orderingParam = orderBy;
|
|
9254
10089
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9255
10090
|
return state.userPanel;
|
|
@@ -9262,7 +10097,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9262
10097
|
}),
|
|
9263
10098
|
isTokenVerified = _useSelector2.isTokenVerified,
|
|
9264
10099
|
hasVerificationError = _useSelector2.hasVerificationError;
|
|
9265
|
-
|
|
9266
10100
|
var onValueChange = function onValueChange(_ref2) {
|
|
9267
10101
|
var _value = _ref2._value;
|
|
9268
10102
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
@@ -9346,6 +10180,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9346
10180
|
submitLabel: 'Save'
|
|
9347
10181
|
}, '', data));
|
|
9348
10182
|
setDataList(data.name);
|
|
10183
|
+
setRowData(data);
|
|
9349
10184
|
setEditModal(true);
|
|
9350
10185
|
};
|
|
9351
10186
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9360,6 +10195,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9360
10195
|
var payload = {
|
|
9361
10196
|
names: [dataList]
|
|
9362
10197
|
};
|
|
10198
|
+
if (tableName === 'department') {
|
|
10199
|
+
payload = {
|
|
10200
|
+
name: dataList,
|
|
10201
|
+
department_head_id: null
|
|
10202
|
+
};
|
|
10203
|
+
}
|
|
9363
10204
|
var message = title + " added successfully.";
|
|
9364
10205
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9365
10206
|
} else {
|
|
@@ -9373,10 +10214,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9373
10214
|
var message = title + " deleted successfully.";
|
|
9374
10215
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9375
10216
|
};
|
|
9376
|
-
|
|
9377
|
-
|
|
10217
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10218
|
+
if (optionalParams === void 0) {
|
|
10219
|
+
optionalParams = null;
|
|
10220
|
+
}
|
|
9378
10221
|
dispatch(userPanelShowLoader());
|
|
9379
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10222
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9380
10223
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9381
10224
|
dispatch(userPanelStopLoader());
|
|
9382
10225
|
if (type === 'delete') {
|
|
@@ -9418,8 +10261,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9418
10261
|
name: dataList
|
|
9419
10262
|
}]
|
|
9420
10263
|
};
|
|
10264
|
+
if (tableName === 'department') {
|
|
10265
|
+
payload = {
|
|
10266
|
+
name: dataList,
|
|
10267
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10268
|
+
};
|
|
10269
|
+
}
|
|
9421
10270
|
var message = title + " updated successfully.";
|
|
9422
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10271
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9423
10272
|
setErrorEdit(false);
|
|
9424
10273
|
} else {
|
|
9425
10274
|
setErrorEdit(true);
|
|
@@ -9526,7 +10375,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9526
10375
|
submitHandler: handleEditPanel,
|
|
9527
10376
|
isError: errorEdit,
|
|
9528
10377
|
isDisabledSubmitBtn: loading,
|
|
9529
|
-
validation: validation
|
|
10378
|
+
validation: validation,
|
|
10379
|
+
rowData: rowData,
|
|
10380
|
+
tableName: tableName,
|
|
10381
|
+
config: config
|
|
9530
10382
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9531
10383
|
config: config
|
|
9532
10384
|
}));
|