@itilite/iui-user-management 1.2.1 → 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 +63 -0
- package/dist/index.js +521 -123
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +522 -124
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -459,6 +459,14 @@ var userPanelUrl = {
|
|
|
459
459
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
460
460
|
}
|
|
461
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
|
+
};
|
|
462
470
|
|
|
463
471
|
var api = utils.configs.api;
|
|
464
472
|
var NAoptionConfig = {
|
|
@@ -687,6 +695,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
687
695
|
return Promise.reject(e);
|
|
688
696
|
}
|
|
689
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
|
+
};
|
|
690
738
|
|
|
691
739
|
var UserRole = function UserRole(_ref) {
|
|
692
740
|
var _ref$list = _ref.list,
|
|
@@ -1722,7 +1770,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1722
1770
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1723
1771
|
return function (dispatch) {
|
|
1724
1772
|
return new Promise(function (resolve, reject) {
|
|
1725
|
-
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) {
|
|
1726
1774
|
resolve(res);
|
|
1727
1775
|
})["catch"](function (err) {
|
|
1728
1776
|
var _err$response17, _err$response17$data;
|
|
@@ -1758,6 +1806,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1758
1806
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1759
1807
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1760
1808
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1809
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1761
1810
|
|
|
1762
1811
|
var api$3 = utils.configs.api;
|
|
1763
1812
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1807,14 +1856,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1807
1856
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1808
1857
|
return function (dispatch) {
|
|
1809
1858
|
return new Promise(function (resolve, reject) {
|
|
1810
|
-
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) {
|
|
1811
1860
|
dispatch(getUserPanalData(getParam));
|
|
1812
1861
|
dispatch(closeDialog());
|
|
1813
1862
|
resolve(res);
|
|
1814
1863
|
})["catch"](function (err) {
|
|
1815
|
-
var _err$
|
|
1864
|
+
var _err$response3, _err$response3$data;
|
|
1816
1865
|
dispatch(userPanelStopLoader());
|
|
1817
|
-
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.');
|
|
1818
1867
|
});
|
|
1819
1868
|
});
|
|
1820
1869
|
};
|
|
@@ -1828,25 +1877,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1828
1877
|
dispatch(userPanelStopLoader());
|
|
1829
1878
|
resolve();
|
|
1830
1879
|
})["catch"](function (err) {
|
|
1831
|
-
var _err$
|
|
1832
|
-
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.');
|
|
1833
1882
|
dispatch(userPanelStopLoader());
|
|
1834
1883
|
});
|
|
1835
1884
|
});
|
|
1836
1885
|
};
|
|
1837
1886
|
};
|
|
1838
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1887
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1839
1888
|
return function (dispatch) {
|
|
1840
1889
|
return new Promise(function (resolve, reject) {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
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
|
+
}
|
|
1850
1911
|
});
|
|
1851
1912
|
};
|
|
1852
1913
|
};
|
|
@@ -1858,8 +1919,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1858
1919
|
dispatch(closeDialog());
|
|
1859
1920
|
resolve(res);
|
|
1860
1921
|
})["catch"](function (err) {
|
|
1861
|
-
var _err$
|
|
1862
|
-
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.');
|
|
1863
1924
|
});
|
|
1864
1925
|
});
|
|
1865
1926
|
};
|
|
@@ -3959,6 +4020,7 @@ var initialState$2 = {
|
|
|
3959
4020
|
previous: null,
|
|
3960
4021
|
results: []
|
|
3961
4022
|
},
|
|
4023
|
+
deptUsers: [],
|
|
3962
4024
|
loading: false
|
|
3963
4025
|
};
|
|
3964
4026
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4028,6 +4090,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4028
4090
|
loading: false
|
|
4029
4091
|
});
|
|
4030
4092
|
}
|
|
4093
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4094
|
+
{
|
|
4095
|
+
return _extends({}, state, {
|
|
4096
|
+
deptUsers: action.payload
|
|
4097
|
+
});
|
|
4098
|
+
}
|
|
4031
4099
|
default:
|
|
4032
4100
|
return state;
|
|
4033
4101
|
}
|
|
@@ -4806,6 +4874,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4806
4874
|
isILadmin = _useSelector2.isILadmin,
|
|
4807
4875
|
companyName = _useSelector2.companyName;
|
|
4808
4876
|
var history = reactRouterDom.useHistory();
|
|
4877
|
+
var location = reactRouterDom.useLocation();
|
|
4809
4878
|
var _useState = React.useState({
|
|
4810
4879
|
travel: false,
|
|
4811
4880
|
expense: false
|
|
@@ -5061,6 +5130,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5061
5130
|
var onAddModalClose = function onAddModalClose() {
|
|
5062
5131
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5063
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
|
+
}, []);
|
|
5064
5145
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5065
5146
|
var title = '';
|
|
5066
5147
|
if (id === 'entity') {
|
|
@@ -5086,24 +5167,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5086
5167
|
}));
|
|
5087
5168
|
} else {
|
|
5088
5169
|
dispatch(showLoader());
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
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;
|
|
5093
5183
|
setAddModalData(_extends({}, addModalData, {
|
|
5094
5184
|
isOpen: false
|
|
5095
5185
|
}));
|
|
5096
5186
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5097
5187
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
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)));
|
|
5103
5202
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5104
5203
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5105
|
-
var
|
|
5106
|
-
return _extends({}, prevState, (
|
|
5204
|
+
var _extends5;
|
|
5205
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5107
5206
|
});
|
|
5108
5207
|
dispatch(stopLoader());
|
|
5109
5208
|
});
|
|
@@ -5122,8 +5221,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5122
5221
|
try {
|
|
5123
5222
|
var _temp6 = function _temp6() {
|
|
5124
5223
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5125
|
-
var
|
|
5126
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5224
|
+
var _extends6;
|
|
5225
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5127
5226
|
}
|
|
5128
5227
|
};
|
|
5129
5228
|
var _name = args._name,
|
|
@@ -5146,8 +5245,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5146
5245
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5147
5246
|
} else {
|
|
5148
5247
|
var _temp8 = function _temp8() {
|
|
5149
|
-
var
|
|
5150
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5248
|
+
var _extends7;
|
|
5249
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5151
5250
|
updateError(_name, _isError, _errorMsg);
|
|
5152
5251
|
};
|
|
5153
5252
|
var _temp9 = function () {
|
|
@@ -5195,7 +5294,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5195
5294
|
}
|
|
5196
5295
|
};
|
|
5197
5296
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5198
|
-
var
|
|
5297
|
+
var _extends8;
|
|
5199
5298
|
var _name = args._name,
|
|
5200
5299
|
_value = args._value,
|
|
5201
5300
|
_isError = args._isError,
|
|
@@ -5204,11 +5303,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5204
5303
|
_name: _name,
|
|
5205
5304
|
_value: _value
|
|
5206
5305
|
});
|
|
5207
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5306
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5208
5307
|
updateError(_name, _isError, _errorMsg);
|
|
5209
5308
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5210
|
-
var
|
|
5211
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5309
|
+
var _extends9;
|
|
5310
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5212
5311
|
}
|
|
5213
5312
|
};
|
|
5214
5313
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5218,9 +5317,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5218
5317
|
return tag.id;
|
|
5219
5318
|
};
|
|
5220
5319
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5221
|
-
var
|
|
5320
|
+
var _extends10;
|
|
5222
5321
|
var e = args._event;
|
|
5223
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5322
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5224
5323
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5225
5324
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5226
5325
|
userTagType: true
|
|
@@ -5228,22 +5327,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5228
5327
|
}
|
|
5229
5328
|
};
|
|
5230
5329
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5231
|
-
var
|
|
5330
|
+
var _extends11;
|
|
5232
5331
|
var _name = _ref2._name,
|
|
5233
5332
|
_value = _ref2._value;
|
|
5234
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5333
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5235
5334
|
};
|
|
5236
5335
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5237
|
-
var
|
|
5336
|
+
var _extends12;
|
|
5238
5337
|
var _name = _ref3._name,
|
|
5239
5338
|
_value = _ref3._value;
|
|
5240
|
-
|
|
5339
|
+
console.log(_name, _value, 'travel');
|
|
5340
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5241
5341
|
};
|
|
5242
5342
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5243
|
-
var
|
|
5343
|
+
var _extends13;
|
|
5244
5344
|
var _name = _ref4._name,
|
|
5245
5345
|
_value = _ref4._value;
|
|
5246
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5346
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5247
5347
|
};
|
|
5248
5348
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5249
5349
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5277,39 +5377,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5277
5377
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5278
5378
|
};
|
|
5279
5379
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5280
|
-
var
|
|
5380
|
+
var _extends14;
|
|
5281
5381
|
var _name = args._name,
|
|
5282
5382
|
_value = args._value,
|
|
5283
5383
|
_isError = args._isError,
|
|
5284
5384
|
_errorMsg = args._errorMsg;
|
|
5285
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5385
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5286
5386
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5287
|
-
var
|
|
5288
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5387
|
+
var _extends15;
|
|
5388
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5289
5389
|
}
|
|
5290
5390
|
updateError(_name, _isError, _errorMsg);
|
|
5291
5391
|
};
|
|
5292
5392
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5293
|
-
var
|
|
5393
|
+
var _extends16;
|
|
5294
5394
|
var _name = args._name,
|
|
5295
5395
|
_value = args._value,
|
|
5296
5396
|
_isError = args._isError,
|
|
5297
5397
|
_errorMsg = args._errorMsg;
|
|
5298
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5398
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5299
5399
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5300
|
-
var
|
|
5301
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5400
|
+
var _extends17;
|
|
5401
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5302
5402
|
}
|
|
5303
5403
|
updateError(_name, _isError, _errorMsg);
|
|
5304
5404
|
};
|
|
5305
5405
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5306
5406
|
try {
|
|
5307
5407
|
var _temp14 = function _temp14() {
|
|
5308
|
-
var
|
|
5309
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5408
|
+
var _extends18;
|
|
5409
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5310
5410
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5311
|
-
var
|
|
5312
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5411
|
+
var _extends19;
|
|
5412
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5313
5413
|
}
|
|
5314
5414
|
updateError(_name, _isError, _errorMsg);
|
|
5315
5415
|
};
|
|
@@ -5415,8 +5515,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5415
5515
|
return _errorArray;
|
|
5416
5516
|
});
|
|
5417
5517
|
setErrorMsgs(function (prevState) {
|
|
5418
|
-
var
|
|
5419
|
-
return _extends({}, prevState, (
|
|
5518
|
+
var _extends20;
|
|
5519
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5420
5520
|
});
|
|
5421
5521
|
};
|
|
5422
5522
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -6742,7 +6842,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6742
6842
|
};
|
|
6743
6843
|
};
|
|
6744
6844
|
|
|
6745
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
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"};
|
|
6746
6846
|
|
|
6747
6847
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6748
6848
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8527,6 +8627,25 @@ function InviteInfoIcon() {
|
|
|
8527
8627
|
}));
|
|
8528
8628
|
}
|
|
8529
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
|
+
|
|
8530
8649
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8531
8650
|
var env$7 = utils.configs.env;
|
|
8532
8651
|
var UndoButton = function UndoButton(_ref) {
|
|
@@ -8578,9 +8697,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8578
8697
|
var _React$useState3 = React__default.useState('asc'),
|
|
8579
8698
|
order = _React$useState3[0],
|
|
8580
8699
|
setOrder = _React$useState3[1];
|
|
8581
|
-
var _React$useState4 = React__default.useState(
|
|
8582
|
-
|
|
8583
|
-
|
|
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];
|
|
8584
8706
|
var _useState2 = React.useState(''),
|
|
8585
8707
|
searchValue = _useState2[0],
|
|
8586
8708
|
setSearchValue = _useState2[1];
|
|
@@ -8615,15 +8737,21 @@ var UserList = function UserList(_ref2) {
|
|
|
8615
8737
|
var _useState10 = React.useState(false),
|
|
8616
8738
|
isApiFetching = _useState10[0],
|
|
8617
8739
|
setisApiFetching = _useState10[1];
|
|
8618
|
-
var _useState11 = React.useState(
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
var
|
|
8625
|
-
|
|
8626
|
-
|
|
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];
|
|
8627
8755
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8628
8756
|
var prevPos = _ref3.prevPos,
|
|
8629
8757
|
currPos = _ref3.currPos;
|
|
@@ -8644,33 +8772,33 @@ var UserList = function UserList(_ref2) {
|
|
|
8644
8772
|
behavior: 'smooth'
|
|
8645
8773
|
});
|
|
8646
8774
|
};
|
|
8647
|
-
var _React$
|
|
8648
|
-
signup_page = _React$
|
|
8649
|
-
setSignUpPage = _React$
|
|
8650
|
-
var
|
|
8651
|
-
signup_rowsPerPage =
|
|
8652
|
-
setSignUpRowsPerPage =
|
|
8653
|
-
var _React$
|
|
8654
|
-
signup_order = _React$
|
|
8655
|
-
setSignUpOrder = _React$
|
|
8656
|
-
var _React$
|
|
8657
|
-
signup_orderBy = _React$
|
|
8658
|
-
setSignUpOrderBy = _React$
|
|
8659
|
-
var
|
|
8660
|
-
signup_searchValue =
|
|
8661
|
-
set_signup_SearchValue =
|
|
8662
|
-
var _useState15 = React.useState(false),
|
|
8663
|
-
isSignUpSortingChange = _useState15[0],
|
|
8664
|
-
setSignUpSortingChange = _useState15[1];
|
|
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];
|
|
8665
8790
|
var _useState16 = React.useState(false),
|
|
8666
|
-
|
|
8667
|
-
|
|
8791
|
+
isSignUpSortingChange = _useState16[0],
|
|
8792
|
+
setSignUpSortingChange = _useState16[1];
|
|
8668
8793
|
var _useState17 = React.useState(false),
|
|
8669
|
-
|
|
8670
|
-
|
|
8794
|
+
isSignUpSearchingChange = _useState17[0],
|
|
8795
|
+
setSignUpSearchingChange = _useState17[1];
|
|
8671
8796
|
var _useState18 = React.useState(false),
|
|
8672
|
-
|
|
8673
|
-
|
|
8797
|
+
isSignUpSortingChangeTemp = _useState18[0],
|
|
8798
|
+
setSignUpSortingChangeTemp = _useState18[1];
|
|
8799
|
+
var _useState19 = React.useState(false),
|
|
8800
|
+
isSignUpSearchingChangeTemp = _useState19[0],
|
|
8801
|
+
setSignUpSearchingChangeTemp = _useState19[1];
|
|
8674
8802
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8675
8803
|
return state.userList;
|
|
8676
8804
|
}),
|
|
@@ -9185,6 +9313,82 @@ var UserList = function UserList(_ref2) {
|
|
|
9185
9313
|
}))
|
|
9186
9314
|
}]
|
|
9187
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, {
|
|
9188
9392
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9189
9393
|
closeHandler: closeDeActivateModal,
|
|
9190
9394
|
cancelLabel: "Cancel",
|
|
@@ -9253,8 +9457,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9253
9457
|
errMsg: hasVerificationError
|
|
9254
9458
|
}));
|
|
9255
9459
|
};
|
|
9256
|
-
var TabLabelCount = function TabLabelCount(
|
|
9257
|
-
var count =
|
|
9460
|
+
var TabLabelCount = function TabLabelCount(_ref7) {
|
|
9461
|
+
var count = _ref7.count;
|
|
9258
9462
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9259
9463
|
className: styles$5.TabLabelCount
|
|
9260
9464
|
}, " ", count, " ");
|
|
@@ -9329,11 +9533,12 @@ function Header(props) {
|
|
|
9329
9533
|
})));
|
|
9330
9534
|
}
|
|
9331
9535
|
|
|
9332
|
-
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"};
|
|
9333
9537
|
|
|
9334
9538
|
function Listview(_ref) {
|
|
9335
9539
|
var data = _ref.data,
|
|
9336
9540
|
name = _ref.name,
|
|
9541
|
+
tableName = _ref.tableName,
|
|
9337
9542
|
handleEditDialog = _ref.handleEditDialog,
|
|
9338
9543
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9339
9544
|
orderBy = _ref.orderBy,
|
|
@@ -9346,16 +9551,82 @@ function Listview(_ref) {
|
|
|
9346
9551
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9347
9552
|
page = _ref.page,
|
|
9348
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
|
+
};
|
|
9349
9560
|
var columns = [{
|
|
9350
9561
|
id: 'name',
|
|
9351
9562
|
label: name,
|
|
9352
|
-
width: '
|
|
9563
|
+
width: '40%',
|
|
9564
|
+
sortable: true,
|
|
9565
|
+
cell: function cell(row) {
|
|
9566
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9567
|
+
component: "div"
|
|
9568
|
+
}, row.name);
|
|
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%',
|
|
9353
9612
|
sortable: true,
|
|
9354
9613
|
cell: function cell(row) {
|
|
9355
9614
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9356
9615
|
component: "div"
|
|
9357
9616
|
}, row.name);
|
|
9358
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
|
+
}
|
|
9359
9630
|
}, {
|
|
9360
9631
|
id: 'no_of_users',
|
|
9361
9632
|
label: 'Number of users',
|
|
@@ -9369,7 +9640,7 @@ function Listview(_ref) {
|
|
|
9369
9640
|
}, {
|
|
9370
9641
|
id: 'actions',
|
|
9371
9642
|
label: 'Actions',
|
|
9372
|
-
width: '
|
|
9643
|
+
width: '15%',
|
|
9373
9644
|
cell: function cell(row) {
|
|
9374
9645
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9375
9646
|
display: "flex"
|
|
@@ -9402,7 +9673,7 @@ function Listview(_ref) {
|
|
|
9402
9673
|
hasFilter: true,
|
|
9403
9674
|
isCheckboxTable: false,
|
|
9404
9675
|
count: data.count,
|
|
9405
|
-
columns: columns,
|
|
9676
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9406
9677
|
rows: data.results,
|
|
9407
9678
|
page: page,
|
|
9408
9679
|
handleChangePage: handleChangePage,
|
|
@@ -9459,15 +9730,44 @@ function EditPanelDialog(_ref) {
|
|
|
9459
9730
|
var isOpen = _ref.isOpen,
|
|
9460
9731
|
closeHandler = _ref.closeHandler,
|
|
9461
9732
|
onValueChange = _ref.onValueChange,
|
|
9462
|
-
|
|
9733
|
+
_submitHandler = _ref.submitHandler,
|
|
9463
9734
|
isError = _ref.isError,
|
|
9464
9735
|
name = _ref.name,
|
|
9465
9736
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9466
|
-
validation = _ref.validation
|
|
9737
|
+
validation = _ref.validation,
|
|
9738
|
+
rowData = _ref.rowData,
|
|
9739
|
+
tableName = _ref.tableName,
|
|
9740
|
+
config = _ref.config;
|
|
9467
9741
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9468
9742
|
return state.userPanel;
|
|
9469
9743
|
}),
|
|
9470
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
|
+
};
|
|
9471
9771
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9472
9772
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9473
9773
|
isOpen: isOpen,
|
|
@@ -9475,25 +9775,59 @@ function EditPanelDialog(_ref) {
|
|
|
9475
9775
|
headerText: "Edit " + name.toLowerCase(),
|
|
9476
9776
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9477
9777
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9478
|
-
submitHandler: submitHandler
|
|
9479
|
-
|
|
9778
|
+
submitHandler: function submitHandler() {
|
|
9779
|
+
return _submitHandler(head);
|
|
9780
|
+
},
|
|
9781
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9480
9782
|
hideCloseIcon: false,
|
|
9481
9783
|
modalBodyStyle: {
|
|
9482
|
-
|
|
9483
|
-
overflow: 'auto',
|
|
9484
|
-
margin: '0px'
|
|
9784
|
+
overflowY: 'visible'
|
|
9485
9785
|
},
|
|
9486
9786
|
footerStyle: {
|
|
9487
9787
|
justifyContent: 'end'
|
|
9488
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
|
+
}
|
|
9489
9797
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9490
|
-
component: "div",
|
|
9491
9798
|
display: "flex",
|
|
9492
9799
|
justifyContent: "center",
|
|
9493
9800
|
alignItems: "center",
|
|
9494
9801
|
flexDirection: "column",
|
|
9495
|
-
|
|
9496
|
-
}, /*#__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, {
|
|
9497
9831
|
label: name + " name",
|
|
9498
9832
|
name: "name",
|
|
9499
9833
|
defaultValue: dialogData.data.name,
|
|
@@ -9502,7 +9836,49 @@ function EditPanelDialog(_ref) {
|
|
|
9502
9836
|
isError: isError,
|
|
9503
9837
|
validation: validation,
|
|
9504
9838
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9505
|
-
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
|
+
}
|
|
9506
9882
|
})));
|
|
9507
9883
|
}
|
|
9508
9884
|
|
|
@@ -9681,12 +10057,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9681
10057
|
var _useState13 = React.useState(false),
|
|
9682
10058
|
isSortingChangeTemp = _useState13[0],
|
|
9683
10059
|
setSortingChangeTemp = _useState13[1];
|
|
9684
|
-
var _useState14 = React.useState(
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
var _useState15 = React.useState(
|
|
9688
|
-
|
|
9689
|
-
|
|
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];
|
|
9690
10069
|
var orderingParam = orderBy;
|
|
9691
10070
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9692
10071
|
return state.userPanel;
|
|
@@ -9782,6 +10161,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9782
10161
|
submitLabel: 'Save'
|
|
9783
10162
|
}, '', data));
|
|
9784
10163
|
setDataList(data.name);
|
|
10164
|
+
setRowData(data);
|
|
9785
10165
|
setEditModal(true);
|
|
9786
10166
|
};
|
|
9787
10167
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9796,6 +10176,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9796
10176
|
var payload = {
|
|
9797
10177
|
names: [dataList]
|
|
9798
10178
|
};
|
|
10179
|
+
if (tableName === 'department') {
|
|
10180
|
+
payload = {
|
|
10181
|
+
name: dataList,
|
|
10182
|
+
department_head_id: null
|
|
10183
|
+
};
|
|
10184
|
+
}
|
|
9799
10185
|
var message = title + " added successfully.";
|
|
9800
10186
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9801
10187
|
} else {
|
|
@@ -9809,9 +10195,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9809
10195
|
var message = title + " deleted successfully.";
|
|
9810
10196
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9811
10197
|
};
|
|
9812
|
-
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
|
+
}
|
|
9813
10202
|
dispatch(userPanelShowLoader());
|
|
9814
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10203
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9815
10204
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9816
10205
|
dispatch(userPanelStopLoader());
|
|
9817
10206
|
if (type === 'delete') {
|
|
@@ -9853,8 +10242,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9853
10242
|
name: dataList
|
|
9854
10243
|
}]
|
|
9855
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
|
+
}
|
|
9856
10251
|
var message = title + " updated successfully.";
|
|
9857
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10252
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9858
10253
|
setErrorEdit(false);
|
|
9859
10254
|
} else {
|
|
9860
10255
|
setErrorEdit(true);
|
|
@@ -9961,7 +10356,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9961
10356
|
submitHandler: handleEditPanel,
|
|
9962
10357
|
isError: errorEdit,
|
|
9963
10358
|
isDisabledSubmitBtn: loading,
|
|
9964
|
-
validation: validation
|
|
10359
|
+
validation: validation,
|
|
10360
|
+
rowData: rowData,
|
|
10361
|
+
tableName: tableName,
|
|
10362
|
+
config: config
|
|
9965
10363
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9966
10364
|
config: config
|
|
9967
10365
|
}));
|