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