@itilite/iui-user-management 1.2.0 → 1.3.1
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 +82 -7
- package/dist/index.js +623 -161
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +626 -164
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var Switch = _interopDefault(require('@material-ui/core/Switch'));
|
|
|
19
19
|
var MoreHorizIcon = _interopDefault(require('@material-ui/icons/MoreHoriz'));
|
|
20
20
|
var Button = _interopDefault(require('@material-ui/core/Button'));
|
|
21
21
|
var core = require('@material-ui/core');
|
|
22
|
+
var useScrollPosition = require('@n8tb1t/use-scroll-position');
|
|
22
23
|
|
|
23
24
|
function _extends() {
|
|
24
25
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -458,6 +459,14 @@ var userPanelUrl = {
|
|
|
458
459
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
459
460
|
}
|
|
460
461
|
};
|
|
462
|
+
var departmentUrl = {
|
|
463
|
+
departmentUrl: function departmentUrl() {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
465
|
+
},
|
|
466
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
467
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
461
470
|
|
|
462
471
|
var api = utils.configs.api;
|
|
463
472
|
var NAoptionConfig = {
|
|
@@ -686,6 +695,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
686
695
|
return Promise.reject(e);
|
|
687
696
|
}
|
|
688
697
|
};
|
|
698
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
|
|
699
|
+
var page = _ref6.page,
|
|
700
|
+
departmentId = _ref6.departmentId;
|
|
701
|
+
try {
|
|
702
|
+
return Promise.resolve(_catch(function () {
|
|
703
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
704
|
+
return res.data;
|
|
705
|
+
})).then(function (response) {
|
|
706
|
+
var mappedValue = response.results.map(function (item) {
|
|
707
|
+
return {
|
|
708
|
+
value: item.id,
|
|
709
|
+
label: item.first_name + ' ' + item.last_name,
|
|
710
|
+
type: 'detailed',
|
|
711
|
+
data: item
|
|
712
|
+
};
|
|
713
|
+
});
|
|
714
|
+
console.log(response.next);
|
|
715
|
+
return {
|
|
716
|
+
options: mappedValue,
|
|
717
|
+
hasMore: !!response.next,
|
|
718
|
+
additional: {
|
|
719
|
+
page: page + 1,
|
|
720
|
+
departmentId: departmentId
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
});
|
|
724
|
+
}, function () {
|
|
725
|
+
return {
|
|
726
|
+
options: [],
|
|
727
|
+
hasMore: false,
|
|
728
|
+
additional: {
|
|
729
|
+
page: 1,
|
|
730
|
+
departmentId: departmentId
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
}));
|
|
734
|
+
} catch (e) {
|
|
735
|
+
return Promise.reject(e);
|
|
736
|
+
}
|
|
737
|
+
};
|
|
689
738
|
|
|
690
739
|
var UserRole = function UserRole(_ref) {
|
|
691
740
|
var _ref$list = _ref.list,
|
|
@@ -1721,7 +1770,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1721
1770
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1722
1771
|
return function (dispatch) {
|
|
1723
1772
|
return new Promise(function (resolve, reject) {
|
|
1724
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1773
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1725
1774
|
resolve(res);
|
|
1726
1775
|
})["catch"](function (err) {
|
|
1727
1776
|
var _err$response17, _err$response17$data;
|
|
@@ -1757,6 +1806,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1757
1806
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1758
1807
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1759
1808
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1809
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1760
1810
|
|
|
1761
1811
|
var api$3 = utils.configs.api;
|
|
1762
1812
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1806,14 +1856,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1806
1856
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1807
1857
|
return function (dispatch) {
|
|
1808
1858
|
return new Promise(function (resolve, reject) {
|
|
1809
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1859
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1810
1860
|
dispatch(getUserPanalData(getParam));
|
|
1811
1861
|
dispatch(closeDialog());
|
|
1812
1862
|
resolve(res);
|
|
1813
1863
|
})["catch"](function (err) {
|
|
1814
|
-
var _err$
|
|
1864
|
+
var _err$response3, _err$response3$data;
|
|
1815
1865
|
dispatch(userPanelStopLoader());
|
|
1816
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1866
|
+
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.');
|
|
1817
1867
|
});
|
|
1818
1868
|
});
|
|
1819
1869
|
};
|
|
@@ -1827,25 +1877,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1827
1877
|
dispatch(userPanelStopLoader());
|
|
1828
1878
|
resolve();
|
|
1829
1879
|
})["catch"](function (err) {
|
|
1830
|
-
var _err$
|
|
1831
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1880
|
+
var _err$response4, _err$response4$data;
|
|
1881
|
+
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.');
|
|
1832
1882
|
dispatch(userPanelStopLoader());
|
|
1833
1883
|
});
|
|
1834
1884
|
});
|
|
1835
1885
|
};
|
|
1836
1886
|
};
|
|
1837
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1887
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1838
1888
|
return function (dispatch) {
|
|
1839
1889
|
return new Promise(function (resolve, reject) {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1890
|
+
if (tableName === 'department') {
|
|
1891
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1892
|
+
dispatch(getUserPanalData(getParam));
|
|
1893
|
+
dispatch(closeDialog());
|
|
1894
|
+
resolve();
|
|
1895
|
+
})["catch"](function (err) {
|
|
1896
|
+
var _err$response5, _err$response5$data;
|
|
1897
|
+
dispatch(userPanelStopLoader());
|
|
1898
|
+
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.');
|
|
1899
|
+
});
|
|
1900
|
+
} else {
|
|
1901
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1902
|
+
dispatch(getUserPanalData(getParam));
|
|
1903
|
+
dispatch(closeDialog());
|
|
1904
|
+
resolve();
|
|
1905
|
+
})["catch"](function (err) {
|
|
1906
|
+
var _err$response6, _err$response6$data;
|
|
1907
|
+
dispatch(userPanelStopLoader());
|
|
1908
|
+
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.');
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1849
1911
|
});
|
|
1850
1912
|
};
|
|
1851
1913
|
};
|
|
@@ -1857,8 +1919,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1857
1919
|
dispatch(closeDialog());
|
|
1858
1920
|
resolve(res);
|
|
1859
1921
|
})["catch"](function (err) {
|
|
1860
|
-
var _err$
|
|
1861
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1922
|
+
var _err$response7, _err$response7$data;
|
|
1923
|
+
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.');
|
|
1862
1924
|
});
|
|
1863
1925
|
});
|
|
1864
1926
|
};
|
|
@@ -3958,6 +4020,7 @@ var initialState$2 = {
|
|
|
3958
4020
|
previous: null,
|
|
3959
4021
|
results: []
|
|
3960
4022
|
},
|
|
4023
|
+
deptUsers: [],
|
|
3961
4024
|
loading: false
|
|
3962
4025
|
};
|
|
3963
4026
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4027,6 +4090,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4027
4090
|
loading: false
|
|
4028
4091
|
});
|
|
4029
4092
|
}
|
|
4093
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4094
|
+
{
|
|
4095
|
+
return _extends({}, state, {
|
|
4096
|
+
deptUsers: action.payload
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4030
4099
|
default:
|
|
4031
4100
|
return state;
|
|
4032
4101
|
}
|
|
@@ -4805,6 +4874,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4805
4874
|
isILadmin = _useSelector2.isILadmin,
|
|
4806
4875
|
companyName = _useSelector2.companyName;
|
|
4807
4876
|
var history = reactRouterDom.useHistory();
|
|
4877
|
+
var location = reactRouterDom.useLocation();
|
|
4808
4878
|
var _useState = React.useState({
|
|
4809
4879
|
travel: false,
|
|
4810
4880
|
expense: false
|
|
@@ -5060,6 +5130,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5060
5130
|
var onAddModalClose = function onAddModalClose() {
|
|
5061
5131
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5062
5132
|
};
|
|
5133
|
+
React.useEffect(function () {
|
|
5134
|
+
var _location$state, _location$state2;
|
|
5135
|
+
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) {
|
|
5136
|
+
var _location$state3, _location$state4;
|
|
5137
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5138
|
+
department: {
|
|
5139
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5140
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5141
|
+
}
|
|
5142
|
+
}));
|
|
5143
|
+
}
|
|
5144
|
+
}, []);
|
|
5063
5145
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5064
5146
|
var title = '';
|
|
5065
5147
|
if (id === 'entity') {
|
|
@@ -5085,24 +5167,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5085
5167
|
}));
|
|
5086
5168
|
} else {
|
|
5087
5169
|
dispatch(showLoader());
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5170
|
+
var dataObj;
|
|
5171
|
+
if (addModalData.id === 'department') {
|
|
5172
|
+
dataObj = {
|
|
5173
|
+
name: validatedValue,
|
|
5174
|
+
department_head_id: null
|
|
5175
|
+
};
|
|
5176
|
+
} else {
|
|
5177
|
+
dataObj = {
|
|
5178
|
+
names: [validatedValue]
|
|
5179
|
+
};
|
|
5180
|
+
}
|
|
5181
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5182
|
+
var _extends4;
|
|
5092
5183
|
setAddModalData(_extends({}, addModalData, {
|
|
5093
5184
|
isOpen: false
|
|
5094
5185
|
}));
|
|
5095
5186
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5096
5187
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5188
|
+
if (addModalData.id === 'department') {
|
|
5189
|
+
var _extends2;
|
|
5190
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5191
|
+
value: res.data.result.id,
|
|
5192
|
+
label: res.data.result.name
|
|
5193
|
+
}, _extends2)));
|
|
5194
|
+
} else {
|
|
5195
|
+
var _extends3;
|
|
5196
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5197
|
+
value: res.data.value,
|
|
5198
|
+
label: res.data.label
|
|
5199
|
+
}, _extends3)));
|
|
5200
|
+
}
|
|
5201
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5102
5202
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5103
5203
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5104
|
-
var
|
|
5105
|
-
return _extends({}, prevState, (
|
|
5204
|
+
var _extends5;
|
|
5205
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5106
5206
|
});
|
|
5107
5207
|
dispatch(stopLoader());
|
|
5108
5208
|
});
|
|
@@ -5121,8 +5221,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5121
5221
|
try {
|
|
5122
5222
|
var _temp6 = function _temp6() {
|
|
5123
5223
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5124
|
-
var
|
|
5125
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5224
|
+
var _extends6;
|
|
5225
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5126
5226
|
}
|
|
5127
5227
|
};
|
|
5128
5228
|
var _name = args._name,
|
|
@@ -5145,8 +5245,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5145
5245
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5146
5246
|
} else {
|
|
5147
5247
|
var _temp8 = function _temp8() {
|
|
5148
|
-
var
|
|
5149
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5248
|
+
var _extends7;
|
|
5249
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5150
5250
|
updateError(_name, _isError, _errorMsg);
|
|
5151
5251
|
};
|
|
5152
5252
|
var _temp9 = function () {
|
|
@@ -5194,7 +5294,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5194
5294
|
}
|
|
5195
5295
|
};
|
|
5196
5296
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5197
|
-
var
|
|
5297
|
+
var _extends8;
|
|
5198
5298
|
var _name = args._name,
|
|
5199
5299
|
_value = args._value,
|
|
5200
5300
|
_isError = args._isError,
|
|
@@ -5203,11 +5303,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5203
5303
|
_name: _name,
|
|
5204
5304
|
_value: _value
|
|
5205
5305
|
});
|
|
5206
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5306
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5207
5307
|
updateError(_name, _isError, _errorMsg);
|
|
5208
5308
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5209
|
-
var
|
|
5210
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5309
|
+
var _extends9;
|
|
5310
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5211
5311
|
}
|
|
5212
5312
|
};
|
|
5213
5313
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5217,9 +5317,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5217
5317
|
return tag.id;
|
|
5218
5318
|
};
|
|
5219
5319
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5220
|
-
var
|
|
5320
|
+
var _extends10;
|
|
5221
5321
|
var e = args._event;
|
|
5222
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5322
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5223
5323
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5224
5324
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5225
5325
|
userTagType: true
|
|
@@ -5227,22 +5327,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5227
5327
|
}
|
|
5228
5328
|
};
|
|
5229
5329
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5230
|
-
var
|
|
5330
|
+
var _extends11;
|
|
5231
5331
|
var _name = _ref2._name,
|
|
5232
5332
|
_value = _ref2._value;
|
|
5233
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5333
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5234
5334
|
};
|
|
5235
5335
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5236
|
-
var
|
|
5336
|
+
var _extends12;
|
|
5237
5337
|
var _name = _ref3._name,
|
|
5238
5338
|
_value = _ref3._value;
|
|
5239
|
-
|
|
5339
|
+
console.log(_name, _value, 'travel');
|
|
5340
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5240
5341
|
};
|
|
5241
5342
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5242
|
-
var
|
|
5343
|
+
var _extends13;
|
|
5243
5344
|
var _name = _ref4._name,
|
|
5244
5345
|
_value = _ref4._value;
|
|
5245
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5346
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5246
5347
|
};
|
|
5247
5348
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5248
5349
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5276,39 +5377,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5276
5377
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5277
5378
|
};
|
|
5278
5379
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5279
|
-
var
|
|
5380
|
+
var _extends14;
|
|
5280
5381
|
var _name = args._name,
|
|
5281
5382
|
_value = args._value,
|
|
5282
5383
|
_isError = args._isError,
|
|
5283
5384
|
_errorMsg = args._errorMsg;
|
|
5284
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5385
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5285
5386
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5286
|
-
var
|
|
5287
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5387
|
+
var _extends15;
|
|
5388
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5288
5389
|
}
|
|
5289
5390
|
updateError(_name, _isError, _errorMsg);
|
|
5290
5391
|
};
|
|
5291
5392
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5292
|
-
var
|
|
5393
|
+
var _extends16;
|
|
5293
5394
|
var _name = args._name,
|
|
5294
5395
|
_value = args._value,
|
|
5295
5396
|
_isError = args._isError,
|
|
5296
5397
|
_errorMsg = args._errorMsg;
|
|
5297
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5398
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5298
5399
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5299
|
-
var
|
|
5300
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5400
|
+
var _extends17;
|
|
5401
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5301
5402
|
}
|
|
5302
5403
|
updateError(_name, _isError, _errorMsg);
|
|
5303
5404
|
};
|
|
5304
5405
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5305
5406
|
try {
|
|
5306
5407
|
var _temp14 = function _temp14() {
|
|
5307
|
-
var
|
|
5308
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5408
|
+
var _extends18;
|
|
5409
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5309
5410
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5310
|
-
var
|
|
5311
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5411
|
+
var _extends19;
|
|
5412
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5312
5413
|
}
|
|
5313
5414
|
updateError(_name, _isError, _errorMsg);
|
|
5314
5415
|
};
|
|
@@ -5414,8 +5515,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5414
5515
|
return _errorArray;
|
|
5415
5516
|
});
|
|
5416
5517
|
setErrorMsgs(function (prevState) {
|
|
5417
|
-
var
|
|
5418
|
-
return _extends({}, prevState, (
|
|
5518
|
+
var _extends20;
|
|
5519
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5419
5520
|
});
|
|
5420
5521
|
};
|
|
5421
5522
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -6741,7 +6842,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6741
6842
|
};
|
|
6742
6843
|
};
|
|
6743
6844
|
|
|
6744
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","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"};
|
|
6845
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6745
6846
|
|
|
6746
6847
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6747
6848
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8394,7 +8495,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8394
8495
|
isDataFetching: isDataFetching,
|
|
8395
8496
|
disableRowCheckbox: disableRowCheckbox,
|
|
8396
8497
|
searchBoxWidth: "400px",
|
|
8397
|
-
searchValue: searchValue
|
|
8498
|
+
searchValue: searchValue,
|
|
8499
|
+
hideTopPagination: false
|
|
8398
8500
|
});
|
|
8399
8501
|
};
|
|
8400
8502
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8525,6 +8627,25 @@ function InviteInfoIcon() {
|
|
|
8525
8627
|
}));
|
|
8526
8628
|
}
|
|
8527
8629
|
|
|
8630
|
+
function InfoYellowIcon(props) {
|
|
8631
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8632
|
+
width: props.width,
|
|
8633
|
+
height: props.height,
|
|
8634
|
+
viewBox: "0 0 20 20",
|
|
8635
|
+
fill: "none",
|
|
8636
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8637
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8638
|
+
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",
|
|
8639
|
+
fill: "#CA8A04"
|
|
8640
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8641
|
+
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",
|
|
8642
|
+
fill: "#CA8A04"
|
|
8643
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8644
|
+
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",
|
|
8645
|
+
fill: "#CA8A04"
|
|
8646
|
+
}));
|
|
8647
|
+
}
|
|
8648
|
+
|
|
8528
8649
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8529
8650
|
var env$7 = utils.configs.env;
|
|
8530
8651
|
var UndoButton = function UndoButton(_ref) {
|
|
@@ -8567,7 +8688,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8567
8688
|
var _React$useState = React__default.useState(1),
|
|
8568
8689
|
page = _React$useState[0],
|
|
8569
8690
|
setPage = _React$useState[1];
|
|
8570
|
-
var _useState = React.useState(
|
|
8691
|
+
var _useState = React.useState(10),
|
|
8571
8692
|
rowsPerPage = _useState[0],
|
|
8572
8693
|
setRowsPerPage = _useState[1];
|
|
8573
8694
|
var _React$useState2 = React__default.useState({}),
|
|
@@ -8576,9 +8697,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8576
8697
|
var _React$useState3 = React__default.useState('asc'),
|
|
8577
8698
|
order = _React$useState3[0],
|
|
8578
8699
|
setOrder = _React$useState3[1];
|
|
8579
|
-
var _React$useState4 = React__default.useState(
|
|
8580
|
-
|
|
8581
|
-
|
|
8700
|
+
var _React$useState4 = React__default.useState(false),
|
|
8701
|
+
deactivateSingle = _React$useState4[0],
|
|
8702
|
+
setDeactivateSingle = _React$useState4[1];
|
|
8703
|
+
var _React$useState5 = React__default.useState('first_name'),
|
|
8704
|
+
orderBy = _React$useState5[0],
|
|
8705
|
+
setOrderBy = _React$useState5[1];
|
|
8582
8706
|
var _useState2 = React.useState(''),
|
|
8583
8707
|
searchValue = _useState2[0],
|
|
8584
8708
|
setSearchValue = _useState2[1];
|
|
@@ -8613,39 +8737,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8613
8737
|
var _useState10 = React.useState(false),
|
|
8614
8738
|
isApiFetching = _useState10[0],
|
|
8615
8739
|
setisApiFetching = _useState10[1];
|
|
8616
|
-
var _useState11 = React.useState(
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
var
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
var _useState13 = React.useState(
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
var _React$useState6 = React__default.useState(
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8740
|
+
var _useState11 = React.useState({
|
|
8741
|
+
value: '',
|
|
8742
|
+
label: 'Select approver'
|
|
8743
|
+
}),
|
|
8744
|
+
travelFYI = _useState11[0],
|
|
8745
|
+
setTravelFYI = _useState11[1];
|
|
8746
|
+
var _useState12 = React.useState(false),
|
|
8747
|
+
showInviteModal = _useState12[0],
|
|
8748
|
+
setToggleInviteModal = _useState12[1];
|
|
8749
|
+
var _useState13 = React.useState(''),
|
|
8750
|
+
userIds = _useState13[0],
|
|
8751
|
+
setUserIds = _useState13[1];
|
|
8752
|
+
var _React$useState6 = React__default.useState(false),
|
|
8753
|
+
overlayMenu = _React$useState6[0],
|
|
8754
|
+
setOverlayMenu = _React$useState6[1];
|
|
8755
|
+
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8756
|
+
var prevPos = _ref3.prevPos,
|
|
8757
|
+
currPos = _ref3.currPos;
|
|
8758
|
+
if (prevPos.y - currPos.y > 0) {
|
|
8759
|
+
if (currPos.y <= -275) {
|
|
8760
|
+
setOverlayMenu(true);
|
|
8761
|
+
}
|
|
8762
|
+
} else {
|
|
8763
|
+
if (currPos.y > -295) {
|
|
8764
|
+
setOverlayMenu(false);
|
|
8765
|
+
}
|
|
8766
|
+
}
|
|
8767
|
+
}, [overlayMenu]);
|
|
8768
|
+
var scrollTo = function scrollTo(id) {
|
|
8769
|
+
var el = document.getElementById(id);
|
|
8770
|
+
window.scrollTo({
|
|
8771
|
+
top: el.offsetTop,
|
|
8772
|
+
behavior: 'smooth'
|
|
8773
|
+
});
|
|
8774
|
+
};
|
|
8775
|
+
var _React$useState7 = React__default.useState(1),
|
|
8776
|
+
signup_page = _React$useState7[0],
|
|
8777
|
+
setSignUpPage = _React$useState7[1];
|
|
8778
|
+
var _useState14 = React.useState(5),
|
|
8779
|
+
signup_rowsPerPage = _useState14[0],
|
|
8780
|
+
setSignUpRowsPerPage = _useState14[1];
|
|
8781
|
+
var _React$useState8 = React__default.useState('asc'),
|
|
8782
|
+
signup_order = _React$useState8[0],
|
|
8783
|
+
setSignUpOrder = _React$useState8[1];
|
|
8784
|
+
var _React$useState9 = React__default.useState('fname'),
|
|
8785
|
+
signup_orderBy = _React$useState9[0],
|
|
8786
|
+
setSignUpOrderBy = _React$useState9[1];
|
|
8787
|
+
var _useState15 = React.useState(''),
|
|
8788
|
+
signup_searchValue = _useState15[0],
|
|
8789
|
+
set_signup_SearchValue = _useState15[1];
|
|
8640
8790
|
var _useState16 = React.useState(false),
|
|
8641
|
-
|
|
8642
|
-
|
|
8791
|
+
isSignUpSortingChange = _useState16[0],
|
|
8792
|
+
setSignUpSortingChange = _useState16[1];
|
|
8643
8793
|
var _useState17 = React.useState(false),
|
|
8644
|
-
|
|
8645
|
-
|
|
8794
|
+
isSignUpSearchingChange = _useState17[0],
|
|
8795
|
+
setSignUpSearchingChange = _useState17[1];
|
|
8646
8796
|
var _useState18 = React.useState(false),
|
|
8647
|
-
|
|
8648
|
-
|
|
8797
|
+
isSignUpSortingChangeTemp = _useState18[0],
|
|
8798
|
+
setSignUpSortingChangeTemp = _useState18[1];
|
|
8799
|
+
var _useState19 = React.useState(false),
|
|
8800
|
+
isSignUpSearchingChangeTemp = _useState19[0],
|
|
8801
|
+
setSignUpSearchingChangeTemp = _useState19[1];
|
|
8649
8802
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8650
8803
|
return state.userList;
|
|
8651
8804
|
}),
|
|
@@ -8890,6 +9043,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8890
9043
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8891
9044
|
setSearchingChange(false);
|
|
8892
9045
|
setisApiFetching(false);
|
|
9046
|
+
scrollTo('table-root');
|
|
8893
9047
|
});
|
|
8894
9048
|
}, 1000);
|
|
8895
9049
|
return function () {
|
|
@@ -8916,6 +9070,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8916
9070
|
}
|
|
8917
9071
|
if (isSortingChange) {
|
|
8918
9072
|
setisApiFetching(true);
|
|
9073
|
+
scrollTo('table-root');
|
|
8919
9074
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8920
9075
|
setisApiFetching(false);
|
|
8921
9076
|
setSortingChange(false);
|
|
@@ -8956,15 +9111,89 @@ var UserList = function UserList(_ref2) {
|
|
|
8956
9111
|
}
|
|
8957
9112
|
}
|
|
8958
9113
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9114
|
+
var topRightButtons = function topRightButtons() {
|
|
9115
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9116
|
+
component: "div",
|
|
9117
|
+
className: styles$5.buttonWrapper,
|
|
9118
|
+
display: "flex",
|
|
9119
|
+
justifyContent: "space-between",
|
|
9120
|
+
alignItems: "center",
|
|
9121
|
+
alignSelf: "flex-start"
|
|
9122
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9123
|
+
component: "div",
|
|
9124
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9125
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9126
|
+
buttonText: "Export all users",
|
|
9127
|
+
type: "outlined",
|
|
9128
|
+
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9129
|
+
width: "22",
|
|
9130
|
+
height: "22"
|
|
9131
|
+
}),
|
|
9132
|
+
onClick: handleExportUsers
|
|
9133
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9134
|
+
component: "div",
|
|
9135
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9136
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9137
|
+
buttonText: "Bulk actions",
|
|
9138
|
+
type: "outlined",
|
|
9139
|
+
menuListInfo: BulkUploadInfo
|
|
9140
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9141
|
+
component: "div",
|
|
9142
|
+
className: "pageHeader--button-single button-right"
|
|
9143
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9144
|
+
buttonText: "Add user",
|
|
9145
|
+
type: "contained",
|
|
9146
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9147
|
+
width: "9",
|
|
9148
|
+
height: "9",
|
|
9149
|
+
color: "white"
|
|
9150
|
+
}),
|
|
9151
|
+
onClick: handleAddPageNavigation
|
|
9152
|
+
})));
|
|
9153
|
+
};
|
|
8959
9154
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8960
9155
|
component: "div",
|
|
8961
9156
|
className: styles$5.UUIUserManagementList
|
|
8962
|
-
},
|
|
9157
|
+
}, overlayMenu ? /*#__PURE__*/React__default.createElement(core.Box, {
|
|
9158
|
+
className: styles$5.scrollOverlayMenu
|
|
9159
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9160
|
+
component: "div",
|
|
9161
|
+
className: clsx(styles$5.pageHeader)
|
|
9162
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9163
|
+
component: "div",
|
|
9164
|
+
display: "flex",
|
|
9165
|
+
justifyContent: "space-between",
|
|
9166
|
+
alignItems: "center",
|
|
9167
|
+
flexWrap: "wrap",
|
|
9168
|
+
style: {
|
|
9169
|
+
gap: '1rem'
|
|
9170
|
+
}
|
|
9171
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9172
|
+
component: "div",
|
|
9173
|
+
display: "flex",
|
|
9174
|
+
flexDirection: "column",
|
|
9175
|
+
style: {
|
|
9176
|
+
gap: '0.5rem'
|
|
9177
|
+
}
|
|
9178
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
|
|
9179
|
+
placeholder: "Search by name, email & department",
|
|
9180
|
+
value: searchValue,
|
|
9181
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
9182
|
+
return onSearchHandler(e.target.value);
|
|
9183
|
+
},
|
|
9184
|
+
className: styles$5.overlaysearch
|
|
9185
|
+
})), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9186
|
+
component: "div",
|
|
9187
|
+
display: "flex",
|
|
9188
|
+
justifyContent: "space-between",
|
|
9189
|
+
alignItems: "center"
|
|
9190
|
+
}))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8963
9191
|
open: isFileDownloading || isApiFetching,
|
|
8964
9192
|
className: styles$5.backdrop
|
|
8965
9193
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
|
|
8966
9194
|
color: "inherit"
|
|
8967
9195
|
})), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9196
|
+
id: "table-root",
|
|
8968
9197
|
component: "div",
|
|
8969
9198
|
className: clsx(styles$5.pageHeader)
|
|
8970
9199
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8989,44 +9218,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8989
9218
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8990
9219
|
variant: "h3",
|
|
8991
9220
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8992
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8993
|
-
component: "div",
|
|
8994
|
-
className: styles$5.buttonWrapper,
|
|
8995
|
-
display: "flex",
|
|
8996
|
-
justifyContent: "space-between",
|
|
8997
|
-
alignItems: "center",
|
|
8998
|
-
alignSelf: "flex-start"
|
|
8999
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9000
|
-
component: "div",
|
|
9001
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9002
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9003
|
-
buttonText: "Export all users",
|
|
9004
|
-
type: "outlined",
|
|
9005
|
-
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9006
|
-
width: "22",
|
|
9007
|
-
height: "22"
|
|
9008
|
-
}),
|
|
9009
|
-
onClick: handleExportUsers
|
|
9010
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9011
|
-
component: "div",
|
|
9012
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9013
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9014
|
-
buttonText: "Bulk actions",
|
|
9015
|
-
type: "outlined",
|
|
9016
|
-
menuListInfo: BulkUploadInfo
|
|
9017
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9018
|
-
component: "div",
|
|
9019
|
-
className: "pageHeader--button-single button-right"
|
|
9020
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9021
|
-
buttonText: "Add user",
|
|
9022
|
-
type: "contained",
|
|
9023
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9024
|
-
width: "9",
|
|
9025
|
-
height: "9",
|
|
9026
|
-
color: "white"
|
|
9027
|
-
}),
|
|
9028
|
-
onClick: handleAddPageNavigation
|
|
9029
|
-
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9221
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9030
9222
|
component: "div",
|
|
9031
9223
|
display: "flex",
|
|
9032
9224
|
justifyContent: "space-between",
|
|
@@ -9121,6 +9313,82 @@ var UserList = function UserList(_ref2) {
|
|
|
9121
9313
|
}))
|
|
9122
9314
|
}]
|
|
9123
9315
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9316
|
+
isOpen: deactivateSingle,
|
|
9317
|
+
closeHandler: function closeHandler() {
|
|
9318
|
+
setDeactivateSingle(false);
|
|
9319
|
+
},
|
|
9320
|
+
cancelLabel: "Cancel",
|
|
9321
|
+
submitLabel: "Deactivate",
|
|
9322
|
+
submitHandler: handleDeactivateUsers,
|
|
9323
|
+
headerText: "Deactivate this user?",
|
|
9324
|
+
width: "400px",
|
|
9325
|
+
subHanderText: "",
|
|
9326
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9327
|
+
isDisabledSubmitBtn: true
|
|
9328
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9329
|
+
className: styles$5.deactivateSingle
|
|
9330
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9331
|
+
className: styles$5.deactivateAlert
|
|
9332
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9333
|
+
width: "9",
|
|
9334
|
+
height: "9"
|
|
9335
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, null, /*#__PURE__*/React__default.createElement("b", null, "Anvesh Dunna"), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9336
|
+
className: "iui__mb-15 iui__mt-15"
|
|
9337
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9338
|
+
isMove: true,
|
|
9339
|
+
additional: {
|
|
9340
|
+
page: 1,
|
|
9341
|
+
product: 'travel',
|
|
9342
|
+
placeholder: 'Select a user'
|
|
9343
|
+
},
|
|
9344
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9345
|
+
label: "Transfer admin role to",
|
|
9346
|
+
value: travelFYI,
|
|
9347
|
+
onValueChange: function onValueChange(_ref4) {
|
|
9348
|
+
var _value = _ref4._value;
|
|
9349
|
+
return setTravelFYI(_value);
|
|
9350
|
+
},
|
|
9351
|
+
loadOption: approversOptions,
|
|
9352
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9353
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9354
|
+
className: clsx('iui__mb-5', styles$5.departmentHeadText)
|
|
9355
|
+
}, "Anvesh Dunna is the department head for: Product Design."), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9356
|
+
className: "iui__mb-15"
|
|
9357
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9358
|
+
isMove: true,
|
|
9359
|
+
additional: {
|
|
9360
|
+
page: 1,
|
|
9361
|
+
product: 'travel',
|
|
9362
|
+
placeholder: 'Select a user'
|
|
9363
|
+
},
|
|
9364
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9365
|
+
label: "Transfer department head role to",
|
|
9366
|
+
value: travelFYI,
|
|
9367
|
+
onValueChange: function onValueChange(_ref5) {
|
|
9368
|
+
var _value = _ref5._value;
|
|
9369
|
+
return setTravelFYI(_value);
|
|
9370
|
+
},
|
|
9371
|
+
loadOption: approversOptions,
|
|
9372
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9373
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9374
|
+
className: "iui__mb-15"
|
|
9375
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9376
|
+
isMove: true,
|
|
9377
|
+
additional: {
|
|
9378
|
+
page: 1,
|
|
9379
|
+
product: 'travel',
|
|
9380
|
+
placeholder: 'Select a user'
|
|
9381
|
+
},
|
|
9382
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9383
|
+
label: "Transfer approver role to",
|
|
9384
|
+
value: travelFYI,
|
|
9385
|
+
onValueChange: function onValueChange(_ref6) {
|
|
9386
|
+
var _value = _ref6._value;
|
|
9387
|
+
return setTravelFYI(_value);
|
|
9388
|
+
},
|
|
9389
|
+
loadOption: approversOptions,
|
|
9390
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9391
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9124
9392
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9125
9393
|
closeHandler: closeDeActivateModal,
|
|
9126
9394
|
cancelLabel: "Cancel",
|
|
@@ -9189,8 +9457,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9189
9457
|
errMsg: hasVerificationError
|
|
9190
9458
|
}));
|
|
9191
9459
|
};
|
|
9192
|
-
var TabLabelCount = function TabLabelCount(
|
|
9193
|
-
var count =
|
|
9460
|
+
var TabLabelCount = function TabLabelCount(_ref7) {
|
|
9461
|
+
var count = _ref7.count;
|
|
9194
9462
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9195
9463
|
className: styles$5.TabLabelCount
|
|
9196
9464
|
}, " ", count, " ");
|
|
@@ -9265,11 +9533,12 @@ function Header(props) {
|
|
|
9265
9533
|
})));
|
|
9266
9534
|
}
|
|
9267
9535
|
|
|
9268
|
-
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"};
|
|
9536
|
+
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"};
|
|
9269
9537
|
|
|
9270
9538
|
function Listview(_ref) {
|
|
9271
9539
|
var data = _ref.data,
|
|
9272
9540
|
name = _ref.name,
|
|
9541
|
+
tableName = _ref.tableName,
|
|
9273
9542
|
handleEditDialog = _ref.handleEditDialog,
|
|
9274
9543
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9275
9544
|
orderBy = _ref.orderBy,
|
|
@@ -9282,16 +9551,82 @@ function Listview(_ref) {
|
|
|
9282
9551
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9283
9552
|
page = _ref.page,
|
|
9284
9553
|
rowsPerPage = _ref.rowsPerPage;
|
|
9554
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9555
|
+
var _data$dept_head_detai;
|
|
9556
|
+
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) {
|
|
9557
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9558
|
+
}
|
|
9559
|
+
};
|
|
9285
9560
|
var columns = [{
|
|
9286
9561
|
id: 'name',
|
|
9287
9562
|
label: name,
|
|
9288
|
-
width: '
|
|
9563
|
+
width: '40%',
|
|
9289
9564
|
sortable: true,
|
|
9290
9565
|
cell: function cell(row) {
|
|
9291
9566
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9292
9567
|
component: "div"
|
|
9293
9568
|
}, row.name);
|
|
9294
9569
|
}
|
|
9570
|
+
}, {
|
|
9571
|
+
id: 'no_of_users',
|
|
9572
|
+
label: 'Number of users',
|
|
9573
|
+
width: '40%',
|
|
9574
|
+
sortable: true,
|
|
9575
|
+
cell: function cell(row) {
|
|
9576
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9577
|
+
component: "div"
|
|
9578
|
+
}, row.no_of_users);
|
|
9579
|
+
}
|
|
9580
|
+
}, {
|
|
9581
|
+
id: 'actions',
|
|
9582
|
+
label: 'Actions',
|
|
9583
|
+
width: '20%',
|
|
9584
|
+
cell: function cell(row) {
|
|
9585
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9586
|
+
display: "flex"
|
|
9587
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9588
|
+
buttonText: "Edit",
|
|
9589
|
+
className: styles$7.buttonWidth,
|
|
9590
|
+
onClick: function onClick() {
|
|
9591
|
+
return handleEditDialog(row);
|
|
9592
|
+
}
|
|
9593
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9594
|
+
buttonText: "Delete",
|
|
9595
|
+
className: styles$7.buttonWidth,
|
|
9596
|
+
onClick: function onClick() {
|
|
9597
|
+
return handleDeleteDialog(row, true);
|
|
9598
|
+
}
|
|
9599
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9600
|
+
buttonText: "Delete",
|
|
9601
|
+
className: styles$7.buttonWidth,
|
|
9602
|
+
onClick: function onClick() {
|
|
9603
|
+
return handleDeleteDialog(row, false);
|
|
9604
|
+
}
|
|
9605
|
+
}));
|
|
9606
|
+
}
|
|
9607
|
+
}];
|
|
9608
|
+
var departmentColumns = [{
|
|
9609
|
+
id: 'name',
|
|
9610
|
+
label: name,
|
|
9611
|
+
width: '30%',
|
|
9612
|
+
sortable: true,
|
|
9613
|
+
cell: function cell(row) {
|
|
9614
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9615
|
+
component: "div"
|
|
9616
|
+
}, row.name);
|
|
9617
|
+
}
|
|
9618
|
+
}, {
|
|
9619
|
+
id: 'department_head',
|
|
9620
|
+
label: 'Department head',
|
|
9621
|
+
width: '30%',
|
|
9622
|
+
sortable: true,
|
|
9623
|
+
cell: function cell(row) {
|
|
9624
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9625
|
+
component: "div"
|
|
9626
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9627
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9628
|
+
}, "Assigned by default"));
|
|
9629
|
+
}
|
|
9295
9630
|
}, {
|
|
9296
9631
|
id: 'no_of_users',
|
|
9297
9632
|
label: 'Number of users',
|
|
@@ -9305,7 +9640,7 @@ function Listview(_ref) {
|
|
|
9305
9640
|
}, {
|
|
9306
9641
|
id: 'actions',
|
|
9307
9642
|
label: 'Actions',
|
|
9308
|
-
width: '
|
|
9643
|
+
width: '15%',
|
|
9309
9644
|
cell: function cell(row) {
|
|
9310
9645
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9311
9646
|
display: "flex"
|
|
@@ -9338,7 +9673,7 @@ function Listview(_ref) {
|
|
|
9338
9673
|
hasFilter: true,
|
|
9339
9674
|
isCheckboxTable: false,
|
|
9340
9675
|
count: data.count,
|
|
9341
|
-
columns: columns,
|
|
9676
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9342
9677
|
rows: data.results,
|
|
9343
9678
|
page: page,
|
|
9344
9679
|
handleChangePage: handleChangePage,
|
|
@@ -9395,15 +9730,44 @@ function EditPanelDialog(_ref) {
|
|
|
9395
9730
|
var isOpen = _ref.isOpen,
|
|
9396
9731
|
closeHandler = _ref.closeHandler,
|
|
9397
9732
|
onValueChange = _ref.onValueChange,
|
|
9398
|
-
|
|
9733
|
+
_submitHandler = _ref.submitHandler,
|
|
9399
9734
|
isError = _ref.isError,
|
|
9400
9735
|
name = _ref.name,
|
|
9401
9736
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9402
|
-
validation = _ref.validation
|
|
9737
|
+
validation = _ref.validation,
|
|
9738
|
+
rowData = _ref.rowData,
|
|
9739
|
+
tableName = _ref.tableName,
|
|
9740
|
+
config = _ref.config;
|
|
9403
9741
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9404
9742
|
return state.userPanel;
|
|
9405
9743
|
}),
|
|
9406
9744
|
dialogData = _useSelector.dialogData;
|
|
9745
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9746
|
+
var _data$dept_head_detai;
|
|
9747
|
+
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) {
|
|
9748
|
+
setHead({
|
|
9749
|
+
value: data.dept_head_details[0].id,
|
|
9750
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9751
|
+
});
|
|
9752
|
+
}
|
|
9753
|
+
};
|
|
9754
|
+
var _useState = React.useState({
|
|
9755
|
+
value: '',
|
|
9756
|
+
label: 'Select'
|
|
9757
|
+
}),
|
|
9758
|
+
head = _useState[0],
|
|
9759
|
+
setHead = _useState[1];
|
|
9760
|
+
React.useEffect(function () {
|
|
9761
|
+
deptHeadDetails(rowData);
|
|
9762
|
+
}, [rowData]);
|
|
9763
|
+
var history = reactRouterDom.useHistory();
|
|
9764
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9765
|
+
console.log(rowData);
|
|
9766
|
+
history.push({
|
|
9767
|
+
pathname: config.routes.users.add.path,
|
|
9768
|
+
state: rowData
|
|
9769
|
+
});
|
|
9770
|
+
};
|
|
9407
9771
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9408
9772
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9409
9773
|
isOpen: isOpen,
|
|
@@ -9411,25 +9775,59 @@ function EditPanelDialog(_ref) {
|
|
|
9411
9775
|
headerText: "Edit " + name.toLowerCase(),
|
|
9412
9776
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9413
9777
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9414
|
-
submitHandler: submitHandler
|
|
9415
|
-
|
|
9778
|
+
submitHandler: function submitHandler() {
|
|
9779
|
+
return _submitHandler(head);
|
|
9780
|
+
},
|
|
9781
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9416
9782
|
hideCloseIcon: false,
|
|
9417
9783
|
modalBodyStyle: {
|
|
9418
|
-
|
|
9419
|
-
overflow: 'auto',
|
|
9420
|
-
margin: '0px'
|
|
9784
|
+
overflowY: 'visible'
|
|
9421
9785
|
},
|
|
9422
9786
|
footerStyle: {
|
|
9423
9787
|
justifyContent: 'end'
|
|
9424
9788
|
}
|
|
9789
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9790
|
+
display: "flex",
|
|
9791
|
+
justifyContent: "center",
|
|
9792
|
+
alignItems: "center",
|
|
9793
|
+
flexDirection: "column",
|
|
9794
|
+
style: {
|
|
9795
|
+
marginBottom: '30px'
|
|
9796
|
+
}
|
|
9425
9797
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9426
|
-
component: "div",
|
|
9427
9798
|
display: "flex",
|
|
9428
9799
|
justifyContent: "center",
|
|
9429
9800
|
alignItems: "center",
|
|
9430
9801
|
flexDirection: "column",
|
|
9431
|
-
|
|
9432
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
9802
|
+
className: styles$7.baseAlert
|
|
9803
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9804
|
+
className: styles$7.alertDescContainer
|
|
9805
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9806
|
+
className: styles$7.iconLayout,
|
|
9807
|
+
style: {
|
|
9808
|
+
paddingTop: '4px'
|
|
9809
|
+
}
|
|
9810
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
9811
|
+
color: "#CA8A04",
|
|
9812
|
+
width: "25",
|
|
9813
|
+
height: "20",
|
|
9814
|
+
className: styles$7.iconStyle
|
|
9815
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
9816
|
+
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.",
|
|
9817
|
+
style: {
|
|
9818
|
+
fontWeight: 'normal'
|
|
9819
|
+
}
|
|
9820
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9821
|
+
buttonText: "Add user",
|
|
9822
|
+
type: "text",
|
|
9823
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9824
|
+
width: "9",
|
|
9825
|
+
height: "9",
|
|
9826
|
+
color: "#EC5D25"
|
|
9827
|
+
}),
|
|
9828
|
+
onClick: handleAddPageNavigation,
|
|
9829
|
+
className: styles$7.addUserButton
|
|
9830
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9433
9831
|
label: name + " name",
|
|
9434
9832
|
name: "name",
|
|
9435
9833
|
defaultValue: dialogData.data.name,
|
|
@@ -9438,7 +9836,49 @@ function EditPanelDialog(_ref) {
|
|
|
9438
9836
|
isError: isError,
|
|
9439
9837
|
validation: validation,
|
|
9440
9838
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9441
|
-
required: true
|
|
9839
|
+
required: true,
|
|
9840
|
+
style: tableName === 'department' && {
|
|
9841
|
+
width: '350px'
|
|
9842
|
+
}
|
|
9843
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9844
|
+
className: "iui__mt-15",
|
|
9845
|
+
style: {
|
|
9846
|
+
width: '100%'
|
|
9847
|
+
}
|
|
9848
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9849
|
+
label: "Department head",
|
|
9850
|
+
name: "name",
|
|
9851
|
+
defaultValue: head.label,
|
|
9852
|
+
placeholder: "",
|
|
9853
|
+
readOnly: true,
|
|
9854
|
+
style: {
|
|
9855
|
+
width: '350px'
|
|
9856
|
+
}
|
|
9857
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9858
|
+
className: "iui__mt-15",
|
|
9859
|
+
style: {
|
|
9860
|
+
width: '100%'
|
|
9861
|
+
}
|
|
9862
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9863
|
+
noResultsText: true,
|
|
9864
|
+
isMove: true,
|
|
9865
|
+
additional: {
|
|
9866
|
+
page: 1,
|
|
9867
|
+
departmentId: rowData.id
|
|
9868
|
+
},
|
|
9869
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9870
|
+
label: "Department head",
|
|
9871
|
+
value: head,
|
|
9872
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9873
|
+
var _value = _ref2._value;
|
|
9874
|
+
return setHead(_value);
|
|
9875
|
+
},
|
|
9876
|
+
loadOption: departmentHeadOptions,
|
|
9877
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9878
|
+
customLoadingText: "No users found in this department",
|
|
9879
|
+
customLoadingTextStyle: {
|
|
9880
|
+
color: '#374151'
|
|
9881
|
+
}
|
|
9442
9882
|
})));
|
|
9443
9883
|
}
|
|
9444
9884
|
|
|
@@ -9617,12 +10057,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9617
10057
|
var _useState13 = React.useState(false),
|
|
9618
10058
|
isSortingChangeTemp = _useState13[0],
|
|
9619
10059
|
setSortingChangeTemp = _useState13[1];
|
|
9620
|
-
var _useState14 = React.useState(
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
var _useState15 = React.useState(
|
|
9624
|
-
|
|
9625
|
-
|
|
10060
|
+
var _useState14 = React.useState([]),
|
|
10061
|
+
rowData = _useState14[0],
|
|
10062
|
+
setRowData = _useState14[1];
|
|
10063
|
+
var _useState15 = React.useState(1),
|
|
10064
|
+
page = _useState15[0],
|
|
10065
|
+
setPage = _useState15[1];
|
|
10066
|
+
var _useState16 = React.useState(5),
|
|
10067
|
+
rowsPerPage = _useState16[0],
|
|
10068
|
+
setRowsPerPage = _useState16[1];
|
|
9626
10069
|
var orderingParam = orderBy;
|
|
9627
10070
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9628
10071
|
return state.userPanel;
|
|
@@ -9718,6 +10161,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9718
10161
|
submitLabel: 'Save'
|
|
9719
10162
|
}, '', data));
|
|
9720
10163
|
setDataList(data.name);
|
|
10164
|
+
setRowData(data);
|
|
9721
10165
|
setEditModal(true);
|
|
9722
10166
|
};
|
|
9723
10167
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9732,6 +10176,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9732
10176
|
var payload = {
|
|
9733
10177
|
names: [dataList]
|
|
9734
10178
|
};
|
|
10179
|
+
if (tableName === 'department') {
|
|
10180
|
+
payload = {
|
|
10181
|
+
name: dataList,
|
|
10182
|
+
department_head_id: null
|
|
10183
|
+
};
|
|
10184
|
+
}
|
|
9735
10185
|
var message = title + " added successfully.";
|
|
9736
10186
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9737
10187
|
} else {
|
|
@@ -9745,9 +10195,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9745
10195
|
var message = title + " deleted successfully.";
|
|
9746
10196
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9747
10197
|
};
|
|
9748
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10198
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10199
|
+
if (optionalParams === void 0) {
|
|
10200
|
+
optionalParams = null;
|
|
10201
|
+
}
|
|
9749
10202
|
dispatch(userPanelShowLoader());
|
|
9750
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10203
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9751
10204
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9752
10205
|
dispatch(userPanelStopLoader());
|
|
9753
10206
|
if (type === 'delete') {
|
|
@@ -9789,8 +10242,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9789
10242
|
name: dataList
|
|
9790
10243
|
}]
|
|
9791
10244
|
};
|
|
10245
|
+
if (tableName === 'department') {
|
|
10246
|
+
payload = {
|
|
10247
|
+
name: dataList,
|
|
10248
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10249
|
+
};
|
|
10250
|
+
}
|
|
9792
10251
|
var message = title + " updated successfully.";
|
|
9793
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10252
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9794
10253
|
setErrorEdit(false);
|
|
9795
10254
|
} else {
|
|
9796
10255
|
setErrorEdit(true);
|
|
@@ -9897,7 +10356,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9897
10356
|
submitHandler: handleEditPanel,
|
|
9898
10357
|
isError: errorEdit,
|
|
9899
10358
|
isDisabledSubmitBtn: loading,
|
|
9900
|
-
validation: validation
|
|
10359
|
+
validation: validation,
|
|
10360
|
+
rowData: rowData,
|
|
10361
|
+
tableName: tableName,
|
|
10362
|
+
config: config
|
|
9901
10363
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9902
10364
|
config: config
|
|
9903
10365
|
}));
|