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