@itilite/iui-user-management 0.4.207 → 0.4.208
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 +14 -63
- package/dist/index.js +232 -639
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +233 -640
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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
|
|
12
|
+
import { useHistory } 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,9 +354,6 @@ var userAddEditUrl = {
|
|
|
354
354
|
approversSearch: function approversSearch() {
|
|
355
355
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
356
356
|
},
|
|
357
|
-
_approversSearch: function _approversSearch() {
|
|
358
|
-
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
-
},
|
|
360
357
|
preSignedUrl: function preSignedUrl() {
|
|
361
358
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
362
359
|
},
|
|
@@ -453,14 +450,6 @@ var userPanelUrl = {
|
|
|
453
450
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
454
451
|
}
|
|
455
452
|
};
|
|
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
|
-
};
|
|
464
453
|
|
|
465
454
|
var api = configs.api;
|
|
466
455
|
var NAoptionConfig = {
|
|
@@ -605,20 +594,28 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
605
594
|
var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
606
595
|
var page = _ref4.page,
|
|
607
596
|
product = _ref4.product,
|
|
608
|
-
userId = _ref4.userId
|
|
597
|
+
userId = _ref4.userId,
|
|
598
|
+
placeholder = _ref4.placeholder;
|
|
609
599
|
try {
|
|
610
600
|
return Promise.resolve(_catch(function () {
|
|
611
|
-
return Promise.resolve(api.get(userAddEditUrl.
|
|
601
|
+
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
612
602
|
return res.data;
|
|
613
603
|
})).then(function (response) {
|
|
614
604
|
var mappedValue = response.results.map(function (item) {
|
|
615
605
|
return {
|
|
616
|
-
value: item.email,
|
|
617
|
-
label: item.email,
|
|
606
|
+
value: item.approver.email,
|
|
607
|
+
label: item.approver.email,
|
|
618
608
|
type: 'detailed',
|
|
619
|
-
data: item
|
|
609
|
+
data: item.approver
|
|
620
610
|
};
|
|
621
611
|
});
|
|
612
|
+
if (page === 1) {
|
|
613
|
+
var placeholderLbl = {
|
|
614
|
+
value: '',
|
|
615
|
+
label: placeholder
|
|
616
|
+
};
|
|
617
|
+
mappedValue.unshift(placeholderLbl);
|
|
618
|
+
}
|
|
622
619
|
return {
|
|
623
620
|
options: mappedValue,
|
|
624
621
|
hasMore: !!response.next,
|
|
@@ -681,46 +678,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
681
678
|
return Promise.reject(e);
|
|
682
679
|
}
|
|
683
680
|
};
|
|
684
|
-
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
|
|
685
|
-
var page = _ref6.page,
|
|
686
|
-
departmentId = _ref6.departmentId;
|
|
687
|
-
try {
|
|
688
|
-
return Promise.resolve(_catch(function () {
|
|
689
|
-
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
690
|
-
return res.data;
|
|
691
|
-
})).then(function (response) {
|
|
692
|
-
var mappedValue = response.results.map(function (item) {
|
|
693
|
-
return {
|
|
694
|
-
value: item.id,
|
|
695
|
-
label: item.first_name + ' ' + item.last_name,
|
|
696
|
-
type: 'detailed',
|
|
697
|
-
data: item
|
|
698
|
-
};
|
|
699
|
-
});
|
|
700
|
-
console.log(response.next);
|
|
701
|
-
return {
|
|
702
|
-
options: mappedValue,
|
|
703
|
-
hasMore: !!response.next,
|
|
704
|
-
additional: {
|
|
705
|
-
page: page + 1,
|
|
706
|
-
departmentId: departmentId
|
|
707
|
-
}
|
|
708
|
-
};
|
|
709
|
-
});
|
|
710
|
-
}, function () {
|
|
711
|
-
return {
|
|
712
|
-
options: [],
|
|
713
|
-
hasMore: false,
|
|
714
|
-
additional: {
|
|
715
|
-
page: 1,
|
|
716
|
-
departmentId: departmentId
|
|
717
|
-
}
|
|
718
|
-
};
|
|
719
|
-
}));
|
|
720
|
-
} catch (e) {
|
|
721
|
-
return Promise.reject(e);
|
|
722
|
-
}
|
|
723
|
-
};
|
|
724
681
|
|
|
725
682
|
var UserRole = function UserRole(_ref) {
|
|
726
683
|
var _ref$list = _ref.list,
|
|
@@ -1097,6 +1054,12 @@ var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
|
1097
1054
|
payload: payload
|
|
1098
1055
|
};
|
|
1099
1056
|
};
|
|
1057
|
+
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1058
|
+
return {
|
|
1059
|
+
type: SET_BULK_DEACTIVATED_USERS,
|
|
1060
|
+
payload: payload
|
|
1061
|
+
};
|
|
1062
|
+
};
|
|
1100
1063
|
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1101
1064
|
return {
|
|
1102
1065
|
type: SHOW_LOADER$1,
|
|
@@ -1157,25 +1120,36 @@ var exportUsers = function exportUsers(payload) {
|
|
|
1157
1120
|
});
|
|
1158
1121
|
};
|
|
1159
1122
|
};
|
|
1123
|
+
var deActivateUsers = function deActivateUsers(ids) {
|
|
1124
|
+
return function (dispatch) {
|
|
1125
|
+
return new Promise(function (resolve, reject) {
|
|
1126
|
+
api$1.post("" + userListUrl.bulkDeactivate(), {
|
|
1127
|
+
user_ids: ids
|
|
1128
|
+
}).then(function (res) {
|
|
1129
|
+
dispatch(setBulkDeactivatedUsers(ids));
|
|
1130
|
+
IUIToastMessageService.sNotify(ids.length + ' Users deactivated successfully');
|
|
1131
|
+
resolve();
|
|
1132
|
+
})["catch"](function (err) {
|
|
1133
|
+
if (!err.response.data.status) {
|
|
1134
|
+
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1135
|
+
reject(err);
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
reject(err);
|
|
1139
|
+
});
|
|
1140
|
+
});
|
|
1141
|
+
};
|
|
1142
|
+
};
|
|
1160
1143
|
var updateTabValue = function updateTabValue(tabId) {
|
|
1161
1144
|
return {
|
|
1162
1145
|
type: SET_TAB_VALUE,
|
|
1163
1146
|
payload: tabId
|
|
1164
1147
|
};
|
|
1165
1148
|
};
|
|
1166
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id
|
|
1167
|
-
if (roleTransfer === void 0) {
|
|
1168
|
-
roleTransfer = false;
|
|
1169
|
-
}
|
|
1170
|
-
var _payload = {
|
|
1171
|
-
role_transfer: roleTransfer
|
|
1172
|
-
};
|
|
1173
|
-
if (roleTransfer) {
|
|
1174
|
-
_payload['new_approver_user_id'] = newApproverUserId;
|
|
1175
|
-
}
|
|
1149
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1176
1150
|
return function (dispatch) {
|
|
1177
1151
|
return new Promise(function (resolve, reject) {
|
|
1178
|
-
api$1.
|
|
1152
|
+
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1179
1153
|
dispatch(setUserActiveStatus({
|
|
1180
1154
|
is_active: activateVal !== 0,
|
|
1181
1155
|
id: id
|
|
@@ -1739,7 +1713,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1739
1713
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1740
1714
|
return function (dispatch) {
|
|
1741
1715
|
return new Promise(function (resolve, reject) {
|
|
1742
|
-
api$2.post(
|
|
1716
|
+
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1743
1717
|
resolve(res);
|
|
1744
1718
|
})["catch"](function (err) {
|
|
1745
1719
|
var _err$response17, _err$response17$data;
|
|
@@ -1775,7 +1749,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1775
1749
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1776
1750
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1777
1751
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1778
|
-
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1779
1752
|
|
|
1780
1753
|
var api$3 = configs.api;
|
|
1781
1754
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1825,14 +1798,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1825
1798
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1826
1799
|
return function (dispatch) {
|
|
1827
1800
|
return new Promise(function (resolve, reject) {
|
|
1828
|
-
api$3.post(
|
|
1801
|
+
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1829
1802
|
dispatch(getUserPanalData(getParam));
|
|
1830
1803
|
dispatch(closeDialog());
|
|
1831
1804
|
resolve(res);
|
|
1832
1805
|
})["catch"](function (err) {
|
|
1833
|
-
var _err$
|
|
1806
|
+
var _err$response2, _err$response2$data;
|
|
1834
1807
|
dispatch(userPanelStopLoader());
|
|
1835
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1808
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.message) || 'Opps, Something went wrong.');
|
|
1836
1809
|
});
|
|
1837
1810
|
});
|
|
1838
1811
|
};
|
|
@@ -1846,37 +1819,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1846
1819
|
dispatch(userPanelStopLoader());
|
|
1847
1820
|
resolve();
|
|
1848
1821
|
})["catch"](function (err) {
|
|
1849
|
-
var _err$
|
|
1850
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1822
|
+
var _err$response3, _err$response3$data;
|
|
1823
|
+
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.');
|
|
1851
1824
|
dispatch(userPanelStopLoader());
|
|
1852
1825
|
});
|
|
1853
1826
|
});
|
|
1854
1827
|
};
|
|
1855
1828
|
};
|
|
1856
|
-
var editRecord = function editRecord(tableName, data, getParam
|
|
1829
|
+
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1857
1830
|
return function (dispatch) {
|
|
1858
1831
|
return new Promise(function (resolve, reject) {
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
});
|
|
1869
|
-
} else {
|
|
1870
|
-
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1871
|
-
dispatch(getUserPanalData(getParam));
|
|
1872
|
-
dispatch(closeDialog());
|
|
1873
|
-
resolve();
|
|
1874
|
-
})["catch"](function (err) {
|
|
1875
|
-
var _err$response6, _err$response6$data;
|
|
1876
|
-
dispatch(userPanelStopLoader());
|
|
1877
|
-
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.');
|
|
1878
|
-
});
|
|
1879
|
-
}
|
|
1832
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1833
|
+
dispatch(getUserPanalData(getParam));
|
|
1834
|
+
dispatch(closeDialog());
|
|
1835
|
+
resolve();
|
|
1836
|
+
})["catch"](function (err) {
|
|
1837
|
+
var _err$response4, _err$response4$data;
|
|
1838
|
+
dispatch(userPanelStopLoader());
|
|
1839
|
+
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.');
|
|
1840
|
+
});
|
|
1880
1841
|
});
|
|
1881
1842
|
};
|
|
1882
1843
|
};
|
|
@@ -1888,8 +1849,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1888
1849
|
dispatch(closeDialog());
|
|
1889
1850
|
resolve(res);
|
|
1890
1851
|
})["catch"](function (err) {
|
|
1891
|
-
var _err$
|
|
1892
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1852
|
+
var _err$response5, _err$response5$data;
|
|
1853
|
+
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.');
|
|
1893
1854
|
});
|
|
1894
1855
|
});
|
|
1895
1856
|
};
|
|
@@ -3989,7 +3950,6 @@ var initialState$2 = {
|
|
|
3989
3950
|
previous: null,
|
|
3990
3951
|
results: []
|
|
3991
3952
|
},
|
|
3992
|
-
deptUsers: [],
|
|
3993
3953
|
loading: false
|
|
3994
3954
|
};
|
|
3995
3955
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4059,12 +4019,6 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4059
4019
|
loading: false
|
|
4060
4020
|
});
|
|
4061
4021
|
}
|
|
4062
|
-
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4063
|
-
{
|
|
4064
|
-
return _extends({}, state, {
|
|
4065
|
-
deptUsers: action.payload
|
|
4066
|
-
});
|
|
4067
|
-
}
|
|
4068
4022
|
default:
|
|
4069
4023
|
return state;
|
|
4070
4024
|
}
|
|
@@ -4843,7 +4797,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4843
4797
|
isILadmin = _useSelector2.isILadmin,
|
|
4844
4798
|
companyName = _useSelector2.companyName;
|
|
4845
4799
|
var history = useHistory();
|
|
4846
|
-
var location = useLocation();
|
|
4847
4800
|
var _useState = useState({
|
|
4848
4801
|
travel: false,
|
|
4849
4802
|
expense: false
|
|
@@ -5099,18 +5052,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5099
5052
|
var onAddModalClose = function onAddModalClose() {
|
|
5100
5053
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5101
5054
|
};
|
|
5102
|
-
useEffect(function () {
|
|
5103
|
-
var _location$state, _location$state2;
|
|
5104
|
-
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) {
|
|
5105
|
-
var _location$state3, _location$state4;
|
|
5106
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5107
|
-
department: {
|
|
5108
|
-
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5109
|
-
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5110
|
-
}
|
|
5111
|
-
}));
|
|
5112
|
-
}
|
|
5113
|
-
}, []);
|
|
5114
5055
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5115
5056
|
var title = '';
|
|
5116
5057
|
if (id === 'entity') {
|
|
@@ -5136,42 +5077,24 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5136
5077
|
}));
|
|
5137
5078
|
} else {
|
|
5138
5079
|
dispatch(showLoader());
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
department_head_id: null
|
|
5144
|
-
};
|
|
5145
|
-
} else {
|
|
5146
|
-
dataObj = {
|
|
5147
|
-
names: [validatedValue]
|
|
5148
|
-
};
|
|
5149
|
-
}
|
|
5150
|
-
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5151
|
-
var _extends4;
|
|
5080
|
+
dispatch(submitAddModalData(addModalData.id, {
|
|
5081
|
+
names: [validatedValue]
|
|
5082
|
+
})).then(function (res) {
|
|
5083
|
+
var _extends2, _extends3;
|
|
5152
5084
|
setAddModalData(_extends({}, addModalData, {
|
|
5153
5085
|
isOpen: false
|
|
5154
5086
|
}));
|
|
5155
5087
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5156
5088
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
}, _extends2)));
|
|
5163
|
-
} else {
|
|
5164
|
-
var _extends3;
|
|
5165
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5166
|
-
value: res.data.value,
|
|
5167
|
-
label: res.data.label
|
|
5168
|
-
}, _extends3)));
|
|
5169
|
-
}
|
|
5170
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5089
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5090
|
+
value: res.data.value,
|
|
5091
|
+
label: res.data.label
|
|
5092
|
+
}, _extends2)));
|
|
5093
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends3 = {}, _extends3[tempKey] = true, _extends3)));
|
|
5171
5094
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5172
5095
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5173
|
-
var
|
|
5174
|
-
return _extends({}, prevState, (
|
|
5096
|
+
var _extends4;
|
|
5097
|
+
return _extends({}, prevState, (_extends4 = {}, _extends4[tempKey] = prevState[tempKey] + 1, _extends4));
|
|
5175
5098
|
});
|
|
5176
5099
|
dispatch(stopLoader());
|
|
5177
5100
|
});
|
|
@@ -5190,8 +5113,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5190
5113
|
try {
|
|
5191
5114
|
var _temp5 = function _temp5() {
|
|
5192
5115
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5193
|
-
var
|
|
5194
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5116
|
+
var _extends5;
|
|
5117
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends5 = {}, _extends5[_name] = true, _extends5)));
|
|
5195
5118
|
}
|
|
5196
5119
|
};
|
|
5197
5120
|
var _name = args._name,
|
|
@@ -5214,8 +5137,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5214
5137
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5215
5138
|
} else {
|
|
5216
5139
|
var _temp3 = function _temp3() {
|
|
5217
|
-
var
|
|
5218
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5140
|
+
var _extends6;
|
|
5141
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends6 = {}, _extends6[_name] = _value, _extends6)));
|
|
5219
5142
|
updateError(_name, _isError, _errorMsg);
|
|
5220
5143
|
};
|
|
5221
5144
|
var _temp2 = function () {
|
|
@@ -5263,7 +5186,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5263
5186
|
}
|
|
5264
5187
|
};
|
|
5265
5188
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5266
|
-
var
|
|
5189
|
+
var _extends7;
|
|
5267
5190
|
var _name = args._name,
|
|
5268
5191
|
_value = args._value,
|
|
5269
5192
|
_isError = args._isError,
|
|
@@ -5272,11 +5195,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5272
5195
|
_name: _name,
|
|
5273
5196
|
_value: _value
|
|
5274
5197
|
});
|
|
5275
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5198
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5276
5199
|
updateError(_name, _isError, _errorMsg);
|
|
5277
5200
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5278
|
-
var
|
|
5279
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5201
|
+
var _extends8;
|
|
5202
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends8 = {}, _extends8[_name] = true, _extends8)));
|
|
5280
5203
|
}
|
|
5281
5204
|
};
|
|
5282
5205
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5286,9 +5209,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5286
5209
|
return tag.id;
|
|
5287
5210
|
};
|
|
5288
5211
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5289
|
-
var
|
|
5212
|
+
var _extends9;
|
|
5290
5213
|
var e = args._event;
|
|
5291
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5214
|
+
setUserTagType(_extends({}, userTagType, (_extends9 = {}, _extends9[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends9)));
|
|
5292
5215
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5293
5216
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5294
5217
|
userTagType: true
|
|
@@ -5296,23 +5219,22 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5296
5219
|
}
|
|
5297
5220
|
};
|
|
5298
5221
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5299
|
-
var
|
|
5222
|
+
var _extends10;
|
|
5300
5223
|
var _name = _ref2._name,
|
|
5301
5224
|
_value = _ref2._value;
|
|
5302
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5225
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends10 = {}, _extends10[_name] = _value, _extends10)));
|
|
5303
5226
|
};
|
|
5304
5227
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5305
|
-
var
|
|
5228
|
+
var _extends11;
|
|
5306
5229
|
var _name = _ref3._name,
|
|
5307
5230
|
_value = _ref3._value;
|
|
5308
|
-
|
|
5309
|
-
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5231
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5310
5232
|
};
|
|
5311
5233
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5312
|
-
var
|
|
5234
|
+
var _extends12;
|
|
5313
5235
|
var _name = _ref4._name,
|
|
5314
5236
|
_value = _ref4._value;
|
|
5315
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5237
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5316
5238
|
};
|
|
5317
5239
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5318
5240
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5346,39 +5268,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5346
5268
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5347
5269
|
};
|
|
5348
5270
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5349
|
-
var
|
|
5271
|
+
var _extends13;
|
|
5350
5272
|
var _name = args._name,
|
|
5351
5273
|
_value = args._value,
|
|
5352
5274
|
_isError = args._isError,
|
|
5353
5275
|
_errorMsg = args._errorMsg;
|
|
5354
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5276
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5355
5277
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5356
|
-
var
|
|
5357
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5278
|
+
var _extends14;
|
|
5279
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends14 = {}, _extends14[_name] = true, _extends14)));
|
|
5358
5280
|
}
|
|
5359
5281
|
updateError(_name, _isError, _errorMsg);
|
|
5360
5282
|
};
|
|
5361
5283
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5362
|
-
var
|
|
5284
|
+
var _extends15;
|
|
5363
5285
|
var _name = args._name,
|
|
5364
5286
|
_value = args._value,
|
|
5365
5287
|
_isError = args._isError,
|
|
5366
5288
|
_errorMsg = args._errorMsg;
|
|
5367
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5289
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends15 = {}, _extends15[_name] = _value, _extends15)));
|
|
5368
5290
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5369
|
-
var
|
|
5370
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5291
|
+
var _extends16;
|
|
5292
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends16 = {}, _extends16[_name] = true, _extends16)));
|
|
5371
5293
|
}
|
|
5372
5294
|
updateError(_name, _isError, _errorMsg);
|
|
5373
5295
|
};
|
|
5374
5296
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5375
5297
|
try {
|
|
5376
5298
|
var _temp8 = function _temp8() {
|
|
5377
|
-
var
|
|
5378
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5299
|
+
var _extends17;
|
|
5300
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends17 = {}, _extends17[_name] = _value, _extends17)));
|
|
5379
5301
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5380
|
-
var
|
|
5381
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5302
|
+
var _extends18;
|
|
5303
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends18 = {}, _extends18[_name] = true, _extends18)));
|
|
5382
5304
|
}
|
|
5383
5305
|
updateError(_name, _isError, _errorMsg);
|
|
5384
5306
|
};
|
|
@@ -5484,8 +5406,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5484
5406
|
return _errorArray;
|
|
5485
5407
|
});
|
|
5486
5408
|
setErrorMsgs(function (prevState) {
|
|
5487
|
-
var
|
|
5488
|
-
return _extends({}, prevState, (
|
|
5409
|
+
var _extends19;
|
|
5410
|
+
return _extends({}, prevState, (_extends19 = {}, _extends19[_name] = _errorMsg, _extends19));
|
|
5489
5411
|
});
|
|
5490
5412
|
};
|
|
5491
5413
|
var dispatch = useDispatch();
|
|
@@ -6814,7 +6736,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6814
6736
|
};
|
|
6815
6737
|
};
|
|
6816
6738
|
|
|
6817
|
-
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","
|
|
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_","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","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6818
6740
|
|
|
6819
6741
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6820
6742
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8300,9 +8222,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8300
8222
|
cell: function cell(row) {
|
|
8301
8223
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8302
8224
|
component: "div",
|
|
8303
|
-
width:
|
|
8225
|
+
width: 80
|
|
8304
8226
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8305
|
-
title: "This user hasn't logged
|
|
8227
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8306
8228
|
arrow: true,
|
|
8307
8229
|
classes: {
|
|
8308
8230
|
arrow: classes.arrow,
|
|
@@ -8310,7 +8232,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8310
8232
|
},
|
|
8311
8233
|
placement: "top-start"
|
|
8312
8234
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8313
|
-
className: clsx(styles$5.
|
|
8235
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8314
8236
|
}, "Invited")) : null);
|
|
8315
8237
|
}
|
|
8316
8238
|
}, {
|
|
@@ -8411,7 +8333,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8411
8333
|
options.push({
|
|
8412
8334
|
label: 'Resend invite',
|
|
8413
8335
|
handler: function handler() {
|
|
8414
|
-
return toggleInviteModal(row.id, 'single');
|
|
8336
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8415
8337
|
}
|
|
8416
8338
|
});
|
|
8417
8339
|
}
|
|
@@ -8583,42 +8505,6 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8583
8505
|
});
|
|
8584
8506
|
};
|
|
8585
8507
|
|
|
8586
|
-
function InfoYellowIcon(props) {
|
|
8587
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8588
|
-
width: props.width,
|
|
8589
|
-
height: props.height,
|
|
8590
|
-
viewBox: "0 0 20 20",
|
|
8591
|
-
fill: "none",
|
|
8592
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8593
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8594
|
-
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",
|
|
8595
|
-
fill: "#CA8A04"
|
|
8596
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8597
|
-
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",
|
|
8598
|
-
fill: "#CA8A04"
|
|
8599
|
-
}), /*#__PURE__*/React.createElement("path", {
|
|
8600
|
-
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",
|
|
8601
|
-
fill: "#CA8A04"
|
|
8602
|
-
}));
|
|
8603
|
-
}
|
|
8604
|
-
|
|
8605
|
-
function RedWarningIcon(props) {
|
|
8606
|
-
var _props$color = props.color,
|
|
8607
|
-
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8608
|
-
_props$size = props.size,
|
|
8609
|
-
size = _props$size === void 0 ? '14' : _props$size;
|
|
8610
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
8611
|
-
width: size,
|
|
8612
|
-
height: size,
|
|
8613
|
-
viewBox: "0 0 14 14",
|
|
8614
|
-
fill: color,
|
|
8615
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
8616
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
8617
|
-
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",
|
|
8618
|
-
fill: color
|
|
8619
|
-
}));
|
|
8620
|
-
}
|
|
8621
|
-
|
|
8622
8508
|
function InviteInfoIcon() {
|
|
8623
8509
|
return /*#__PURE__*/React.createElement("svg", {
|
|
8624
8510
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8636,8 +8522,7 @@ function InviteInfoIcon() {
|
|
|
8636
8522
|
}
|
|
8637
8523
|
|
|
8638
8524
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8639
|
-
var env$7 = configs.env
|
|
8640
|
-
api$7 = configs.api;
|
|
8525
|
+
var env$7 = configs.env;
|
|
8641
8526
|
var UndoButton = function UndoButton(_ref) {
|
|
8642
8527
|
var onUndo = _ref.onUndo,
|
|
8643
8528
|
msg = _ref.msg;
|
|
@@ -8675,33 +8560,21 @@ var UserList = function UserList(_ref2) {
|
|
|
8675
8560
|
isDataFetching = _useSelector.isDataFetching,
|
|
8676
8561
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8677
8562
|
tabValue = _useSelector.tabValue;
|
|
8678
|
-
var
|
|
8679
|
-
|
|
8680
|
-
|
|
8681
|
-
setDeactivateUser = _React$useState[1];
|
|
8682
|
-
var _React$useState2 = React.useState(null),
|
|
8683
|
-
setDefaultId = _React$useState2[1];
|
|
8684
|
-
var _React$useState3 = React.useState(1),
|
|
8685
|
-
page = _React$useState3[0],
|
|
8686
|
-
setPage = _React$useState3[1];
|
|
8687
|
-
var _React$useState4 = React.useState(''),
|
|
8688
|
-
user = _React$useState4[0],
|
|
8689
|
-
setUser = _React$useState4[1];
|
|
8563
|
+
var _React$useState = React.useState(1),
|
|
8564
|
+
page = _React$useState[0],
|
|
8565
|
+
setPage = _React$useState[1];
|
|
8690
8566
|
var _useState = useState(10),
|
|
8691
8567
|
rowsPerPage = _useState[0],
|
|
8692
8568
|
setRowsPerPage = _useState[1];
|
|
8693
|
-
var _React$
|
|
8694
|
-
selected = _React$
|
|
8695
|
-
setSelected = _React$
|
|
8696
|
-
var _React$
|
|
8697
|
-
order = _React$
|
|
8698
|
-
setOrder = _React$
|
|
8699
|
-
var _React$
|
|
8700
|
-
|
|
8701
|
-
|
|
8702
|
-
var _React$useState8 = React.useState('first_name'),
|
|
8703
|
-
orderBy = _React$useState8[0],
|
|
8704
|
-
setOrderBy = _React$useState8[1];
|
|
8569
|
+
var _React$useState2 = React.useState({}),
|
|
8570
|
+
selected = _React$useState2[0],
|
|
8571
|
+
setSelected = _React$useState2[1];
|
|
8572
|
+
var _React$useState3 = React.useState('asc'),
|
|
8573
|
+
order = _React$useState3[0],
|
|
8574
|
+
setOrder = _React$useState3[1];
|
|
8575
|
+
var _React$useState4 = React.useState('first_name'),
|
|
8576
|
+
orderBy = _React$useState4[0],
|
|
8577
|
+
setOrderBy = _React$useState4[1];
|
|
8705
8578
|
var _useState2 = useState(''),
|
|
8706
8579
|
searchValue = _useState2[0],
|
|
8707
8580
|
setSearchValue = _useState2[1];
|
|
@@ -8719,44 +8592,38 @@ var UserList = function UserList(_ref2) {
|
|
|
8719
8592
|
isOpenImportUsersModal = _useState4[0],
|
|
8720
8593
|
setOpenImportUsersModal = _useState4[1];
|
|
8721
8594
|
var _useState5 = useState(false),
|
|
8722
|
-
|
|
8723
|
-
|
|
8595
|
+
isFileDownloading = _useState5[0],
|
|
8596
|
+
setDownlStatus = _useState5[1];
|
|
8724
8597
|
var _useState6 = useState(false),
|
|
8725
|
-
|
|
8726
|
-
|
|
8598
|
+
isSortingChange = _useState6[0],
|
|
8599
|
+
setSortingChange = _useState6[1];
|
|
8727
8600
|
var _useState7 = useState(false),
|
|
8728
|
-
|
|
8729
|
-
|
|
8601
|
+
isSearchingChange = _useState7[0],
|
|
8602
|
+
setSearchingChange = _useState7[1];
|
|
8730
8603
|
var _useState8 = useState(false),
|
|
8731
|
-
|
|
8732
|
-
|
|
8604
|
+
isSortingChangeTemp = _useState8[0],
|
|
8605
|
+
setSortingChangeTemp = _useState8[1];
|
|
8733
8606
|
var _useState9 = useState(false),
|
|
8734
|
-
|
|
8735
|
-
|
|
8607
|
+
isSearchingChangeTemp = _useState9[0],
|
|
8608
|
+
setSearchingChangeTemp = _useState9[1];
|
|
8736
8609
|
var _useState10 = useState(false),
|
|
8737
|
-
|
|
8738
|
-
|
|
8610
|
+
isApiFetching = _useState10[0],
|
|
8611
|
+
setisApiFetching = _useState10[1];
|
|
8739
8612
|
var _useState11 = useState(false),
|
|
8740
|
-
|
|
8741
|
-
|
|
8742
|
-
var _useState12 = useState(
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8747
|
-
|
|
8748
|
-
var _useState13 = useState(
|
|
8749
|
-
|
|
8750
|
-
|
|
8613
|
+
showInviteModal = _useState11[0],
|
|
8614
|
+
setToggleInviteModal = _useState11[1];
|
|
8615
|
+
var _useState12 = useState(''),
|
|
8616
|
+
userIds = _useState12[0],
|
|
8617
|
+
setUserIds = _useState12[1];
|
|
8618
|
+
var _React$useState5 = React.useState(false),
|
|
8619
|
+
overlayMenu = _React$useState5[0],
|
|
8620
|
+
setOverlayMenu = _React$useState5[1];
|
|
8621
|
+
var _useState13 = useState(''),
|
|
8622
|
+
userFirstName = _useState13[0],
|
|
8623
|
+
setUserFirstName = _useState13[1];
|
|
8751
8624
|
var _useState14 = useState(''),
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
var _React$useState9 = React.useState(false),
|
|
8755
|
-
overlayMenu = _React$useState9[0],
|
|
8756
|
-
setOverlayMenu = _React$useState9[1];
|
|
8757
|
-
var _useState15 = useState(true),
|
|
8758
|
-
isDisabledSubmitBtn = _useState15[0],
|
|
8759
|
-
setIsDisabledSubmitBtn = _useState15[1];
|
|
8625
|
+
userLastName = _useState14[0],
|
|
8626
|
+
setUserLastName = _useState14[1];
|
|
8760
8627
|
useScrollPosition(function (_ref3) {
|
|
8761
8628
|
var prevPos = _ref3.prevPos,
|
|
8762
8629
|
currPos = _ref3.currPos;
|
|
@@ -8777,40 +8644,37 @@ var UserList = function UserList(_ref2) {
|
|
|
8777
8644
|
behavior: 'smooth'
|
|
8778
8645
|
});
|
|
8779
8646
|
};
|
|
8780
|
-
var _React$
|
|
8781
|
-
signup_page = _React$
|
|
8782
|
-
setSignUpPage = _React$
|
|
8783
|
-
var
|
|
8784
|
-
signup_rowsPerPage =
|
|
8785
|
-
setSignUpRowsPerPage =
|
|
8786
|
-
var _React$
|
|
8787
|
-
signup_order = _React$
|
|
8788
|
-
setSignUpOrder = _React$
|
|
8789
|
-
var _React$
|
|
8790
|
-
signup_orderBy = _React$
|
|
8791
|
-
setSignUpOrderBy = _React$
|
|
8792
|
-
var
|
|
8793
|
-
signup_searchValue =
|
|
8794
|
-
set_signup_SearchValue =
|
|
8647
|
+
var _React$useState6 = React.useState(1),
|
|
8648
|
+
signup_page = _React$useState6[0],
|
|
8649
|
+
setSignUpPage = _React$useState6[1];
|
|
8650
|
+
var _useState15 = useState(5),
|
|
8651
|
+
signup_rowsPerPage = _useState15[0],
|
|
8652
|
+
setSignUpRowsPerPage = _useState15[1];
|
|
8653
|
+
var _React$useState7 = React.useState('asc'),
|
|
8654
|
+
signup_order = _React$useState7[0],
|
|
8655
|
+
setSignUpOrder = _React$useState7[1];
|
|
8656
|
+
var _React$useState8 = React.useState('fname'),
|
|
8657
|
+
signup_orderBy = _React$useState8[0],
|
|
8658
|
+
setSignUpOrderBy = _React$useState8[1];
|
|
8659
|
+
var _useState16 = useState(''),
|
|
8660
|
+
signup_searchValue = _useState16[0],
|
|
8661
|
+
set_signup_SearchValue = _useState16[1];
|
|
8662
|
+
var _useState17 = useState(false),
|
|
8663
|
+
isSignUpSortingChange = _useState17[0],
|
|
8664
|
+
setSignUpSortingChange = _useState17[1];
|
|
8795
8665
|
var _useState18 = useState(false),
|
|
8796
|
-
|
|
8797
|
-
|
|
8666
|
+
isSignUpSearchingChange = _useState18[0],
|
|
8667
|
+
setSignUpSearchingChange = _useState18[1];
|
|
8798
8668
|
var _useState19 = useState(false),
|
|
8799
|
-
|
|
8800
|
-
|
|
8669
|
+
isSignUpSortingChangeTemp = _useState19[0],
|
|
8670
|
+
setSignUpSortingChangeTemp = _useState19[1];
|
|
8801
8671
|
var _useState20 = useState(false),
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
var _useState21 = useState(false),
|
|
8805
|
-
isSignUpSearchingChangeTemp = _useState21[0],
|
|
8806
|
-
setSignUpSearchingChangeTemp = _useState21[1];
|
|
8672
|
+
isSignUpSearchingChangeTemp = _useState20[0],
|
|
8673
|
+
setSignUpSearchingChangeTemp = _useState20[1];
|
|
8807
8674
|
var _useSelector3 = useSelector(function (state) {
|
|
8808
8675
|
return state.userList;
|
|
8809
8676
|
}),
|
|
8810
8677
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8811
|
-
var redirectToNotifications = function redirectToNotifications() {
|
|
8812
|
-
history.push(config.routes.notification.path);
|
|
8813
|
-
};
|
|
8814
8678
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8815
8679
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8816
8680
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
@@ -8868,12 +8732,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8868
8732
|
};
|
|
8869
8733
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8870
8734
|
var _extends2;
|
|
8871
|
-
var
|
|
8735
|
+
var newSelecteds = userListInfo.results.filter(function (n) {
|
|
8872
8736
|
return n.is_active;
|
|
8873
8737
|
}).map(function (obj) {
|
|
8874
8738
|
return obj.id.toString();
|
|
8875
8739
|
});
|
|
8876
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] =
|
|
8740
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = newSelecteds, _extends2)));
|
|
8877
8741
|
};
|
|
8878
8742
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8879
8743
|
var _extends3;
|
|
@@ -8907,43 +8771,18 @@ var UserList = function UserList(_ref2) {
|
|
|
8907
8771
|
selectedTemp[page] = [];
|
|
8908
8772
|
}
|
|
8909
8773
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8910
|
-
var
|
|
8774
|
+
var newSelected = [];
|
|
8911
8775
|
if (selectedIndex === -1) {
|
|
8912
|
-
|
|
8776
|
+
newSelected = newSelected.concat(selectedTemp[page], id);
|
|
8913
8777
|
} else if (selectedIndex === 0) {
|
|
8914
|
-
|
|
8778
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(1));
|
|
8915
8779
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8916
|
-
|
|
8780
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8917
8781
|
} else if (selectedIndex > 0) {
|
|
8918
|
-
|
|
8782
|
+
newSelected = newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8919
8783
|
}
|
|
8920
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] =
|
|
8784
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = newSelected, _extends4)));
|
|
8921
8785
|
};
|
|
8922
|
-
useEffect(function () {
|
|
8923
|
-
setApproverRole({
|
|
8924
|
-
value: '',
|
|
8925
|
-
label: 'Select approver'
|
|
8926
|
-
});
|
|
8927
|
-
setIsDisabledSubmitBtn(true);
|
|
8928
|
-
setApproveeStatus(false);
|
|
8929
|
-
if (deactivateSingle === true) {
|
|
8930
|
-
api$7.get(userAddEditUrl._approversSearch() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
8931
|
-
setDefaultId(response.data["default"].id);
|
|
8932
|
-
response.data.results.map(function (item) {
|
|
8933
|
-
if (response.data["default"].id === item.id) {
|
|
8934
|
-
setApproverRole({
|
|
8935
|
-
value: '',
|
|
8936
|
-
label: item.email
|
|
8937
|
-
});
|
|
8938
|
-
setIsDisabledSubmitBtn(false);
|
|
8939
|
-
if (item.approvee_status) {
|
|
8940
|
-
setApproveeStatus(true);
|
|
8941
|
-
}
|
|
8942
|
-
}
|
|
8943
|
-
});
|
|
8944
|
-
});
|
|
8945
|
-
}
|
|
8946
|
-
}, [deactivateSingle]);
|
|
8947
8786
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8948
8787
|
setRowsPerPage(+event.target.value);
|
|
8949
8788
|
setPage(1);
|
|
@@ -8953,43 +8792,20 @@ var UserList = function UserList(_ref2) {
|
|
|
8953
8792
|
};
|
|
8954
8793
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8955
8794
|
var isActive = e.target.checked;
|
|
8956
|
-
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
|
|
8960
|
-
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
setUser(item);
|
|
8964
|
-
} else {
|
|
8965
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
8966
|
-
if (!isActive) {
|
|
8967
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8968
|
-
var _extends5;
|
|
8969
|
-
var selectedTemp = _extends({}, selected);
|
|
8970
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8971
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
8972
|
-
}
|
|
8973
|
-
}
|
|
8974
|
-
});
|
|
8795
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8796
|
+
if (!isActive) {
|
|
8797
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8798
|
+
var _extends5;
|
|
8799
|
+
var selectedTemp = _extends({}, selected);
|
|
8800
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8801
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
8975
8802
|
}
|
|
8976
8803
|
}
|
|
8977
8804
|
});
|
|
8978
8805
|
};
|
|
8979
|
-
var selectApprover = function selectApprover(_ref4) {
|
|
8980
|
-
var _value = _ref4._value;
|
|
8981
|
-
if (_value.data.approvee_status) {
|
|
8982
|
-
setApproveeStatus(true);
|
|
8983
|
-
} else {
|
|
8984
|
-
setApproveeStatus(false);
|
|
8985
|
-
}
|
|
8986
|
-
setApproverRole(_value);
|
|
8987
|
-
setIsDisabledSubmitBtn(false);
|
|
8988
|
-
};
|
|
8989
8806
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8990
|
-
dispatch(
|
|
8807
|
+
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8991
8808
|
setOpenDeActivateModalFlag(false);
|
|
8992
|
-
setDeactivateSingle(false);
|
|
8993
8809
|
setSelected({});
|
|
8994
8810
|
};
|
|
8995
8811
|
var importUserHandler = function importUserHandler() {
|
|
@@ -9007,13 +8823,19 @@ var UserList = function UserList(_ref2) {
|
|
|
9007
8823
|
email: email
|
|
9008
8824
|
}));
|
|
9009
8825
|
};
|
|
9010
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
|
|
9014
|
-
|
|
8826
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
8827
|
+
if (type === undefined) {
|
|
8828
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8829
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
8830
|
+
return false;
|
|
8831
|
+
}
|
|
9015
8832
|
}
|
|
9016
8833
|
setUserIds(ids);
|
|
8834
|
+
setUserFirstName(firstName);
|
|
8835
|
+
setUserLastName(lastName);
|
|
8836
|
+
setToggleInviteModal(!showInviteModal);
|
|
8837
|
+
};
|
|
8838
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
9017
8839
|
setToggleInviteModal(!showInviteModal);
|
|
9018
8840
|
};
|
|
9019
8841
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -9337,11 +9159,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9337
9159
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9338
9160
|
variant: "body2",
|
|
9339
9161
|
className: clsx(styles$5.description)
|
|
9340
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in",
|
|
9341
|
-
variant: "span",
|
|
9342
|
-
onClick: config.routes.notification && redirectToNotifications,
|
|
9343
|
-
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9344
|
-
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9162
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in Notifications.")), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9345
9163
|
data: signupRequestListInfo,
|
|
9346
9164
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9347
9165
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9373,45 +9191,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9373
9191
|
}))
|
|
9374
9192
|
}]
|
|
9375
9193
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9376
|
-
isOpen: deactivateSingle,
|
|
9377
|
-
closeHandler: function closeHandler() {
|
|
9378
|
-
setDeactivateSingle(false);
|
|
9379
|
-
},
|
|
9380
|
-
cancelLabel: "Cancel",
|
|
9381
|
-
submitLabel: "Deactivate",
|
|
9382
|
-
submitHandler: handleDeactivateUsers,
|
|
9383
|
-
headerText: "Deactivate this user?",
|
|
9384
|
-
width: "400px",
|
|
9385
|
-
subHanderText: "",
|
|
9386
|
-
submitBtnClass: styles$5.deactivateBtn,
|
|
9387
|
-
isDisabledSubmitBtn: isDisabledSubmitBtn
|
|
9388
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9389
|
-
className: styles$5.deactivateSingle
|
|
9390
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9391
|
-
className: styles$5.deactivateAlert
|
|
9392
|
-
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9393
|
-
width: "9",
|
|
9394
|
-
height: "9"
|
|
9395
|
-
}), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9396
|
-
className: "iui__my-15"
|
|
9397
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9398
|
-
isMove: true,
|
|
9399
|
-
additional: {
|
|
9400
|
-
page: 1,
|
|
9401
|
-
product: 'travel',
|
|
9402
|
-
userId: user.id
|
|
9403
|
-
},
|
|
9404
|
-
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
9405
|
-
label: "Transfer approver role to",
|
|
9406
|
-
value: approverRole,
|
|
9407
|
-
onValueChange: selectApprover,
|
|
9408
|
-
loadOption: approversOptions,
|
|
9409
|
-
disableText: "Please get in touch with your administrator to change this value."
|
|
9410
|
-
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9411
|
-
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9412
|
-
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9413
|
-
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9414
|
-
}, "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, {
|
|
9415
9194
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9416
9195
|
closeHandler: closeDeActivateModal,
|
|
9417
9196
|
cancelLabel: "Cancel",
|
|
@@ -9439,7 +9218,9 @@ var UserList = function UserList(_ref2) {
|
|
|
9439
9218
|
className: styles$5.description
|
|
9440
9219
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9441
9220
|
isOpen: showInviteModal,
|
|
9442
|
-
closeHandler:
|
|
9221
|
+
closeHandler: function closeHandler() {
|
|
9222
|
+
return toggleInviteModalClose();
|
|
9223
|
+
},
|
|
9443
9224
|
cancelLabel: "Cancel",
|
|
9444
9225
|
headerText: "Resend Invites?",
|
|
9445
9226
|
submitLabel: "Send",
|
|
@@ -9471,7 +9252,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9471
9252
|
fontSize: '14px',
|
|
9472
9253
|
color: '#374151'
|
|
9473
9254
|
}
|
|
9474
|
-
}, "This invitation will be sent to
|
|
9255
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9256
|
+
style: {
|
|
9257
|
+
fontSize: '14px',
|
|
9258
|
+
color: '#374151',
|
|
9259
|
+
fontWeight: 'bold'
|
|
9260
|
+
}
|
|
9261
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9475
9262
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9476
9263
|
closeImportUsersModal: closeImportUsersModal,
|
|
9477
9264
|
closeImportModal: closeImportModal
|
|
@@ -9480,8 +9267,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9480
9267
|
errMsg: hasVerificationError
|
|
9481
9268
|
}));
|
|
9482
9269
|
};
|
|
9483
|
-
var TabLabelCount = function TabLabelCount(
|
|
9484
|
-
var count =
|
|
9270
|
+
var TabLabelCount = function TabLabelCount(_ref4) {
|
|
9271
|
+
var count = _ref4.count;
|
|
9485
9272
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9486
9273
|
className: styles$5.TabLabelCount
|
|
9487
9274
|
}, " ", count, " ");
|
|
@@ -9556,12 +9343,11 @@ function Header(props) {
|
|
|
9556
9343
|
})));
|
|
9557
9344
|
}
|
|
9558
9345
|
|
|
9559
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","
|
|
9346
|
+
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"};
|
|
9560
9347
|
|
|
9561
9348
|
function Listview(_ref) {
|
|
9562
9349
|
var data = _ref.data,
|
|
9563
9350
|
name = _ref.name,
|
|
9564
|
-
tableName = _ref.tableName,
|
|
9565
9351
|
handleEditDialog = _ref.handleEditDialog,
|
|
9566
9352
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9567
9353
|
orderBy = _ref.orderBy,
|
|
@@ -9574,82 +9360,16 @@ function Listview(_ref) {
|
|
|
9574
9360
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9575
9361
|
page = _ref.page,
|
|
9576
9362
|
rowsPerPage = _ref.rowsPerPage;
|
|
9577
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9578
|
-
var _data$dept_head_detai;
|
|
9579
|
-
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) {
|
|
9580
|
-
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9581
|
-
}
|
|
9582
|
-
};
|
|
9583
9363
|
var columns = [{
|
|
9584
9364
|
id: 'name',
|
|
9585
9365
|
label: name,
|
|
9586
|
-
width: '
|
|
9587
|
-
sortable: true,
|
|
9588
|
-
cell: function cell(row) {
|
|
9589
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9590
|
-
component: "div"
|
|
9591
|
-
}, row.name);
|
|
9592
|
-
}
|
|
9593
|
-
}, {
|
|
9594
|
-
id: 'no_of_users',
|
|
9595
|
-
label: 'Number of users',
|
|
9596
|
-
width: '40%',
|
|
9597
|
-
sortable: true,
|
|
9598
|
-
cell: function cell(row) {
|
|
9599
|
-
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9600
|
-
component: "div"
|
|
9601
|
-
}, row.no_of_users);
|
|
9602
|
-
}
|
|
9603
|
-
}, {
|
|
9604
|
-
id: 'actions',
|
|
9605
|
-
label: 'Actions',
|
|
9606
|
-
width: '20%',
|
|
9607
|
-
cell: function cell(row) {
|
|
9608
|
-
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9609
|
-
display: "flex"
|
|
9610
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9611
|
-
buttonText: "Edit",
|
|
9612
|
-
className: styles$7.buttonWidth,
|
|
9613
|
-
onClick: function onClick() {
|
|
9614
|
-
return handleEditDialog(row);
|
|
9615
|
-
}
|
|
9616
|
-
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9617
|
-
buttonText: "Delete",
|
|
9618
|
-
className: styles$7.buttonWidth,
|
|
9619
|
-
onClick: function onClick() {
|
|
9620
|
-
return handleDeleteDialog(row, true);
|
|
9621
|
-
}
|
|
9622
|
-
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9623
|
-
buttonText: "Delete",
|
|
9624
|
-
className: styles$7.buttonWidth,
|
|
9625
|
-
onClick: function onClick() {
|
|
9626
|
-
return handleDeleteDialog(row, false);
|
|
9627
|
-
}
|
|
9628
|
-
}));
|
|
9629
|
-
}
|
|
9630
|
-
}];
|
|
9631
|
-
var departmentColumns = [{
|
|
9632
|
-
id: 'name',
|
|
9633
|
-
label: name,
|
|
9634
|
-
width: '30%',
|
|
9366
|
+
width: '45%',
|
|
9635
9367
|
sortable: true,
|
|
9636
9368
|
cell: function cell(row) {
|
|
9637
9369
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9638
9370
|
component: "div"
|
|
9639
9371
|
}, row.name);
|
|
9640
9372
|
}
|
|
9641
|
-
}, {
|
|
9642
|
-
id: 'department_head',
|
|
9643
|
-
label: 'Department head',
|
|
9644
|
-
width: '30%',
|
|
9645
|
-
sortable: true,
|
|
9646
|
-
cell: function cell(row) {
|
|
9647
|
-
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9648
|
-
component: "div"
|
|
9649
|
-
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9650
|
-
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9651
|
-
}, "Assigned by default"));
|
|
9652
|
-
}
|
|
9653
9373
|
}, {
|
|
9654
9374
|
id: 'no_of_users',
|
|
9655
9375
|
label: 'Number of users',
|
|
@@ -9663,7 +9383,7 @@ function Listview(_ref) {
|
|
|
9663
9383
|
}, {
|
|
9664
9384
|
id: 'actions',
|
|
9665
9385
|
label: 'Actions',
|
|
9666
|
-
width: '
|
|
9386
|
+
width: '10%',
|
|
9667
9387
|
cell: function cell(row) {
|
|
9668
9388
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9669
9389
|
display: "flex"
|
|
@@ -9696,7 +9416,7 @@ function Listview(_ref) {
|
|
|
9696
9416
|
hasFilter: true,
|
|
9697
9417
|
isCheckboxTable: false,
|
|
9698
9418
|
count: data.count,
|
|
9699
|
-
columns:
|
|
9419
|
+
columns: columns,
|
|
9700
9420
|
rows: data.results,
|
|
9701
9421
|
page: page,
|
|
9702
9422
|
handleChangePage: handleChangePage,
|
|
@@ -9753,44 +9473,15 @@ function EditPanelDialog(_ref) {
|
|
|
9753
9473
|
var isOpen = _ref.isOpen,
|
|
9754
9474
|
closeHandler = _ref.closeHandler,
|
|
9755
9475
|
onValueChange = _ref.onValueChange,
|
|
9756
|
-
|
|
9476
|
+
submitHandler = _ref.submitHandler,
|
|
9757
9477
|
isError = _ref.isError,
|
|
9758
9478
|
name = _ref.name,
|
|
9759
9479
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9760
|
-
validation = _ref.validation
|
|
9761
|
-
rowData = _ref.rowData,
|
|
9762
|
-
tableName = _ref.tableName,
|
|
9763
|
-
config = _ref.config;
|
|
9480
|
+
validation = _ref.validation;
|
|
9764
9481
|
var _useSelector = useSelector(function (state) {
|
|
9765
9482
|
return state.userPanel;
|
|
9766
9483
|
}),
|
|
9767
9484
|
dialogData = _useSelector.dialogData;
|
|
9768
|
-
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9769
|
-
var _data$dept_head_detai;
|
|
9770
|
-
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) {
|
|
9771
|
-
setHead({
|
|
9772
|
-
value: data.dept_head_details[0].id,
|
|
9773
|
-
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9774
|
-
});
|
|
9775
|
-
}
|
|
9776
|
-
};
|
|
9777
|
-
var _useState = useState({
|
|
9778
|
-
value: '',
|
|
9779
|
-
label: 'Select'
|
|
9780
|
-
}),
|
|
9781
|
-
head = _useState[0],
|
|
9782
|
-
setHead = _useState[1];
|
|
9783
|
-
useEffect(function () {
|
|
9784
|
-
deptHeadDetails(rowData);
|
|
9785
|
-
}, [rowData]);
|
|
9786
|
-
var history = useHistory();
|
|
9787
|
-
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9788
|
-
console.log(rowData);
|
|
9789
|
-
history.push({
|
|
9790
|
-
pathname: config.routes.users.add.path,
|
|
9791
|
-
state: rowData
|
|
9792
|
-
});
|
|
9793
|
-
};
|
|
9794
9485
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9795
9486
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9796
9487
|
isOpen: isOpen,
|
|
@@ -9798,59 +9489,25 @@ function EditPanelDialog(_ref) {
|
|
|
9798
9489
|
headerText: "Edit " + name.toLowerCase(),
|
|
9799
9490
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9800
9491
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9801
|
-
submitHandler:
|
|
9802
|
-
|
|
9803
|
-
},
|
|
9804
|
-
width: tableName === 'department' ? '400px' : '365px',
|
|
9492
|
+
submitHandler: submitHandler,
|
|
9493
|
+
width: "365px",
|
|
9805
9494
|
hideCloseIcon: false,
|
|
9806
9495
|
modalBodyStyle: {
|
|
9807
|
-
|
|
9496
|
+
maxHeight: '400px',
|
|
9497
|
+
overflow: 'auto',
|
|
9498
|
+
margin: '0px'
|
|
9808
9499
|
},
|
|
9809
9500
|
footerStyle: {
|
|
9810
9501
|
justifyContent: 'end'
|
|
9811
9502
|
}
|
|
9812
|
-
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9813
|
-
display: "flex",
|
|
9814
|
-
justifyContent: "center",
|
|
9815
|
-
alignItems: "center",
|
|
9816
|
-
flexDirection: "column",
|
|
9817
|
-
style: {
|
|
9818
|
-
marginBottom: '30px'
|
|
9819
|
-
}
|
|
9820
9503
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9504
|
+
component: "div",
|
|
9821
9505
|
display: "flex",
|
|
9822
9506
|
justifyContent: "center",
|
|
9823
9507
|
alignItems: "center",
|
|
9824
9508
|
flexDirection: "column",
|
|
9825
|
-
|
|
9826
|
-
}, /*#__PURE__*/React.createElement(
|
|
9827
|
-
className: styles$7.alertDescContainer
|
|
9828
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9829
|
-
className: styles$7.iconLayout,
|
|
9830
|
-
style: {
|
|
9831
|
-
paddingTop: '4px'
|
|
9832
|
-
}
|
|
9833
|
-
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
9834
|
-
color: "#CA8A04",
|
|
9835
|
-
width: "25",
|
|
9836
|
-
height: "20",
|
|
9837
|
-
className: styles$7.iconStyle
|
|
9838
|
-
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
9839
|
-
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.",
|
|
9840
|
-
style: {
|
|
9841
|
-
fontWeight: 'normal'
|
|
9842
|
-
}
|
|
9843
|
-
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
9844
|
-
buttonText: "Add user",
|
|
9845
|
-
type: "text",
|
|
9846
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9847
|
-
width: "9",
|
|
9848
|
-
height: "9",
|
|
9849
|
-
color: "#EC5D25"
|
|
9850
|
-
}),
|
|
9851
|
-
onClick: handleAddPageNavigation,
|
|
9852
|
-
className: styles$7.addUserButton
|
|
9853
|
-
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9509
|
+
padding: "8px 24px"
|
|
9510
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9854
9511
|
label: name + " name",
|
|
9855
9512
|
name: "name",
|
|
9856
9513
|
defaultValue: dialogData.data.name,
|
|
@@ -9859,49 +9516,7 @@ function EditPanelDialog(_ref) {
|
|
|
9859
9516
|
isError: isError,
|
|
9860
9517
|
validation: validation,
|
|
9861
9518
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9862
|
-
required: true
|
|
9863
|
-
style: tableName === 'department' && {
|
|
9864
|
-
width: '350px'
|
|
9865
|
-
}
|
|
9866
|
-
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9867
|
-
className: "iui__mt-15",
|
|
9868
|
-
style: {
|
|
9869
|
-
width: '100%'
|
|
9870
|
-
}
|
|
9871
|
-
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9872
|
-
label: "Department head",
|
|
9873
|
-
name: "name",
|
|
9874
|
-
defaultValue: head.label,
|
|
9875
|
-
placeholder: "",
|
|
9876
|
-
readOnly: true,
|
|
9877
|
-
style: {
|
|
9878
|
-
width: '350px'
|
|
9879
|
-
}
|
|
9880
|
-
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9881
|
-
className: "iui__mt-15",
|
|
9882
|
-
style: {
|
|
9883
|
-
width: '100%'
|
|
9884
|
-
}
|
|
9885
|
-
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9886
|
-
noResultsText: true,
|
|
9887
|
-
isMove: true,
|
|
9888
|
-
additional: {
|
|
9889
|
-
page: 1,
|
|
9890
|
-
departmentId: rowData.id
|
|
9891
|
-
},
|
|
9892
|
-
placeHolderCheck: head !== undefined && head.value === '',
|
|
9893
|
-
label: "Department head",
|
|
9894
|
-
value: head,
|
|
9895
|
-
onValueChange: function onValueChange(_ref2) {
|
|
9896
|
-
var _value = _ref2._value;
|
|
9897
|
-
return setHead(_value);
|
|
9898
|
-
},
|
|
9899
|
-
loadOption: departmentHeadOptions,
|
|
9900
|
-
disableText: "Please get in touch with your administrator to change this value.",
|
|
9901
|
-
customLoadingText: "No users found in this department",
|
|
9902
|
-
customLoadingTextStyle: {
|
|
9903
|
-
color: '#374151'
|
|
9904
|
-
}
|
|
9519
|
+
required: true
|
|
9905
9520
|
})));
|
|
9906
9521
|
}
|
|
9907
9522
|
|
|
@@ -10080,15 +9695,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10080
9695
|
var _useState13 = useState(false),
|
|
10081
9696
|
isSortingChangeTemp = _useState13[0],
|
|
10082
9697
|
setSortingChangeTemp = _useState13[1];
|
|
10083
|
-
var _useState14 = useState(
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
var _useState15 = useState(
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
var _useState16 = useState(5),
|
|
10090
|
-
rowsPerPage = _useState16[0],
|
|
10091
|
-
setRowsPerPage = _useState16[1];
|
|
9698
|
+
var _useState14 = useState(1),
|
|
9699
|
+
page = _useState14[0],
|
|
9700
|
+
setPage = _useState14[1];
|
|
9701
|
+
var _useState15 = useState(5),
|
|
9702
|
+
rowsPerPage = _useState15[0],
|
|
9703
|
+
setRowsPerPage = _useState15[1];
|
|
10092
9704
|
var orderingParam = orderBy;
|
|
10093
9705
|
var _useSelector = useSelector(function (state) {
|
|
10094
9706
|
return state.userPanel;
|
|
@@ -10184,7 +9796,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10184
9796
|
submitLabel: 'Save'
|
|
10185
9797
|
}, '', data));
|
|
10186
9798
|
setDataList(data.name);
|
|
10187
|
-
setRowData(data);
|
|
10188
9799
|
setEditModal(true);
|
|
10189
9800
|
};
|
|
10190
9801
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -10199,12 +9810,6 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10199
9810
|
var payload = {
|
|
10200
9811
|
names: [dataList]
|
|
10201
9812
|
};
|
|
10202
|
-
if (tableName === 'department') {
|
|
10203
|
-
payload = {
|
|
10204
|
-
name: dataList,
|
|
10205
|
-
department_head_id: null
|
|
10206
|
-
};
|
|
10207
|
-
}
|
|
10208
9813
|
var message = title + " added successfully.";
|
|
10209
9814
|
handleApiCall(addRecord, payload, message, 'add');
|
|
10210
9815
|
} else {
|
|
@@ -10218,12 +9823,9 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10218
9823
|
var message = title + " deleted successfully.";
|
|
10219
9824
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
10220
9825
|
};
|
|
10221
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type
|
|
10222
|
-
if (optionalParams === void 0) {
|
|
10223
|
-
optionalParams = null;
|
|
10224
|
-
}
|
|
9826
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10225
9827
|
dispatch(userPanelShowLoader());
|
|
10226
|
-
dispatch(dispatchFun(tableName, payload, getApiData()
|
|
9828
|
+
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10227
9829
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
10228
9830
|
dispatch(userPanelStopLoader());
|
|
10229
9831
|
if (type === 'delete') {
|
|
@@ -10265,14 +9867,8 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10265
9867
|
name: dataList
|
|
10266
9868
|
}]
|
|
10267
9869
|
};
|
|
10268
|
-
if (tableName === 'department') {
|
|
10269
|
-
payload = {
|
|
10270
|
-
name: dataList,
|
|
10271
|
-
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10272
|
-
};
|
|
10273
|
-
}
|
|
10274
9870
|
var message = title + " updated successfully.";
|
|
10275
|
-
handleApiCall(editRecord, payload, message, 'edit'
|
|
9871
|
+
handleApiCall(editRecord, payload, message, 'edit');
|
|
10276
9872
|
setErrorEdit(false);
|
|
10277
9873
|
} else {
|
|
10278
9874
|
setErrorEdit(true);
|
|
@@ -10379,10 +9975,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10379
9975
|
submitHandler: handleEditPanel,
|
|
10380
9976
|
isError: errorEdit,
|
|
10381
9977
|
isDisabledSubmitBtn: loading,
|
|
10382
|
-
validation: validation
|
|
10383
|
-
rowData: rowData,
|
|
10384
|
-
tableName: tableName,
|
|
10385
|
-
config: config
|
|
9978
|
+
validation: validation
|
|
10386
9979
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10387
9980
|
config: config
|
|
10388
9981
|
}));
|