@itilite/iui-user-management 0.4.210 → 0.4.211
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 +88 -0
- package/dist/index.js +892 -201
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +893 -202
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -357,6 +357,9 @@ var userAddEditUrl = {
|
|
|
357
357
|
approversSearch: function approversSearch() {
|
|
358
358
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
359
359
|
},
|
|
360
|
+
transferAppover: function transferAppover() {
|
|
361
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
362
|
+
},
|
|
360
363
|
preSignedUrl: function preSignedUrl() {
|
|
361
364
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
362
365
|
},
|
|
@@ -453,6 +456,14 @@ var userPanelUrl = {
|
|
|
453
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
454
457
|
}
|
|
455
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
|
+
};
|
|
456
467
|
|
|
457
468
|
var api = utils.configs.api;
|
|
458
469
|
var NAoptionConfig = {
|
|
@@ -594,11 +605,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
594
605
|
return Promise.reject(e);
|
|
595
606
|
}
|
|
596
607
|
};
|
|
597
|
-
var
|
|
608
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
598
609
|
var page = _ref4.page,
|
|
599
610
|
product = _ref4.product,
|
|
600
|
-
userId = _ref4.userId
|
|
601
|
-
|
|
611
|
+
userId = _ref4.userId;
|
|
612
|
+
try {
|
|
613
|
+
return Promise.resolve(_catch(function () {
|
|
614
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
615
|
+
return res.data;
|
|
616
|
+
})).then(function (response) {
|
|
617
|
+
var mappedValue = response.results.map(function (item) {
|
|
618
|
+
return {
|
|
619
|
+
value: item.email,
|
|
620
|
+
label: item.email,
|
|
621
|
+
type: 'detailed',
|
|
622
|
+
data: item
|
|
623
|
+
};
|
|
624
|
+
});
|
|
625
|
+
return {
|
|
626
|
+
options: mappedValue,
|
|
627
|
+
hasMore: !!response.next,
|
|
628
|
+
additional: {
|
|
629
|
+
page: page + 1,
|
|
630
|
+
product: product,
|
|
631
|
+
userId: userId
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
});
|
|
635
|
+
}, function () {
|
|
636
|
+
return {
|
|
637
|
+
options: [],
|
|
638
|
+
hasMore: false,
|
|
639
|
+
additional: {
|
|
640
|
+
page: 1,
|
|
641
|
+
product: product,
|
|
642
|
+
userId: userId
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}));
|
|
646
|
+
} catch (e) {
|
|
647
|
+
return Promise.reject(e);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
651
|
+
var page = _ref5.page,
|
|
652
|
+
product = _ref5.product,
|
|
653
|
+
userId = _ref5.userId,
|
|
654
|
+
placeholder = _ref5.placeholder;
|
|
602
655
|
try {
|
|
603
656
|
return Promise.resolve(_catch(function () {
|
|
604
657
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -644,9 +697,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
644
697
|
return Promise.reject(e);
|
|
645
698
|
}
|
|
646
699
|
};
|
|
647
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
648
|
-
var page =
|
|
649
|
-
tabelName =
|
|
700
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
701
|
+
var page = _ref6.page,
|
|
702
|
+
tabelName = _ref6.tabelName;
|
|
650
703
|
try {
|
|
651
704
|
return Promise.resolve(_catch(function () {
|
|
652
705
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -681,6 +734,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
681
734
|
return Promise.reject(e);
|
|
682
735
|
}
|
|
683
736
|
};
|
|
737
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
738
|
+
var page = _ref7.page,
|
|
739
|
+
departmentId = _ref7.departmentId;
|
|
740
|
+
try {
|
|
741
|
+
return Promise.resolve(_catch(function () {
|
|
742
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
743
|
+
return res.data;
|
|
744
|
+
})).then(function (response) {
|
|
745
|
+
var mappedValue = response.results.map(function (item) {
|
|
746
|
+
return {
|
|
747
|
+
value: item.id,
|
|
748
|
+
label: item.first_name + ' ' + item.last_name,
|
|
749
|
+
type: 'detailed',
|
|
750
|
+
data: item
|
|
751
|
+
};
|
|
752
|
+
});
|
|
753
|
+
console.log(response.next);
|
|
754
|
+
return {
|
|
755
|
+
options: mappedValue,
|
|
756
|
+
hasMore: !!response.next,
|
|
757
|
+
additional: {
|
|
758
|
+
page: page + 1,
|
|
759
|
+
departmentId: departmentId
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
});
|
|
763
|
+
}, function () {
|
|
764
|
+
return {
|
|
765
|
+
options: [],
|
|
766
|
+
hasMore: false,
|
|
767
|
+
additional: {
|
|
768
|
+
page: 1,
|
|
769
|
+
departmentId: departmentId
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
}));
|
|
773
|
+
} catch (e) {
|
|
774
|
+
return Promise.reject(e);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
684
777
|
|
|
685
778
|
var UserRole = function UserRole(_ref) {
|
|
686
779
|
var _ref$list = _ref.list,
|
|
@@ -1149,10 +1242,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1149
1242
|
payload: tabId
|
|
1150
1243
|
};
|
|
1151
1244
|
};
|
|
1152
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1245
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1246
|
+
if (roleTransfer === void 0) {
|
|
1247
|
+
roleTransfer = false;
|
|
1248
|
+
}
|
|
1249
|
+
var _payload = {
|
|
1250
|
+
role_transfer: roleTransfer
|
|
1251
|
+
};
|
|
1252
|
+
if (roleTransfer) {
|
|
1253
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1254
|
+
}
|
|
1153
1255
|
return function (dispatch) {
|
|
1154
1256
|
return new Promise(function (resolve, reject) {
|
|
1155
|
-
api$1.
|
|
1257
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1156
1258
|
dispatch(setUserActiveStatus({
|
|
1157
1259
|
is_active: activateVal !== 0,
|
|
1158
1260
|
id: id
|
|
@@ -1716,7 +1818,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1716
1818
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1717
1819
|
return function (dispatch) {
|
|
1718
1820
|
return new Promise(function (resolve, reject) {
|
|
1719
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1821
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1720
1822
|
resolve(res);
|
|
1721
1823
|
})["catch"](function (err) {
|
|
1722
1824
|
var _err$response17, _err$response17$data;
|
|
@@ -1752,6 +1854,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1752
1854
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1753
1855
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1754
1856
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1857
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1755
1858
|
|
|
1756
1859
|
var api$3 = utils.configs.api;
|
|
1757
1860
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1801,14 +1904,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1801
1904
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1802
1905
|
return function (dispatch) {
|
|
1803
1906
|
return new Promise(function (resolve, reject) {
|
|
1804
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1907
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1805
1908
|
dispatch(getUserPanalData(getParam));
|
|
1806
1909
|
dispatch(closeDialog());
|
|
1807
1910
|
resolve(res);
|
|
1808
1911
|
})["catch"](function (err) {
|
|
1809
|
-
var _err$
|
|
1912
|
+
var _err$response3, _err$response3$data;
|
|
1810
1913
|
dispatch(userPanelStopLoader());
|
|
1811
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1914
|
+
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.');
|
|
1812
1915
|
});
|
|
1813
1916
|
});
|
|
1814
1917
|
};
|
|
@@ -1822,25 +1925,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1822
1925
|
dispatch(userPanelStopLoader());
|
|
1823
1926
|
resolve();
|
|
1824
1927
|
})["catch"](function (err) {
|
|
1825
|
-
var _err$
|
|
1826
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1928
|
+
var _err$response4, _err$response4$data;
|
|
1929
|
+
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.');
|
|
1827
1930
|
dispatch(userPanelStopLoader());
|
|
1828
1931
|
});
|
|
1829
1932
|
});
|
|
1830
1933
|
};
|
|
1831
1934
|
};
|
|
1832
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1935
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1833
1936
|
return function (dispatch) {
|
|
1834
1937
|
return new Promise(function (resolve, reject) {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1938
|
+
if (tableName === 'department') {
|
|
1939
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1940
|
+
dispatch(getUserPanalData(getParam));
|
|
1941
|
+
dispatch(closeDialog());
|
|
1942
|
+
resolve();
|
|
1943
|
+
})["catch"](function (err) {
|
|
1944
|
+
var _err$response5, _err$response5$data;
|
|
1945
|
+
dispatch(userPanelStopLoader());
|
|
1946
|
+
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.');
|
|
1947
|
+
});
|
|
1948
|
+
} else {
|
|
1949
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1950
|
+
dispatch(getUserPanalData(getParam));
|
|
1951
|
+
dispatch(closeDialog());
|
|
1952
|
+
resolve();
|
|
1953
|
+
})["catch"](function (err) {
|
|
1954
|
+
var _err$response6, _err$response6$data;
|
|
1955
|
+
dispatch(userPanelStopLoader());
|
|
1956
|
+
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.');
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1844
1959
|
});
|
|
1845
1960
|
};
|
|
1846
1961
|
};
|
|
@@ -1852,8 +1967,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1852
1967
|
dispatch(closeDialog());
|
|
1853
1968
|
resolve(res);
|
|
1854
1969
|
})["catch"](function (err) {
|
|
1855
|
-
var _err$
|
|
1856
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1970
|
+
var _err$response7, _err$response7$data;
|
|
1971
|
+
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.');
|
|
1857
1972
|
});
|
|
1858
1973
|
});
|
|
1859
1974
|
};
|
|
@@ -3953,6 +4068,7 @@ var initialState$2 = {
|
|
|
3953
4068
|
previous: null,
|
|
3954
4069
|
results: []
|
|
3955
4070
|
},
|
|
4071
|
+
deptUsers: [],
|
|
3956
4072
|
loading: false
|
|
3957
4073
|
};
|
|
3958
4074
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4022,6 +4138,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4022
4138
|
loading: false
|
|
4023
4139
|
});
|
|
4024
4140
|
}
|
|
4141
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4142
|
+
{
|
|
4143
|
+
return _extends({}, state, {
|
|
4144
|
+
deptUsers: action.payload
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4025
4147
|
default:
|
|
4026
4148
|
return state;
|
|
4027
4149
|
}
|
|
@@ -4800,6 +4922,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4800
4922
|
isILadmin = _useSelector2.isILadmin,
|
|
4801
4923
|
companyName = _useSelector2.companyName;
|
|
4802
4924
|
var history = reactRouterDom.useHistory();
|
|
4925
|
+
var location = reactRouterDom.useLocation();
|
|
4803
4926
|
var _useState = React.useState({
|
|
4804
4927
|
travel: false,
|
|
4805
4928
|
expense: false
|
|
@@ -5055,6 +5178,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5055
5178
|
var onAddModalClose = function onAddModalClose() {
|
|
5056
5179
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5057
5180
|
};
|
|
5181
|
+
React.useEffect(function () {
|
|
5182
|
+
var _location$state, _location$state2;
|
|
5183
|
+
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) {
|
|
5184
|
+
var _location$state3, _location$state4;
|
|
5185
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5186
|
+
department: {
|
|
5187
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5188
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5189
|
+
}
|
|
5190
|
+
}));
|
|
5191
|
+
}
|
|
5192
|
+
}, []);
|
|
5058
5193
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5059
5194
|
var title = '';
|
|
5060
5195
|
if (id === 'entity') {
|
|
@@ -5080,24 +5215,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5080
5215
|
}));
|
|
5081
5216
|
} else {
|
|
5082
5217
|
dispatch(showLoader());
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5218
|
+
var dataObj;
|
|
5219
|
+
if (addModalData.id === 'department') {
|
|
5220
|
+
dataObj = {
|
|
5221
|
+
name: validatedValue,
|
|
5222
|
+
department_head_id: null
|
|
5223
|
+
};
|
|
5224
|
+
} else {
|
|
5225
|
+
dataObj = {
|
|
5226
|
+
names: [validatedValue]
|
|
5227
|
+
};
|
|
5228
|
+
}
|
|
5229
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5230
|
+
var _extends4;
|
|
5087
5231
|
setAddModalData(_extends({}, addModalData, {
|
|
5088
5232
|
isOpen: false
|
|
5089
5233
|
}));
|
|
5090
5234
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5091
5235
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5236
|
+
if (addModalData.id === 'department') {
|
|
5237
|
+
var _extends2;
|
|
5238
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5239
|
+
value: res.data.result.id,
|
|
5240
|
+
label: res.data.result.name
|
|
5241
|
+
}, _extends2)));
|
|
5242
|
+
} else {
|
|
5243
|
+
var _extends3;
|
|
5244
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5245
|
+
value: res.data.value,
|
|
5246
|
+
label: res.data.label
|
|
5247
|
+
}, _extends3)));
|
|
5248
|
+
}
|
|
5249
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5097
5250
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5098
5251
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5099
|
-
var
|
|
5100
|
-
return _extends({}, prevState, (
|
|
5252
|
+
var _extends5;
|
|
5253
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5101
5254
|
});
|
|
5102
5255
|
dispatch(stopLoader());
|
|
5103
5256
|
});
|
|
@@ -5116,8 +5269,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5116
5269
|
try {
|
|
5117
5270
|
var _temp5 = function _temp5() {
|
|
5118
5271
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5119
|
-
var
|
|
5120
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5272
|
+
var _extends6;
|
|
5273
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5121
5274
|
}
|
|
5122
5275
|
};
|
|
5123
5276
|
var _name = args._name,
|
|
@@ -5140,8 +5293,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5140
5293
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5141
5294
|
} else {
|
|
5142
5295
|
var _temp3 = function _temp3() {
|
|
5143
|
-
var
|
|
5144
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5296
|
+
var _extends7;
|
|
5297
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5145
5298
|
updateError(_name, _isError, _errorMsg);
|
|
5146
5299
|
};
|
|
5147
5300
|
var _temp2 = function () {
|
|
@@ -5189,7 +5342,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5189
5342
|
}
|
|
5190
5343
|
};
|
|
5191
5344
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5192
|
-
var
|
|
5345
|
+
var _extends8;
|
|
5193
5346
|
var _name = args._name,
|
|
5194
5347
|
_value = args._value,
|
|
5195
5348
|
_isError = args._isError,
|
|
@@ -5198,11 +5351,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5198
5351
|
_name: _name,
|
|
5199
5352
|
_value: _value
|
|
5200
5353
|
});
|
|
5201
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5354
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5202
5355
|
updateError(_name, _isError, _errorMsg);
|
|
5203
5356
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5204
|
-
var
|
|
5205
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5357
|
+
var _extends9;
|
|
5358
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5206
5359
|
}
|
|
5207
5360
|
};
|
|
5208
5361
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5212,9 +5365,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5212
5365
|
return tag.id;
|
|
5213
5366
|
};
|
|
5214
5367
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5215
|
-
var
|
|
5368
|
+
var _extends10;
|
|
5216
5369
|
var e = args._event;
|
|
5217
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5370
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5218
5371
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5219
5372
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5220
5373
|
userTagType: true
|
|
@@ -5222,22 +5375,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5222
5375
|
}
|
|
5223
5376
|
};
|
|
5224
5377
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5225
|
-
var
|
|
5378
|
+
var _extends11;
|
|
5226
5379
|
var _name = _ref2._name,
|
|
5227
5380
|
_value = _ref2._value;
|
|
5228
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5381
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5229
5382
|
};
|
|
5230
5383
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5231
|
-
var
|
|
5384
|
+
var _extends12;
|
|
5232
5385
|
var _name = _ref3._name,
|
|
5233
5386
|
_value = _ref3._value;
|
|
5234
|
-
|
|
5387
|
+
console.log(_name, _value, 'travel');
|
|
5388
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5235
5389
|
};
|
|
5236
5390
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5237
|
-
var
|
|
5391
|
+
var _extends13;
|
|
5238
5392
|
var _name = _ref4._name,
|
|
5239
5393
|
_value = _ref4._value;
|
|
5240
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5394
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5241
5395
|
};
|
|
5242
5396
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5243
5397
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5271,39 +5425,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5271
5425
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5272
5426
|
};
|
|
5273
5427
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5274
|
-
var
|
|
5428
|
+
var _extends14;
|
|
5275
5429
|
var _name = args._name,
|
|
5276
5430
|
_value = args._value,
|
|
5277
5431
|
_isError = args._isError,
|
|
5278
5432
|
_errorMsg = args._errorMsg;
|
|
5279
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5433
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5280
5434
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5281
|
-
var
|
|
5282
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5435
|
+
var _extends15;
|
|
5436
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5283
5437
|
}
|
|
5284
5438
|
updateError(_name, _isError, _errorMsg);
|
|
5285
5439
|
};
|
|
5286
5440
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5287
|
-
var
|
|
5441
|
+
var _extends16;
|
|
5288
5442
|
var _name = args._name,
|
|
5289
5443
|
_value = args._value,
|
|
5290
5444
|
_isError = args._isError,
|
|
5291
5445
|
_errorMsg = args._errorMsg;
|
|
5292
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5446
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5293
5447
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5294
|
-
var
|
|
5295
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5448
|
+
var _extends17;
|
|
5449
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5296
5450
|
}
|
|
5297
5451
|
updateError(_name, _isError, _errorMsg);
|
|
5298
5452
|
};
|
|
5299
5453
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5300
5454
|
try {
|
|
5301
5455
|
var _temp8 = function _temp8() {
|
|
5302
|
-
var
|
|
5303
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5456
|
+
var _extends18;
|
|
5457
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5304
5458
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5305
|
-
var
|
|
5306
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5459
|
+
var _extends19;
|
|
5460
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5307
5461
|
}
|
|
5308
5462
|
updateError(_name, _isError, _errorMsg);
|
|
5309
5463
|
};
|
|
@@ -5409,8 +5563,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5409
5563
|
return _errorArray;
|
|
5410
5564
|
});
|
|
5411
5565
|
setErrorMsgs(function (prevState) {
|
|
5412
|
-
var
|
|
5413
|
-
return _extends({}, prevState, (
|
|
5566
|
+
var _extends20;
|
|
5567
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5414
5568
|
});
|
|
5415
5569
|
};
|
|
5416
5570
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -6739,7 +6893,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6739
6893
|
};
|
|
6740
6894
|
};
|
|
6741
6895
|
|
|
6742
|
-
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","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6896
|
+
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_","tooltipTextDiv":"_1l4V-","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","warningSvg":"_2H6Bq","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn","deactivateSubmitBtn":"_1qxY-","deactivateCustomButtonClass":"_2YBWE"};
|
|
6743
6897
|
|
|
6744
6898
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6745
6899
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8225,9 +8379,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8225
8379
|
cell: function cell(row) {
|
|
8226
8380
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8227
8381
|
component: "div",
|
|
8228
|
-
width:
|
|
8382
|
+
width: 80
|
|
8229
8383
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8230
|
-
title: "This user hasn't logged
|
|
8384
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8231
8385
|
arrow: true,
|
|
8232
8386
|
classes: {
|
|
8233
8387
|
arrow: classes.arrow,
|
|
@@ -8235,7 +8389,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8235
8389
|
},
|
|
8236
8390
|
placement: "top-start"
|
|
8237
8391
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8238
|
-
className: clsx(styles$5.
|
|
8392
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8239
8393
|
}, "Invited")) : null);
|
|
8240
8394
|
}
|
|
8241
8395
|
}, {
|
|
@@ -8336,7 +8490,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8336
8490
|
options.push({
|
|
8337
8491
|
label: 'Resend invite',
|
|
8338
8492
|
handler: function handler() {
|
|
8339
|
-
return toggleInviteModal(row.id, 'single');
|
|
8493
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8340
8494
|
}
|
|
8341
8495
|
});
|
|
8342
8496
|
}
|
|
@@ -8508,6 +8662,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8508
8662
|
});
|
|
8509
8663
|
};
|
|
8510
8664
|
|
|
8665
|
+
function InfoYellowIcon(props) {
|
|
8666
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8667
|
+
width: props.width,
|
|
8668
|
+
height: props.height,
|
|
8669
|
+
viewBox: "0 0 20 20",
|
|
8670
|
+
fill: "none",
|
|
8671
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8672
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8673
|
+
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",
|
|
8674
|
+
fill: "#CA8A04"
|
|
8675
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8676
|
+
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",
|
|
8677
|
+
fill: "#CA8A04"
|
|
8678
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8679
|
+
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",
|
|
8680
|
+
fill: "#CA8A04"
|
|
8681
|
+
}));
|
|
8682
|
+
}
|
|
8683
|
+
|
|
8684
|
+
function RedWarningIcon(props) {
|
|
8685
|
+
var _props$color = props.color,
|
|
8686
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8687
|
+
_props$size = props.size,
|
|
8688
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8689
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8690
|
+
width: size,
|
|
8691
|
+
height: size,
|
|
8692
|
+
viewBox: "0 0 14 14",
|
|
8693
|
+
fill: color,
|
|
8694
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8695
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8696
|
+
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",
|
|
8697
|
+
fill: color
|
|
8698
|
+
}));
|
|
8699
|
+
}
|
|
8700
|
+
|
|
8511
8701
|
function InviteInfoIcon() {
|
|
8512
8702
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8513
8703
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8525,7 +8715,8 @@ function InviteInfoIcon() {
|
|
|
8525
8715
|
}
|
|
8526
8716
|
|
|
8527
8717
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8528
|
-
var env$7 = utils.configs.env
|
|
8718
|
+
var env$7 = utils.configs.env,
|
|
8719
|
+
api$7 = utils.configs.api;
|
|
8529
8720
|
var UndoButton = function UndoButton(_ref) {
|
|
8530
8721
|
var onUndo = _ref.onUndo,
|
|
8531
8722
|
msg = _ref.msg;
|
|
@@ -8563,27 +8754,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8563
8754
|
isDataFetching = _useSelector.isDataFetching,
|
|
8564
8755
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8565
8756
|
tabValue = _useSelector.tabValue;
|
|
8566
|
-
var
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
searchValue = _useState2[0],
|
|
8583
|
-
setSearchValue = _useState2[1];
|
|
8757
|
+
var newSelecteds = userListInfo.results;
|
|
8758
|
+
var _React$useState = React__default.useState(''),
|
|
8759
|
+
deactivateUser = _React$useState[0],
|
|
8760
|
+
setDeactivateUser = _React$useState[1];
|
|
8761
|
+
var _React$useState2 = React__default.useState(null),
|
|
8762
|
+
defaultId = _React$useState2[0],
|
|
8763
|
+
setDefaultId = _React$useState2[1];
|
|
8764
|
+
var _React$useState3 = React__default.useState(1),
|
|
8765
|
+
page = _React$useState3[0],
|
|
8766
|
+
setPage = _React$useState3[1];
|
|
8767
|
+
var _useState = React.useState([]),
|
|
8768
|
+
selectedUsersNotApprover = _useState[0],
|
|
8769
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8770
|
+
var _useState2 = React.useState([]),
|
|
8771
|
+
selectedUsersApprover = _useState2[0],
|
|
8772
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8584
8773
|
var _useState3 = React.useState(false),
|
|
8585
|
-
|
|
8586
|
-
|
|
8774
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8775
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8776
|
+
var _React$useState4 = React__default.useState(''),
|
|
8777
|
+
user = _React$useState4[0],
|
|
8778
|
+
setUser = _React$useState4[1];
|
|
8779
|
+
var _useState4 = React.useState(10),
|
|
8780
|
+
rowsPerPage = _useState4[0],
|
|
8781
|
+
setRowsPerPage = _useState4[1];
|
|
8782
|
+
var _React$useState5 = React__default.useState({}),
|
|
8783
|
+
selected = _React$useState5[0],
|
|
8784
|
+
setSelected = _React$useState5[1];
|
|
8785
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8786
|
+
order = _React$useState6[0],
|
|
8787
|
+
setOrder = _React$useState6[1];
|
|
8788
|
+
var _React$useState7 = React__default.useState(false),
|
|
8789
|
+
deactivateSingle = _React$useState7[0],
|
|
8790
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8791
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8792
|
+
orderBy = _React$useState8[0],
|
|
8793
|
+
setOrderBy = _React$useState8[1];
|
|
8794
|
+
var _useState5 = React.useState(''),
|
|
8795
|
+
searchValue = _useState5[0],
|
|
8796
|
+
setSearchValue = _useState5[1];
|
|
8797
|
+
var _useState6 = React.useState(false),
|
|
8798
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8799
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8587
8800
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
8588
8801
|
return state.common;
|
|
8589
8802
|
}),
|
|
@@ -8591,36 +8804,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8591
8804
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8592
8805
|
isILadmin = _useSelector2.isILadmin,
|
|
8593
8806
|
companyName = _useSelector2.companyName;
|
|
8594
|
-
var _useState4 = React.useState(false),
|
|
8595
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8596
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8597
|
-
var _useState5 = React.useState(false),
|
|
8598
|
-
isFileDownloading = _useState5[0],
|
|
8599
|
-
setDownlStatus = _useState5[1];
|
|
8600
|
-
var _useState6 = React.useState(false),
|
|
8601
|
-
isSortingChange = _useState6[0],
|
|
8602
|
-
setSortingChange = _useState6[1];
|
|
8603
8807
|
var _useState7 = React.useState(false),
|
|
8604
|
-
|
|
8605
|
-
|
|
8808
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8809
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8606
8810
|
var _useState8 = React.useState(false),
|
|
8607
|
-
|
|
8608
|
-
|
|
8811
|
+
approveeStatus = _useState8[0],
|
|
8812
|
+
setApproveeStatus = _useState8[1];
|
|
8609
8813
|
var _useState9 = React.useState(false),
|
|
8610
|
-
|
|
8611
|
-
|
|
8814
|
+
isFileDownloading = _useState9[0],
|
|
8815
|
+
setDownlStatus = _useState9[1];
|
|
8612
8816
|
var _useState10 = React.useState(false),
|
|
8613
|
-
|
|
8614
|
-
|
|
8817
|
+
isSortingChange = _useState10[0],
|
|
8818
|
+
setSortingChange = _useState10[1];
|
|
8615
8819
|
var _useState11 = React.useState(false),
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
var _useState12 = React.useState(
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
var
|
|
8622
|
-
|
|
8623
|
-
|
|
8820
|
+
isSearchingChange = _useState11[0],
|
|
8821
|
+
setSearchingChange = _useState11[1];
|
|
8822
|
+
var _useState12 = React.useState(false),
|
|
8823
|
+
isSortingChangeTemp = _useState12[0],
|
|
8824
|
+
setSortingChangeTemp = _useState12[1];
|
|
8825
|
+
var _useState13 = React.useState(false),
|
|
8826
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8827
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8828
|
+
var _useState14 = React.useState(false),
|
|
8829
|
+
isApiFetching = _useState14[0],
|
|
8830
|
+
setisApiFetching = _useState14[1];
|
|
8831
|
+
var _useState15 = React.useState({
|
|
8832
|
+
value: '',
|
|
8833
|
+
label: 'Select approver'
|
|
8834
|
+
}),
|
|
8835
|
+
approverRole = _useState15[0],
|
|
8836
|
+
setApproverRole = _useState15[1];
|
|
8837
|
+
var _useState16 = React.useState(false),
|
|
8838
|
+
showInviteModal = _useState16[0],
|
|
8839
|
+
setToggleInviteModal = _useState16[1];
|
|
8840
|
+
var _useState17 = React.useState(''),
|
|
8841
|
+
userIds = _useState17[0],
|
|
8842
|
+
setUserIds = _useState17[1];
|
|
8843
|
+
var _React$useState9 = React__default.useState(false),
|
|
8844
|
+
overlayMenu = _React$useState9[0],
|
|
8845
|
+
setOverlayMenu = _React$useState9[1];
|
|
8846
|
+
var _useState18 = React.useState(''),
|
|
8847
|
+
userFirstName = _useState18[0],
|
|
8848
|
+
setUserFirstName = _useState18[1];
|
|
8849
|
+
var _useState19 = React.useState(''),
|
|
8850
|
+
userLastName = _useState19[0],
|
|
8851
|
+
setUserLastName = _useState19[1];
|
|
8852
|
+
var _useState20 = React.useState(true),
|
|
8853
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8854
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8624
8855
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8625
8856
|
var prevPos = _ref3.prevPos,
|
|
8626
8857
|
currPos = _ref3.currPos;
|
|
@@ -8641,33 +8872,33 @@ var UserList = function UserList(_ref2) {
|
|
|
8641
8872
|
behavior: 'smooth'
|
|
8642
8873
|
});
|
|
8643
8874
|
};
|
|
8644
|
-
var _React$
|
|
8645
|
-
signup_page = _React$
|
|
8646
|
-
setSignUpPage = _React$
|
|
8647
|
-
var
|
|
8648
|
-
signup_rowsPerPage =
|
|
8649
|
-
setSignUpRowsPerPage =
|
|
8650
|
-
var _React$
|
|
8651
|
-
signup_order = _React$
|
|
8652
|
-
setSignUpOrder = _React$
|
|
8653
|
-
var _React$
|
|
8654
|
-
signup_orderBy = _React$
|
|
8655
|
-
setSignUpOrderBy = _React$
|
|
8656
|
-
var
|
|
8657
|
-
signup_searchValue =
|
|
8658
|
-
set_signup_SearchValue =
|
|
8659
|
-
var
|
|
8660
|
-
isSignUpSortingChange =
|
|
8661
|
-
setSignUpSortingChange =
|
|
8662
|
-
var
|
|
8663
|
-
isSignUpSearchingChange =
|
|
8664
|
-
setSignUpSearchingChange =
|
|
8665
|
-
var
|
|
8666
|
-
isSignUpSortingChangeTemp =
|
|
8667
|
-
setSignUpSortingChangeTemp =
|
|
8668
|
-
var
|
|
8669
|
-
isSignUpSearchingChangeTemp =
|
|
8670
|
-
setSignUpSearchingChangeTemp =
|
|
8875
|
+
var _React$useState10 = React__default.useState(1),
|
|
8876
|
+
signup_page = _React$useState10[0],
|
|
8877
|
+
setSignUpPage = _React$useState10[1];
|
|
8878
|
+
var _useState21 = React.useState(5),
|
|
8879
|
+
signup_rowsPerPage = _useState21[0],
|
|
8880
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8881
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8882
|
+
signup_order = _React$useState11[0],
|
|
8883
|
+
setSignUpOrder = _React$useState11[1];
|
|
8884
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8885
|
+
signup_orderBy = _React$useState12[0],
|
|
8886
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8887
|
+
var _useState22 = React.useState(''),
|
|
8888
|
+
signup_searchValue = _useState22[0],
|
|
8889
|
+
set_signup_SearchValue = _useState22[1];
|
|
8890
|
+
var _useState23 = React.useState(false),
|
|
8891
|
+
isSignUpSortingChange = _useState23[0],
|
|
8892
|
+
setSignUpSortingChange = _useState23[1];
|
|
8893
|
+
var _useState24 = React.useState(false),
|
|
8894
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8895
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8896
|
+
var _useState25 = React.useState(false),
|
|
8897
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8898
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8899
|
+
var _useState26 = React.useState(false),
|
|
8900
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8901
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8671
8902
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8672
8903
|
return state.userList;
|
|
8673
8904
|
}),
|
|
@@ -8680,11 +8911,29 @@ var UserList = function UserList(_ref2) {
|
|
|
8680
8911
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8681
8912
|
return false;
|
|
8682
8913
|
}
|
|
8683
|
-
|
|
8914
|
+
if (selectedUsersApprover.length) {
|
|
8915
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8916
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8917
|
+
var _selected = Object.values(selected).flat();
|
|
8918
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8919
|
+
return _selected.includes(item.id.toString());
|
|
8920
|
+
});
|
|
8921
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8922
|
+
return _selected.includes(item.id.toString());
|
|
8923
|
+
});
|
|
8924
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8925
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8926
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8927
|
+
} else {
|
|
8928
|
+
setOpenDeActivateModalFlag(true);
|
|
8929
|
+
}
|
|
8684
8930
|
};
|
|
8685
8931
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8686
8932
|
setOpenDeActivateModalFlag(false);
|
|
8687
8933
|
};
|
|
8934
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8935
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8936
|
+
};
|
|
8688
8937
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8689
8938
|
history.push(config.routes.users.add.path);
|
|
8690
8939
|
};
|
|
@@ -8732,12 +8981,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8732
8981
|
};
|
|
8733
8982
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8734
8983
|
var _extends2;
|
|
8735
|
-
var
|
|
8984
|
+
var selectedId = [];
|
|
8985
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8986
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8987
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8736
8988
|
return n.is_active;
|
|
8737
|
-
}).map(function (obj) {
|
|
8738
|
-
return obj.id.toString();
|
|
8739
8989
|
});
|
|
8740
|
-
|
|
8990
|
+
_newSelecteds.map(function (obj) {
|
|
8991
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
8992
|
+
if (obj.roles.is_approver === true) {
|
|
8993
|
+
_selectedUsersApprover.push(obj);
|
|
8994
|
+
} else if (obj.roles.is_approver === false) {
|
|
8995
|
+
_selectedUsersNotApprover.push(obj);
|
|
8996
|
+
}
|
|
8997
|
+
}
|
|
8998
|
+
selectedId.push(obj.id.toString());
|
|
8999
|
+
});
|
|
9000
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9001
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9002
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8741
9003
|
};
|
|
8742
9004
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8743
9005
|
var _extends3;
|
|
@@ -8764,49 +9026,145 @@ var UserList = function UserList(_ref2) {
|
|
|
8764
9026
|
setSignUpSearchingChange(true);
|
|
8765
9027
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8766
9028
|
};
|
|
8767
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9029
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8768
9030
|
var _extends4;
|
|
8769
9031
|
var selectedTemp = _extends({}, selected);
|
|
8770
9032
|
if (!(page in selectedTemp)) {
|
|
8771
9033
|
selectedTemp[page] = [];
|
|
8772
9034
|
}
|
|
8773
9035
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8774
|
-
var
|
|
9036
|
+
var _newSelected = [];
|
|
8775
9037
|
if (selectedIndex === -1) {
|
|
8776
|
-
|
|
9038
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8777
9039
|
} else if (selectedIndex === 0) {
|
|
8778
|
-
|
|
9040
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8779
9041
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8780
|
-
|
|
9042
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8781
9043
|
} else if (selectedIndex > 0) {
|
|
8782
|
-
|
|
9044
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8783
9045
|
}
|
|
8784
|
-
|
|
9046
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9047
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9048
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9049
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9050
|
+
return id !== item.id.toString();
|
|
9051
|
+
});
|
|
9052
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9053
|
+
return item.id.toString() !== id;
|
|
9054
|
+
});
|
|
9055
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9056
|
+
if (data.roles.is_approver === true) {
|
|
9057
|
+
_SelectedUsersApprover.push(data);
|
|
9058
|
+
} else if (data.roles.is_approver === false) {
|
|
9059
|
+
_SelectedUsersNotApprover.push(data);
|
|
9060
|
+
}
|
|
9061
|
+
}
|
|
9062
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9063
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9064
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8785
9065
|
};
|
|
9066
|
+
React.useEffect(function () {
|
|
9067
|
+
setApproverRole({
|
|
9068
|
+
value: '',
|
|
9069
|
+
label: 'Select approver'
|
|
9070
|
+
});
|
|
9071
|
+
setDefaultId(null);
|
|
9072
|
+
setIsDisabledSubmitBtn(true);
|
|
9073
|
+
setApproveeStatus(false);
|
|
9074
|
+
if (deactivateSingle === true) {
|
|
9075
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9076
|
+
if (response.data["default"].id) {
|
|
9077
|
+
setDefaultId(response.data["default"].id);
|
|
9078
|
+
setApproverRole({
|
|
9079
|
+
value: '',
|
|
9080
|
+
label: response.data["default"].email
|
|
9081
|
+
});
|
|
9082
|
+
setIsDisabledSubmitBtn(false);
|
|
9083
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9084
|
+
}
|
|
9085
|
+
});
|
|
9086
|
+
}
|
|
9087
|
+
}, [deactivateSingle]);
|
|
8786
9088
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8787
9089
|
setRowsPerPage(+event.target.value);
|
|
8788
9090
|
setPage(1);
|
|
8789
9091
|
setSelected({});
|
|
9092
|
+
setSelectedUsersNotApprover([]);
|
|
9093
|
+
setSelectedUsersApprover([]);
|
|
8790
9094
|
setSortingChange(true);
|
|
8791
9095
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8792
9096
|
};
|
|
8793
9097
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8794
9098
|
var isActive = e.target.checked;
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
9099
|
+
var _isApprover;
|
|
9100
|
+
newSelecteds.map(function (item) {
|
|
9101
|
+
if (item.id === id) {
|
|
9102
|
+
_isApprover = item.roles.is_approver;
|
|
9103
|
+
if (_isApprover === true && isActive === false) {
|
|
9104
|
+
setDeactivateSingle(true);
|
|
9105
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9106
|
+
setUser(item);
|
|
9107
|
+
} else {
|
|
9108
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9109
|
+
if (!isActive) {
|
|
9110
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9111
|
+
var _extends5;
|
|
9112
|
+
var selectedTemp = _extends({}, selected);
|
|
9113
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9114
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9115
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9116
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9117
|
+
return item.id != id;
|
|
9118
|
+
});
|
|
9119
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9120
|
+
return item.id != id;
|
|
9121
|
+
});
|
|
9122
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9123
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9124
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9125
|
+
}
|
|
9126
|
+
}
|
|
9127
|
+
});
|
|
8802
9128
|
}
|
|
8803
9129
|
}
|
|
8804
9130
|
});
|
|
8805
9131
|
};
|
|
9132
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9133
|
+
var _value = _ref4._value;
|
|
9134
|
+
if (_value.data.approvee_status) {
|
|
9135
|
+
setApproveeStatus(true);
|
|
9136
|
+
} else {
|
|
9137
|
+
setApproveeStatus(false);
|
|
9138
|
+
}
|
|
9139
|
+
setDefaultId(_value.data.id);
|
|
9140
|
+
setApproverRole(_value);
|
|
9141
|
+
setIsDisabledSubmitBtn(false);
|
|
9142
|
+
};
|
|
9143
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9144
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9145
|
+
setOpenDeActivateModalFlag(false);
|
|
9146
|
+
setDeactivateSingle(false);
|
|
9147
|
+
setSelected({});
|
|
9148
|
+
setSelectedUsersNotApprover([]);
|
|
9149
|
+
setSelectedUsersApprover([]);
|
|
9150
|
+
};
|
|
8806
9151
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8807
9152
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8808
9153
|
setOpenDeActivateModalFlag(false);
|
|
8809
9154
|
setSelected({});
|
|
9155
|
+
setSelectedUsersNotApprover([]);
|
|
9156
|
+
setSelectedUsersApprover([]);
|
|
9157
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9158
|
+
};
|
|
9159
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9160
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9161
|
+
return item.id;
|
|
9162
|
+
});
|
|
9163
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9164
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9165
|
+
setSelected({});
|
|
9166
|
+
setSelectedUsersNotApprover([]);
|
|
9167
|
+
setSelectedUsersApprover([]);
|
|
8810
9168
|
};
|
|
8811
9169
|
var importUserHandler = function importUserHandler() {
|
|
8812
9170
|
setOpenImportUsersModal(true);
|
|
@@ -8823,13 +9181,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8823
9181
|
email: email
|
|
8824
9182
|
}));
|
|
8825
9183
|
};
|
|
8826
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
9184
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9185
|
+
if (type === undefined) {
|
|
9186
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9187
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9188
|
+
return false;
|
|
9189
|
+
}
|
|
8831
9190
|
}
|
|
8832
9191
|
setUserIds(ids);
|
|
9192
|
+
setUserFirstName(firstName);
|
|
9193
|
+
setUserLastName(lastName);
|
|
9194
|
+
setToggleInviteModal(!showInviteModal);
|
|
9195
|
+
};
|
|
9196
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8833
9197
|
setToggleInviteModal(!showInviteModal);
|
|
8834
9198
|
};
|
|
8835
9199
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8902,6 +9266,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8902
9266
|
userId: userId
|
|
8903
9267
|
}));
|
|
8904
9268
|
};
|
|
9269
|
+
var knowMore = function knowMore() {
|
|
9270
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9271
|
+
};
|
|
8905
9272
|
var dispatch = reactRedux.useDispatch();
|
|
8906
9273
|
React.useEffect(function () {
|
|
8907
9274
|
if (isTokenVerified === true) {
|
|
@@ -9153,11 +9520,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9153
9520
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9154
9521
|
variant: "body2",
|
|
9155
9522
|
className: clsx(styles$5.description)
|
|
9156
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React__default.createElement(
|
|
9157
|
-
variant: "span",
|
|
9523
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9158
9524
|
onClick: config.routes.notification && redirectToNotifications,
|
|
9159
9525
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9160
|
-
}, "Notifications")
|
|
9526
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9161
9527
|
data: signupRequestListInfo,
|
|
9162
9528
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9163
9529
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9189,6 +9555,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9189
9555
|
}))
|
|
9190
9556
|
}]
|
|
9191
9557
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9558
|
+
isOpen: deactivateSingle,
|
|
9559
|
+
closeHandler: function closeHandler() {
|
|
9560
|
+
setDeactivateSingle(false);
|
|
9561
|
+
},
|
|
9562
|
+
cancelLabel: "Cancel",
|
|
9563
|
+
submitLabel: "Deactivate",
|
|
9564
|
+
submitHandler: handleDeactivateUser,
|
|
9565
|
+
headerText: "Deactivate this user?",
|
|
9566
|
+
width: "400px",
|
|
9567
|
+
subHanderText: "",
|
|
9568
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9569
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9570
|
+
modalClass: "deactivateSingleModal",
|
|
9571
|
+
modalBodyStyle: {
|
|
9572
|
+
overflowY: 'unset'
|
|
9573
|
+
}
|
|
9574
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9575
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9576
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9577
|
+
className: styles$5.deactivateAlert
|
|
9578
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9579
|
+
width: "9",
|
|
9580
|
+
height: "9"
|
|
9581
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9582
|
+
variant: "body2"
|
|
9583
|
+
}, /*#__PURE__*/React__default.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9584
|
+
onClick: knowMore,
|
|
9585
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9586
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9587
|
+
className: "iui__mt-15"
|
|
9588
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9589
|
+
isMove: true,
|
|
9590
|
+
additional: {
|
|
9591
|
+
page: 1,
|
|
9592
|
+
product: 'travel',
|
|
9593
|
+
userId: user.id
|
|
9594
|
+
},
|
|
9595
|
+
label: "Transfer approver role to",
|
|
9596
|
+
value: approverRole,
|
|
9597
|
+
onValueChange: selectApprover,
|
|
9598
|
+
loadOption: transferRoleOptions,
|
|
9599
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9600
|
+
customLoadingText: "No results found"
|
|
9601
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9602
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9603
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9604
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9605
|
+
}, "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, {
|
|
9192
9606
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9193
9607
|
closeHandler: closeDeActivateModal,
|
|
9194
9608
|
cancelLabel: "Cancel",
|
|
@@ -9215,8 +9629,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9215
9629
|
}, '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, {
|
|
9216
9630
|
className: styles$5.description
|
|
9217
9631
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9632
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9633
|
+
closeHandler: closeDeActiveModal,
|
|
9634
|
+
cancelLabel: "Cancel",
|
|
9635
|
+
submitLabel: "Deactivate safe users",
|
|
9636
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9637
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9638
|
+
customButtonLabel: "Deactivate all users",
|
|
9639
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9640
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9641
|
+
width: "640px",
|
|
9642
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9643
|
+
headerText: "Deactivate users?",
|
|
9644
|
+
modalBodyStyle: {
|
|
9645
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9646
|
+
}
|
|
9647
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9648
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9649
|
+
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9650
|
+
color: "#9A6700",
|
|
9651
|
+
size: "14"
|
|
9652
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9653
|
+
variant: "body2"
|
|
9654
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9655
|
+
onClick: knowMore,
|
|
9656
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9657
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9658
|
+
className: "iui__my-15"
|
|
9659
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9660
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9661
|
+
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9662
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9663
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9664
|
+
var _item$data;
|
|
9665
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9666
|
+
key: index,
|
|
9667
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9668
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9669
|
+
firstName: item.first_name,
|
|
9670
|
+
lastName: item.last_name,
|
|
9671
|
+
isLetterAvatar: "true",
|
|
9672
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9673
|
+
secondaryText: item.email,
|
|
9674
|
+
letterAvatarTextColor: "black",
|
|
9675
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9676
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9677
|
+
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9678
|
+
color: "#9A6700",
|
|
9679
|
+
size: "14"
|
|
9680
|
+
}));
|
|
9681
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
9682
|
+
style: {
|
|
9683
|
+
borderColor: '#E5E9ED'
|
|
9684
|
+
}
|
|
9685
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9686
|
+
className: "iui__my-15"
|
|
9687
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9688
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9689
|
+
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9690
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9691
|
+
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
9692
|
+
var _item$data2;
|
|
9693
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9694
|
+
key: index,
|
|
9695
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9696
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9697
|
+
firstName: item.first_name,
|
|
9698
|
+
lastName: item.last_name,
|
|
9699
|
+
isLetterAvatar: "true",
|
|
9700
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9701
|
+
secondaryText: item.email,
|
|
9702
|
+
letterAvatarTextColor: "black",
|
|
9703
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9704
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9705
|
+
}));
|
|
9706
|
+
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9218
9707
|
isOpen: showInviteModal,
|
|
9219
|
-
closeHandler:
|
|
9708
|
+
closeHandler: function closeHandler() {
|
|
9709
|
+
return toggleInviteModalClose();
|
|
9710
|
+
},
|
|
9220
9711
|
cancelLabel: "Cancel",
|
|
9221
9712
|
headerText: "Resend Invites?",
|
|
9222
9713
|
submitLabel: "Send",
|
|
@@ -9248,7 +9739,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9248
9739
|
fontSize: '14px',
|
|
9249
9740
|
color: '#374151'
|
|
9250
9741
|
}
|
|
9251
|
-
}, "This invitation will be sent to
|
|
9742
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9743
|
+
style: {
|
|
9744
|
+
fontSize: '14px',
|
|
9745
|
+
color: '#374151',
|
|
9746
|
+
fontWeight: 'bold'
|
|
9747
|
+
}
|
|
9748
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9252
9749
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9253
9750
|
closeImportUsersModal: closeImportUsersModal,
|
|
9254
9751
|
closeImportModal: closeImportModal
|
|
@@ -9257,8 +9754,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9257
9754
|
errMsg: hasVerificationError
|
|
9258
9755
|
}));
|
|
9259
9756
|
};
|
|
9260
|
-
var TabLabelCount = function TabLabelCount(
|
|
9261
|
-
var count =
|
|
9757
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9758
|
+
var count = _ref5.count;
|
|
9262
9759
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9263
9760
|
className: styles$5.TabLabelCount
|
|
9264
9761
|
}, " ", count, " ");
|
|
@@ -9333,11 +9830,12 @@ function Header(props) {
|
|
|
9333
9830
|
})));
|
|
9334
9831
|
}
|
|
9335
9832
|
|
|
9336
|
-
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"};
|
|
9833
|
+
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"};
|
|
9337
9834
|
|
|
9338
9835
|
function Listview(_ref) {
|
|
9339
9836
|
var data = _ref.data,
|
|
9340
9837
|
name = _ref.name,
|
|
9838
|
+
tableName = _ref.tableName,
|
|
9341
9839
|
handleEditDialog = _ref.handleEditDialog,
|
|
9342
9840
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9343
9841
|
orderBy = _ref.orderBy,
|
|
@@ -9350,16 +9848,82 @@ function Listview(_ref) {
|
|
|
9350
9848
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9351
9849
|
page = _ref.page,
|
|
9352
9850
|
rowsPerPage = _ref.rowsPerPage;
|
|
9851
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9852
|
+
var _data$dept_head_detai;
|
|
9853
|
+
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) {
|
|
9854
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9855
|
+
}
|
|
9856
|
+
};
|
|
9353
9857
|
var columns = [{
|
|
9354
9858
|
id: 'name',
|
|
9355
9859
|
label: name,
|
|
9356
|
-
width: '
|
|
9860
|
+
width: '40%',
|
|
9357
9861
|
sortable: true,
|
|
9358
9862
|
cell: function cell(row) {
|
|
9359
9863
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9360
9864
|
component: "div"
|
|
9361
9865
|
}, row.name);
|
|
9362
9866
|
}
|
|
9867
|
+
}, {
|
|
9868
|
+
id: 'no_of_users',
|
|
9869
|
+
label: 'Number of users',
|
|
9870
|
+
width: '40%',
|
|
9871
|
+
sortable: true,
|
|
9872
|
+
cell: function cell(row) {
|
|
9873
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9874
|
+
component: "div"
|
|
9875
|
+
}, row.no_of_users);
|
|
9876
|
+
}
|
|
9877
|
+
}, {
|
|
9878
|
+
id: 'actions',
|
|
9879
|
+
label: 'Actions',
|
|
9880
|
+
width: '20%',
|
|
9881
|
+
cell: function cell(row) {
|
|
9882
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9883
|
+
display: "flex"
|
|
9884
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9885
|
+
buttonText: "Edit",
|
|
9886
|
+
className: styles$7.buttonWidth,
|
|
9887
|
+
onClick: function onClick() {
|
|
9888
|
+
return handleEditDialog(row);
|
|
9889
|
+
}
|
|
9890
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9891
|
+
buttonText: "Delete",
|
|
9892
|
+
className: styles$7.buttonWidth,
|
|
9893
|
+
onClick: function onClick() {
|
|
9894
|
+
return handleDeleteDialog(row, true);
|
|
9895
|
+
}
|
|
9896
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9897
|
+
buttonText: "Delete",
|
|
9898
|
+
className: styles$7.buttonWidth,
|
|
9899
|
+
onClick: function onClick() {
|
|
9900
|
+
return handleDeleteDialog(row, false);
|
|
9901
|
+
}
|
|
9902
|
+
}));
|
|
9903
|
+
}
|
|
9904
|
+
}];
|
|
9905
|
+
var departmentColumns = [{
|
|
9906
|
+
id: 'name',
|
|
9907
|
+
label: name,
|
|
9908
|
+
width: '30%',
|
|
9909
|
+
sortable: true,
|
|
9910
|
+
cell: function cell(row) {
|
|
9911
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9912
|
+
component: "div"
|
|
9913
|
+
}, row.name);
|
|
9914
|
+
}
|
|
9915
|
+
}, {
|
|
9916
|
+
id: 'department_head',
|
|
9917
|
+
label: 'Department head',
|
|
9918
|
+
width: '30%',
|
|
9919
|
+
sortable: true,
|
|
9920
|
+
cell: function cell(row) {
|
|
9921
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9922
|
+
component: "div"
|
|
9923
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9924
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9925
|
+
}, "Assigned by default"));
|
|
9926
|
+
}
|
|
9363
9927
|
}, {
|
|
9364
9928
|
id: 'no_of_users',
|
|
9365
9929
|
label: 'Number of users',
|
|
@@ -9373,7 +9937,7 @@ function Listview(_ref) {
|
|
|
9373
9937
|
}, {
|
|
9374
9938
|
id: 'actions',
|
|
9375
9939
|
label: 'Actions',
|
|
9376
|
-
width: '
|
|
9940
|
+
width: '15%',
|
|
9377
9941
|
cell: function cell(row) {
|
|
9378
9942
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9379
9943
|
display: "flex"
|
|
@@ -9406,7 +9970,7 @@ function Listview(_ref) {
|
|
|
9406
9970
|
hasFilter: true,
|
|
9407
9971
|
isCheckboxTable: false,
|
|
9408
9972
|
count: data.count,
|
|
9409
|
-
columns: columns,
|
|
9973
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9410
9974
|
rows: data.results,
|
|
9411
9975
|
page: page,
|
|
9412
9976
|
handleChangePage: handleChangePage,
|
|
@@ -9463,15 +10027,44 @@ function EditPanelDialog(_ref) {
|
|
|
9463
10027
|
var isOpen = _ref.isOpen,
|
|
9464
10028
|
closeHandler = _ref.closeHandler,
|
|
9465
10029
|
onValueChange = _ref.onValueChange,
|
|
9466
|
-
|
|
10030
|
+
_submitHandler = _ref.submitHandler,
|
|
9467
10031
|
isError = _ref.isError,
|
|
9468
10032
|
name = _ref.name,
|
|
9469
10033
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9470
|
-
validation = _ref.validation
|
|
10034
|
+
validation = _ref.validation,
|
|
10035
|
+
rowData = _ref.rowData,
|
|
10036
|
+
tableName = _ref.tableName,
|
|
10037
|
+
config = _ref.config;
|
|
9471
10038
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9472
10039
|
return state.userPanel;
|
|
9473
10040
|
}),
|
|
9474
10041
|
dialogData = _useSelector.dialogData;
|
|
10042
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10043
|
+
var _data$dept_head_detai;
|
|
10044
|
+
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) {
|
|
10045
|
+
setHead({
|
|
10046
|
+
value: data.dept_head_details[0].id,
|
|
10047
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10048
|
+
});
|
|
10049
|
+
}
|
|
10050
|
+
};
|
|
10051
|
+
var _useState = React.useState({
|
|
10052
|
+
value: '',
|
|
10053
|
+
label: 'Select'
|
|
10054
|
+
}),
|
|
10055
|
+
head = _useState[0],
|
|
10056
|
+
setHead = _useState[1];
|
|
10057
|
+
React.useEffect(function () {
|
|
10058
|
+
deptHeadDetails(rowData);
|
|
10059
|
+
}, [rowData]);
|
|
10060
|
+
var history = reactRouterDom.useHistory();
|
|
10061
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10062
|
+
console.log(rowData);
|
|
10063
|
+
history.push({
|
|
10064
|
+
pathname: config.routes.users.add.path,
|
|
10065
|
+
state: rowData
|
|
10066
|
+
});
|
|
10067
|
+
};
|
|
9475
10068
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9476
10069
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9477
10070
|
isOpen: isOpen,
|
|
@@ -9479,25 +10072,59 @@ function EditPanelDialog(_ref) {
|
|
|
9479
10072
|
headerText: "Edit " + name.toLowerCase(),
|
|
9480
10073
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9481
10074
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9482
|
-
submitHandler: submitHandler
|
|
9483
|
-
|
|
10075
|
+
submitHandler: function submitHandler() {
|
|
10076
|
+
return _submitHandler(head);
|
|
10077
|
+
},
|
|
10078
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9484
10079
|
hideCloseIcon: false,
|
|
9485
10080
|
modalBodyStyle: {
|
|
9486
|
-
|
|
9487
|
-
overflow: 'auto',
|
|
9488
|
-
margin: '0px'
|
|
10081
|
+
overflowY: 'visible'
|
|
9489
10082
|
},
|
|
9490
10083
|
footerStyle: {
|
|
9491
10084
|
justifyContent: 'end'
|
|
9492
10085
|
}
|
|
10086
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10087
|
+
display: "flex",
|
|
10088
|
+
justifyContent: "center",
|
|
10089
|
+
alignItems: "center",
|
|
10090
|
+
flexDirection: "column",
|
|
10091
|
+
style: {
|
|
10092
|
+
marginBottom: '30px'
|
|
10093
|
+
}
|
|
9493
10094
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9494
|
-
component: "div",
|
|
9495
10095
|
display: "flex",
|
|
9496
10096
|
justifyContent: "center",
|
|
9497
10097
|
alignItems: "center",
|
|
9498
10098
|
flexDirection: "column",
|
|
9499
|
-
|
|
9500
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10099
|
+
className: styles$7.baseAlert
|
|
10100
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10101
|
+
className: styles$7.alertDescContainer
|
|
10102
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10103
|
+
className: styles$7.iconLayout,
|
|
10104
|
+
style: {
|
|
10105
|
+
paddingTop: '4px'
|
|
10106
|
+
}
|
|
10107
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10108
|
+
color: "#CA8A04",
|
|
10109
|
+
width: "25",
|
|
10110
|
+
height: "20",
|
|
10111
|
+
className: styles$7.iconStyle
|
|
10112
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10113
|
+
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.",
|
|
10114
|
+
style: {
|
|
10115
|
+
fontWeight: 'normal'
|
|
10116
|
+
}
|
|
10117
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10118
|
+
buttonText: "Add user",
|
|
10119
|
+
type: "text",
|
|
10120
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10121
|
+
width: "9",
|
|
10122
|
+
height: "9",
|
|
10123
|
+
color: "#EC5D25"
|
|
10124
|
+
}),
|
|
10125
|
+
onClick: handleAddPageNavigation,
|
|
10126
|
+
className: styles$7.addUserButton
|
|
10127
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9501
10128
|
label: name + " name",
|
|
9502
10129
|
name: "name",
|
|
9503
10130
|
defaultValue: dialogData.data.name,
|
|
@@ -9506,7 +10133,49 @@ function EditPanelDialog(_ref) {
|
|
|
9506
10133
|
isError: isError,
|
|
9507
10134
|
validation: validation,
|
|
9508
10135
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9509
|
-
required: true
|
|
10136
|
+
required: true,
|
|
10137
|
+
style: tableName === 'department' && {
|
|
10138
|
+
width: '350px'
|
|
10139
|
+
}
|
|
10140
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10141
|
+
className: "iui__mt-15",
|
|
10142
|
+
style: {
|
|
10143
|
+
width: '100%'
|
|
10144
|
+
}
|
|
10145
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10146
|
+
label: "Department head",
|
|
10147
|
+
name: "name",
|
|
10148
|
+
defaultValue: head.label,
|
|
10149
|
+
placeholder: "",
|
|
10150
|
+
readOnly: true,
|
|
10151
|
+
style: {
|
|
10152
|
+
width: '350px'
|
|
10153
|
+
}
|
|
10154
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10155
|
+
className: "iui__mt-15",
|
|
10156
|
+
style: {
|
|
10157
|
+
width: '100%'
|
|
10158
|
+
}
|
|
10159
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10160
|
+
noResultsText: true,
|
|
10161
|
+
isMove: true,
|
|
10162
|
+
additional: {
|
|
10163
|
+
page: 1,
|
|
10164
|
+
departmentId: rowData.id
|
|
10165
|
+
},
|
|
10166
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10167
|
+
label: "Department head",
|
|
10168
|
+
value: head,
|
|
10169
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10170
|
+
var _value = _ref2._value;
|
|
10171
|
+
return setHead(_value);
|
|
10172
|
+
},
|
|
10173
|
+
loadOption: departmentHeadOptions,
|
|
10174
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10175
|
+
customLoadingText: "No users found in this department",
|
|
10176
|
+
customLoadingTextStyle: {
|
|
10177
|
+
color: '#374151'
|
|
10178
|
+
}
|
|
9510
10179
|
})));
|
|
9511
10180
|
}
|
|
9512
10181
|
|
|
@@ -9685,12 +10354,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9685
10354
|
var _useState13 = React.useState(false),
|
|
9686
10355
|
isSortingChangeTemp = _useState13[0],
|
|
9687
10356
|
setSortingChangeTemp = _useState13[1];
|
|
9688
|
-
var _useState14 = React.useState(
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
var _useState15 = React.useState(
|
|
9692
|
-
|
|
9693
|
-
|
|
10357
|
+
var _useState14 = React.useState([]),
|
|
10358
|
+
rowData = _useState14[0],
|
|
10359
|
+
setRowData = _useState14[1];
|
|
10360
|
+
var _useState15 = React.useState(1),
|
|
10361
|
+
page = _useState15[0],
|
|
10362
|
+
setPage = _useState15[1];
|
|
10363
|
+
var _useState16 = React.useState(5),
|
|
10364
|
+
rowsPerPage = _useState16[0],
|
|
10365
|
+
setRowsPerPage = _useState16[1];
|
|
9694
10366
|
var orderingParam = orderBy;
|
|
9695
10367
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9696
10368
|
return state.userPanel;
|
|
@@ -9786,6 +10458,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9786
10458
|
submitLabel: 'Save'
|
|
9787
10459
|
}, '', data));
|
|
9788
10460
|
setDataList(data.name);
|
|
10461
|
+
setRowData(data);
|
|
9789
10462
|
setEditModal(true);
|
|
9790
10463
|
};
|
|
9791
10464
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9800,6 +10473,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9800
10473
|
var payload = {
|
|
9801
10474
|
names: [dataList]
|
|
9802
10475
|
};
|
|
10476
|
+
if (tableName === 'department') {
|
|
10477
|
+
payload = {
|
|
10478
|
+
name: dataList,
|
|
10479
|
+
department_head_id: null
|
|
10480
|
+
};
|
|
10481
|
+
}
|
|
9803
10482
|
var message = title + " added successfully.";
|
|
9804
10483
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9805
10484
|
} else {
|
|
@@ -9813,9 +10492,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9813
10492
|
var message = title + " deleted successfully.";
|
|
9814
10493
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9815
10494
|
};
|
|
9816
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10495
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10496
|
+
if (optionalParams === void 0) {
|
|
10497
|
+
optionalParams = null;
|
|
10498
|
+
}
|
|
9817
10499
|
dispatch(userPanelShowLoader());
|
|
9818
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10500
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9819
10501
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9820
10502
|
dispatch(userPanelStopLoader());
|
|
9821
10503
|
if (type === 'delete') {
|
|
@@ -9857,8 +10539,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9857
10539
|
name: dataList
|
|
9858
10540
|
}]
|
|
9859
10541
|
};
|
|
10542
|
+
if (tableName === 'department') {
|
|
10543
|
+
payload = {
|
|
10544
|
+
name: dataList,
|
|
10545
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10546
|
+
};
|
|
10547
|
+
}
|
|
9860
10548
|
var message = title + " updated successfully.";
|
|
9861
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10549
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9862
10550
|
setErrorEdit(false);
|
|
9863
10551
|
} else {
|
|
9864
10552
|
setErrorEdit(true);
|
|
@@ -9965,7 +10653,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9965
10653
|
submitHandler: handleEditPanel,
|
|
9966
10654
|
isError: errorEdit,
|
|
9967
10655
|
isDisabledSubmitBtn: loading,
|
|
9968
|
-
validation: validation
|
|
10656
|
+
validation: validation,
|
|
10657
|
+
rowData: rowData,
|
|
10658
|
+
tableName: tableName,
|
|
10659
|
+
config: config
|
|
9969
10660
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9970
10661
|
config: config
|
|
9971
10662
|
}));
|