@itilite/iui-user-management 0.4.210 → 0.4.212
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 +908 -201
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +909 -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,45 @@ 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
|
+
var uniqueArray1 = [].concat(new Set(_SelectedUsersNotApprover.map(function (item) {
|
|
8919
|
+
return item.id;
|
|
8920
|
+
}))).map(function (id) {
|
|
8921
|
+
return _SelectedUsersNotApprover.find(function (a) {
|
|
8922
|
+
return a.id === id;
|
|
8923
|
+
});
|
|
8924
|
+
});
|
|
8925
|
+
var uniqueArray2 = [].concat(new Set(_SelectedUsersApprover.map(function (item) {
|
|
8926
|
+
return item.id;
|
|
8927
|
+
}))).map(function (id) {
|
|
8928
|
+
return _SelectedUsersApprover.find(function (a) {
|
|
8929
|
+
return a.id === id;
|
|
8930
|
+
});
|
|
8931
|
+
});
|
|
8932
|
+
console.log('uniqueArray1', uniqueArray1);
|
|
8933
|
+
console.log('uniqueArray2', uniqueArray2);
|
|
8934
|
+
_SelectedUsersNotApprover = uniqueArray1.filter(function (item) {
|
|
8935
|
+
return _selected.includes(item.id.toString());
|
|
8936
|
+
});
|
|
8937
|
+
_SelectedUsersApprover = uniqueArray2.filter(function (item) {
|
|
8938
|
+
return _selected.includes(item.id.toString());
|
|
8939
|
+
});
|
|
8940
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8941
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8942
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8943
|
+
} else {
|
|
8944
|
+
setOpenDeActivateModalFlag(true);
|
|
8945
|
+
}
|
|
8684
8946
|
};
|
|
8685
8947
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8686
8948
|
setOpenDeActivateModalFlag(false);
|
|
8687
8949
|
};
|
|
8950
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8951
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8952
|
+
};
|
|
8688
8953
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8689
8954
|
history.push(config.routes.users.add.path);
|
|
8690
8955
|
};
|
|
@@ -8732,12 +8997,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8732
8997
|
};
|
|
8733
8998
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8734
8999
|
var _extends2;
|
|
8735
|
-
var
|
|
9000
|
+
var selectedId = [];
|
|
9001
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9002
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9003
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8736
9004
|
return n.is_active;
|
|
8737
|
-
}).map(function (obj) {
|
|
8738
|
-
return obj.id.toString();
|
|
8739
9005
|
});
|
|
8740
|
-
|
|
9006
|
+
_newSelecteds.map(function (obj) {
|
|
9007
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9008
|
+
if (obj.roles.is_approver === true) {
|
|
9009
|
+
_selectedUsersApprover.push(obj);
|
|
9010
|
+
} else if (obj.roles.is_approver === false) {
|
|
9011
|
+
_selectedUsersNotApprover.push(obj);
|
|
9012
|
+
}
|
|
9013
|
+
}
|
|
9014
|
+
selectedId.push(obj.id.toString());
|
|
9015
|
+
});
|
|
9016
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9017
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9018
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8741
9019
|
};
|
|
8742
9020
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8743
9021
|
var _extends3;
|
|
@@ -8764,49 +9042,145 @@ var UserList = function UserList(_ref2) {
|
|
|
8764
9042
|
setSignUpSearchingChange(true);
|
|
8765
9043
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8766
9044
|
};
|
|
8767
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9045
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8768
9046
|
var _extends4;
|
|
8769
9047
|
var selectedTemp = _extends({}, selected);
|
|
8770
9048
|
if (!(page in selectedTemp)) {
|
|
8771
9049
|
selectedTemp[page] = [];
|
|
8772
9050
|
}
|
|
8773
9051
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8774
|
-
var
|
|
9052
|
+
var _newSelected = [];
|
|
8775
9053
|
if (selectedIndex === -1) {
|
|
8776
|
-
|
|
9054
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8777
9055
|
} else if (selectedIndex === 0) {
|
|
8778
|
-
|
|
9056
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8779
9057
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8780
|
-
|
|
9058
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8781
9059
|
} else if (selectedIndex > 0) {
|
|
8782
|
-
|
|
9060
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9061
|
+
}
|
|
9062
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9063
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9064
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9065
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9066
|
+
return id !== item.id.toString();
|
|
9067
|
+
});
|
|
9068
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9069
|
+
return item.id.toString() !== id;
|
|
9070
|
+
});
|
|
9071
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9072
|
+
if (data.roles.is_approver === true) {
|
|
9073
|
+
_SelectedUsersApprover.push(data);
|
|
9074
|
+
} else if (data.roles.is_approver === false) {
|
|
9075
|
+
_SelectedUsersNotApprover.push(data);
|
|
9076
|
+
}
|
|
8783
9077
|
}
|
|
8784
|
-
|
|
9078
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9079
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9080
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8785
9081
|
};
|
|
9082
|
+
React.useEffect(function () {
|
|
9083
|
+
setApproverRole({
|
|
9084
|
+
value: '',
|
|
9085
|
+
label: 'Select approver'
|
|
9086
|
+
});
|
|
9087
|
+
setDefaultId(null);
|
|
9088
|
+
setIsDisabledSubmitBtn(true);
|
|
9089
|
+
setApproveeStatus(false);
|
|
9090
|
+
if (deactivateSingle === true) {
|
|
9091
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9092
|
+
if (response.data["default"].id) {
|
|
9093
|
+
setDefaultId(response.data["default"].id);
|
|
9094
|
+
setApproverRole({
|
|
9095
|
+
value: '',
|
|
9096
|
+
label: response.data["default"].email
|
|
9097
|
+
});
|
|
9098
|
+
setIsDisabledSubmitBtn(false);
|
|
9099
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9100
|
+
}
|
|
9101
|
+
});
|
|
9102
|
+
}
|
|
9103
|
+
}, [deactivateSingle]);
|
|
8786
9104
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8787
9105
|
setRowsPerPage(+event.target.value);
|
|
8788
9106
|
setPage(1);
|
|
8789
9107
|
setSelected({});
|
|
9108
|
+
setSelectedUsersNotApprover([]);
|
|
9109
|
+
setSelectedUsersApprover([]);
|
|
8790
9110
|
setSortingChange(true);
|
|
8791
9111
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8792
9112
|
};
|
|
8793
9113
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8794
9114
|
var isActive = e.target.checked;
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
9115
|
+
var _isApprover;
|
|
9116
|
+
newSelecteds.map(function (item) {
|
|
9117
|
+
if (item.id === id) {
|
|
9118
|
+
_isApprover = item.roles.is_approver;
|
|
9119
|
+
if (_isApprover === true && isActive === false) {
|
|
9120
|
+
setDeactivateSingle(true);
|
|
9121
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9122
|
+
setUser(item);
|
|
9123
|
+
} else {
|
|
9124
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9125
|
+
if (!isActive) {
|
|
9126
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9127
|
+
var _extends5;
|
|
9128
|
+
var selectedTemp = _extends({}, selected);
|
|
9129
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9130
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9131
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9132
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9133
|
+
return item.id != id;
|
|
9134
|
+
});
|
|
9135
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9136
|
+
return item.id != id;
|
|
9137
|
+
});
|
|
9138
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9139
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9140
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9141
|
+
}
|
|
9142
|
+
}
|
|
9143
|
+
});
|
|
8802
9144
|
}
|
|
8803
9145
|
}
|
|
8804
9146
|
});
|
|
8805
9147
|
};
|
|
9148
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9149
|
+
var _value = _ref4._value;
|
|
9150
|
+
if (_value.data.approvee_status) {
|
|
9151
|
+
setApproveeStatus(true);
|
|
9152
|
+
} else {
|
|
9153
|
+
setApproveeStatus(false);
|
|
9154
|
+
}
|
|
9155
|
+
setDefaultId(_value.data.id);
|
|
9156
|
+
setApproverRole(_value);
|
|
9157
|
+
setIsDisabledSubmitBtn(false);
|
|
9158
|
+
};
|
|
9159
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9160
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9161
|
+
setOpenDeActivateModalFlag(false);
|
|
9162
|
+
setDeactivateSingle(false);
|
|
9163
|
+
setSelected({});
|
|
9164
|
+
setSelectedUsersNotApprover([]);
|
|
9165
|
+
setSelectedUsersApprover([]);
|
|
9166
|
+
};
|
|
8806
9167
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8807
9168
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8808
9169
|
setOpenDeActivateModalFlag(false);
|
|
8809
9170
|
setSelected({});
|
|
9171
|
+
setSelectedUsersNotApprover([]);
|
|
9172
|
+
setSelectedUsersApprover([]);
|
|
9173
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9174
|
+
};
|
|
9175
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9176
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9177
|
+
return item.id;
|
|
9178
|
+
});
|
|
9179
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9180
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9181
|
+
setSelected({});
|
|
9182
|
+
setSelectedUsersNotApprover([]);
|
|
9183
|
+
setSelectedUsersApprover([]);
|
|
8810
9184
|
};
|
|
8811
9185
|
var importUserHandler = function importUserHandler() {
|
|
8812
9186
|
setOpenImportUsersModal(true);
|
|
@@ -8823,13 +9197,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8823
9197
|
email: email
|
|
8824
9198
|
}));
|
|
8825
9199
|
};
|
|
8826
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
9200
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9201
|
+
if (type === undefined) {
|
|
9202
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9203
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9204
|
+
return false;
|
|
9205
|
+
}
|
|
8831
9206
|
}
|
|
8832
9207
|
setUserIds(ids);
|
|
9208
|
+
setUserFirstName(firstName);
|
|
9209
|
+
setUserLastName(lastName);
|
|
9210
|
+
setToggleInviteModal(!showInviteModal);
|
|
9211
|
+
};
|
|
9212
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8833
9213
|
setToggleInviteModal(!showInviteModal);
|
|
8834
9214
|
};
|
|
8835
9215
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8902,6 +9282,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8902
9282
|
userId: userId
|
|
8903
9283
|
}));
|
|
8904
9284
|
};
|
|
9285
|
+
var knowMore = function knowMore() {
|
|
9286
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9287
|
+
};
|
|
8905
9288
|
var dispatch = reactRedux.useDispatch();
|
|
8906
9289
|
React.useEffect(function () {
|
|
8907
9290
|
if (isTokenVerified === true) {
|
|
@@ -9153,11 +9536,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9153
9536
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9154
9537
|
variant: "body2",
|
|
9155
9538
|
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",
|
|
9539
|
+
}, "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
9540
|
onClick: config.routes.notification && redirectToNotifications,
|
|
9159
9541
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9160
|
-
}, "Notifications")
|
|
9542
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9161
9543
|
data: signupRequestListInfo,
|
|
9162
9544
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9163
9545
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9189,6 +9571,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9189
9571
|
}))
|
|
9190
9572
|
}]
|
|
9191
9573
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9574
|
+
isOpen: deactivateSingle,
|
|
9575
|
+
closeHandler: function closeHandler() {
|
|
9576
|
+
setDeactivateSingle(false);
|
|
9577
|
+
},
|
|
9578
|
+
cancelLabel: "Cancel",
|
|
9579
|
+
submitLabel: "Deactivate",
|
|
9580
|
+
submitHandler: handleDeactivateUser,
|
|
9581
|
+
headerText: "Deactivate this user?",
|
|
9582
|
+
width: "400px",
|
|
9583
|
+
subHanderText: "",
|
|
9584
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9585
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9586
|
+
modalClass: "deactivateSingleModal",
|
|
9587
|
+
modalBodyStyle: {
|
|
9588
|
+
overflowY: 'unset'
|
|
9589
|
+
}
|
|
9590
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9591
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9592
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9593
|
+
className: styles$5.deactivateAlert
|
|
9594
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9595
|
+
width: "9",
|
|
9596
|
+
height: "9"
|
|
9597
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9598
|
+
variant: "body2"
|
|
9599
|
+
}, /*#__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", {
|
|
9600
|
+
onClick: knowMore,
|
|
9601
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9602
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9603
|
+
className: "iui__mt-15"
|
|
9604
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9605
|
+
isMove: true,
|
|
9606
|
+
additional: {
|
|
9607
|
+
page: 1,
|
|
9608
|
+
product: 'travel',
|
|
9609
|
+
userId: user.id
|
|
9610
|
+
},
|
|
9611
|
+
label: "Transfer approver role to",
|
|
9612
|
+
value: approverRole,
|
|
9613
|
+
onValueChange: selectApprover,
|
|
9614
|
+
loadOption: transferRoleOptions,
|
|
9615
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9616
|
+
customLoadingText: "No results found"
|
|
9617
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9618
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9619
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9620
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9621
|
+
}, "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
9622
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9193
9623
|
closeHandler: closeDeActivateModal,
|
|
9194
9624
|
cancelLabel: "Cancel",
|
|
@@ -9215,8 +9645,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9215
9645
|
}, '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
9646
|
className: styles$5.description
|
|
9217
9647
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9648
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9649
|
+
closeHandler: closeDeActiveModal,
|
|
9650
|
+
cancelLabel: "Cancel",
|
|
9651
|
+
submitLabel: "Deactivate safe users",
|
|
9652
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9653
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9654
|
+
customButtonLabel: "Deactivate all users",
|
|
9655
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9656
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9657
|
+
width: "640px",
|
|
9658
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9659
|
+
headerText: "Deactivate users?",
|
|
9660
|
+
modalBodyStyle: {
|
|
9661
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9662
|
+
}
|
|
9663
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9664
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9665
|
+
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9666
|
+
color: "#9A6700",
|
|
9667
|
+
size: "14"
|
|
9668
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9669
|
+
variant: "body2"
|
|
9670
|
+
}, "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", {
|
|
9671
|
+
onClick: knowMore,
|
|
9672
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9673
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9674
|
+
className: "iui__my-15"
|
|
9675
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9676
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9677
|
+
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9678
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9679
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9680
|
+
var _item$data;
|
|
9681
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9682
|
+
key: index,
|
|
9683
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9684
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9685
|
+
firstName: item.first_name,
|
|
9686
|
+
lastName: item.last_name,
|
|
9687
|
+
isLetterAvatar: "true",
|
|
9688
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9689
|
+
secondaryText: item.email,
|
|
9690
|
+
letterAvatarTextColor: "black",
|
|
9691
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9692
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9693
|
+
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9694
|
+
color: "#9A6700",
|
|
9695
|
+
size: "14"
|
|
9696
|
+
}));
|
|
9697
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
9698
|
+
style: {
|
|
9699
|
+
borderColor: '#E5E9ED'
|
|
9700
|
+
}
|
|
9701
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9702
|
+
className: "iui__my-15"
|
|
9703
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9704
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9705
|
+
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9706
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9707
|
+
}, "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) {
|
|
9708
|
+
var _item$data2;
|
|
9709
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9710
|
+
key: index,
|
|
9711
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9712
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9713
|
+
firstName: item.first_name,
|
|
9714
|
+
lastName: item.last_name,
|
|
9715
|
+
isLetterAvatar: "true",
|
|
9716
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9717
|
+
secondaryText: item.email,
|
|
9718
|
+
letterAvatarTextColor: "black",
|
|
9719
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9720
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9721
|
+
}));
|
|
9722
|
+
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9218
9723
|
isOpen: showInviteModal,
|
|
9219
|
-
closeHandler:
|
|
9724
|
+
closeHandler: function closeHandler() {
|
|
9725
|
+
return toggleInviteModalClose();
|
|
9726
|
+
},
|
|
9220
9727
|
cancelLabel: "Cancel",
|
|
9221
9728
|
headerText: "Resend Invites?",
|
|
9222
9729
|
submitLabel: "Send",
|
|
@@ -9248,7 +9755,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9248
9755
|
fontSize: '14px',
|
|
9249
9756
|
color: '#374151'
|
|
9250
9757
|
}
|
|
9251
|
-
}, "This invitation will be sent to
|
|
9758
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9759
|
+
style: {
|
|
9760
|
+
fontSize: '14px',
|
|
9761
|
+
color: '#374151',
|
|
9762
|
+
fontWeight: 'bold'
|
|
9763
|
+
}
|
|
9764
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9252
9765
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9253
9766
|
closeImportUsersModal: closeImportUsersModal,
|
|
9254
9767
|
closeImportModal: closeImportModal
|
|
@@ -9257,8 +9770,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9257
9770
|
errMsg: hasVerificationError
|
|
9258
9771
|
}));
|
|
9259
9772
|
};
|
|
9260
|
-
var TabLabelCount = function TabLabelCount(
|
|
9261
|
-
var count =
|
|
9773
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9774
|
+
var count = _ref5.count;
|
|
9262
9775
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9263
9776
|
className: styles$5.TabLabelCount
|
|
9264
9777
|
}, " ", count, " ");
|
|
@@ -9333,11 +9846,12 @@ function Header(props) {
|
|
|
9333
9846
|
})));
|
|
9334
9847
|
}
|
|
9335
9848
|
|
|
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"};
|
|
9849
|
+
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
9850
|
|
|
9338
9851
|
function Listview(_ref) {
|
|
9339
9852
|
var data = _ref.data,
|
|
9340
9853
|
name = _ref.name,
|
|
9854
|
+
tableName = _ref.tableName,
|
|
9341
9855
|
handleEditDialog = _ref.handleEditDialog,
|
|
9342
9856
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9343
9857
|
orderBy = _ref.orderBy,
|
|
@@ -9350,16 +9864,82 @@ function Listview(_ref) {
|
|
|
9350
9864
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9351
9865
|
page = _ref.page,
|
|
9352
9866
|
rowsPerPage = _ref.rowsPerPage;
|
|
9867
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9868
|
+
var _data$dept_head_detai;
|
|
9869
|
+
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) {
|
|
9870
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9871
|
+
}
|
|
9872
|
+
};
|
|
9353
9873
|
var columns = [{
|
|
9354
9874
|
id: 'name',
|
|
9355
9875
|
label: name,
|
|
9356
|
-
width: '
|
|
9876
|
+
width: '40%',
|
|
9357
9877
|
sortable: true,
|
|
9358
9878
|
cell: function cell(row) {
|
|
9359
9879
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9360
9880
|
component: "div"
|
|
9361
9881
|
}, row.name);
|
|
9362
9882
|
}
|
|
9883
|
+
}, {
|
|
9884
|
+
id: 'no_of_users',
|
|
9885
|
+
label: 'Number of users',
|
|
9886
|
+
width: '40%',
|
|
9887
|
+
sortable: true,
|
|
9888
|
+
cell: function cell(row) {
|
|
9889
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9890
|
+
component: "div"
|
|
9891
|
+
}, row.no_of_users);
|
|
9892
|
+
}
|
|
9893
|
+
}, {
|
|
9894
|
+
id: 'actions',
|
|
9895
|
+
label: 'Actions',
|
|
9896
|
+
width: '20%',
|
|
9897
|
+
cell: function cell(row) {
|
|
9898
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9899
|
+
display: "flex"
|
|
9900
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9901
|
+
buttonText: "Edit",
|
|
9902
|
+
className: styles$7.buttonWidth,
|
|
9903
|
+
onClick: function onClick() {
|
|
9904
|
+
return handleEditDialog(row);
|
|
9905
|
+
}
|
|
9906
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9907
|
+
buttonText: "Delete",
|
|
9908
|
+
className: styles$7.buttonWidth,
|
|
9909
|
+
onClick: function onClick() {
|
|
9910
|
+
return handleDeleteDialog(row, true);
|
|
9911
|
+
}
|
|
9912
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9913
|
+
buttonText: "Delete",
|
|
9914
|
+
className: styles$7.buttonWidth,
|
|
9915
|
+
onClick: function onClick() {
|
|
9916
|
+
return handleDeleteDialog(row, false);
|
|
9917
|
+
}
|
|
9918
|
+
}));
|
|
9919
|
+
}
|
|
9920
|
+
}];
|
|
9921
|
+
var departmentColumns = [{
|
|
9922
|
+
id: 'name',
|
|
9923
|
+
label: name,
|
|
9924
|
+
width: '30%',
|
|
9925
|
+
sortable: true,
|
|
9926
|
+
cell: function cell(row) {
|
|
9927
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9928
|
+
component: "div"
|
|
9929
|
+
}, row.name);
|
|
9930
|
+
}
|
|
9931
|
+
}, {
|
|
9932
|
+
id: 'department_head',
|
|
9933
|
+
label: 'Department head',
|
|
9934
|
+
width: '30%',
|
|
9935
|
+
sortable: true,
|
|
9936
|
+
cell: function cell(row) {
|
|
9937
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9938
|
+
component: "div"
|
|
9939
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9940
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9941
|
+
}, "Assigned by default"));
|
|
9942
|
+
}
|
|
9363
9943
|
}, {
|
|
9364
9944
|
id: 'no_of_users',
|
|
9365
9945
|
label: 'Number of users',
|
|
@@ -9373,7 +9953,7 @@ function Listview(_ref) {
|
|
|
9373
9953
|
}, {
|
|
9374
9954
|
id: 'actions',
|
|
9375
9955
|
label: 'Actions',
|
|
9376
|
-
width: '
|
|
9956
|
+
width: '15%',
|
|
9377
9957
|
cell: function cell(row) {
|
|
9378
9958
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9379
9959
|
display: "flex"
|
|
@@ -9406,7 +9986,7 @@ function Listview(_ref) {
|
|
|
9406
9986
|
hasFilter: true,
|
|
9407
9987
|
isCheckboxTable: false,
|
|
9408
9988
|
count: data.count,
|
|
9409
|
-
columns: columns,
|
|
9989
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9410
9990
|
rows: data.results,
|
|
9411
9991
|
page: page,
|
|
9412
9992
|
handleChangePage: handleChangePage,
|
|
@@ -9463,15 +10043,44 @@ function EditPanelDialog(_ref) {
|
|
|
9463
10043
|
var isOpen = _ref.isOpen,
|
|
9464
10044
|
closeHandler = _ref.closeHandler,
|
|
9465
10045
|
onValueChange = _ref.onValueChange,
|
|
9466
|
-
|
|
10046
|
+
_submitHandler = _ref.submitHandler,
|
|
9467
10047
|
isError = _ref.isError,
|
|
9468
10048
|
name = _ref.name,
|
|
9469
10049
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9470
|
-
validation = _ref.validation
|
|
10050
|
+
validation = _ref.validation,
|
|
10051
|
+
rowData = _ref.rowData,
|
|
10052
|
+
tableName = _ref.tableName,
|
|
10053
|
+
config = _ref.config;
|
|
9471
10054
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9472
10055
|
return state.userPanel;
|
|
9473
10056
|
}),
|
|
9474
10057
|
dialogData = _useSelector.dialogData;
|
|
10058
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10059
|
+
var _data$dept_head_detai;
|
|
10060
|
+
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) {
|
|
10061
|
+
setHead({
|
|
10062
|
+
value: data.dept_head_details[0].id,
|
|
10063
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10064
|
+
});
|
|
10065
|
+
}
|
|
10066
|
+
};
|
|
10067
|
+
var _useState = React.useState({
|
|
10068
|
+
value: '',
|
|
10069
|
+
label: 'Select'
|
|
10070
|
+
}),
|
|
10071
|
+
head = _useState[0],
|
|
10072
|
+
setHead = _useState[1];
|
|
10073
|
+
React.useEffect(function () {
|
|
10074
|
+
deptHeadDetails(rowData);
|
|
10075
|
+
}, [rowData]);
|
|
10076
|
+
var history = reactRouterDom.useHistory();
|
|
10077
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10078
|
+
console.log(rowData);
|
|
10079
|
+
history.push({
|
|
10080
|
+
pathname: config.routes.users.add.path,
|
|
10081
|
+
state: rowData
|
|
10082
|
+
});
|
|
10083
|
+
};
|
|
9475
10084
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9476
10085
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9477
10086
|
isOpen: isOpen,
|
|
@@ -9479,25 +10088,59 @@ function EditPanelDialog(_ref) {
|
|
|
9479
10088
|
headerText: "Edit " + name.toLowerCase(),
|
|
9480
10089
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9481
10090
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9482
|
-
submitHandler: submitHandler
|
|
9483
|
-
|
|
10091
|
+
submitHandler: function submitHandler() {
|
|
10092
|
+
return _submitHandler(head);
|
|
10093
|
+
},
|
|
10094
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9484
10095
|
hideCloseIcon: false,
|
|
9485
10096
|
modalBodyStyle: {
|
|
9486
|
-
|
|
9487
|
-
overflow: 'auto',
|
|
9488
|
-
margin: '0px'
|
|
10097
|
+
overflowY: 'visible'
|
|
9489
10098
|
},
|
|
9490
10099
|
footerStyle: {
|
|
9491
10100
|
justifyContent: 'end'
|
|
9492
10101
|
}
|
|
10102
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10103
|
+
display: "flex",
|
|
10104
|
+
justifyContent: "center",
|
|
10105
|
+
alignItems: "center",
|
|
10106
|
+
flexDirection: "column",
|
|
10107
|
+
style: {
|
|
10108
|
+
marginBottom: '30px'
|
|
10109
|
+
}
|
|
9493
10110
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9494
|
-
component: "div",
|
|
9495
10111
|
display: "flex",
|
|
9496
10112
|
justifyContent: "center",
|
|
9497
10113
|
alignItems: "center",
|
|
9498
10114
|
flexDirection: "column",
|
|
9499
|
-
|
|
9500
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10115
|
+
className: styles$7.baseAlert
|
|
10116
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10117
|
+
className: styles$7.alertDescContainer
|
|
10118
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10119
|
+
className: styles$7.iconLayout,
|
|
10120
|
+
style: {
|
|
10121
|
+
paddingTop: '4px'
|
|
10122
|
+
}
|
|
10123
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10124
|
+
color: "#CA8A04",
|
|
10125
|
+
width: "25",
|
|
10126
|
+
height: "20",
|
|
10127
|
+
className: styles$7.iconStyle
|
|
10128
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10129
|
+
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.",
|
|
10130
|
+
style: {
|
|
10131
|
+
fontWeight: 'normal'
|
|
10132
|
+
}
|
|
10133
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10134
|
+
buttonText: "Add user",
|
|
10135
|
+
type: "text",
|
|
10136
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10137
|
+
width: "9",
|
|
10138
|
+
height: "9",
|
|
10139
|
+
color: "#EC5D25"
|
|
10140
|
+
}),
|
|
10141
|
+
onClick: handleAddPageNavigation,
|
|
10142
|
+
className: styles$7.addUserButton
|
|
10143
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9501
10144
|
label: name + " name",
|
|
9502
10145
|
name: "name",
|
|
9503
10146
|
defaultValue: dialogData.data.name,
|
|
@@ -9506,7 +10149,49 @@ function EditPanelDialog(_ref) {
|
|
|
9506
10149
|
isError: isError,
|
|
9507
10150
|
validation: validation,
|
|
9508
10151
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9509
|
-
required: true
|
|
10152
|
+
required: true,
|
|
10153
|
+
style: tableName === 'department' && {
|
|
10154
|
+
width: '350px'
|
|
10155
|
+
}
|
|
10156
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10157
|
+
className: "iui__mt-15",
|
|
10158
|
+
style: {
|
|
10159
|
+
width: '100%'
|
|
10160
|
+
}
|
|
10161
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10162
|
+
label: "Department head",
|
|
10163
|
+
name: "name",
|
|
10164
|
+
defaultValue: head.label,
|
|
10165
|
+
placeholder: "",
|
|
10166
|
+
readOnly: true,
|
|
10167
|
+
style: {
|
|
10168
|
+
width: '350px'
|
|
10169
|
+
}
|
|
10170
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10171
|
+
className: "iui__mt-15",
|
|
10172
|
+
style: {
|
|
10173
|
+
width: '100%'
|
|
10174
|
+
}
|
|
10175
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10176
|
+
noResultsText: true,
|
|
10177
|
+
isMove: true,
|
|
10178
|
+
additional: {
|
|
10179
|
+
page: 1,
|
|
10180
|
+
departmentId: rowData.id
|
|
10181
|
+
},
|
|
10182
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10183
|
+
label: "Department head",
|
|
10184
|
+
value: head,
|
|
10185
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10186
|
+
var _value = _ref2._value;
|
|
10187
|
+
return setHead(_value);
|
|
10188
|
+
},
|
|
10189
|
+
loadOption: departmentHeadOptions,
|
|
10190
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10191
|
+
customLoadingText: "No users found in this department",
|
|
10192
|
+
customLoadingTextStyle: {
|
|
10193
|
+
color: '#374151'
|
|
10194
|
+
}
|
|
9510
10195
|
})));
|
|
9511
10196
|
}
|
|
9512
10197
|
|
|
@@ -9685,12 +10370,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9685
10370
|
var _useState13 = React.useState(false),
|
|
9686
10371
|
isSortingChangeTemp = _useState13[0],
|
|
9687
10372
|
setSortingChangeTemp = _useState13[1];
|
|
9688
|
-
var _useState14 = React.useState(
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
var _useState15 = React.useState(
|
|
9692
|
-
|
|
9693
|
-
|
|
10373
|
+
var _useState14 = React.useState([]),
|
|
10374
|
+
rowData = _useState14[0],
|
|
10375
|
+
setRowData = _useState14[1];
|
|
10376
|
+
var _useState15 = React.useState(1),
|
|
10377
|
+
page = _useState15[0],
|
|
10378
|
+
setPage = _useState15[1];
|
|
10379
|
+
var _useState16 = React.useState(5),
|
|
10380
|
+
rowsPerPage = _useState16[0],
|
|
10381
|
+
setRowsPerPage = _useState16[1];
|
|
9694
10382
|
var orderingParam = orderBy;
|
|
9695
10383
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9696
10384
|
return state.userPanel;
|
|
@@ -9786,6 +10474,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9786
10474
|
submitLabel: 'Save'
|
|
9787
10475
|
}, '', data));
|
|
9788
10476
|
setDataList(data.name);
|
|
10477
|
+
setRowData(data);
|
|
9789
10478
|
setEditModal(true);
|
|
9790
10479
|
};
|
|
9791
10480
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9800,6 +10489,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9800
10489
|
var payload = {
|
|
9801
10490
|
names: [dataList]
|
|
9802
10491
|
};
|
|
10492
|
+
if (tableName === 'department') {
|
|
10493
|
+
payload = {
|
|
10494
|
+
name: dataList,
|
|
10495
|
+
department_head_id: null
|
|
10496
|
+
};
|
|
10497
|
+
}
|
|
9803
10498
|
var message = title + " added successfully.";
|
|
9804
10499
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9805
10500
|
} else {
|
|
@@ -9813,9 +10508,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9813
10508
|
var message = title + " deleted successfully.";
|
|
9814
10509
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9815
10510
|
};
|
|
9816
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10511
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10512
|
+
if (optionalParams === void 0) {
|
|
10513
|
+
optionalParams = null;
|
|
10514
|
+
}
|
|
9817
10515
|
dispatch(userPanelShowLoader());
|
|
9818
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10516
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9819
10517
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9820
10518
|
dispatch(userPanelStopLoader());
|
|
9821
10519
|
if (type === 'delete') {
|
|
@@ -9857,8 +10555,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9857
10555
|
name: dataList
|
|
9858
10556
|
}]
|
|
9859
10557
|
};
|
|
10558
|
+
if (tableName === 'department') {
|
|
10559
|
+
payload = {
|
|
10560
|
+
name: dataList,
|
|
10561
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10562
|
+
};
|
|
10563
|
+
}
|
|
9860
10564
|
var message = title + " updated successfully.";
|
|
9861
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10565
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9862
10566
|
setErrorEdit(false);
|
|
9863
10567
|
} else {
|
|
9864
10568
|
setErrorEdit(true);
|
|
@@ -9965,7 +10669,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9965
10669
|
submitHandler: handleEditPanel,
|
|
9966
10670
|
isError: errorEdit,
|
|
9967
10671
|
isDisabledSubmitBtn: loading,
|
|
9968
|
-
validation: validation
|
|
10672
|
+
validation: validation,
|
|
10673
|
+
rowData: rowData,
|
|
10674
|
+
tableName: tableName,
|
|
10675
|
+
config: config
|
|
9969
10676
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9970
10677
|
config: config
|
|
9971
10678
|
}));
|