@itilite/iui-user-management 0.4.36 → 0.4.38

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.
@@ -9,7 +9,7 @@ import { combineReducers, createStore, applyMiddleware } from 'redux';
9
9
  import thunk from 'redux-thunk';
10
10
  import moment from 'moment';
11
11
  import { composeWithDevTools } from 'redux-devtools-extension';
12
- import { useHistory, useLocation } from 'react-router-dom';
12
+ import { useHistory } from 'react-router-dom';
13
13
  import { withStyles, makeStyles } from '@material-ui/core/styles';
14
14
  import Tooltip from '@material-ui/core/Tooltip';
15
15
  import Switch from '@material-ui/core/Switch';
@@ -456,14 +456,6 @@ var userPanelUrl = {
456
456
  return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
457
457
  }
458
458
  };
459
- var departmentUrl = {
460
- departmentUrl: function departmentUrl() {
461
- return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
462
- },
463
- getDepartmentHead: function getDepartmentHead(departmentId, page) {
464
- return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
465
- }
466
- };
467
459
 
468
460
  var api = configs.api;
469
461
  var NAoptionConfig = {
@@ -692,46 +684,6 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
692
684
  return Promise.reject(e);
693
685
  }
694
686
  };
695
- var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
696
- var page = _ref6.page,
697
- departmentId = _ref6.departmentId;
698
- try {
699
- return Promise.resolve(_catch(function () {
700
- return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
701
- return res.data;
702
- })).then(function (response) {
703
- var mappedValue = response.results.map(function (item) {
704
- return {
705
- value: item.id,
706
- label: item.first_name + ' ' + item.last_name,
707
- type: 'detailed',
708
- data: item
709
- };
710
- });
711
- console.log(response.next);
712
- return {
713
- options: mappedValue,
714
- hasMore: !!response.next,
715
- additional: {
716
- page: page + 1,
717
- departmentId: departmentId
718
- }
719
- };
720
- });
721
- }, function () {
722
- return {
723
- options: [],
724
- hasMore: false,
725
- additional: {
726
- page: 1,
727
- departmentId: departmentId
728
- }
729
- };
730
- }));
731
- } catch (e) {
732
- return Promise.reject(e);
733
- }
734
- };
735
687
 
736
688
  var UserRole = function UserRole(_ref) {
737
689
  var _ref$list = _ref.list,
@@ -1767,7 +1719,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
1767
1719
  var submitAddModalData = function submitAddModalData(tableName, data) {
1768
1720
  return function (dispatch) {
1769
1721
  return new Promise(function (resolve, reject) {
1770
- api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
1722
+ api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
1771
1723
  resolve(res);
1772
1724
  })["catch"](function (err) {
1773
1725
  var _err$response17, _err$response17$data;
@@ -1803,7 +1755,6 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
1803
1755
  var CLOSE_DIALOG = 'CLOSE_DIALOG';
1804
1756
  var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
1805
1757
  var UNASSIGNED_USERS = 'Not assigned';
1806
- var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
1807
1758
 
1808
1759
  var api$3 = configs.api;
1809
1760
  var IUIToastMessageService$2 = services.IUIToastMessageService;
@@ -1853,14 +1804,14 @@ var getUserPanalData = function getUserPanalData(params) {
1853
1804
  var addRecord = function addRecord(tableName, data, getParam) {
1854
1805
  return function (dispatch) {
1855
1806
  return new Promise(function (resolve, reject) {
1856
- api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
1807
+ api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
1857
1808
  dispatch(getUserPanalData(getParam));
1858
1809
  dispatch(closeDialog());
1859
1810
  resolve(res);
1860
1811
  })["catch"](function (err) {
1861
- var _err$response3, _err$response3$data;
1812
+ var _err$response2, _err$response2$data;
1862
1813
  dispatch(userPanelStopLoader());
1863
- 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.');
1814
+ IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response2 = err.response) === null || _err$response2 === void 0 ? void 0 : (_err$response2$data = _err$response2.data) === null || _err$response2$data === void 0 ? void 0 : _err$response2$data.message) || 'Opps, Something went wrong.');
1864
1815
  });
1865
1816
  });
1866
1817
  };
@@ -1874,37 +1825,25 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
1874
1825
  dispatch(userPanelStopLoader());
1875
1826
  resolve();
1876
1827
  })["catch"](function (err) {
1877
- var _err$response4, _err$response4$data;
1878
- 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.');
1828
+ var _err$response3, _err$response3$data;
1829
+ 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.');
1879
1830
  dispatch(userPanelStopLoader());
1880
1831
  });
1881
1832
  });
1882
1833
  };
1883
1834
  };
1884
- var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
1835
+ var editRecord = function editRecord(tableName, data, getParam) {
1885
1836
  return function (dispatch) {
1886
1837
  return new Promise(function (resolve, reject) {
1887
- if (tableName === 'department') {
1888
- api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
1889
- dispatch(getUserPanalData(getParam));
1890
- dispatch(closeDialog());
1891
- resolve();
1892
- })["catch"](function (err) {
1893
- var _err$response5, _err$response5$data;
1894
- dispatch(userPanelStopLoader());
1895
- 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.');
1896
- });
1897
- } else {
1898
- api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
1899
- dispatch(getUserPanalData(getParam));
1900
- dispatch(closeDialog());
1901
- resolve();
1902
- })["catch"](function (err) {
1903
- var _err$response6, _err$response6$data;
1904
- dispatch(userPanelStopLoader());
1905
- 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.');
1906
- });
1907
- }
1838
+ api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
1839
+ dispatch(getUserPanalData(getParam));
1840
+ dispatch(closeDialog());
1841
+ resolve();
1842
+ })["catch"](function (err) {
1843
+ var _err$response4, _err$response4$data;
1844
+ dispatch(userPanelStopLoader());
1845
+ 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.');
1846
+ });
1908
1847
  });
1909
1848
  };
1910
1849
  };
@@ -1916,8 +1855,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
1916
1855
  dispatch(closeDialog());
1917
1856
  resolve(res);
1918
1857
  })["catch"](function (err) {
1919
- var _err$response7, _err$response7$data;
1920
- 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.');
1858
+ var _err$response5, _err$response5$data;
1859
+ 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.');
1921
1860
  });
1922
1861
  });
1923
1862
  };
@@ -3107,6 +3046,31 @@ var workInfo = [{
3107
3046
  minLength: 0
3108
3047
  },
3109
3048
  disableText: 'Please get in touch with your administrator to change this value.'
3049
+ }, {
3050
+ id: 7,
3051
+ label: 'Manager',
3052
+ name: 'manager',
3053
+ required: false,
3054
+ type: 'async_select',
3055
+ fullWidth: false,
3056
+ visibility: true,
3057
+ readOnly: false,
3058
+ placeholder: 'Select manager',
3059
+ tabelName: 'manager',
3060
+ product: 'travel',
3061
+ loadOption: approversOptions
3062
+ }, {
3063
+ id: 8,
3064
+ label: 'Skip manager',
3065
+ name: 'skip_manager',
3066
+ required: false,
3067
+ type: 'async_select',
3068
+ fullWidth: false,
3069
+ visibility: true,
3070
+ readOnly: false,
3071
+ placeholder: 'Select manager',
3072
+ product: 'travel',
3073
+ loadOption: approversOptions
3110
3074
  }, {
3111
3075
  id: 9,
3112
3076
  label: 'Base location',
@@ -4017,7 +3981,6 @@ var initialState$2 = {
4017
3981
  previous: null,
4018
3982
  results: []
4019
3983
  },
4020
- deptUsers: [],
4021
3984
  loading: false
4022
3985
  };
4023
3986
  var reducer$2 = function reducer(state, action) {
@@ -4087,12 +4050,6 @@ var reducer$2 = function reducer(state, action) {
4087
4050
  loading: false
4088
4051
  });
4089
4052
  }
4090
- case FETCH_DEPARTMENT_USERS_DATA:
4091
- {
4092
- return _extends({}, state, {
4093
- deptUsers: action.payload
4094
- });
4095
- }
4096
4053
  default:
4097
4054
  return state;
4098
4055
  }
@@ -4871,7 +4828,6 @@ var UserAddEdit = function UserAddEdit(props) {
4871
4828
  isILadmin = _useSelector2.isILadmin,
4872
4829
  companyName = _useSelector2.companyName;
4873
4830
  var history = useHistory();
4874
- var location = useLocation();
4875
4831
  var _useState = useState({
4876
4832
  travel: false,
4877
4833
  expense: false
@@ -4940,6 +4896,14 @@ var UserAddEdit = function UserAddEdit(props) {
4940
4896
  },
4941
4897
  designation: '',
4942
4898
  base_location: '',
4899
+ manager: {
4900
+ value: '',
4901
+ label: 'Select Manager'
4902
+ },
4903
+ skip_manager: {
4904
+ value: '',
4905
+ label: 'Select Manager'
4906
+ },
4943
4907
  currency: {
4944
4908
  value: defaultCurrency,
4945
4909
  label: defaultCurrency
@@ -5127,18 +5091,6 @@ var UserAddEdit = function UserAddEdit(props) {
5127
5091
  var onAddModalClose = function onAddModalClose() {
5128
5092
  setAddModalData(_extends({}, defaultAddModalData));
5129
5093
  };
5130
- useEffect(function () {
5131
- var _location$state, _location$state2;
5132
- 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) {
5133
- var _location$state3, _location$state4;
5134
- setEmployeeInfoInput(_extends({}, employeeInfoInput, {
5135
- department: {
5136
- value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
5137
- label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
5138
- }
5139
- }));
5140
- }
5141
- }, []);
5142
5094
  var onModalOpen = function onModalOpen(e, id) {
5143
5095
  var title = '';
5144
5096
  if (id === 'entity') {
@@ -5164,18 +5116,9 @@ var UserAddEdit = function UserAddEdit(props) {
5164
5116
  }));
5165
5117
  } else {
5166
5118
  dispatch(showLoader());
5167
- var dataObj;
5168
- if (addModalData.id === 'department') {
5169
- dataObj = {
5170
- name: validatedValue,
5171
- department_head_id: null
5172
- };
5173
- } else {
5174
- dataObj = {
5175
- names: [validatedValue]
5176
- };
5177
- }
5178
- dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
5119
+ dispatch(submitAddModalData(addModalData.id, {
5120
+ names: [validatedValue]
5121
+ })).then(function (res) {
5179
5122
  var _extends2, _extends3;
5180
5123
  setAddModalData(_extends({}, addModalData, {
5181
5124
  isOpen: false
@@ -5183,8 +5126,8 @@ var UserAddEdit = function UserAddEdit(props) {
5183
5126
  IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
5184
5127
  var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
5185
5128
  setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
5186
- value: res.data.result.id,
5187
- label: res.data.result.name
5129
+ value: res.data.value,
5130
+ label: res.data.label
5188
5131
  }, _extends2)));
5189
5132
  updateInputChangeLog(_extends({}, inputChangeLog, (_extends3 = {}, _extends3[tempKey] = true, _extends3)));
5190
5133
  asyncSelectRefs.current[tempKey].current.blur();
@@ -5324,7 +5267,6 @@ var UserAddEdit = function UserAddEdit(props) {
5324
5267
  var _extends11;
5325
5268
  var _name = _ref3._name,
5326
5269
  _value = _ref3._value;
5327
- console.log(_name, _value, 'travel');
5328
5270
  setTravelApproversInput(_extends({}, travelApproversInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
5329
5271
  };
5330
5272
  var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
@@ -5843,10 +5785,23 @@ var UserAddEdit = function UserAddEdit(props) {
5843
5785
  IUIToastMessageService$4.warningNotify(checkAnyError);
5844
5786
  return Promise.resolve();
5845
5787
  }
5788
+ var manager_info = {
5789
+ manager: '',
5790
+ skip_manager: ''
5791
+ };
5792
+ if (employeeInfoInput.manager.value !== '') {
5793
+ manager_info.manager = employeeInfoInput.manager.value;
5794
+ delete employeeInfoInput.manager;
5795
+ }
5796
+ if (employeeInfoInput.skip_manager.value !== '') {
5797
+ manager_info.skip_manager = employeeInfoInput.skip_manager.value;
5798
+ delete employeeInfoInput.skip_manager;
5799
+ }
5846
5800
  var payload = {
5847
5801
  personalInfoInput: personalInfoInput,
5848
5802
  employeeInfoInput: employeeInfoInput,
5849
5803
  customFieldsInput: customFieldsInput,
5804
+ manager_info: manager_info,
5850
5805
  productAccess: productAccess,
5851
5806
  travelRole: travelRole,
5852
5807
  travelApproversInput: travelApproversInput,
@@ -6009,7 +5964,6 @@ var UserAddEdit = function UserAddEdit(props) {
6009
5964
  }
6010
5965
  }
6011
5966
  }
6012
- return Promise.resolve();
6013
5967
  }
6014
5968
  if (isEditMode && editUserId || isProfile) {
6015
5969
  dispatch(showLoader());
@@ -6830,7 +6784,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
6830
6784
  };
6831
6785
  };
6832
6786
 
6833
- 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"};
6787
+ 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"};
6834
6788
 
6835
6789
  var BulkUploadModal = function BulkUploadModal(props) {
6836
6790
  var isOpenImportUsersModal = props.isOpenImportUsersModal,
@@ -8615,25 +8569,6 @@ function InviteInfoIcon() {
8615
8569
  }));
8616
8570
  }
8617
8571
 
8618
- function InfoYellowIcon(props) {
8619
- return /*#__PURE__*/React.createElement("svg", {
8620
- width: props.width,
8621
- height: props.height,
8622
- viewBox: "0 0 20 20",
8623
- fill: "none",
8624
- xmlns: "http://www.w3.org/2000/svg"
8625
- }, /*#__PURE__*/React.createElement("path", {
8626
- 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",
8627
- fill: "#CA8A04"
8628
- }), /*#__PURE__*/React.createElement("path", {
8629
- 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",
8630
- fill: "#CA8A04"
8631
- }), /*#__PURE__*/React.createElement("path", {
8632
- 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",
8633
- fill: "#CA8A04"
8634
- }));
8635
- }
8636
-
8637
8572
  var IUIToastMessageService$7 = services.IUIToastMessageService;
8638
8573
  var env$7 = configs.env;
8639
8574
  var UndoButton = function UndoButton(_ref) {
@@ -8685,12 +8620,9 @@ var UserList = function UserList(_ref2) {
8685
8620
  var _React$useState3 = React.useState('asc'),
8686
8621
  order = _React$useState3[0],
8687
8622
  setOrder = _React$useState3[1];
8688
- var _React$useState4 = React.useState(false),
8689
- deactivateSingle = _React$useState4[0],
8690
- setDeactivateSingle = _React$useState4[1];
8691
- var _React$useState5 = React.useState('first_name'),
8692
- orderBy = _React$useState5[0],
8693
- setOrderBy = _React$useState5[1];
8623
+ var _React$useState4 = React.useState('first_name'),
8624
+ orderBy = _React$useState4[0],
8625
+ setOrderBy = _React$useState4[1];
8694
8626
  var _useState2 = useState(''),
8695
8627
  searchValue = _useState2[0],
8696
8628
  setSearchValue = _useState2[1];
@@ -8725,21 +8657,15 @@ var UserList = function UserList(_ref2) {
8725
8657
  var _useState10 = useState(false),
8726
8658
  isApiFetching = _useState10[0],
8727
8659
  setisApiFetching = _useState10[1];
8728
- var _useState11 = useState({
8729
- value: '',
8730
- label: 'Select approver'
8731
- }),
8732
- travelFYI = _useState11[0],
8733
- setTravelFYI = _useState11[1];
8734
- var _useState12 = useState(false),
8735
- showInviteModal = _useState12[0],
8736
- setToggleInviteModal = _useState12[1];
8737
- var _useState13 = useState(''),
8738
- userIds = _useState13[0],
8739
- setUserIds = _useState13[1];
8740
- var _React$useState6 = React.useState(false),
8741
- overlayMenu = _React$useState6[0],
8742
- setOverlayMenu = _React$useState6[1];
8660
+ var _useState11 = useState(false),
8661
+ showInviteModal = _useState11[0],
8662
+ setToggleInviteModal = _useState11[1];
8663
+ var _useState12 = useState(''),
8664
+ userIds = _useState12[0],
8665
+ setUserIds = _useState12[1];
8666
+ var _React$useState5 = React.useState(false),
8667
+ overlayMenu = _React$useState5[0],
8668
+ setOverlayMenu = _React$useState5[1];
8743
8669
  useScrollPosition(function (_ref3) {
8744
8670
  var prevPos = _ref3.prevPos,
8745
8671
  currPos = _ref3.currPos;
@@ -8760,33 +8686,33 @@ var UserList = function UserList(_ref2) {
8760
8686
  behavior: 'smooth'
8761
8687
  });
8762
8688
  };
8763
- var _React$useState7 = React.useState(1),
8764
- signup_page = _React$useState7[0],
8765
- setSignUpPage = _React$useState7[1];
8766
- var _useState14 = useState(5),
8767
- signup_rowsPerPage = _useState14[0],
8768
- setSignUpRowsPerPage = _useState14[1];
8769
- var _React$useState8 = React.useState('asc'),
8770
- signup_order = _React$useState8[0],
8771
- setSignUpOrder = _React$useState8[1];
8772
- var _React$useState9 = React.useState('fname'),
8773
- signup_orderBy = _React$useState9[0],
8774
- setSignUpOrderBy = _React$useState9[1];
8775
- var _useState15 = useState(''),
8776
- signup_searchValue = _useState15[0],
8777
- set_signup_SearchValue = _useState15[1];
8689
+ var _React$useState6 = React.useState(1),
8690
+ signup_page = _React$useState6[0],
8691
+ setSignUpPage = _React$useState6[1];
8692
+ var _useState13 = useState(5),
8693
+ signup_rowsPerPage = _useState13[0],
8694
+ setSignUpRowsPerPage = _useState13[1];
8695
+ var _React$useState7 = React.useState('asc'),
8696
+ signup_order = _React$useState7[0],
8697
+ setSignUpOrder = _React$useState7[1];
8698
+ var _React$useState8 = React.useState('fname'),
8699
+ signup_orderBy = _React$useState8[0],
8700
+ setSignUpOrderBy = _React$useState8[1];
8701
+ var _useState14 = useState(''),
8702
+ signup_searchValue = _useState14[0],
8703
+ set_signup_SearchValue = _useState14[1];
8704
+ var _useState15 = useState(false),
8705
+ isSignUpSortingChange = _useState15[0],
8706
+ setSignUpSortingChange = _useState15[1];
8778
8707
  var _useState16 = useState(false),
8779
- isSignUpSortingChange = _useState16[0],
8780
- setSignUpSortingChange = _useState16[1];
8708
+ isSignUpSearchingChange = _useState16[0],
8709
+ setSignUpSearchingChange = _useState16[1];
8781
8710
  var _useState17 = useState(false),
8782
- isSignUpSearchingChange = _useState17[0],
8783
- setSignUpSearchingChange = _useState17[1];
8711
+ isSignUpSortingChangeTemp = _useState17[0],
8712
+ setSignUpSortingChangeTemp = _useState17[1];
8784
8713
  var _useState18 = useState(false),
8785
- isSignUpSortingChangeTemp = _useState18[0],
8786
- setSignUpSortingChangeTemp = _useState18[1];
8787
- var _useState19 = useState(false),
8788
- isSignUpSearchingChangeTemp = _useState19[0],
8789
- setSignUpSearchingChangeTemp = _useState19[1];
8714
+ isSignUpSearchingChangeTemp = _useState18[0],
8715
+ setSignUpSearchingChangeTemp = _useState18[1];
8790
8716
  var _useSelector3 = useSelector(function (state) {
8791
8717
  return state.userList;
8792
8718
  }),
@@ -9301,82 +9227,6 @@ var UserList = function UserList(_ref2) {
9301
9227
  }))
9302
9228
  }]
9303
9229
  }))), /*#__PURE__*/React.createElement(IUIModal, {
9304
- isOpen: deactivateSingle,
9305
- closeHandler: function closeHandler() {
9306
- setDeactivateSingle(false);
9307
- },
9308
- cancelLabel: "Cancel",
9309
- submitLabel: "Deactivate",
9310
- submitHandler: handleDeactivateUsers,
9311
- headerText: "Deactivate this user?",
9312
- width: "400px",
9313
- subHanderText: "",
9314
- submitBtnClass: styles$5.deactivateBtn,
9315
- isDisabledSubmitBtn: true
9316
- }, /*#__PURE__*/React.createElement(IUIBox, {
9317
- className: styles$5.deactivateSingle
9318
- }, /*#__PURE__*/React.createElement(IUIBox, {
9319
- className: styles$5.deactivateAlert
9320
- }, /*#__PURE__*/React.createElement(InfoYellowIcon, {
9321
- width: "9",
9322
- height: "9"
9323
- }), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.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.createElement(IUIBox, {
9324
- className: "iui__mb-15 iui__mt-15"
9325
- }, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
9326
- isMove: true,
9327
- additional: {
9328
- page: 1,
9329
- product: 'travel',
9330
- placeholder: 'Select a user'
9331
- },
9332
- placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
9333
- label: "Transfer admin role to",
9334
- value: travelFYI,
9335
- onValueChange: function onValueChange(_ref4) {
9336
- var _value = _ref4._value;
9337
- return setTravelFYI(_value);
9338
- },
9339
- loadOption: approversOptions,
9340
- disableText: "Please get in touch with your administrator to change this value."
9341
- })), /*#__PURE__*/React.createElement(IUITypography, {
9342
- className: clsx('iui__mb-5', styles$5.departmentHeadText)
9343
- }, "Anvesh Dunna is the department head for: Product Design."), /*#__PURE__*/React.createElement(IUIBox, {
9344
- className: "iui__mb-15"
9345
- }, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
9346
- isMove: true,
9347
- additional: {
9348
- page: 1,
9349
- product: 'travel',
9350
- placeholder: 'Select a user'
9351
- },
9352
- placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
9353
- label: "Transfer department head role to",
9354
- value: travelFYI,
9355
- onValueChange: function onValueChange(_ref5) {
9356
- var _value = _ref5._value;
9357
- return setTravelFYI(_value);
9358
- },
9359
- loadOption: approversOptions,
9360
- disableText: "Please get in touch with your administrator to change this value."
9361
- })), /*#__PURE__*/React.createElement(IUIBox, {
9362
- className: "iui__mb-15"
9363
- }, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
9364
- isMove: true,
9365
- additional: {
9366
- page: 1,
9367
- product: 'travel',
9368
- placeholder: 'Select a user'
9369
- },
9370
- placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
9371
- label: "Transfer approver role to",
9372
- value: travelFYI,
9373
- onValueChange: function onValueChange(_ref6) {
9374
- var _value = _ref6._value;
9375
- return setTravelFYI(_value);
9376
- },
9377
- loadOption: approversOptions,
9378
- disableText: "Please get in touch with your administrator to change this value."
9379
- })))), /*#__PURE__*/React.createElement(IUIModal, {
9380
9230
  isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
9381
9231
  closeHandler: closeDeActivateModal,
9382
9232
  cancelLabel: "Cancel",
@@ -9445,8 +9295,8 @@ var UserList = function UserList(_ref2) {
9445
9295
  errMsg: hasVerificationError
9446
9296
  }));
9447
9297
  };
9448
- var TabLabelCount = function TabLabelCount(_ref7) {
9449
- var count = _ref7.count;
9298
+ var TabLabelCount = function TabLabelCount(_ref4) {
9299
+ var count = _ref4.count;
9450
9300
  return /*#__PURE__*/React.createElement(IUIBox, {
9451
9301
  className: styles$5.TabLabelCount
9452
9302
  }, " ", count, " ");
@@ -9521,12 +9371,11 @@ function Header(props) {
9521
9371
  })));
9522
9372
  }
9523
9373
 
9524
- 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"};
9374
+ 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"};
9525
9375
 
9526
9376
  function Listview(_ref) {
9527
9377
  var data = _ref.data,
9528
9378
  name = _ref.name,
9529
- tableName = _ref.tableName,
9530
9379
  handleEditDialog = _ref.handleEditDialog,
9531
9380
  handleDeleteDialog = _ref.handleDeleteDialog,
9532
9381
  orderBy = _ref.orderBy,
@@ -9539,82 +9388,16 @@ function Listview(_ref) {
9539
9388
  handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
9540
9389
  page = _ref.page,
9541
9390
  rowsPerPage = _ref.rowsPerPage;
9542
- var deptHeadDetails = function deptHeadDetails(data) {
9543
- var _data$dept_head_detai;
9544
- 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) {
9545
- return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
9546
- }
9547
- };
9548
9391
  var columns = [{
9549
9392
  id: 'name',
9550
9393
  label: name,
9551
- width: '40%',
9552
- sortable: true,
9553
- cell: function cell(row) {
9554
- return /*#__PURE__*/React.createElement(IUIBox, {
9555
- component: "div"
9556
- }, row.name);
9557
- }
9558
- }, {
9559
- id: 'no_of_users',
9560
- label: 'Number of users',
9561
- width: '40%',
9562
- sortable: true,
9563
- cell: function cell(row) {
9564
- return /*#__PURE__*/React.createElement(IUIBox, {
9565
- component: "div"
9566
- }, row.no_of_users);
9567
- }
9568
- }, {
9569
- id: 'actions',
9570
- label: 'Actions',
9571
- width: '20%',
9572
- cell: function cell(row) {
9573
- return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
9574
- display: "flex"
9575
- }, /*#__PURE__*/React.createElement(IUIButton, {
9576
- buttonText: "Edit",
9577
- className: styles$7.buttonWidth,
9578
- onClick: function onClick() {
9579
- return handleEditDialog(row);
9580
- }
9581
- }), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
9582
- buttonText: "Delete",
9583
- className: styles$7.buttonWidth,
9584
- onClick: function onClick() {
9585
- return handleDeleteDialog(row, true);
9586
- }
9587
- }) : /*#__PURE__*/React.createElement(IUIButton, {
9588
- buttonText: "Delete",
9589
- className: styles$7.buttonWidth,
9590
- onClick: function onClick() {
9591
- return handleDeleteDialog(row, false);
9592
- }
9593
- }));
9594
- }
9595
- }];
9596
- var departmentColumns = [{
9597
- id: 'name',
9598
- label: name,
9599
- width: '30%',
9394
+ width: '45%',
9600
9395
  sortable: true,
9601
9396
  cell: function cell(row) {
9602
9397
  return /*#__PURE__*/React.createElement(IUIBox, {
9603
9398
  component: "div"
9604
9399
  }, row.name);
9605
9400
  }
9606
- }, {
9607
- id: 'department_head',
9608
- label: 'Department head',
9609
- width: '30%',
9610
- sortable: true,
9611
- cell: function cell(row) {
9612
- return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
9613
- component: "div"
9614
- }, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
9615
- className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
9616
- }, "Assigned by default"));
9617
- }
9618
9401
  }, {
9619
9402
  id: 'no_of_users',
9620
9403
  label: 'Number of users',
@@ -9628,7 +9411,7 @@ function Listview(_ref) {
9628
9411
  }, {
9629
9412
  id: 'actions',
9630
9413
  label: 'Actions',
9631
- width: '15%',
9414
+ width: '10%',
9632
9415
  cell: function cell(row) {
9633
9416
  return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
9634
9417
  display: "flex"
@@ -9661,7 +9444,7 @@ function Listview(_ref) {
9661
9444
  hasFilter: true,
9662
9445
  isCheckboxTable: false,
9663
9446
  count: data.count,
9664
- columns: tableName === 'department' ? departmentColumns : columns,
9447
+ columns: columns,
9665
9448
  rows: data.results,
9666
9449
  page: page,
9667
9450
  handleChangePage: handleChangePage,
@@ -9718,44 +9501,15 @@ function EditPanelDialog(_ref) {
9718
9501
  var isOpen = _ref.isOpen,
9719
9502
  closeHandler = _ref.closeHandler,
9720
9503
  onValueChange = _ref.onValueChange,
9721
- _submitHandler = _ref.submitHandler,
9504
+ submitHandler = _ref.submitHandler,
9722
9505
  isError = _ref.isError,
9723
9506
  name = _ref.name,
9724
9507
  isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
9725
- validation = _ref.validation,
9726
- rowData = _ref.rowData,
9727
- tableName = _ref.tableName,
9728
- config = _ref.config;
9508
+ validation = _ref.validation;
9729
9509
  var _useSelector = useSelector(function (state) {
9730
9510
  return state.userPanel;
9731
9511
  }),
9732
9512
  dialogData = _useSelector.dialogData;
9733
- var deptHeadDetails = function deptHeadDetails(data) {
9734
- var _data$dept_head_detai;
9735
- 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) {
9736
- setHead({
9737
- value: data.dept_head_details[0].id,
9738
- label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
9739
- });
9740
- }
9741
- };
9742
- var _useState = useState({
9743
- value: '',
9744
- label: 'Select'
9745
- }),
9746
- head = _useState[0],
9747
- setHead = _useState[1];
9748
- useEffect(function () {
9749
- deptHeadDetails(rowData);
9750
- }, [rowData]);
9751
- var history = useHistory();
9752
- var handleAddPageNavigation = function handleAddPageNavigation() {
9753
- console.log(rowData);
9754
- history.push({
9755
- pathname: config.routes.users.add.path,
9756
- state: rowData
9757
- });
9758
- };
9759
9513
  return /*#__PURE__*/React.createElement(IUIModal, {
9760
9514
  isDisabledSubmitBtn: isDisabledSubmitBtn,
9761
9515
  isOpen: isOpen,
@@ -9763,59 +9517,25 @@ function EditPanelDialog(_ref) {
9763
9517
  headerText: "Edit " + name.toLowerCase(),
9764
9518
  cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
9765
9519
  submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
9766
- submitHandler: function submitHandler() {
9767
- return _submitHandler(head);
9768
- },
9769
- width: tableName === 'department' ? '400px' : '365px',
9520
+ submitHandler: submitHandler,
9521
+ width: "365px",
9770
9522
  hideCloseIcon: false,
9771
9523
  modalBodyStyle: {
9772
- overflowY: 'visible'
9524
+ maxHeight: '400px',
9525
+ overflow: 'auto',
9526
+ margin: '0px'
9773
9527
  },
9774
9528
  footerStyle: {
9775
9529
  justifyContent: 'end'
9776
9530
  }
9777
- }, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
9778
- display: "flex",
9779
- justifyContent: "center",
9780
- alignItems: "center",
9781
- flexDirection: "column",
9782
- style: {
9783
- marginBottom: '30px'
9784
- }
9785
9531
  }, /*#__PURE__*/React.createElement(IUIBox, {
9532
+ component: "div",
9786
9533
  display: "flex",
9787
9534
  justifyContent: "center",
9788
9535
  alignItems: "center",
9789
9536
  flexDirection: "column",
9790
- className: styles$7.baseAlert
9791
- }, /*#__PURE__*/React.createElement(IUIBox, {
9792
- className: styles$7.alertDescContainer
9793
- }, /*#__PURE__*/React.createElement(IUIBox, {
9794
- className: styles$7.iconLayout,
9795
- style: {
9796
- paddingTop: '4px'
9797
- }
9798
- }, /*#__PURE__*/React.createElement(BoldInfoIcon, {
9799
- color: "#CA8A04",
9800
- width: "25",
9801
- height: "20",
9802
- className: styles$7.iconStyle
9803
- })), /*#__PURE__*/React.createElement(IUILabel, {
9804
- 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.",
9805
- style: {
9806
- fontWeight: 'normal'
9807
- }
9808
- })), /*#__PURE__*/React.createElement(IUIButton, {
9809
- buttonText: "Add user",
9810
- type: "text",
9811
- startIcon: /*#__PURE__*/React.createElement(AddIcon, {
9812
- width: "9",
9813
- height: "9",
9814
- color: "#EC5D25"
9815
- }),
9816
- onClick: handleAddPageNavigation,
9817
- className: styles$7.addUserButton
9818
- }))), /*#__PURE__*/React.createElement(IUIInput, {
9537
+ padding: "8px 24px"
9538
+ }, /*#__PURE__*/React.createElement(IUIInput, {
9819
9539
  label: name + " name",
9820
9540
  name: "name",
9821
9541
  defaultValue: dialogData.data.name,
@@ -9824,49 +9544,7 @@ function EditPanelDialog(_ref) {
9824
9544
  isError: isError,
9825
9545
  validation: validation,
9826
9546
  errorMsg: "Please enter " + name.toLowerCase() + " name.",
9827
- required: true,
9828
- style: tableName === 'department' && {
9829
- width: '350px'
9830
- }
9831
- }), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
9832
- className: "iui__mt-15",
9833
- style: {
9834
- width: '100%'
9835
- }
9836
- }, /*#__PURE__*/React.createElement(IUIInput, {
9837
- label: "Department head",
9838
- name: "name",
9839
- defaultValue: head.label,
9840
- placeholder: "",
9841
- readOnly: true,
9842
- style: {
9843
- width: '350px'
9844
- }
9845
- })), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
9846
- className: "iui__mt-15",
9847
- style: {
9848
- width: '100%'
9849
- }
9850
- }, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
9851
- noResultsText: true,
9852
- isMove: true,
9853
- additional: {
9854
- page: 1,
9855
- departmentId: rowData.id
9856
- },
9857
- placeHolderCheck: head !== undefined && head.value === '',
9858
- label: "Department head",
9859
- value: head,
9860
- onValueChange: function onValueChange(_ref2) {
9861
- var _value = _ref2._value;
9862
- return setHead(_value);
9863
- },
9864
- loadOption: departmentHeadOptions,
9865
- disableText: "Please get in touch with your administrator to change this value.",
9866
- customLoadingText: "No users found in this department",
9867
- customLoadingTextStyle: {
9868
- color: '#374151'
9869
- }
9547
+ required: true
9870
9548
  })));
9871
9549
  }
9872
9550
 
@@ -10045,15 +9723,12 @@ var UserPanel = function UserPanel(_ref) {
10045
9723
  var _useState13 = useState(false),
10046
9724
  isSortingChangeTemp = _useState13[0],
10047
9725
  setSortingChangeTemp = _useState13[1];
10048
- var _useState14 = useState([]),
10049
- rowData = _useState14[0],
10050
- setRowData = _useState14[1];
10051
- var _useState15 = useState(1),
10052
- page = _useState15[0],
10053
- setPage = _useState15[1];
10054
- var _useState16 = useState(5),
10055
- rowsPerPage = _useState16[0],
10056
- setRowsPerPage = _useState16[1];
9726
+ var _useState14 = useState(1),
9727
+ page = _useState14[0],
9728
+ setPage = _useState14[1];
9729
+ var _useState15 = useState(5),
9730
+ rowsPerPage = _useState15[0],
9731
+ setRowsPerPage = _useState15[1];
10057
9732
  var orderingParam = orderBy;
10058
9733
  var _useSelector = useSelector(function (state) {
10059
9734
  return state.userPanel;
@@ -10149,7 +9824,6 @@ var UserPanel = function UserPanel(_ref) {
10149
9824
  submitLabel: 'Save'
10150
9825
  }, '', data));
10151
9826
  setDataList(data.name);
10152
- setRowData(data);
10153
9827
  setEditModal(true);
10154
9828
  };
10155
9829
  var closeEditDialog = function closeEditDialog() {
@@ -10164,12 +9838,6 @@ var UserPanel = function UserPanel(_ref) {
10164
9838
  var payload = {
10165
9839
  names: [dataList]
10166
9840
  };
10167
- if (tableName === 'department') {
10168
- payload = {
10169
- name: dataList,
10170
- department_head_id: null
10171
- };
10172
- }
10173
9841
  var message = title + " added successfully.";
10174
9842
  handleApiCall(addRecord, payload, message, 'add');
10175
9843
  } else {
@@ -10183,12 +9851,9 @@ var UserPanel = function UserPanel(_ref) {
10183
9851
  var message = title + " deleted successfully.";
10184
9852
  handleApiCall(deleteRecord, payload, message, 'delete');
10185
9853
  };
10186
- var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
10187
- if (optionalParams === void 0) {
10188
- optionalParams = null;
10189
- }
9854
+ var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
10190
9855
  dispatch(userPanelShowLoader());
10191
- dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
9856
+ dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
10192
9857
  IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
10193
9858
  dispatch(userPanelStopLoader());
10194
9859
  if (type === 'delete') {
@@ -10230,14 +9895,8 @@ var UserPanel = function UserPanel(_ref) {
10230
9895
  name: dataList
10231
9896
  }]
10232
9897
  };
10233
- if (tableName === 'department') {
10234
- payload = {
10235
- name: dataList,
10236
- department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
10237
- };
10238
- }
10239
9898
  var message = title + " updated successfully.";
10240
- handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
9899
+ handleApiCall(editRecord, payload, message, 'edit');
10241
9900
  setErrorEdit(false);
10242
9901
  } else {
10243
9902
  setErrorEdit(true);
@@ -10344,10 +10003,7 @@ var UserPanel = function UserPanel(_ref) {
10344
10003
  submitHandler: handleEditPanel,
10345
10004
  isError: errorEdit,
10346
10005
  isDisabledSubmitBtn: loading,
10347
- validation: validation,
10348
- rowData: rowData,
10349
- tableName: tableName,
10350
- config: config
10006
+ validation: validation
10351
10007
  })) : /*#__PURE__*/React.createElement(VerificationError, {
10352
10008
  config: config
10353
10009
  }));