@itilite/iui-user-management 0.4.208 → 0.4.209
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 +63 -14
- package/dist/index.js +682 -225
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +683 -226
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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
|
+
_approversSearch: function _approversSearch() {
|
|
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._approversSearch() + "user_id=" + userId + "&page=" + page).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,
|
|
@@ -1057,12 +1150,6 @@ var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
|
1057
1150
|
payload: payload
|
|
1058
1151
|
};
|
|
1059
1152
|
};
|
|
1060
|
-
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1061
|
-
return {
|
|
1062
|
-
type: SET_BULK_DEACTIVATED_USERS,
|
|
1063
|
-
payload: payload
|
|
1064
|
-
};
|
|
1065
|
-
};
|
|
1066
1153
|
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1067
1154
|
return {
|
|
1068
1155
|
type: SHOW_LOADER$1,
|
|
@@ -1123,36 +1210,25 @@ var exportUsers = function exportUsers(payload) {
|
|
|
1123
1210
|
});
|
|
1124
1211
|
};
|
|
1125
1212
|
};
|
|
1126
|
-
var deActivateUsers = function deActivateUsers(ids) {
|
|
1127
|
-
return function (dispatch) {
|
|
1128
|
-
return new Promise(function (resolve, reject) {
|
|
1129
|
-
api$1.post("" + userListUrl.bulkDeactivate(), {
|
|
1130
|
-
user_ids: ids
|
|
1131
|
-
}).then(function (res) {
|
|
1132
|
-
dispatch(setBulkDeactivatedUsers(ids));
|
|
1133
|
-
IUIToastMessageService.sNotify(ids.length + ' Users deactivated successfully');
|
|
1134
|
-
resolve();
|
|
1135
|
-
})["catch"](function (err) {
|
|
1136
|
-
if (!err.response.data.status) {
|
|
1137
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1138
|
-
reject(err);
|
|
1139
|
-
return;
|
|
1140
|
-
}
|
|
1141
|
-
reject(err);
|
|
1142
|
-
});
|
|
1143
|
-
});
|
|
1144
|
-
};
|
|
1145
|
-
};
|
|
1146
1213
|
var updateTabValue = function updateTabValue(tabId) {
|
|
1147
1214
|
return {
|
|
1148
1215
|
type: SET_TAB_VALUE,
|
|
1149
1216
|
payload: tabId
|
|
1150
1217
|
};
|
|
1151
1218
|
};
|
|
1152
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1219
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1220
|
+
if (roleTransfer === void 0) {
|
|
1221
|
+
roleTransfer = false;
|
|
1222
|
+
}
|
|
1223
|
+
var _payload = {
|
|
1224
|
+
role_transfer: roleTransfer
|
|
1225
|
+
};
|
|
1226
|
+
if (roleTransfer) {
|
|
1227
|
+
_payload['new_approver_user_id'] = newApproverUserId;
|
|
1228
|
+
}
|
|
1153
1229
|
return function (dispatch) {
|
|
1154
1230
|
return new Promise(function (resolve, reject) {
|
|
1155
|
-
api$1.
|
|
1231
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1156
1232
|
dispatch(setUserActiveStatus({
|
|
1157
1233
|
is_active: activateVal !== 0,
|
|
1158
1234
|
id: id
|
|
@@ -1716,7 +1792,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1716
1792
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1717
1793
|
return function (dispatch) {
|
|
1718
1794
|
return new Promise(function (resolve, reject) {
|
|
1719
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1795
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1720
1796
|
resolve(res);
|
|
1721
1797
|
})["catch"](function (err) {
|
|
1722
1798
|
var _err$response17, _err$response17$data;
|
|
@@ -1752,6 +1828,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1752
1828
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1753
1829
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1754
1830
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1831
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1755
1832
|
|
|
1756
1833
|
var api$3 = utils.configs.api;
|
|
1757
1834
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1801,14 +1878,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1801
1878
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1802
1879
|
return function (dispatch) {
|
|
1803
1880
|
return new Promise(function (resolve, reject) {
|
|
1804
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1881
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1805
1882
|
dispatch(getUserPanalData(getParam));
|
|
1806
1883
|
dispatch(closeDialog());
|
|
1807
1884
|
resolve(res);
|
|
1808
1885
|
})["catch"](function (err) {
|
|
1809
|
-
var _err$
|
|
1886
|
+
var _err$response3, _err$response3$data;
|
|
1810
1887
|
dispatch(userPanelStopLoader());
|
|
1811
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1888
|
+
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
1889
|
});
|
|
1813
1890
|
});
|
|
1814
1891
|
};
|
|
@@ -1822,25 +1899,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1822
1899
|
dispatch(userPanelStopLoader());
|
|
1823
1900
|
resolve();
|
|
1824
1901
|
})["catch"](function (err) {
|
|
1825
|
-
var _err$
|
|
1826
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1902
|
+
var _err$response4, _err$response4$data;
|
|
1903
|
+
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
1904
|
dispatch(userPanelStopLoader());
|
|
1828
1905
|
});
|
|
1829
1906
|
});
|
|
1830
1907
|
};
|
|
1831
1908
|
};
|
|
1832
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1909
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1833
1910
|
return function (dispatch) {
|
|
1834
1911
|
return new Promise(function (resolve, reject) {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1912
|
+
if (tableName === 'department') {
|
|
1913
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1914
|
+
dispatch(getUserPanalData(getParam));
|
|
1915
|
+
dispatch(closeDialog());
|
|
1916
|
+
resolve();
|
|
1917
|
+
})["catch"](function (err) {
|
|
1918
|
+
var _err$response5, _err$response5$data;
|
|
1919
|
+
dispatch(userPanelStopLoader());
|
|
1920
|
+
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.');
|
|
1921
|
+
});
|
|
1922
|
+
} else {
|
|
1923
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1924
|
+
dispatch(getUserPanalData(getParam));
|
|
1925
|
+
dispatch(closeDialog());
|
|
1926
|
+
resolve();
|
|
1927
|
+
})["catch"](function (err) {
|
|
1928
|
+
var _err$response6, _err$response6$data;
|
|
1929
|
+
dispatch(userPanelStopLoader());
|
|
1930
|
+
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.');
|
|
1931
|
+
});
|
|
1932
|
+
}
|
|
1844
1933
|
});
|
|
1845
1934
|
};
|
|
1846
1935
|
};
|
|
@@ -1852,8 +1941,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1852
1941
|
dispatch(closeDialog());
|
|
1853
1942
|
resolve(res);
|
|
1854
1943
|
})["catch"](function (err) {
|
|
1855
|
-
var _err$
|
|
1856
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1944
|
+
var _err$response7, _err$response7$data;
|
|
1945
|
+
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
1946
|
});
|
|
1858
1947
|
});
|
|
1859
1948
|
};
|
|
@@ -3953,6 +4042,7 @@ var initialState$2 = {
|
|
|
3953
4042
|
previous: null,
|
|
3954
4043
|
results: []
|
|
3955
4044
|
},
|
|
4045
|
+
deptUsers: [],
|
|
3956
4046
|
loading: false
|
|
3957
4047
|
};
|
|
3958
4048
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4022,6 +4112,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4022
4112
|
loading: false
|
|
4023
4113
|
});
|
|
4024
4114
|
}
|
|
4115
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4116
|
+
{
|
|
4117
|
+
return _extends({}, state, {
|
|
4118
|
+
deptUsers: action.payload
|
|
4119
|
+
});
|
|
4120
|
+
}
|
|
4025
4121
|
default:
|
|
4026
4122
|
return state;
|
|
4027
4123
|
}
|
|
@@ -4800,6 +4896,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4800
4896
|
isILadmin = _useSelector2.isILadmin,
|
|
4801
4897
|
companyName = _useSelector2.companyName;
|
|
4802
4898
|
var history = reactRouterDom.useHistory();
|
|
4899
|
+
var location = reactRouterDom.useLocation();
|
|
4803
4900
|
var _useState = React.useState({
|
|
4804
4901
|
travel: false,
|
|
4805
4902
|
expense: false
|
|
@@ -5055,6 +5152,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5055
5152
|
var onAddModalClose = function onAddModalClose() {
|
|
5056
5153
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5057
5154
|
};
|
|
5155
|
+
React.useEffect(function () {
|
|
5156
|
+
var _location$state, _location$state2;
|
|
5157
|
+
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) {
|
|
5158
|
+
var _location$state3, _location$state4;
|
|
5159
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5160
|
+
department: {
|
|
5161
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5162
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5163
|
+
}
|
|
5164
|
+
}));
|
|
5165
|
+
}
|
|
5166
|
+
}, []);
|
|
5058
5167
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5059
5168
|
var title = '';
|
|
5060
5169
|
if (id === 'entity') {
|
|
@@ -5080,24 +5189,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5080
5189
|
}));
|
|
5081
5190
|
} else {
|
|
5082
5191
|
dispatch(showLoader());
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5192
|
+
var dataObj;
|
|
5193
|
+
if (addModalData.id === 'department') {
|
|
5194
|
+
dataObj = {
|
|
5195
|
+
name: validatedValue,
|
|
5196
|
+
department_head_id: null
|
|
5197
|
+
};
|
|
5198
|
+
} else {
|
|
5199
|
+
dataObj = {
|
|
5200
|
+
names: [validatedValue]
|
|
5201
|
+
};
|
|
5202
|
+
}
|
|
5203
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5204
|
+
var _extends4;
|
|
5087
5205
|
setAddModalData(_extends({}, addModalData, {
|
|
5088
5206
|
isOpen: false
|
|
5089
5207
|
}));
|
|
5090
5208
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5091
5209
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5210
|
+
if (addModalData.id === 'department') {
|
|
5211
|
+
var _extends2;
|
|
5212
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5213
|
+
value: res.data.result.id,
|
|
5214
|
+
label: res.data.result.name
|
|
5215
|
+
}, _extends2)));
|
|
5216
|
+
} else {
|
|
5217
|
+
var _extends3;
|
|
5218
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5219
|
+
value: res.data.value,
|
|
5220
|
+
label: res.data.label
|
|
5221
|
+
}, _extends3)));
|
|
5222
|
+
}
|
|
5223
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5097
5224
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5098
5225
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5099
|
-
var
|
|
5100
|
-
return _extends({}, prevState, (
|
|
5226
|
+
var _extends5;
|
|
5227
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5101
5228
|
});
|
|
5102
5229
|
dispatch(stopLoader());
|
|
5103
5230
|
});
|
|
@@ -5116,8 +5243,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5116
5243
|
try {
|
|
5117
5244
|
var _temp5 = function _temp5() {
|
|
5118
5245
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5119
|
-
var
|
|
5120
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5246
|
+
var _extends6;
|
|
5247
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5121
5248
|
}
|
|
5122
5249
|
};
|
|
5123
5250
|
var _name = args._name,
|
|
@@ -5140,8 +5267,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5140
5267
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5141
5268
|
} else {
|
|
5142
5269
|
var _temp3 = function _temp3() {
|
|
5143
|
-
var
|
|
5144
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5270
|
+
var _extends7;
|
|
5271
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5145
5272
|
updateError(_name, _isError, _errorMsg);
|
|
5146
5273
|
};
|
|
5147
5274
|
var _temp2 = function () {
|
|
@@ -5189,7 +5316,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5189
5316
|
}
|
|
5190
5317
|
};
|
|
5191
5318
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5192
|
-
var
|
|
5319
|
+
var _extends8;
|
|
5193
5320
|
var _name = args._name,
|
|
5194
5321
|
_value = args._value,
|
|
5195
5322
|
_isError = args._isError,
|
|
@@ -5198,11 +5325,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5198
5325
|
_name: _name,
|
|
5199
5326
|
_value: _value
|
|
5200
5327
|
});
|
|
5201
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5328
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5202
5329
|
updateError(_name, _isError, _errorMsg);
|
|
5203
5330
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5204
|
-
var
|
|
5205
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5331
|
+
var _extends9;
|
|
5332
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5206
5333
|
}
|
|
5207
5334
|
};
|
|
5208
5335
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5212,9 +5339,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5212
5339
|
return tag.id;
|
|
5213
5340
|
};
|
|
5214
5341
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5215
|
-
var
|
|
5342
|
+
var _extends10;
|
|
5216
5343
|
var e = args._event;
|
|
5217
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5344
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5218
5345
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5219
5346
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5220
5347
|
userTagType: true
|
|
@@ -5222,22 +5349,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5222
5349
|
}
|
|
5223
5350
|
};
|
|
5224
5351
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5225
|
-
var
|
|
5352
|
+
var _extends11;
|
|
5226
5353
|
var _name = _ref2._name,
|
|
5227
5354
|
_value = _ref2._value;
|
|
5228
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5355
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5229
5356
|
};
|
|
5230
5357
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5231
|
-
var
|
|
5358
|
+
var _extends12;
|
|
5232
5359
|
var _name = _ref3._name,
|
|
5233
5360
|
_value = _ref3._value;
|
|
5234
|
-
|
|
5361
|
+
console.log(_name, _value, 'travel');
|
|
5362
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5235
5363
|
};
|
|
5236
5364
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5237
|
-
var
|
|
5365
|
+
var _extends13;
|
|
5238
5366
|
var _name = _ref4._name,
|
|
5239
5367
|
_value = _ref4._value;
|
|
5240
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5368
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5241
5369
|
};
|
|
5242
5370
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5243
5371
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5271,39 +5399,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5271
5399
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5272
5400
|
};
|
|
5273
5401
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5274
|
-
var
|
|
5402
|
+
var _extends14;
|
|
5275
5403
|
var _name = args._name,
|
|
5276
5404
|
_value = args._value,
|
|
5277
5405
|
_isError = args._isError,
|
|
5278
5406
|
_errorMsg = args._errorMsg;
|
|
5279
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5407
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5280
5408
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5281
|
-
var
|
|
5282
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5409
|
+
var _extends15;
|
|
5410
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5283
5411
|
}
|
|
5284
5412
|
updateError(_name, _isError, _errorMsg);
|
|
5285
5413
|
};
|
|
5286
5414
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5287
|
-
var
|
|
5415
|
+
var _extends16;
|
|
5288
5416
|
var _name = args._name,
|
|
5289
5417
|
_value = args._value,
|
|
5290
5418
|
_isError = args._isError,
|
|
5291
5419
|
_errorMsg = args._errorMsg;
|
|
5292
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5420
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5293
5421
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5294
|
-
var
|
|
5295
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5422
|
+
var _extends17;
|
|
5423
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5296
5424
|
}
|
|
5297
5425
|
updateError(_name, _isError, _errorMsg);
|
|
5298
5426
|
};
|
|
5299
5427
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5300
5428
|
try {
|
|
5301
5429
|
var _temp8 = function _temp8() {
|
|
5302
|
-
var
|
|
5303
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5430
|
+
var _extends18;
|
|
5431
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5304
5432
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5305
|
-
var
|
|
5306
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5433
|
+
var _extends19;
|
|
5434
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5307
5435
|
}
|
|
5308
5436
|
updateError(_name, _isError, _errorMsg);
|
|
5309
5437
|
};
|
|
@@ -5409,8 +5537,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5409
5537
|
return _errorArray;
|
|
5410
5538
|
});
|
|
5411
5539
|
setErrorMsgs(function (prevState) {
|
|
5412
|
-
var
|
|
5413
|
-
return _extends({}, prevState, (
|
|
5540
|
+
var _extends20;
|
|
5541
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5414
5542
|
});
|
|
5415
5543
|
};
|
|
5416
5544
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -6739,7 +6867,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6739
6867
|
};
|
|
6740
6868
|
};
|
|
6741
6869
|
|
|
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_","
|
|
6870
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6743
6871
|
|
|
6744
6872
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6745
6873
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8225,9 +8353,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8225
8353
|
cell: function cell(row) {
|
|
8226
8354
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8227
8355
|
component: "div",
|
|
8228
|
-
width:
|
|
8356
|
+
width: 60
|
|
8229
8357
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8230
|
-
title: "This user hasn't logged
|
|
8358
|
+
title: "This user hasn't logged on to the platform yet",
|
|
8231
8359
|
arrow: true,
|
|
8232
8360
|
classes: {
|
|
8233
8361
|
arrow: classes.arrow,
|
|
@@ -8235,7 +8363,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8235
8363
|
},
|
|
8236
8364
|
placement: "top-start"
|
|
8237
8365
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8238
|
-
className: clsx(styles$5.
|
|
8366
|
+
className: clsx(styles$5.tooltipText)
|
|
8239
8367
|
}, "Invited")) : null);
|
|
8240
8368
|
}
|
|
8241
8369
|
}, {
|
|
@@ -8336,7 +8464,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8336
8464
|
options.push({
|
|
8337
8465
|
label: 'Resend invite',
|
|
8338
8466
|
handler: function handler() {
|
|
8339
|
-
return toggleInviteModal(row.id, 'single'
|
|
8467
|
+
return toggleInviteModal(row.id, 'single');
|
|
8340
8468
|
}
|
|
8341
8469
|
});
|
|
8342
8470
|
}
|
|
@@ -8508,6 +8636,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8508
8636
|
});
|
|
8509
8637
|
};
|
|
8510
8638
|
|
|
8639
|
+
function InfoYellowIcon(props) {
|
|
8640
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8641
|
+
width: props.width,
|
|
8642
|
+
height: props.height,
|
|
8643
|
+
viewBox: "0 0 20 20",
|
|
8644
|
+
fill: "none",
|
|
8645
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8646
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8647
|
+
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",
|
|
8648
|
+
fill: "#CA8A04"
|
|
8649
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8650
|
+
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",
|
|
8651
|
+
fill: "#CA8A04"
|
|
8652
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8653
|
+
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",
|
|
8654
|
+
fill: "#CA8A04"
|
|
8655
|
+
}));
|
|
8656
|
+
}
|
|
8657
|
+
|
|
8658
|
+
function RedWarningIcon(props) {
|
|
8659
|
+
var _props$color = props.color,
|
|
8660
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8661
|
+
_props$size = props.size,
|
|
8662
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8663
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8664
|
+
width: size,
|
|
8665
|
+
height: size,
|
|
8666
|
+
viewBox: "0 0 14 14",
|
|
8667
|
+
fill: color,
|
|
8668
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8669
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8670
|
+
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",
|
|
8671
|
+
fill: color
|
|
8672
|
+
}));
|
|
8673
|
+
}
|
|
8674
|
+
|
|
8511
8675
|
function InviteInfoIcon() {
|
|
8512
8676
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8513
8677
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8525,7 +8689,8 @@ function InviteInfoIcon() {
|
|
|
8525
8689
|
}
|
|
8526
8690
|
|
|
8527
8691
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8528
|
-
var env$7 = utils.configs.env
|
|
8692
|
+
var env$7 = utils.configs.env,
|
|
8693
|
+
api$7 = utils.configs.api;
|
|
8529
8694
|
var UndoButton = function UndoButton(_ref) {
|
|
8530
8695
|
var onUndo = _ref.onUndo,
|
|
8531
8696
|
msg = _ref.msg;
|
|
@@ -8563,21 +8728,33 @@ var UserList = function UserList(_ref2) {
|
|
|
8563
8728
|
isDataFetching = _useSelector.isDataFetching,
|
|
8564
8729
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8565
8730
|
tabValue = _useSelector.tabValue;
|
|
8566
|
-
var
|
|
8567
|
-
|
|
8568
|
-
|
|
8731
|
+
var newSelecteds = userListInfo.results;
|
|
8732
|
+
var _React$useState = React__default.useState(''),
|
|
8733
|
+
deactivateUser = _React$useState[0],
|
|
8734
|
+
setDeactivateUser = _React$useState[1];
|
|
8735
|
+
var _React$useState2 = React__default.useState(null),
|
|
8736
|
+
setDefaultId = _React$useState2[1];
|
|
8737
|
+
var _React$useState3 = React__default.useState(1),
|
|
8738
|
+
page = _React$useState3[0],
|
|
8739
|
+
setPage = _React$useState3[1];
|
|
8740
|
+
var _React$useState4 = React__default.useState(''),
|
|
8741
|
+
user = _React$useState4[0],
|
|
8742
|
+
setUser = _React$useState4[1];
|
|
8569
8743
|
var _useState = React.useState(10),
|
|
8570
8744
|
rowsPerPage = _useState[0],
|
|
8571
8745
|
setRowsPerPage = _useState[1];
|
|
8572
|
-
var _React$
|
|
8573
|
-
selected = _React$
|
|
8574
|
-
setSelected = _React$
|
|
8575
|
-
var _React$
|
|
8576
|
-
order = _React$
|
|
8577
|
-
setOrder = _React$
|
|
8578
|
-
var _React$
|
|
8579
|
-
|
|
8580
|
-
|
|
8746
|
+
var _React$useState5 = React__default.useState({}),
|
|
8747
|
+
selected = _React$useState5[0],
|
|
8748
|
+
setSelected = _React$useState5[1];
|
|
8749
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8750
|
+
order = _React$useState6[0],
|
|
8751
|
+
setOrder = _React$useState6[1];
|
|
8752
|
+
var _React$useState7 = React__default.useState(false),
|
|
8753
|
+
deactivateSingle = _React$useState7[0],
|
|
8754
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8755
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8756
|
+
orderBy = _React$useState8[0],
|
|
8757
|
+
setOrderBy = _React$useState8[1];
|
|
8581
8758
|
var _useState2 = React.useState(''),
|
|
8582
8759
|
searchValue = _useState2[0],
|
|
8583
8760
|
setSearchValue = _useState2[1];
|
|
@@ -8595,38 +8772,44 @@ var UserList = function UserList(_ref2) {
|
|
|
8595
8772
|
isOpenImportUsersModal = _useState4[0],
|
|
8596
8773
|
setOpenImportUsersModal = _useState4[1];
|
|
8597
8774
|
var _useState5 = React.useState(false),
|
|
8598
|
-
|
|
8599
|
-
|
|
8775
|
+
approveeStatus = _useState5[0],
|
|
8776
|
+
setApproveeStatus = _useState5[1];
|
|
8600
8777
|
var _useState6 = React.useState(false),
|
|
8601
|
-
|
|
8602
|
-
|
|
8778
|
+
isFileDownloading = _useState6[0],
|
|
8779
|
+
setDownlStatus = _useState6[1];
|
|
8603
8780
|
var _useState7 = React.useState(false),
|
|
8604
|
-
|
|
8605
|
-
|
|
8781
|
+
isSortingChange = _useState7[0],
|
|
8782
|
+
setSortingChange = _useState7[1];
|
|
8606
8783
|
var _useState8 = React.useState(false),
|
|
8607
|
-
|
|
8608
|
-
|
|
8784
|
+
isSearchingChange = _useState8[0],
|
|
8785
|
+
setSearchingChange = _useState8[1];
|
|
8609
8786
|
var _useState9 = React.useState(false),
|
|
8610
|
-
|
|
8611
|
-
|
|
8787
|
+
isSortingChangeTemp = _useState9[0],
|
|
8788
|
+
setSortingChangeTemp = _useState9[1];
|
|
8612
8789
|
var _useState10 = React.useState(false),
|
|
8613
|
-
|
|
8614
|
-
|
|
8790
|
+
isSearchingChangeTemp = _useState10[0],
|
|
8791
|
+
setSearchingChangeTemp = _useState10[1];
|
|
8615
8792
|
var _useState11 = React.useState(false),
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
var _useState12 = React.useState(
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
var _useState13 = React.useState(
|
|
8625
|
-
|
|
8626
|
-
|
|
8793
|
+
isApiFetching = _useState11[0],
|
|
8794
|
+
setisApiFetching = _useState11[1];
|
|
8795
|
+
var _useState12 = React.useState({
|
|
8796
|
+
value: '',
|
|
8797
|
+
label: 'Select approver'
|
|
8798
|
+
}),
|
|
8799
|
+
approverRole = _useState12[0],
|
|
8800
|
+
setApproverRole = _useState12[1];
|
|
8801
|
+
var _useState13 = React.useState(false),
|
|
8802
|
+
showInviteModal = _useState13[0],
|
|
8803
|
+
setToggleInviteModal = _useState13[1];
|
|
8627
8804
|
var _useState14 = React.useState(''),
|
|
8628
|
-
|
|
8629
|
-
|
|
8805
|
+
userIds = _useState14[0],
|
|
8806
|
+
setUserIds = _useState14[1];
|
|
8807
|
+
var _React$useState9 = React__default.useState(false),
|
|
8808
|
+
overlayMenu = _React$useState9[0],
|
|
8809
|
+
setOverlayMenu = _React$useState9[1];
|
|
8810
|
+
var _useState15 = React.useState(true),
|
|
8811
|
+
isDisabledSubmitBtn = _useState15[0],
|
|
8812
|
+
setIsDisabledSubmitBtn = _useState15[1];
|
|
8630
8813
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8631
8814
|
var prevPos = _ref3.prevPos,
|
|
8632
8815
|
currPos = _ref3.currPos;
|
|
@@ -8647,37 +8830,40 @@ var UserList = function UserList(_ref2) {
|
|
|
8647
8830
|
behavior: 'smooth'
|
|
8648
8831
|
});
|
|
8649
8832
|
};
|
|
8650
|
-
var _React$
|
|
8651
|
-
signup_page = _React$
|
|
8652
|
-
setSignUpPage = _React$
|
|
8653
|
-
var
|
|
8654
|
-
signup_rowsPerPage =
|
|
8655
|
-
setSignUpRowsPerPage =
|
|
8656
|
-
var _React$
|
|
8657
|
-
signup_order = _React$
|
|
8658
|
-
setSignUpOrder = _React$
|
|
8659
|
-
var _React$
|
|
8660
|
-
signup_orderBy = _React$
|
|
8661
|
-
setSignUpOrderBy = _React$
|
|
8662
|
-
var
|
|
8663
|
-
signup_searchValue =
|
|
8664
|
-
set_signup_SearchValue =
|
|
8665
|
-
var _useState17 = React.useState(false),
|
|
8666
|
-
isSignUpSortingChange = _useState17[0],
|
|
8667
|
-
setSignUpSortingChange = _useState17[1];
|
|
8833
|
+
var _React$useState10 = React__default.useState(1),
|
|
8834
|
+
signup_page = _React$useState10[0],
|
|
8835
|
+
setSignUpPage = _React$useState10[1];
|
|
8836
|
+
var _useState16 = React.useState(5),
|
|
8837
|
+
signup_rowsPerPage = _useState16[0],
|
|
8838
|
+
setSignUpRowsPerPage = _useState16[1];
|
|
8839
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8840
|
+
signup_order = _React$useState11[0],
|
|
8841
|
+
setSignUpOrder = _React$useState11[1];
|
|
8842
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8843
|
+
signup_orderBy = _React$useState12[0],
|
|
8844
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8845
|
+
var _useState17 = React.useState(''),
|
|
8846
|
+
signup_searchValue = _useState17[0],
|
|
8847
|
+
set_signup_SearchValue = _useState17[1];
|
|
8668
8848
|
var _useState18 = React.useState(false),
|
|
8669
|
-
|
|
8670
|
-
|
|
8849
|
+
isSignUpSortingChange = _useState18[0],
|
|
8850
|
+
setSignUpSortingChange = _useState18[1];
|
|
8671
8851
|
var _useState19 = React.useState(false),
|
|
8672
|
-
|
|
8673
|
-
|
|
8852
|
+
isSignUpSearchingChange = _useState19[0],
|
|
8853
|
+
setSignUpSearchingChange = _useState19[1];
|
|
8674
8854
|
var _useState20 = React.useState(false),
|
|
8675
|
-
|
|
8676
|
-
|
|
8855
|
+
isSignUpSortingChangeTemp = _useState20[0],
|
|
8856
|
+
setSignUpSortingChangeTemp = _useState20[1];
|
|
8857
|
+
var _useState21 = React.useState(false),
|
|
8858
|
+
isSignUpSearchingChangeTemp = _useState21[0],
|
|
8859
|
+
setSignUpSearchingChangeTemp = _useState21[1];
|
|
8677
8860
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8678
8861
|
return state.userList;
|
|
8679
8862
|
}),
|
|
8680
8863
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8864
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8865
|
+
history.push(config.routes.notification.path);
|
|
8866
|
+
};
|
|
8681
8867
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8682
8868
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8683
8869
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
@@ -8735,12 +8921,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8735
8921
|
};
|
|
8736
8922
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8737
8923
|
var _extends2;
|
|
8738
|
-
var
|
|
8924
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8739
8925
|
return n.is_active;
|
|
8740
8926
|
}).map(function (obj) {
|
|
8741
8927
|
return obj.id.toString();
|
|
8742
8928
|
});
|
|
8743
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] =
|
|
8929
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = _newSelecteds, _extends2)));
|
|
8744
8930
|
};
|
|
8745
8931
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8746
8932
|
var _extends3;
|
|
@@ -8774,18 +8960,43 @@ var UserList = function UserList(_ref2) {
|
|
|
8774
8960
|
selectedTemp[page] = [];
|
|
8775
8961
|
}
|
|
8776
8962
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8777
|
-
var
|
|
8963
|
+
var _newSelected = [];
|
|
8778
8964
|
if (selectedIndex === -1) {
|
|
8779
|
-
|
|
8965
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8780
8966
|
} else if (selectedIndex === 0) {
|
|
8781
|
-
|
|
8967
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8782
8968
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8783
|
-
|
|
8969
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8784
8970
|
} else if (selectedIndex > 0) {
|
|
8785
|
-
|
|
8971
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8786
8972
|
}
|
|
8787
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] =
|
|
8973
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8788
8974
|
};
|
|
8975
|
+
React.useEffect(function () {
|
|
8976
|
+
setApproverRole({
|
|
8977
|
+
value: '',
|
|
8978
|
+
label: 'Select approver'
|
|
8979
|
+
});
|
|
8980
|
+
setIsDisabledSubmitBtn(true);
|
|
8981
|
+
setApproveeStatus(false);
|
|
8982
|
+
if (deactivateSingle === true) {
|
|
8983
|
+
api$7.get(userAddEditUrl._approversSearch() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
8984
|
+
setDefaultId(response.data["default"].id);
|
|
8985
|
+
response.data.results.map(function (item) {
|
|
8986
|
+
if (response.data["default"].id === item.id) {
|
|
8987
|
+
setApproverRole({
|
|
8988
|
+
value: '',
|
|
8989
|
+
label: item.email
|
|
8990
|
+
});
|
|
8991
|
+
setIsDisabledSubmitBtn(false);
|
|
8992
|
+
if (item.approvee_status) {
|
|
8993
|
+
setApproveeStatus(true);
|
|
8994
|
+
}
|
|
8995
|
+
}
|
|
8996
|
+
});
|
|
8997
|
+
});
|
|
8998
|
+
}
|
|
8999
|
+
}, [deactivateSingle]);
|
|
8789
9000
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8790
9001
|
setRowsPerPage(+event.target.value);
|
|
8791
9002
|
setPage(1);
|
|
@@ -8795,20 +9006,43 @@ var UserList = function UserList(_ref2) {
|
|
|
8795
9006
|
};
|
|
8796
9007
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8797
9008
|
var isActive = e.target.checked;
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
9009
|
+
var _isApprover;
|
|
9010
|
+
newSelecteds.map(function (item) {
|
|
9011
|
+
if (item.id === id) {
|
|
9012
|
+
_isApprover = item.roles.is_approver;
|
|
9013
|
+
if (_isApprover === true && isActive === false) {
|
|
9014
|
+
setDeactivateSingle(true);
|
|
9015
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9016
|
+
setUser(item);
|
|
9017
|
+
} else {
|
|
9018
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9019
|
+
if (!isActive) {
|
|
9020
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9021
|
+
var _extends5;
|
|
9022
|
+
var selectedTemp = _extends({}, selected);
|
|
9023
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9024
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9025
|
+
}
|
|
9026
|
+
}
|
|
9027
|
+
});
|
|
8805
9028
|
}
|
|
8806
9029
|
}
|
|
8807
9030
|
});
|
|
8808
9031
|
};
|
|
9032
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9033
|
+
var _value = _ref4._value;
|
|
9034
|
+
if (_value.data.approvee_status) {
|
|
9035
|
+
setApproveeStatus(true);
|
|
9036
|
+
} else {
|
|
9037
|
+
setApproveeStatus(false);
|
|
9038
|
+
}
|
|
9039
|
+
setApproverRole(_value);
|
|
9040
|
+
setIsDisabledSubmitBtn(false);
|
|
9041
|
+
};
|
|
8809
9042
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8810
|
-
dispatch(
|
|
9043
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, approverRole.data.id));
|
|
8811
9044
|
setOpenDeActivateModalFlag(false);
|
|
9045
|
+
setDeactivateSingle(false);
|
|
8812
9046
|
setSelected({});
|
|
8813
9047
|
};
|
|
8814
9048
|
var importUserHandler = function importUserHandler() {
|
|
@@ -8826,19 +9060,13 @@ var UserList = function UserList(_ref2) {
|
|
|
8826
9060
|
email: email
|
|
8827
9061
|
}));
|
|
8828
9062
|
};
|
|
8829
|
-
var toggleInviteModal = function toggleInviteModal(ids, type
|
|
8830
|
-
|
|
8831
|
-
|
|
8832
|
-
|
|
8833
|
-
|
|
8834
|
-
}
|
|
9063
|
+
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
9064
|
+
console.log(type);
|
|
9065
|
+
if (!type && (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined)) {
|
|
9066
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9067
|
+
return false;
|
|
8835
9068
|
}
|
|
8836
9069
|
setUserIds(ids);
|
|
8837
|
-
setUserFirstName(firstName);
|
|
8838
|
-
setUserLastName(lastName);
|
|
8839
|
-
setToggleInviteModal(!showInviteModal);
|
|
8840
|
-
};
|
|
8841
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8842
9070
|
setToggleInviteModal(!showInviteModal);
|
|
8843
9071
|
};
|
|
8844
9072
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -9162,7 +9390,11 @@ var UserList = function UserList(_ref2) {
|
|
|
9162
9390
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9163
9391
|
variant: "body2",
|
|
9164
9392
|
className: clsx(styles$5.description)
|
|
9165
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9393
|
+
}, "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(iuistyles.IUITypography, {
|
|
9394
|
+
variant: "span",
|
|
9395
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9396
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9397
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9166
9398
|
data: signupRequestListInfo,
|
|
9167
9399
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9168
9400
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9194,6 +9426,45 @@ var UserList = function UserList(_ref2) {
|
|
|
9194
9426
|
}))
|
|
9195
9427
|
}]
|
|
9196
9428
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9429
|
+
isOpen: deactivateSingle,
|
|
9430
|
+
closeHandler: function closeHandler() {
|
|
9431
|
+
setDeactivateSingle(false);
|
|
9432
|
+
},
|
|
9433
|
+
cancelLabel: "Cancel",
|
|
9434
|
+
submitLabel: "Deactivate",
|
|
9435
|
+
submitHandler: handleDeactivateUsers,
|
|
9436
|
+
headerText: "Deactivate this user?",
|
|
9437
|
+
width: "400px",
|
|
9438
|
+
subHanderText: "",
|
|
9439
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9440
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn
|
|
9441
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9442
|
+
className: styles$5.deactivateSingle
|
|
9443
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9444
|
+
className: styles$5.deactivateAlert
|
|
9445
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9446
|
+
width: "9",
|
|
9447
|
+
height: "9"
|
|
9448
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, null, /*#__PURE__*/React__default.createElement("b", null, deactivateUser), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9449
|
+
className: "iui__my-15"
|
|
9450
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9451
|
+
isMove: true,
|
|
9452
|
+
additional: {
|
|
9453
|
+
page: 1,
|
|
9454
|
+
product: 'travel',
|
|
9455
|
+
userId: user.id
|
|
9456
|
+
},
|
|
9457
|
+
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
9458
|
+
label: "Transfer approver role to",
|
|
9459
|
+
value: approverRole,
|
|
9460
|
+
onValueChange: selectApprover,
|
|
9461
|
+
loadOption: transferRoleOptions,
|
|
9462
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9463
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9464
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9465
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9466
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9467
|
+
}, "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, {
|
|
9197
9468
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9198
9469
|
closeHandler: closeDeActivateModal,
|
|
9199
9470
|
cancelLabel: "Cancel",
|
|
@@ -9221,9 +9492,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9221
9492
|
className: styles$5.description
|
|
9222
9493
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9223
9494
|
isOpen: showInviteModal,
|
|
9224
|
-
closeHandler:
|
|
9225
|
-
return toggleInviteModalClose();
|
|
9226
|
-
},
|
|
9495
|
+
closeHandler: toggleInviteModal,
|
|
9227
9496
|
cancelLabel: "Cancel",
|
|
9228
9497
|
headerText: "Resend Invites?",
|
|
9229
9498
|
submitLabel: "Send",
|
|
@@ -9255,13 +9524,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9255
9524
|
fontSize: '14px',
|
|
9256
9525
|
color: '#374151'
|
|
9257
9526
|
}
|
|
9258
|
-
}, "This invitation will be sent to
|
|
9259
|
-
style: {
|
|
9260
|
-
fontSize: '14px',
|
|
9261
|
-
color: '#374151',
|
|
9262
|
-
fontWeight: 'bold'
|
|
9263
|
-
}
|
|
9264
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9527
|
+
}, "This invitation will be sent to users who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9265
9528
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9266
9529
|
closeImportUsersModal: closeImportUsersModal,
|
|
9267
9530
|
closeImportModal: closeImportModal
|
|
@@ -9270,8 +9533,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9270
9533
|
errMsg: hasVerificationError
|
|
9271
9534
|
}));
|
|
9272
9535
|
};
|
|
9273
|
-
var TabLabelCount = function TabLabelCount(
|
|
9274
|
-
var count =
|
|
9536
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9537
|
+
var count = _ref5.count;
|
|
9275
9538
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9276
9539
|
className: styles$5.TabLabelCount
|
|
9277
9540
|
}, " ", count, " ");
|
|
@@ -9346,11 +9609,12 @@ function Header(props) {
|
|
|
9346
9609
|
})));
|
|
9347
9610
|
}
|
|
9348
9611
|
|
|
9349
|
-
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"};
|
|
9612
|
+
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"};
|
|
9350
9613
|
|
|
9351
9614
|
function Listview(_ref) {
|
|
9352
9615
|
var data = _ref.data,
|
|
9353
9616
|
name = _ref.name,
|
|
9617
|
+
tableName = _ref.tableName,
|
|
9354
9618
|
handleEditDialog = _ref.handleEditDialog,
|
|
9355
9619
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9356
9620
|
orderBy = _ref.orderBy,
|
|
@@ -9363,16 +9627,82 @@ function Listview(_ref) {
|
|
|
9363
9627
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9364
9628
|
page = _ref.page,
|
|
9365
9629
|
rowsPerPage = _ref.rowsPerPage;
|
|
9630
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9631
|
+
var _data$dept_head_detai;
|
|
9632
|
+
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) {
|
|
9633
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9634
|
+
}
|
|
9635
|
+
};
|
|
9366
9636
|
var columns = [{
|
|
9367
9637
|
id: 'name',
|
|
9368
9638
|
label: name,
|
|
9369
|
-
width: '
|
|
9639
|
+
width: '40%',
|
|
9640
|
+
sortable: true,
|
|
9641
|
+
cell: function cell(row) {
|
|
9642
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9643
|
+
component: "div"
|
|
9644
|
+
}, row.name);
|
|
9645
|
+
}
|
|
9646
|
+
}, {
|
|
9647
|
+
id: 'no_of_users',
|
|
9648
|
+
label: 'Number of users',
|
|
9649
|
+
width: '40%',
|
|
9650
|
+
sortable: true,
|
|
9651
|
+
cell: function cell(row) {
|
|
9652
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9653
|
+
component: "div"
|
|
9654
|
+
}, row.no_of_users);
|
|
9655
|
+
}
|
|
9656
|
+
}, {
|
|
9657
|
+
id: 'actions',
|
|
9658
|
+
label: 'Actions',
|
|
9659
|
+
width: '20%',
|
|
9660
|
+
cell: function cell(row) {
|
|
9661
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9662
|
+
display: "flex"
|
|
9663
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9664
|
+
buttonText: "Edit",
|
|
9665
|
+
className: styles$7.buttonWidth,
|
|
9666
|
+
onClick: function onClick() {
|
|
9667
|
+
return handleEditDialog(row);
|
|
9668
|
+
}
|
|
9669
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9670
|
+
buttonText: "Delete",
|
|
9671
|
+
className: styles$7.buttonWidth,
|
|
9672
|
+
onClick: function onClick() {
|
|
9673
|
+
return handleDeleteDialog(row, true);
|
|
9674
|
+
}
|
|
9675
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9676
|
+
buttonText: "Delete",
|
|
9677
|
+
className: styles$7.buttonWidth,
|
|
9678
|
+
onClick: function onClick() {
|
|
9679
|
+
return handleDeleteDialog(row, false);
|
|
9680
|
+
}
|
|
9681
|
+
}));
|
|
9682
|
+
}
|
|
9683
|
+
}];
|
|
9684
|
+
var departmentColumns = [{
|
|
9685
|
+
id: 'name',
|
|
9686
|
+
label: name,
|
|
9687
|
+
width: '30%',
|
|
9370
9688
|
sortable: true,
|
|
9371
9689
|
cell: function cell(row) {
|
|
9372
9690
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9373
9691
|
component: "div"
|
|
9374
9692
|
}, row.name);
|
|
9375
9693
|
}
|
|
9694
|
+
}, {
|
|
9695
|
+
id: 'department_head',
|
|
9696
|
+
label: 'Department head',
|
|
9697
|
+
width: '30%',
|
|
9698
|
+
sortable: true,
|
|
9699
|
+
cell: function cell(row) {
|
|
9700
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9701
|
+
component: "div"
|
|
9702
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9703
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9704
|
+
}, "Assigned by default"));
|
|
9705
|
+
}
|
|
9376
9706
|
}, {
|
|
9377
9707
|
id: 'no_of_users',
|
|
9378
9708
|
label: 'Number of users',
|
|
@@ -9386,7 +9716,7 @@ function Listview(_ref) {
|
|
|
9386
9716
|
}, {
|
|
9387
9717
|
id: 'actions',
|
|
9388
9718
|
label: 'Actions',
|
|
9389
|
-
width: '
|
|
9719
|
+
width: '15%',
|
|
9390
9720
|
cell: function cell(row) {
|
|
9391
9721
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9392
9722
|
display: "flex"
|
|
@@ -9419,7 +9749,7 @@ function Listview(_ref) {
|
|
|
9419
9749
|
hasFilter: true,
|
|
9420
9750
|
isCheckboxTable: false,
|
|
9421
9751
|
count: data.count,
|
|
9422
|
-
columns: columns,
|
|
9752
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9423
9753
|
rows: data.results,
|
|
9424
9754
|
page: page,
|
|
9425
9755
|
handleChangePage: handleChangePage,
|
|
@@ -9476,15 +9806,44 @@ function EditPanelDialog(_ref) {
|
|
|
9476
9806
|
var isOpen = _ref.isOpen,
|
|
9477
9807
|
closeHandler = _ref.closeHandler,
|
|
9478
9808
|
onValueChange = _ref.onValueChange,
|
|
9479
|
-
|
|
9809
|
+
_submitHandler = _ref.submitHandler,
|
|
9480
9810
|
isError = _ref.isError,
|
|
9481
9811
|
name = _ref.name,
|
|
9482
9812
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9483
|
-
validation = _ref.validation
|
|
9813
|
+
validation = _ref.validation,
|
|
9814
|
+
rowData = _ref.rowData,
|
|
9815
|
+
tableName = _ref.tableName,
|
|
9816
|
+
config = _ref.config;
|
|
9484
9817
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9485
9818
|
return state.userPanel;
|
|
9486
9819
|
}),
|
|
9487
9820
|
dialogData = _useSelector.dialogData;
|
|
9821
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9822
|
+
var _data$dept_head_detai;
|
|
9823
|
+
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) {
|
|
9824
|
+
setHead({
|
|
9825
|
+
value: data.dept_head_details[0].id,
|
|
9826
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9827
|
+
});
|
|
9828
|
+
}
|
|
9829
|
+
};
|
|
9830
|
+
var _useState = React.useState({
|
|
9831
|
+
value: '',
|
|
9832
|
+
label: 'Select'
|
|
9833
|
+
}),
|
|
9834
|
+
head = _useState[0],
|
|
9835
|
+
setHead = _useState[1];
|
|
9836
|
+
React.useEffect(function () {
|
|
9837
|
+
deptHeadDetails(rowData);
|
|
9838
|
+
}, [rowData]);
|
|
9839
|
+
var history = reactRouterDom.useHistory();
|
|
9840
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9841
|
+
console.log(rowData);
|
|
9842
|
+
history.push({
|
|
9843
|
+
pathname: config.routes.users.add.path,
|
|
9844
|
+
state: rowData
|
|
9845
|
+
});
|
|
9846
|
+
};
|
|
9488
9847
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9489
9848
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9490
9849
|
isOpen: isOpen,
|
|
@@ -9492,25 +9851,59 @@ function EditPanelDialog(_ref) {
|
|
|
9492
9851
|
headerText: "Edit " + name.toLowerCase(),
|
|
9493
9852
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9494
9853
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9495
|
-
submitHandler: submitHandler
|
|
9496
|
-
|
|
9854
|
+
submitHandler: function submitHandler() {
|
|
9855
|
+
return _submitHandler(head);
|
|
9856
|
+
},
|
|
9857
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9497
9858
|
hideCloseIcon: false,
|
|
9498
9859
|
modalBodyStyle: {
|
|
9499
|
-
|
|
9500
|
-
overflow: 'auto',
|
|
9501
|
-
margin: '0px'
|
|
9860
|
+
overflowY: 'visible'
|
|
9502
9861
|
},
|
|
9503
9862
|
footerStyle: {
|
|
9504
9863
|
justifyContent: 'end'
|
|
9505
9864
|
}
|
|
9865
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9866
|
+
display: "flex",
|
|
9867
|
+
justifyContent: "center",
|
|
9868
|
+
alignItems: "center",
|
|
9869
|
+
flexDirection: "column",
|
|
9870
|
+
style: {
|
|
9871
|
+
marginBottom: '30px'
|
|
9872
|
+
}
|
|
9506
9873
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9507
|
-
component: "div",
|
|
9508
9874
|
display: "flex",
|
|
9509
9875
|
justifyContent: "center",
|
|
9510
9876
|
alignItems: "center",
|
|
9511
9877
|
flexDirection: "column",
|
|
9512
|
-
|
|
9513
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
9878
|
+
className: styles$7.baseAlert
|
|
9879
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9880
|
+
className: styles$7.alertDescContainer
|
|
9881
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9882
|
+
className: styles$7.iconLayout,
|
|
9883
|
+
style: {
|
|
9884
|
+
paddingTop: '4px'
|
|
9885
|
+
}
|
|
9886
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
9887
|
+
color: "#CA8A04",
|
|
9888
|
+
width: "25",
|
|
9889
|
+
height: "20",
|
|
9890
|
+
className: styles$7.iconStyle
|
|
9891
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
9892
|
+
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.",
|
|
9893
|
+
style: {
|
|
9894
|
+
fontWeight: 'normal'
|
|
9895
|
+
}
|
|
9896
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9897
|
+
buttonText: "Add user",
|
|
9898
|
+
type: "text",
|
|
9899
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9900
|
+
width: "9",
|
|
9901
|
+
height: "9",
|
|
9902
|
+
color: "#EC5D25"
|
|
9903
|
+
}),
|
|
9904
|
+
onClick: handleAddPageNavigation,
|
|
9905
|
+
className: styles$7.addUserButton
|
|
9906
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9514
9907
|
label: name + " name",
|
|
9515
9908
|
name: "name",
|
|
9516
9909
|
defaultValue: dialogData.data.name,
|
|
@@ -9519,7 +9912,49 @@ function EditPanelDialog(_ref) {
|
|
|
9519
9912
|
isError: isError,
|
|
9520
9913
|
validation: validation,
|
|
9521
9914
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9522
|
-
required: true
|
|
9915
|
+
required: true,
|
|
9916
|
+
style: tableName === 'department' && {
|
|
9917
|
+
width: '350px'
|
|
9918
|
+
}
|
|
9919
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9920
|
+
className: "iui__mt-15",
|
|
9921
|
+
style: {
|
|
9922
|
+
width: '100%'
|
|
9923
|
+
}
|
|
9924
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9925
|
+
label: "Department head",
|
|
9926
|
+
name: "name",
|
|
9927
|
+
defaultValue: head.label,
|
|
9928
|
+
placeholder: "",
|
|
9929
|
+
readOnly: true,
|
|
9930
|
+
style: {
|
|
9931
|
+
width: '350px'
|
|
9932
|
+
}
|
|
9933
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9934
|
+
className: "iui__mt-15",
|
|
9935
|
+
style: {
|
|
9936
|
+
width: '100%'
|
|
9937
|
+
}
|
|
9938
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9939
|
+
noResultsText: true,
|
|
9940
|
+
isMove: true,
|
|
9941
|
+
additional: {
|
|
9942
|
+
page: 1,
|
|
9943
|
+
departmentId: rowData.id
|
|
9944
|
+
},
|
|
9945
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9946
|
+
label: "Department head",
|
|
9947
|
+
value: head,
|
|
9948
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9949
|
+
var _value = _ref2._value;
|
|
9950
|
+
return setHead(_value);
|
|
9951
|
+
},
|
|
9952
|
+
loadOption: departmentHeadOptions,
|
|
9953
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9954
|
+
customLoadingText: "No users found in this department",
|
|
9955
|
+
customLoadingTextStyle: {
|
|
9956
|
+
color: '#374151'
|
|
9957
|
+
}
|
|
9523
9958
|
})));
|
|
9524
9959
|
}
|
|
9525
9960
|
|
|
@@ -9698,12 +10133,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9698
10133
|
var _useState13 = React.useState(false),
|
|
9699
10134
|
isSortingChangeTemp = _useState13[0],
|
|
9700
10135
|
setSortingChangeTemp = _useState13[1];
|
|
9701
|
-
var _useState14 = React.useState(
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
var _useState15 = React.useState(
|
|
9705
|
-
|
|
9706
|
-
|
|
10136
|
+
var _useState14 = React.useState([]),
|
|
10137
|
+
rowData = _useState14[0],
|
|
10138
|
+
setRowData = _useState14[1];
|
|
10139
|
+
var _useState15 = React.useState(1),
|
|
10140
|
+
page = _useState15[0],
|
|
10141
|
+
setPage = _useState15[1];
|
|
10142
|
+
var _useState16 = React.useState(5),
|
|
10143
|
+
rowsPerPage = _useState16[0],
|
|
10144
|
+
setRowsPerPage = _useState16[1];
|
|
9707
10145
|
var orderingParam = orderBy;
|
|
9708
10146
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9709
10147
|
return state.userPanel;
|
|
@@ -9799,6 +10237,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9799
10237
|
submitLabel: 'Save'
|
|
9800
10238
|
}, '', data));
|
|
9801
10239
|
setDataList(data.name);
|
|
10240
|
+
setRowData(data);
|
|
9802
10241
|
setEditModal(true);
|
|
9803
10242
|
};
|
|
9804
10243
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9813,6 +10252,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9813
10252
|
var payload = {
|
|
9814
10253
|
names: [dataList]
|
|
9815
10254
|
};
|
|
10255
|
+
if (tableName === 'department') {
|
|
10256
|
+
payload = {
|
|
10257
|
+
name: dataList,
|
|
10258
|
+
department_head_id: null
|
|
10259
|
+
};
|
|
10260
|
+
}
|
|
9816
10261
|
var message = title + " added successfully.";
|
|
9817
10262
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9818
10263
|
} else {
|
|
@@ -9826,9 +10271,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9826
10271
|
var message = title + " deleted successfully.";
|
|
9827
10272
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9828
10273
|
};
|
|
9829
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10274
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10275
|
+
if (optionalParams === void 0) {
|
|
10276
|
+
optionalParams = null;
|
|
10277
|
+
}
|
|
9830
10278
|
dispatch(userPanelShowLoader());
|
|
9831
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10279
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9832
10280
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9833
10281
|
dispatch(userPanelStopLoader());
|
|
9834
10282
|
if (type === 'delete') {
|
|
@@ -9870,8 +10318,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9870
10318
|
name: dataList
|
|
9871
10319
|
}]
|
|
9872
10320
|
};
|
|
10321
|
+
if (tableName === 'department') {
|
|
10322
|
+
payload = {
|
|
10323
|
+
name: dataList,
|
|
10324
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10325
|
+
};
|
|
10326
|
+
}
|
|
9873
10327
|
var message = title + " updated successfully.";
|
|
9874
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10328
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9875
10329
|
setErrorEdit(false);
|
|
9876
10330
|
} else {
|
|
9877
10331
|
setErrorEdit(true);
|
|
@@ -9978,7 +10432,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9978
10432
|
submitHandler: handleEditPanel,
|
|
9979
10433
|
isError: errorEdit,
|
|
9980
10434
|
isDisabledSubmitBtn: loading,
|
|
9981
|
-
validation: validation
|
|
10435
|
+
validation: validation,
|
|
10436
|
+
rowData: rowData,
|
|
10437
|
+
tableName: tableName,
|
|
10438
|
+
config: config
|
|
9982
10439
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9983
10440
|
config: config
|
|
9984
10441
|
}));
|