@itilite/iui-user-management 0.4.42 → 0.4.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +88 -0
- package/dist/index.js +950 -256
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +951 -257
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -9,7 +9,7 @@ import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
|
-
import { useHistory } from 'react-router-dom';
|
|
12
|
+
import { useHistory, useLocation } from 'react-router-dom';
|
|
13
13
|
import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
14
14
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
15
15
|
import Switch from '@material-ui/core/Switch';
|
|
@@ -354,6 +354,9 @@ var userAddEditUrl = {
|
|
|
354
354
|
approversSearch: function approversSearch() {
|
|
355
355
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
356
356
|
},
|
|
357
|
+
transferAppover: function transferAppover() {
|
|
358
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
+
},
|
|
357
360
|
preSignedUrl: function preSignedUrl() {
|
|
358
361
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
359
362
|
},
|
|
@@ -450,6 +453,14 @@ var userPanelUrl = {
|
|
|
450
453
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
451
454
|
}
|
|
452
455
|
};
|
|
456
|
+
var departmentUrl = {
|
|
457
|
+
departmentUrl: function departmentUrl() {
|
|
458
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
459
|
+
},
|
|
460
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
462
|
+
}
|
|
463
|
+
};
|
|
453
464
|
|
|
454
465
|
var api = configs.api;
|
|
455
466
|
var NAoptionConfig = {
|
|
@@ -591,11 +602,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
591
602
|
return Promise.reject(e);
|
|
592
603
|
}
|
|
593
604
|
};
|
|
594
|
-
var
|
|
605
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
595
606
|
var page = _ref4.page,
|
|
596
607
|
product = _ref4.product,
|
|
597
|
-
userId = _ref4.userId
|
|
598
|
-
|
|
608
|
+
userId = _ref4.userId;
|
|
609
|
+
try {
|
|
610
|
+
return Promise.resolve(_catch(function () {
|
|
611
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
612
|
+
return res.data;
|
|
613
|
+
})).then(function (response) {
|
|
614
|
+
var mappedValue = response.results.map(function (item) {
|
|
615
|
+
return {
|
|
616
|
+
value: item.email,
|
|
617
|
+
label: item.email,
|
|
618
|
+
type: 'detailed',
|
|
619
|
+
data: item
|
|
620
|
+
};
|
|
621
|
+
});
|
|
622
|
+
return {
|
|
623
|
+
options: mappedValue,
|
|
624
|
+
hasMore: !!response.next,
|
|
625
|
+
additional: {
|
|
626
|
+
page: page + 1,
|
|
627
|
+
product: product,
|
|
628
|
+
userId: userId
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
});
|
|
632
|
+
}, function () {
|
|
633
|
+
return {
|
|
634
|
+
options: [],
|
|
635
|
+
hasMore: false,
|
|
636
|
+
additional: {
|
|
637
|
+
page: 1,
|
|
638
|
+
product: product,
|
|
639
|
+
userId: userId
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
}));
|
|
643
|
+
} catch (e) {
|
|
644
|
+
return Promise.reject(e);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
648
|
+
var page = _ref5.page,
|
|
649
|
+
product = _ref5.product,
|
|
650
|
+
userId = _ref5.userId,
|
|
651
|
+
placeholder = _ref5.placeholder;
|
|
599
652
|
try {
|
|
600
653
|
return Promise.resolve(_catch(function () {
|
|
601
654
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -641,9 +694,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
641
694
|
return Promise.reject(e);
|
|
642
695
|
}
|
|
643
696
|
};
|
|
644
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
645
|
-
var page =
|
|
646
|
-
tabelName =
|
|
697
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
698
|
+
var page = _ref6.page,
|
|
699
|
+
tabelName = _ref6.tabelName;
|
|
647
700
|
try {
|
|
648
701
|
return Promise.resolve(_catch(function () {
|
|
649
702
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -678,6 +731,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
678
731
|
return Promise.reject(e);
|
|
679
732
|
}
|
|
680
733
|
};
|
|
734
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
735
|
+
var page = _ref7.page,
|
|
736
|
+
departmentId = _ref7.departmentId;
|
|
737
|
+
try {
|
|
738
|
+
return Promise.resolve(_catch(function () {
|
|
739
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
740
|
+
return res.data;
|
|
741
|
+
})).then(function (response) {
|
|
742
|
+
var mappedValue = response.results.map(function (item) {
|
|
743
|
+
return {
|
|
744
|
+
value: item.id,
|
|
745
|
+
label: item.first_name + ' ' + item.last_name,
|
|
746
|
+
type: 'detailed',
|
|
747
|
+
data: item
|
|
748
|
+
};
|
|
749
|
+
});
|
|
750
|
+
console.log(response.next);
|
|
751
|
+
return {
|
|
752
|
+
options: mappedValue,
|
|
753
|
+
hasMore: !!response.next,
|
|
754
|
+
additional: {
|
|
755
|
+
page: page + 1,
|
|
756
|
+
departmentId: departmentId
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
});
|
|
760
|
+
}, function () {
|
|
761
|
+
return {
|
|
762
|
+
options: [],
|
|
763
|
+
hasMore: false,
|
|
764
|
+
additional: {
|
|
765
|
+
page: 1,
|
|
766
|
+
departmentId: departmentId
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}));
|
|
770
|
+
} catch (e) {
|
|
771
|
+
return Promise.reject(e);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
681
774
|
|
|
682
775
|
var UserRole = function UserRole(_ref) {
|
|
683
776
|
var _ref$list = _ref.list,
|
|
@@ -1146,10 +1239,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1146
1239
|
payload: tabId
|
|
1147
1240
|
};
|
|
1148
1241
|
};
|
|
1149
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1242
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1243
|
+
if (roleTransfer === void 0) {
|
|
1244
|
+
roleTransfer = false;
|
|
1245
|
+
}
|
|
1246
|
+
var _payload = {
|
|
1247
|
+
role_transfer: roleTransfer
|
|
1248
|
+
};
|
|
1249
|
+
if (roleTransfer) {
|
|
1250
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1251
|
+
}
|
|
1150
1252
|
return function (dispatch) {
|
|
1151
1253
|
return new Promise(function (resolve, reject) {
|
|
1152
|
-
api$1.
|
|
1254
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1153
1255
|
dispatch(setUserActiveStatus({
|
|
1154
1256
|
is_active: activateVal !== 0,
|
|
1155
1257
|
id: id
|
|
@@ -1713,7 +1815,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1713
1815
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1714
1816
|
return function (dispatch) {
|
|
1715
1817
|
return new Promise(function (resolve, reject) {
|
|
1716
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1818
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1717
1819
|
resolve(res);
|
|
1718
1820
|
})["catch"](function (err) {
|
|
1719
1821
|
var _err$response17, _err$response17$data;
|
|
@@ -1749,6 +1851,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1749
1851
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1750
1852
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1751
1853
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1854
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1752
1855
|
|
|
1753
1856
|
var api$3 = configs.api;
|
|
1754
1857
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1798,14 +1901,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1798
1901
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1799
1902
|
return function (dispatch) {
|
|
1800
1903
|
return new Promise(function (resolve, reject) {
|
|
1801
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1904
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1802
1905
|
dispatch(getUserPanalData(getParam));
|
|
1803
1906
|
dispatch(closeDialog());
|
|
1804
1907
|
resolve(res);
|
|
1805
1908
|
})["catch"](function (err) {
|
|
1806
|
-
var _err$
|
|
1909
|
+
var _err$response3, _err$response3$data;
|
|
1807
1910
|
dispatch(userPanelStopLoader());
|
|
1808
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1911
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1809
1912
|
});
|
|
1810
1913
|
});
|
|
1811
1914
|
};
|
|
@@ -1819,25 +1922,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1819
1922
|
dispatch(userPanelStopLoader());
|
|
1820
1923
|
resolve();
|
|
1821
1924
|
})["catch"](function (err) {
|
|
1822
|
-
var _err$
|
|
1823
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1925
|
+
var _err$response4, _err$response4$data;
|
|
1926
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
1824
1927
|
dispatch(userPanelStopLoader());
|
|
1825
1928
|
});
|
|
1826
1929
|
});
|
|
1827
1930
|
};
|
|
1828
1931
|
};
|
|
1829
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1932
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1830
1933
|
return function (dispatch) {
|
|
1831
1934
|
return new Promise(function (resolve, reject) {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1935
|
+
if (tableName === 'department') {
|
|
1936
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1937
|
+
dispatch(getUserPanalData(getParam));
|
|
1938
|
+
dispatch(closeDialog());
|
|
1939
|
+
resolve();
|
|
1940
|
+
})["catch"](function (err) {
|
|
1941
|
+
var _err$response5, _err$response5$data;
|
|
1942
|
+
dispatch(userPanelStopLoader());
|
|
1943
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
1944
|
+
});
|
|
1945
|
+
} else {
|
|
1946
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1947
|
+
dispatch(getUserPanalData(getParam));
|
|
1948
|
+
dispatch(closeDialog());
|
|
1949
|
+
resolve();
|
|
1950
|
+
})["catch"](function (err) {
|
|
1951
|
+
var _err$response6, _err$response6$data;
|
|
1952
|
+
dispatch(userPanelStopLoader());
|
|
1953
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1841
1956
|
});
|
|
1842
1957
|
};
|
|
1843
1958
|
};
|
|
@@ -1849,8 +1964,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1849
1964
|
dispatch(closeDialog());
|
|
1850
1965
|
resolve(res);
|
|
1851
1966
|
})["catch"](function (err) {
|
|
1852
|
-
var _err$
|
|
1853
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1967
|
+
var _err$response7, _err$response7$data;
|
|
1968
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1854
1969
|
});
|
|
1855
1970
|
});
|
|
1856
1971
|
};
|
|
@@ -2939,8 +3054,8 @@ var workInfo = [{
|
|
|
2939
3054
|
validation: {
|
|
2940
3055
|
regexOnChange: null,
|
|
2941
3056
|
regexOnBlur: [{
|
|
2942
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
2943
|
-
message: "Only alphabets, numbers and
|
|
3057
|
+
regex: /^[(A-Z)(a-z)(0-9)\-_& ]*$/,
|
|
3058
|
+
message: "Only alphabets, numbers, - and _ & are allowed."
|
|
2944
3059
|
}],
|
|
2945
3060
|
maxLimit: '',
|
|
2946
3061
|
minLimit: '',
|
|
@@ -3028,8 +3143,8 @@ var workInfo = [{
|
|
|
3028
3143
|
validation: {
|
|
3029
3144
|
regexOnChange: null,
|
|
3030
3145
|
regexOnBlur: [{
|
|
3031
|
-
regex: /^[A-Za-z0-9
|
|
3032
|
-
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3146
|
+
regex: /^[A-Za-z0-9 \-_.,&'()\/]*$/,
|
|
3147
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) _ - , / are allowed."
|
|
3033
3148
|
}, {
|
|
3034
3149
|
regex: /^[a-zA-Z]/,
|
|
3035
3150
|
message: 'Designation should start with alphabets'
|
|
@@ -3040,31 +3155,6 @@ var workInfo = [{
|
|
|
3040
3155
|
minLength: 0
|
|
3041
3156
|
},
|
|
3042
3157
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3043
|
-
}, {
|
|
3044
|
-
id: 7,
|
|
3045
|
-
label: 'Manager',
|
|
3046
|
-
name: 'manager',
|
|
3047
|
-
required: false,
|
|
3048
|
-
type: 'async_select',
|
|
3049
|
-
fullWidth: false,
|
|
3050
|
-
visibility: true,
|
|
3051
|
-
readOnly: false,
|
|
3052
|
-
placeholder: 'Select manager',
|
|
3053
|
-
tabelName: 'manager',
|
|
3054
|
-
product: 'travel',
|
|
3055
|
-
loadOption: approversOptions
|
|
3056
|
-
}, {
|
|
3057
|
-
id: 8,
|
|
3058
|
-
label: 'Skip manager',
|
|
3059
|
-
name: 'skip_manager',
|
|
3060
|
-
required: false,
|
|
3061
|
-
type: 'async_select',
|
|
3062
|
-
fullWidth: false,
|
|
3063
|
-
visibility: true,
|
|
3064
|
-
readOnly: false,
|
|
3065
|
-
placeholder: 'Select manager',
|
|
3066
|
-
product: 'travel',
|
|
3067
|
-
loadOption: approversOptions
|
|
3068
3158
|
}, {
|
|
3069
3159
|
id: 9,
|
|
3070
3160
|
label: 'Base location',
|
|
@@ -3975,6 +4065,7 @@ var initialState$2 = {
|
|
|
3975
4065
|
previous: null,
|
|
3976
4066
|
results: []
|
|
3977
4067
|
},
|
|
4068
|
+
deptUsers: [],
|
|
3978
4069
|
loading: false
|
|
3979
4070
|
};
|
|
3980
4071
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4044,6 +4135,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4044
4135
|
loading: false
|
|
4045
4136
|
});
|
|
4046
4137
|
}
|
|
4138
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4139
|
+
{
|
|
4140
|
+
return _extends({}, state, {
|
|
4141
|
+
deptUsers: action.payload
|
|
4142
|
+
});
|
|
4143
|
+
}
|
|
4047
4144
|
default:
|
|
4048
4145
|
return state;
|
|
4049
4146
|
}
|
|
@@ -4822,6 +4919,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4822
4919
|
isILadmin = _useSelector2.isILadmin,
|
|
4823
4920
|
companyName = _useSelector2.companyName;
|
|
4824
4921
|
var history = useHistory();
|
|
4922
|
+
var location = useLocation();
|
|
4825
4923
|
var _useState = useState({
|
|
4826
4924
|
travel: false,
|
|
4827
4925
|
expense: false
|
|
@@ -4890,11 +4988,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4890
4988
|
},
|
|
4891
4989
|
designation: '',
|
|
4892
4990
|
base_location: '',
|
|
4893
|
-
|
|
4991
|
+
manager_id: {
|
|
4894
4992
|
value: '',
|
|
4895
4993
|
label: 'Select Manager'
|
|
4896
4994
|
},
|
|
4897
|
-
|
|
4995
|
+
skip_manager_id: {
|
|
4898
4996
|
value: '',
|
|
4899
4997
|
label: 'Select Manager'
|
|
4900
4998
|
},
|
|
@@ -4911,8 +5009,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4911
5009
|
business_unit: 0,
|
|
4912
5010
|
department: 0,
|
|
4913
5011
|
currency: 0,
|
|
4914
|
-
|
|
4915
|
-
|
|
5012
|
+
manager_id: 0,
|
|
5013
|
+
skip_manager_id: 0
|
|
4916
5014
|
}),
|
|
4917
5015
|
cacheForAsyncDropdown = _useState4[0],
|
|
4918
5016
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5066,6 +5164,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5066
5164
|
var _useState25 = useState([]),
|
|
5067
5165
|
uploadedFiles = _useState25[0],
|
|
5068
5166
|
setUploadedFiles = _useState25[1];
|
|
5167
|
+
var _useState26 = useState(70),
|
|
5168
|
+
maxLengthForModal = _useState26[0],
|
|
5169
|
+
setMaxLengthForModal = _useState26[1];
|
|
5069
5170
|
var defaultAddModalData = {
|
|
5070
5171
|
isOpen: false,
|
|
5071
5172
|
isError: false,
|
|
@@ -5078,25 +5179,41 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5078
5179
|
regexOnBlur: null,
|
|
5079
5180
|
maxLimit: '',
|
|
5080
5181
|
minLimit: '',
|
|
5081
|
-
maxLength:
|
|
5182
|
+
maxLength: maxLengthForModal,
|
|
5082
5183
|
minLength: 0
|
|
5083
5184
|
};
|
|
5084
|
-
var
|
|
5085
|
-
addModalData =
|
|
5086
|
-
setAddModalData =
|
|
5185
|
+
var _useState27 = useState(defaultAddModalData),
|
|
5186
|
+
addModalData = _useState27[0],
|
|
5187
|
+
setAddModalData = _useState27[1];
|
|
5087
5188
|
var onAddModalClose = function onAddModalClose() {
|
|
5088
5189
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5089
5190
|
};
|
|
5191
|
+
useEffect(function () {
|
|
5192
|
+
var _location$state, _location$state2;
|
|
5193
|
+
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) {
|
|
5194
|
+
var _location$state3, _location$state4;
|
|
5195
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5196
|
+
department: {
|
|
5197
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5198
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5199
|
+
}
|
|
5200
|
+
}));
|
|
5201
|
+
}
|
|
5202
|
+
}, []);
|
|
5090
5203
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5091
5204
|
var title = '';
|
|
5092
5205
|
if (id === 'entity') {
|
|
5093
5206
|
title = 'Entity';
|
|
5207
|
+
setMaxLengthForModal(70);
|
|
5094
5208
|
} else if (id === 'department') {
|
|
5095
5209
|
title = 'Department';
|
|
5210
|
+
setMaxLengthForModal(70);
|
|
5096
5211
|
} else if (id === 'business_unit') {
|
|
5212
|
+
setMaxLengthForModal(150);
|
|
5097
5213
|
title = 'Business unit';
|
|
5098
5214
|
} else if (id === 'employee_level') {
|
|
5099
5215
|
title = 'Employee level';
|
|
5216
|
+
setMaxLengthForModal(70);
|
|
5100
5217
|
}
|
|
5101
5218
|
setAddModalData(_extends({}, addModalData, {
|
|
5102
5219
|
isOpen: true,
|
|
@@ -5112,24 +5229,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5112
5229
|
}));
|
|
5113
5230
|
} else {
|
|
5114
5231
|
dispatch(showLoader());
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5232
|
+
var dataObj;
|
|
5233
|
+
if (addModalData.id === 'department') {
|
|
5234
|
+
dataObj = {
|
|
5235
|
+
name: validatedValue,
|
|
5236
|
+
department_head_id: null
|
|
5237
|
+
};
|
|
5238
|
+
} else {
|
|
5239
|
+
dataObj = {
|
|
5240
|
+
names: [validatedValue]
|
|
5241
|
+
};
|
|
5242
|
+
}
|
|
5243
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5244
|
+
var _extends4;
|
|
5119
5245
|
setAddModalData(_extends({}, addModalData, {
|
|
5120
5246
|
isOpen: false
|
|
5121
5247
|
}));
|
|
5122
5248
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5123
5249
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5250
|
+
if (addModalData.id === 'department') {
|
|
5251
|
+
var _extends2;
|
|
5252
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5253
|
+
value: res.data.result.id,
|
|
5254
|
+
label: res.data.result.name
|
|
5255
|
+
}, _extends2)));
|
|
5256
|
+
} else {
|
|
5257
|
+
var _extends3;
|
|
5258
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5259
|
+
value: res.data.value,
|
|
5260
|
+
label: res.data.label
|
|
5261
|
+
}, _extends3)));
|
|
5262
|
+
}
|
|
5263
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5129
5264
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5130
5265
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5131
|
-
var
|
|
5132
|
-
return _extends({}, prevState, (
|
|
5266
|
+
var _extends5;
|
|
5267
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5133
5268
|
});
|
|
5134
5269
|
dispatch(stopLoader());
|
|
5135
5270
|
});
|
|
@@ -5148,8 +5283,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5148
5283
|
try {
|
|
5149
5284
|
var _temp5 = function _temp5() {
|
|
5150
5285
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5151
|
-
var
|
|
5152
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5286
|
+
var _extends6;
|
|
5287
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5153
5288
|
}
|
|
5154
5289
|
};
|
|
5155
5290
|
var _name = args._name,
|
|
@@ -5172,8 +5307,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5172
5307
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5173
5308
|
} else {
|
|
5174
5309
|
var _temp3 = function _temp3() {
|
|
5175
|
-
var
|
|
5176
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5310
|
+
var _extends7;
|
|
5311
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5177
5312
|
updateError(_name, _isError, _errorMsg);
|
|
5178
5313
|
};
|
|
5179
5314
|
var _temp2 = function () {
|
|
@@ -5221,16 +5356,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5221
5356
|
}
|
|
5222
5357
|
};
|
|
5223
5358
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5224
|
-
var
|
|
5359
|
+
var _extends8;
|
|
5225
5360
|
var _name = args._name,
|
|
5226
5361
|
_value = args._value,
|
|
5227
5362
|
_isError = args._isError,
|
|
5228
5363
|
_errorMsg = args._errorMsg;
|
|
5229
|
-
|
|
5364
|
+
console.log(_name, _value);
|
|
5365
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5230
5366
|
updateError(_name, _isError, _errorMsg);
|
|
5231
5367
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5232
|
-
var
|
|
5233
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5368
|
+
var _extends9;
|
|
5369
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5234
5370
|
}
|
|
5235
5371
|
};
|
|
5236
5372
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5240,9 +5376,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5240
5376
|
return tag.id;
|
|
5241
5377
|
};
|
|
5242
5378
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5243
|
-
var
|
|
5379
|
+
var _extends10;
|
|
5244
5380
|
var e = args._event;
|
|
5245
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5381
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5246
5382
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5247
5383
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5248
5384
|
userTagType: true
|
|
@@ -5250,22 +5386,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5250
5386
|
}
|
|
5251
5387
|
};
|
|
5252
5388
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5253
|
-
var
|
|
5389
|
+
var _extends11;
|
|
5254
5390
|
var _name = _ref2._name,
|
|
5255
5391
|
_value = _ref2._value;
|
|
5256
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5392
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5257
5393
|
};
|
|
5258
5394
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5259
|
-
var
|
|
5395
|
+
var _extends12;
|
|
5260
5396
|
var _name = _ref3._name,
|
|
5261
5397
|
_value = _ref3._value;
|
|
5262
|
-
|
|
5398
|
+
console.log(_name, _value, 'travel');
|
|
5399
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5263
5400
|
};
|
|
5264
5401
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5265
|
-
var
|
|
5402
|
+
var _extends13;
|
|
5266
5403
|
var _name = _ref4._name,
|
|
5267
5404
|
_value = _ref4._value;
|
|
5268
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5405
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5269
5406
|
};
|
|
5270
5407
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5271
5408
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5299,39 +5436,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5299
5436
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5300
5437
|
};
|
|
5301
5438
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5302
|
-
var
|
|
5439
|
+
var _extends14;
|
|
5303
5440
|
var _name = args._name,
|
|
5304
5441
|
_value = args._value,
|
|
5305
5442
|
_isError = args._isError,
|
|
5306
5443
|
_errorMsg = args._errorMsg;
|
|
5307
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5444
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5308
5445
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5309
|
-
var
|
|
5310
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5446
|
+
var _extends15;
|
|
5447
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5311
5448
|
}
|
|
5312
5449
|
updateError(_name, _isError, _errorMsg);
|
|
5313
5450
|
};
|
|
5314
5451
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5315
|
-
var
|
|
5452
|
+
var _extends16;
|
|
5316
5453
|
var _name = args._name,
|
|
5317
5454
|
_value = args._value,
|
|
5318
5455
|
_isError = args._isError,
|
|
5319
5456
|
_errorMsg = args._errorMsg;
|
|
5320
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5457
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5321
5458
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5322
|
-
var
|
|
5323
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5459
|
+
var _extends17;
|
|
5460
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5324
5461
|
}
|
|
5325
5462
|
updateError(_name, _isError, _errorMsg);
|
|
5326
5463
|
};
|
|
5327
5464
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5328
5465
|
try {
|
|
5329
5466
|
var _temp8 = function _temp8() {
|
|
5330
|
-
var
|
|
5331
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5467
|
+
var _extends18;
|
|
5468
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5332
5469
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5333
|
-
var
|
|
5334
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5470
|
+
var _extends19;
|
|
5471
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5335
5472
|
}
|
|
5336
5473
|
updateError(_name, _isError, _errorMsg);
|
|
5337
5474
|
};
|
|
@@ -5437,8 +5574,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5437
5574
|
return _errorArray;
|
|
5438
5575
|
});
|
|
5439
5576
|
setErrorMsgs(function (prevState) {
|
|
5440
|
-
var
|
|
5441
|
-
return _extends({}, prevState, (
|
|
5577
|
+
var _extends20;
|
|
5578
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5442
5579
|
});
|
|
5443
5580
|
};
|
|
5444
5581
|
var dispatch = useDispatch();
|
|
@@ -5512,14 +5649,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5512
5649
|
value: '',
|
|
5513
5650
|
label: 'Select employee level'
|
|
5514
5651
|
},
|
|
5515
|
-
|
|
5652
|
+
manager_id: res.employee_info.manager ? {
|
|
5516
5653
|
value: res.employee_info.manager,
|
|
5517
5654
|
label: res.employee_info.manager
|
|
5518
5655
|
} : {
|
|
5519
5656
|
value: '',
|
|
5520
5657
|
label: 'Select Manager'
|
|
5521
5658
|
},
|
|
5522
|
-
|
|
5659
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5523
5660
|
value: res.employee_info.skip_manager,
|
|
5524
5661
|
label: res.employee_info.skip_manager
|
|
5525
5662
|
} : {
|
|
@@ -5791,13 +5928,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5791
5928
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5792
5929
|
return Promise.resolve();
|
|
5793
5930
|
}
|
|
5794
|
-
|
|
5931
|
+
console.log(employeeInfoInput, 'data');
|
|
5932
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5795
5933
|
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5796
|
-
delete employeeInfoInput.manager;
|
|
5797
5934
|
}
|
|
5798
|
-
if (employeeInfoInput.
|
|
5935
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5799
5936
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5800
|
-
delete employeeInfoInput.skip_manager;
|
|
5801
5937
|
}
|
|
5802
5938
|
var payload = {
|
|
5803
5939
|
personalInfoInput: personalInfoInput,
|
|
@@ -5856,8 +5992,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5856
5992
|
}
|
|
5857
5993
|
}
|
|
5858
5994
|
for (var _key in employeeInfo) {
|
|
5995
|
+
console.log('key', _key);
|
|
5859
5996
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5860
|
-
|
|
5997
|
+
var _employeeInfoInput$_k;
|
|
5998
|
+
console.log('employeeInfo0000', (_employeeInfoInput$_k = employeeInfoInput[_key]) === null || _employeeInfoInput$_k === void 0 ? void 0 : _employeeInfoInput$_k.value, 'sajkdhjasj');
|
|
5999
|
+
if (employeeInfo[_key] === false && employeeInfoInput[_key] !== undefined && (typeof employeeInfoInput[_key] === 'string' && !employeeInfoInput[_key] || typeof employeeInfoInput[_key] === 'object' && !employeeInfoInput[_key].value || !employeeInfoInput[_key].value) === '' && fieldsVisibility.employee_info[_key] !== 2) {
|
|
5861
6000
|
_isError = true;
|
|
5862
6001
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5863
6002
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -5944,12 +6083,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5944
6083
|
setErrorArray(_errorArray);
|
|
5945
6084
|
setErrorMsgs(_errorMsgs);
|
|
5946
6085
|
var _loop = function _loop() {
|
|
5947
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
5948
|
-
if (_errorMsgs[
|
|
5949
|
-
if (
|
|
6086
|
+
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6087
|
+
if (_errorMsgs[_key3]) {
|
|
6088
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5950
6089
|
setAdditionalInfoFlag('open');
|
|
5951
6090
|
}
|
|
5952
|
-
var el = document.getElementById(
|
|
6091
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5953
6092
|
if (el) {
|
|
5954
6093
|
setTimeout(function () {
|
|
5955
6094
|
el.scrollIntoView({
|
|
@@ -5995,12 +6134,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5995
6134
|
setErrorArray(Object.keys(err));
|
|
5996
6135
|
setErrorMsgs(err);
|
|
5997
6136
|
var _loop2 = function _loop2() {
|
|
5998
|
-
if (Object.hasOwnProperty.call(err,
|
|
5999
|
-
if (err[
|
|
6000
|
-
if (
|
|
6137
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6138
|
+
if (err[_key4]) {
|
|
6139
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6001
6140
|
setAdditionalInfoFlag('open');
|
|
6002
6141
|
}
|
|
6003
|
-
var el = document.getElementById(
|
|
6142
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6004
6143
|
if (el) {
|
|
6005
6144
|
setTimeout(function () {
|
|
6006
6145
|
el.scrollIntoView({
|
|
@@ -6045,12 +6184,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6045
6184
|
setErrorArray(Object.keys(err));
|
|
6046
6185
|
setErrorMsgs(err);
|
|
6047
6186
|
var _loop3 = function _loop3() {
|
|
6048
|
-
if (Object.hasOwnProperty.call(err,
|
|
6049
|
-
if (err[
|
|
6050
|
-
if (
|
|
6187
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6188
|
+
if (err[_key5]) {
|
|
6189
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6051
6190
|
setAdditionalInfoFlag('open');
|
|
6052
6191
|
}
|
|
6053
|
-
var el = document.getElementById(
|
|
6192
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6054
6193
|
if (el) {
|
|
6055
6194
|
setTimeout(function () {
|
|
6056
6195
|
el.scrollIntoView({
|
|
@@ -6790,7 +6929,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6790
6929
|
};
|
|
6791
6930
|
};
|
|
6792
6931
|
|
|
6793
|
-
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"};
|
|
6932
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltipTextDiv":"_1l4V-","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","warningSvg":"_2H6Bq","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn","deactivateSubmitBtn":"_1qxY-","deactivateCustomButtonClass":"_2YBWE"};
|
|
6794
6933
|
|
|
6795
6934
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6796
6935
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8276,9 +8415,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8276
8415
|
cell: function cell(row) {
|
|
8277
8416
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8278
8417
|
component: "div",
|
|
8279
|
-
width:
|
|
8418
|
+
width: 80
|
|
8280
8419
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8281
|
-
title: "This user hasn't logged
|
|
8420
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8282
8421
|
arrow: true,
|
|
8283
8422
|
classes: {
|
|
8284
8423
|
arrow: classes.arrow,
|
|
@@ -8286,7 +8425,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8286
8425
|
},
|
|
8287
8426
|
placement: "top-start"
|
|
8288
8427
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8289
|
-
className: clsx(styles$5.
|
|
8428
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8290
8429
|
}, "Invited")) : null);
|
|
8291
8430
|
}
|
|
8292
8431
|
}, {
|
|
@@ -8387,7 +8526,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8387
8526
|
options.push({
|
|
8388
8527
|
label: 'Resend invite',
|
|
8389
8528
|
handler: function handler() {
|
|
8390
|
-
return toggleInviteModal(row.id, 'single');
|
|
8529
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8391
8530
|
}
|
|
8392
8531
|
});
|
|
8393
8532
|
}
|
|
@@ -8414,6 +8553,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8414
8553
|
endIcon: null,
|
|
8415
8554
|
outlinedBtn: false,
|
|
8416
8555
|
className: "threedotMenuBtn",
|
|
8556
|
+
MoreHorizIcon: true,
|
|
8417
8557
|
placement: "bottom-end"
|
|
8418
8558
|
}));
|
|
8419
8559
|
},
|
|
@@ -8559,6 +8699,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8559
8699
|
});
|
|
8560
8700
|
};
|
|
8561
8701
|
|
|
8702
|
+
function InfoYellowIcon(props) {
|
|
8703
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8704
|
+
width: props.width,
|
|
8705
|
+
height: props.height,
|
|
8706
|
+
viewBox: "0 0 20 20",
|
|
8707
|
+
fill: "none",
|
|
8708
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8709
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8710
|
+
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",
|
|
8711
|
+
fill: "#CA8A04"
|
|
8712
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8713
|
+
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",
|
|
8714
|
+
fill: "#CA8A04"
|
|
8715
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8716
|
+
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",
|
|
8717
|
+
fill: "#CA8A04"
|
|
8718
|
+
}));
|
|
8719
|
+
}
|
|
8720
|
+
|
|
8721
|
+
function RedWarningIcon(props) {
|
|
8722
|
+
var _props$color = props.color,
|
|
8723
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8724
|
+
_props$size = props.size,
|
|
8725
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8726
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8727
|
+
width: size,
|
|
8728
|
+
height: size,
|
|
8729
|
+
viewBox: "0 0 14 14",
|
|
8730
|
+
fill: color,
|
|
8731
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8732
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8733
|
+
d: "M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM6 4C6 3.44772 6.44772 3 7 3C7.55229 3 8 3.44772 8 4V6C8 6.55229 7.55229 7 7 7C6.44772 7 6 6.55229 6 6V4ZM6 10C6 9.44771 6.44772 9 7 9C7.55229 9 8 9.44771 8 10C8 10.5523 7.55229 11 7 11C6.44772 11 6 10.5523 6 10Z",
|
|
8734
|
+
fill: color
|
|
8735
|
+
}));
|
|
8736
|
+
}
|
|
8737
|
+
|
|
8562
8738
|
function InviteInfoIcon() {
|
|
8563
8739
|
return /*#__PURE__*/React.createElement("svg", {
|
|
8564
8740
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8576,7 +8752,8 @@ function InviteInfoIcon() {
|
|
|
8576
8752
|
}
|
|
8577
8753
|
|
|
8578
8754
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8579
|
-
var env$7 = configs.env
|
|
8755
|
+
var env$7 = configs.env,
|
|
8756
|
+
api$7 = configs.api;
|
|
8580
8757
|
var UndoButton = function UndoButton(_ref) {
|
|
8581
8758
|
var onUndo = _ref.onUndo,
|
|
8582
8759
|
msg = _ref.msg;
|
|
@@ -8614,27 +8791,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8614
8791
|
isDataFetching = _useSelector.isDataFetching,
|
|
8615
8792
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8616
8793
|
tabValue = _useSelector.tabValue;
|
|
8617
|
-
var
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
searchValue = _useState2[0],
|
|
8634
|
-
setSearchValue = _useState2[1];
|
|
8794
|
+
var newSelecteds = userListInfo.results;
|
|
8795
|
+
var _React$useState = React.useState(''),
|
|
8796
|
+
deactivateUser = _React$useState[0],
|
|
8797
|
+
setDeactivateUser = _React$useState[1];
|
|
8798
|
+
var _React$useState2 = React.useState(null),
|
|
8799
|
+
defaultId = _React$useState2[0],
|
|
8800
|
+
setDefaultId = _React$useState2[1];
|
|
8801
|
+
var _React$useState3 = React.useState(1),
|
|
8802
|
+
page = _React$useState3[0],
|
|
8803
|
+
setPage = _React$useState3[1];
|
|
8804
|
+
var _useState = useState([]),
|
|
8805
|
+
selectedUsersNotApprover = _useState[0],
|
|
8806
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8807
|
+
var _useState2 = useState([]),
|
|
8808
|
+
selectedUsersApprover = _useState2[0],
|
|
8809
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8635
8810
|
var _useState3 = useState(false),
|
|
8636
|
-
|
|
8637
|
-
|
|
8811
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8812
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8813
|
+
var _React$useState4 = React.useState(''),
|
|
8814
|
+
user = _React$useState4[0],
|
|
8815
|
+
setUser = _React$useState4[1];
|
|
8816
|
+
var _useState4 = useState(10),
|
|
8817
|
+
rowsPerPage = _useState4[0],
|
|
8818
|
+
setRowsPerPage = _useState4[1];
|
|
8819
|
+
var _React$useState5 = React.useState({}),
|
|
8820
|
+
selected = _React$useState5[0],
|
|
8821
|
+
setSelected = _React$useState5[1];
|
|
8822
|
+
var _React$useState6 = React.useState('asc'),
|
|
8823
|
+
order = _React$useState6[0],
|
|
8824
|
+
setOrder = _React$useState6[1];
|
|
8825
|
+
var _React$useState7 = React.useState(false),
|
|
8826
|
+
deactivateSingle = _React$useState7[0],
|
|
8827
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8828
|
+
var _React$useState8 = React.useState('first_name'),
|
|
8829
|
+
orderBy = _React$useState8[0],
|
|
8830
|
+
setOrderBy = _React$useState8[1];
|
|
8831
|
+
var _useState5 = useState(''),
|
|
8832
|
+
searchValue = _useState5[0],
|
|
8833
|
+
setSearchValue = _useState5[1];
|
|
8834
|
+
var _useState6 = useState(false),
|
|
8835
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8836
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8638
8837
|
var _useSelector2 = useSelector(function (state) {
|
|
8639
8838
|
return state.common;
|
|
8640
8839
|
}),
|
|
@@ -8642,36 +8841,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8642
8841
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8643
8842
|
isILadmin = _useSelector2.isILadmin,
|
|
8644
8843
|
companyName = _useSelector2.companyName;
|
|
8645
|
-
var _useState4 = useState(false),
|
|
8646
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8647
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8648
|
-
var _useState5 = useState(false),
|
|
8649
|
-
isFileDownloading = _useState5[0],
|
|
8650
|
-
setDownlStatus = _useState5[1];
|
|
8651
|
-
var _useState6 = useState(false),
|
|
8652
|
-
isSortingChange = _useState6[0],
|
|
8653
|
-
setSortingChange = _useState6[1];
|
|
8654
8844
|
var _useState7 = useState(false),
|
|
8655
|
-
|
|
8656
|
-
|
|
8845
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8846
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8657
8847
|
var _useState8 = useState(false),
|
|
8658
|
-
|
|
8659
|
-
|
|
8848
|
+
approveeStatus = _useState8[0],
|
|
8849
|
+
setApproveeStatus = _useState8[1];
|
|
8660
8850
|
var _useState9 = useState(false),
|
|
8661
|
-
|
|
8662
|
-
|
|
8851
|
+
isFileDownloading = _useState9[0],
|
|
8852
|
+
setDownlStatus = _useState9[1];
|
|
8663
8853
|
var _useState10 = useState(false),
|
|
8664
|
-
|
|
8665
|
-
|
|
8854
|
+
isSortingChange = _useState10[0],
|
|
8855
|
+
setSortingChange = _useState10[1];
|
|
8666
8856
|
var _useState11 = useState(false),
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
var _useState12 = useState(
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
var
|
|
8673
|
-
|
|
8674
|
-
|
|
8857
|
+
isSearchingChange = _useState11[0],
|
|
8858
|
+
setSearchingChange = _useState11[1];
|
|
8859
|
+
var _useState12 = useState(false),
|
|
8860
|
+
isSortingChangeTemp = _useState12[0],
|
|
8861
|
+
setSortingChangeTemp = _useState12[1];
|
|
8862
|
+
var _useState13 = useState(false),
|
|
8863
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8864
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8865
|
+
var _useState14 = useState(false),
|
|
8866
|
+
isApiFetching = _useState14[0],
|
|
8867
|
+
setisApiFetching = _useState14[1];
|
|
8868
|
+
var _useState15 = useState({
|
|
8869
|
+
value: '',
|
|
8870
|
+
label: 'Select approver'
|
|
8871
|
+
}),
|
|
8872
|
+
approverRole = _useState15[0],
|
|
8873
|
+
setApproverRole = _useState15[1];
|
|
8874
|
+
var _useState16 = useState(false),
|
|
8875
|
+
showInviteModal = _useState16[0],
|
|
8876
|
+
setToggleInviteModal = _useState16[1];
|
|
8877
|
+
var _useState17 = useState(''),
|
|
8878
|
+
userIds = _useState17[0],
|
|
8879
|
+
setUserIds = _useState17[1];
|
|
8880
|
+
var _React$useState9 = React.useState(false),
|
|
8881
|
+
overlayMenu = _React$useState9[0],
|
|
8882
|
+
setOverlayMenu = _React$useState9[1];
|
|
8883
|
+
var _useState18 = useState(''),
|
|
8884
|
+
userFirstName = _useState18[0],
|
|
8885
|
+
setUserFirstName = _useState18[1];
|
|
8886
|
+
var _useState19 = useState(''),
|
|
8887
|
+
userLastName = _useState19[0],
|
|
8888
|
+
setUserLastName = _useState19[1];
|
|
8889
|
+
var _useState20 = useState(true),
|
|
8890
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8891
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8675
8892
|
useScrollPosition(function (_ref3) {
|
|
8676
8893
|
var prevPos = _ref3.prevPos,
|
|
8677
8894
|
currPos = _ref3.currPos;
|
|
@@ -8692,47 +8909,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8692
8909
|
behavior: 'smooth'
|
|
8693
8910
|
});
|
|
8694
8911
|
};
|
|
8695
|
-
var _React$
|
|
8696
|
-
signup_page = _React$
|
|
8697
|
-
setSignUpPage = _React$
|
|
8698
|
-
var
|
|
8699
|
-
signup_rowsPerPage =
|
|
8700
|
-
setSignUpRowsPerPage =
|
|
8701
|
-
var _React$
|
|
8702
|
-
signup_order = _React$
|
|
8703
|
-
setSignUpOrder = _React$
|
|
8704
|
-
var _React$
|
|
8705
|
-
signup_orderBy = _React$
|
|
8706
|
-
setSignUpOrderBy = _React$
|
|
8707
|
-
var
|
|
8708
|
-
signup_searchValue =
|
|
8709
|
-
set_signup_SearchValue =
|
|
8710
|
-
var
|
|
8711
|
-
isSignUpSortingChange =
|
|
8712
|
-
setSignUpSortingChange =
|
|
8713
|
-
var
|
|
8714
|
-
isSignUpSearchingChange =
|
|
8715
|
-
setSignUpSearchingChange =
|
|
8716
|
-
var
|
|
8717
|
-
isSignUpSortingChangeTemp =
|
|
8718
|
-
setSignUpSortingChangeTemp =
|
|
8719
|
-
var
|
|
8720
|
-
isSignUpSearchingChangeTemp =
|
|
8721
|
-
setSignUpSearchingChangeTemp =
|
|
8912
|
+
var _React$useState10 = React.useState(1),
|
|
8913
|
+
signup_page = _React$useState10[0],
|
|
8914
|
+
setSignUpPage = _React$useState10[1];
|
|
8915
|
+
var _useState21 = useState(5),
|
|
8916
|
+
signup_rowsPerPage = _useState21[0],
|
|
8917
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8918
|
+
var _React$useState11 = React.useState('asc'),
|
|
8919
|
+
signup_order = _React$useState11[0],
|
|
8920
|
+
setSignUpOrder = _React$useState11[1];
|
|
8921
|
+
var _React$useState12 = React.useState('fname'),
|
|
8922
|
+
signup_orderBy = _React$useState12[0],
|
|
8923
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8924
|
+
var _useState22 = useState(''),
|
|
8925
|
+
signup_searchValue = _useState22[0],
|
|
8926
|
+
set_signup_SearchValue = _useState22[1];
|
|
8927
|
+
var _useState23 = useState(false),
|
|
8928
|
+
isSignUpSortingChange = _useState23[0],
|
|
8929
|
+
setSignUpSortingChange = _useState23[1];
|
|
8930
|
+
var _useState24 = useState(false),
|
|
8931
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8932
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8933
|
+
var _useState25 = useState(false),
|
|
8934
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8935
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8936
|
+
var _useState26 = useState(false),
|
|
8937
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8938
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8722
8939
|
var _useSelector3 = useSelector(function (state) {
|
|
8723
8940
|
return state.userList;
|
|
8724
8941
|
}),
|
|
8725
8942
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8943
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8944
|
+
history.push(config.routes.notification.path);
|
|
8945
|
+
};
|
|
8726
8946
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8727
8947
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8728
8948
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8729
8949
|
return false;
|
|
8730
8950
|
}
|
|
8731
|
-
|
|
8951
|
+
if (selectedUsersApprover.length) {
|
|
8952
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8953
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8954
|
+
var _selected = Object.values(selected).flat();
|
|
8955
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8956
|
+
return _selected.includes(item.id.toString());
|
|
8957
|
+
});
|
|
8958
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8959
|
+
return _selected.includes(item.id.toString());
|
|
8960
|
+
});
|
|
8961
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8962
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8963
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8964
|
+
} else {
|
|
8965
|
+
setOpenDeActivateModalFlag(true);
|
|
8966
|
+
}
|
|
8732
8967
|
};
|
|
8733
8968
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8734
8969
|
setOpenDeActivateModalFlag(false);
|
|
8735
8970
|
};
|
|
8971
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8972
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8973
|
+
};
|
|
8736
8974
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8737
8975
|
history.push(config.routes.users.add.path);
|
|
8738
8976
|
};
|
|
@@ -8780,12 +9018,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8780
9018
|
};
|
|
8781
9019
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8782
9020
|
var _extends2;
|
|
8783
|
-
var
|
|
9021
|
+
var selectedId = [];
|
|
9022
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9023
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9024
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8784
9025
|
return n.is_active;
|
|
8785
|
-
}).map(function (obj) {
|
|
8786
|
-
return obj.id.toString();
|
|
8787
9026
|
});
|
|
8788
|
-
|
|
9027
|
+
_newSelecteds.map(function (obj) {
|
|
9028
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9029
|
+
if (obj.roles.is_approver === true) {
|
|
9030
|
+
_selectedUsersApprover.push(obj);
|
|
9031
|
+
} else if (obj.roles.is_approver === false) {
|
|
9032
|
+
_selectedUsersNotApprover.push(obj);
|
|
9033
|
+
}
|
|
9034
|
+
}
|
|
9035
|
+
selectedId.push(obj.id.toString());
|
|
9036
|
+
});
|
|
9037
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9038
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9039
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8789
9040
|
};
|
|
8790
9041
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8791
9042
|
var _extends3;
|
|
@@ -8803,58 +9054,156 @@ var UserList = function UserList(_ref2) {
|
|
|
8803
9054
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8804
9055
|
};
|
|
8805
9056
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9057
|
+
setPage(1);
|
|
8806
9058
|
setSearchValue(value);
|
|
8807
9059
|
setSearchingChange(true);
|
|
8808
9060
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8809
9061
|
};
|
|
8810
9062
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9063
|
+
setPage(1);
|
|
8811
9064
|
set_signup_SearchValue(value);
|
|
8812
9065
|
setSignUpSearchingChange(true);
|
|
8813
9066
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8814
9067
|
};
|
|
8815
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9068
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8816
9069
|
var _extends4;
|
|
8817
9070
|
var selectedTemp = _extends({}, selected);
|
|
8818
9071
|
if (!(page in selectedTemp)) {
|
|
8819
9072
|
selectedTemp[page] = [];
|
|
8820
9073
|
}
|
|
8821
9074
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8822
|
-
var
|
|
9075
|
+
var _newSelected = [];
|
|
8823
9076
|
if (selectedIndex === -1) {
|
|
8824
|
-
|
|
9077
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8825
9078
|
} else if (selectedIndex === 0) {
|
|
8826
|
-
|
|
9079
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8827
9080
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8828
|
-
|
|
9081
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8829
9082
|
} else if (selectedIndex > 0) {
|
|
8830
|
-
|
|
9083
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9084
|
+
}
|
|
9085
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9086
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9087
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9088
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9089
|
+
return id !== item.id.toString();
|
|
9090
|
+
});
|
|
9091
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9092
|
+
return item.id.toString() !== id;
|
|
9093
|
+
});
|
|
9094
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9095
|
+
if (data.roles.is_approver === true) {
|
|
9096
|
+
_SelectedUsersApprover.push(data);
|
|
9097
|
+
} else if (data.roles.is_approver === false) {
|
|
9098
|
+
_SelectedUsersNotApprover.push(data);
|
|
9099
|
+
}
|
|
8831
9100
|
}
|
|
8832
|
-
|
|
9101
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9102
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9103
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8833
9104
|
};
|
|
9105
|
+
useEffect(function () {
|
|
9106
|
+
setApproverRole({
|
|
9107
|
+
value: '',
|
|
9108
|
+
label: 'Select approver'
|
|
9109
|
+
});
|
|
9110
|
+
setDefaultId(null);
|
|
9111
|
+
setIsDisabledSubmitBtn(true);
|
|
9112
|
+
setApproveeStatus(false);
|
|
9113
|
+
if (deactivateSingle === true) {
|
|
9114
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9115
|
+
if (response.data["default"].id) {
|
|
9116
|
+
setDefaultId(response.data["default"].id);
|
|
9117
|
+
setApproverRole({
|
|
9118
|
+
value: '',
|
|
9119
|
+
label: response.data["default"].email
|
|
9120
|
+
});
|
|
9121
|
+
setIsDisabledSubmitBtn(false);
|
|
9122
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9123
|
+
}
|
|
9124
|
+
});
|
|
9125
|
+
}
|
|
9126
|
+
}, [deactivateSingle]);
|
|
8834
9127
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8835
9128
|
setRowsPerPage(+event.target.value);
|
|
8836
9129
|
setPage(1);
|
|
8837
9130
|
setSelected({});
|
|
9131
|
+
setSelectedUsersNotApprover([]);
|
|
9132
|
+
setSelectedUsersApprover([]);
|
|
8838
9133
|
setSortingChange(true);
|
|
8839
9134
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8840
9135
|
};
|
|
8841
9136
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8842
9137
|
var isActive = e.target.checked;
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
9138
|
+
var _isApprover;
|
|
9139
|
+
newSelecteds.map(function (item) {
|
|
9140
|
+
if (item.id === id) {
|
|
9141
|
+
_isApprover = item.roles.is_approver;
|
|
9142
|
+
if (_isApprover === true && isActive === false) {
|
|
9143
|
+
setDeactivateSingle(true);
|
|
9144
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9145
|
+
setUser(item);
|
|
9146
|
+
} else {
|
|
9147
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9148
|
+
if (!isActive) {
|
|
9149
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9150
|
+
var _extends5;
|
|
9151
|
+
var selectedTemp = _extends({}, selected);
|
|
9152
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9153
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9154
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9155
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9156
|
+
return item.id != id;
|
|
9157
|
+
});
|
|
9158
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9159
|
+
return item.id != id;
|
|
9160
|
+
});
|
|
9161
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9162
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9163
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9164
|
+
}
|
|
9165
|
+
}
|
|
9166
|
+
});
|
|
8850
9167
|
}
|
|
8851
9168
|
}
|
|
8852
9169
|
});
|
|
8853
9170
|
};
|
|
9171
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9172
|
+
var _value = _ref4._value;
|
|
9173
|
+
if (_value.data.approvee_status) {
|
|
9174
|
+
setApproveeStatus(true);
|
|
9175
|
+
} else {
|
|
9176
|
+
setApproveeStatus(false);
|
|
9177
|
+
}
|
|
9178
|
+
setDefaultId(_value.data.id);
|
|
9179
|
+
setApproverRole(_value);
|
|
9180
|
+
setIsDisabledSubmitBtn(false);
|
|
9181
|
+
};
|
|
9182
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9183
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9184
|
+
setOpenDeActivateModalFlag(false);
|
|
9185
|
+
setDeactivateSingle(false);
|
|
9186
|
+
setSelected({});
|
|
9187
|
+
setSelectedUsersNotApprover([]);
|
|
9188
|
+
setSelectedUsersApprover([]);
|
|
9189
|
+
};
|
|
8854
9190
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8855
9191
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8856
9192
|
setOpenDeActivateModalFlag(false);
|
|
8857
9193
|
setSelected({});
|
|
9194
|
+
setSelectedUsersNotApprover([]);
|
|
9195
|
+
setSelectedUsersApprover([]);
|
|
9196
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9197
|
+
};
|
|
9198
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9199
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9200
|
+
return item.id;
|
|
9201
|
+
});
|
|
9202
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9203
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9204
|
+
setSelected({});
|
|
9205
|
+
setSelectedUsersNotApprover([]);
|
|
9206
|
+
setSelectedUsersApprover([]);
|
|
8858
9207
|
};
|
|
8859
9208
|
var importUserHandler = function importUserHandler() {
|
|
8860
9209
|
setOpenImportUsersModal(true);
|
|
@@ -8871,13 +9220,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8871
9220
|
email: email
|
|
8872
9221
|
}));
|
|
8873
9222
|
};
|
|
8874
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
9223
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9224
|
+
if (type === undefined) {
|
|
9225
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9226
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9227
|
+
return false;
|
|
9228
|
+
}
|
|
8879
9229
|
}
|
|
8880
9230
|
setUserIds(ids);
|
|
9231
|
+
setUserFirstName(firstName);
|
|
9232
|
+
setUserLastName(lastName);
|
|
9233
|
+
setToggleInviteModal(!showInviteModal);
|
|
9234
|
+
};
|
|
9235
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8881
9236
|
setToggleInviteModal(!showInviteModal);
|
|
8882
9237
|
};
|
|
8883
9238
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8950,6 +9305,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8950
9305
|
userId: userId
|
|
8951
9306
|
}));
|
|
8952
9307
|
};
|
|
9308
|
+
var knowMore = function knowMore() {
|
|
9309
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9310
|
+
};
|
|
8953
9311
|
var dispatch = useDispatch();
|
|
8954
9312
|
useEffect(function () {
|
|
8955
9313
|
if (isTokenVerified === true) {
|
|
@@ -9201,7 +9559,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9201
9559
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9202
9560
|
variant: "body2",
|
|
9203
9561
|
className: clsx(styles$5.description)
|
|
9204
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9562
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9563
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9564
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9565
|
+
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9205
9566
|
data: signupRequestListInfo,
|
|
9206
9567
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9207
9568
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9233,6 +9594,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9233
9594
|
}))
|
|
9234
9595
|
}]
|
|
9235
9596
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9597
|
+
isOpen: deactivateSingle,
|
|
9598
|
+
closeHandler: function closeHandler() {
|
|
9599
|
+
setDeactivateSingle(false);
|
|
9600
|
+
},
|
|
9601
|
+
cancelLabel: "Cancel",
|
|
9602
|
+
submitLabel: "Deactivate",
|
|
9603
|
+
submitHandler: handleDeactivateUser,
|
|
9604
|
+
headerText: "Deactivate this user?",
|
|
9605
|
+
width: "400px",
|
|
9606
|
+
subHanderText: "",
|
|
9607
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9608
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9609
|
+
modalClass: "deactivateSingleModal",
|
|
9610
|
+
modalBodyStyle: {
|
|
9611
|
+
overflowY: 'unset'
|
|
9612
|
+
}
|
|
9613
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9614
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9615
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9616
|
+
className: styles$5.deactivateAlert
|
|
9617
|
+
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9618
|
+
width: "9",
|
|
9619
|
+
height: "9"
|
|
9620
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9621
|
+
variant: "body2"
|
|
9622
|
+
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9623
|
+
onClick: knowMore,
|
|
9624
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9625
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9626
|
+
className: "iui__mt-15"
|
|
9627
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9628
|
+
isMove: true,
|
|
9629
|
+
additional: {
|
|
9630
|
+
page: 1,
|
|
9631
|
+
product: 'travel',
|
|
9632
|
+
userId: user.id
|
|
9633
|
+
},
|
|
9634
|
+
label: "Transfer approver role to",
|
|
9635
|
+
value: approverRole,
|
|
9636
|
+
onValueChange: selectApprover,
|
|
9637
|
+
loadOption: transferRoleOptions,
|
|
9638
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9639
|
+
customLoadingText: "No results found"
|
|
9640
|
+
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9641
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9642
|
+
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9643
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9644
|
+
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9236
9645
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9237
9646
|
closeHandler: closeDeActivateModal,
|
|
9238
9647
|
cancelLabel: "Cancel",
|
|
@@ -9259,8 +9668,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9259
9668
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9260
9669
|
className: styles$5.description
|
|
9261
9670
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9671
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9672
|
+
closeHandler: closeDeActiveModal,
|
|
9673
|
+
cancelLabel: "Cancel",
|
|
9674
|
+
submitLabel: "Deactivate safe users",
|
|
9675
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9676
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9677
|
+
customButtonLabel: "Deactivate all users",
|
|
9678
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9679
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9680
|
+
width: "640px",
|
|
9681
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9682
|
+
headerText: "Deactivate users?",
|
|
9683
|
+
modalBodyStyle: {
|
|
9684
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9685
|
+
}
|
|
9686
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9687
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9688
|
+
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9689
|
+
color: "#9A6700",
|
|
9690
|
+
size: "14"
|
|
9691
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9692
|
+
variant: "body2"
|
|
9693
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9694
|
+
onClick: knowMore,
|
|
9695
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9696
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9697
|
+
className: "iui__my-15"
|
|
9698
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9699
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9700
|
+
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9701
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9702
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9703
|
+
var _item$data;
|
|
9704
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9705
|
+
key: index,
|
|
9706
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9707
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9708
|
+
firstName: item.first_name,
|
|
9709
|
+
lastName: item.last_name,
|
|
9710
|
+
isLetterAvatar: "true",
|
|
9711
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9712
|
+
secondaryText: item.email,
|
|
9713
|
+
letterAvatarTextColor: "black",
|
|
9714
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9715
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9716
|
+
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9717
|
+
color: "#9A6700",
|
|
9718
|
+
size: "14"
|
|
9719
|
+
}));
|
|
9720
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9721
|
+
style: {
|
|
9722
|
+
borderColor: '#E5E9ED'
|
|
9723
|
+
}
|
|
9724
|
+
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9725
|
+
className: "iui__my-15"
|
|
9726
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9727
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9728
|
+
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9729
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9730
|
+
}, "These users are not linked to any roles and can be deactivated safely."), (selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) && selectedUsersNotApprover.map(function (item, index) {
|
|
9731
|
+
var _item$data2;
|
|
9732
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9733
|
+
key: index,
|
|
9734
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9735
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9736
|
+
firstName: item.first_name,
|
|
9737
|
+
lastName: item.last_name,
|
|
9738
|
+
isLetterAvatar: "true",
|
|
9739
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9740
|
+
secondaryText: item.email,
|
|
9741
|
+
letterAvatarTextColor: "black",
|
|
9742
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9743
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9744
|
+
}));
|
|
9745
|
+
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9262
9746
|
isOpen: showInviteModal,
|
|
9263
|
-
closeHandler:
|
|
9747
|
+
closeHandler: function closeHandler() {
|
|
9748
|
+
return toggleInviteModalClose();
|
|
9749
|
+
},
|
|
9264
9750
|
cancelLabel: "Cancel",
|
|
9265
9751
|
headerText: "Resend Invites?",
|
|
9266
9752
|
submitLabel: "Send",
|
|
@@ -9292,7 +9778,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9292
9778
|
fontSize: '14px',
|
|
9293
9779
|
color: '#374151'
|
|
9294
9780
|
}
|
|
9295
|
-
}, "This invitation will be sent to
|
|
9781
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9782
|
+
style: {
|
|
9783
|
+
fontSize: '14px',
|
|
9784
|
+
color: '#374151',
|
|
9785
|
+
fontWeight: 'bold'
|
|
9786
|
+
}
|
|
9787
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9296
9788
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9297
9789
|
closeImportUsersModal: closeImportUsersModal,
|
|
9298
9790
|
closeImportModal: closeImportModal
|
|
@@ -9301,8 +9793,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9301
9793
|
errMsg: hasVerificationError
|
|
9302
9794
|
}));
|
|
9303
9795
|
};
|
|
9304
|
-
var TabLabelCount = function TabLabelCount(
|
|
9305
|
-
var count =
|
|
9796
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9797
|
+
var count = _ref5.count;
|
|
9306
9798
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9307
9799
|
className: styles$5.TabLabelCount
|
|
9308
9800
|
}, " ", count, " ");
|
|
@@ -9377,11 +9869,12 @@ function Header(props) {
|
|
|
9377
9869
|
})));
|
|
9378
9870
|
}
|
|
9379
9871
|
|
|
9380
|
-
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"};
|
|
9872
|
+
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"};
|
|
9381
9873
|
|
|
9382
9874
|
function Listview(_ref) {
|
|
9383
9875
|
var data = _ref.data,
|
|
9384
9876
|
name = _ref.name,
|
|
9877
|
+
tableName = _ref.tableName,
|
|
9385
9878
|
handleEditDialog = _ref.handleEditDialog,
|
|
9386
9879
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9387
9880
|
orderBy = _ref.orderBy,
|
|
@@ -9394,16 +9887,82 @@ function Listview(_ref) {
|
|
|
9394
9887
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9395
9888
|
page = _ref.page,
|
|
9396
9889
|
rowsPerPage = _ref.rowsPerPage;
|
|
9890
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9891
|
+
var _data$dept_head_detai;
|
|
9892
|
+
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) {
|
|
9893
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9894
|
+
}
|
|
9895
|
+
};
|
|
9397
9896
|
var columns = [{
|
|
9398
9897
|
id: 'name',
|
|
9399
9898
|
label: name,
|
|
9400
|
-
width: '
|
|
9899
|
+
width: '40%',
|
|
9401
9900
|
sortable: true,
|
|
9402
9901
|
cell: function cell(row) {
|
|
9403
9902
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9404
9903
|
component: "div"
|
|
9405
9904
|
}, row.name);
|
|
9406
9905
|
}
|
|
9906
|
+
}, {
|
|
9907
|
+
id: 'no_of_users',
|
|
9908
|
+
label: 'Number of users',
|
|
9909
|
+
width: '40%',
|
|
9910
|
+
sortable: true,
|
|
9911
|
+
cell: function cell(row) {
|
|
9912
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9913
|
+
component: "div"
|
|
9914
|
+
}, row.no_of_users);
|
|
9915
|
+
}
|
|
9916
|
+
}, {
|
|
9917
|
+
id: 'actions',
|
|
9918
|
+
label: 'Actions',
|
|
9919
|
+
width: '20%',
|
|
9920
|
+
cell: function cell(row) {
|
|
9921
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9922
|
+
display: "flex"
|
|
9923
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9924
|
+
buttonText: "Edit",
|
|
9925
|
+
className: styles$7.buttonWidth,
|
|
9926
|
+
onClick: function onClick() {
|
|
9927
|
+
return handleEditDialog(row);
|
|
9928
|
+
}
|
|
9929
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9930
|
+
buttonText: "Delete",
|
|
9931
|
+
className: styles$7.buttonWidth,
|
|
9932
|
+
onClick: function onClick() {
|
|
9933
|
+
return handleDeleteDialog(row, true);
|
|
9934
|
+
}
|
|
9935
|
+
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9936
|
+
buttonText: "Delete",
|
|
9937
|
+
className: styles$7.buttonWidth,
|
|
9938
|
+
onClick: function onClick() {
|
|
9939
|
+
return handleDeleteDialog(row, false);
|
|
9940
|
+
}
|
|
9941
|
+
}));
|
|
9942
|
+
}
|
|
9943
|
+
}];
|
|
9944
|
+
var departmentColumns = [{
|
|
9945
|
+
id: 'name',
|
|
9946
|
+
label: name,
|
|
9947
|
+
width: '30%',
|
|
9948
|
+
sortable: true,
|
|
9949
|
+
cell: function cell(row) {
|
|
9950
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9951
|
+
component: "div"
|
|
9952
|
+
}, row.name);
|
|
9953
|
+
}
|
|
9954
|
+
}, {
|
|
9955
|
+
id: 'department_head',
|
|
9956
|
+
label: 'Department head',
|
|
9957
|
+
width: '30%',
|
|
9958
|
+
sortable: true,
|
|
9959
|
+
cell: function cell(row) {
|
|
9960
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9961
|
+
component: "div"
|
|
9962
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9963
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9964
|
+
}, "Assigned by default"));
|
|
9965
|
+
}
|
|
9407
9966
|
}, {
|
|
9408
9967
|
id: 'no_of_users',
|
|
9409
9968
|
label: 'Number of users',
|
|
@@ -9417,7 +9976,7 @@ function Listview(_ref) {
|
|
|
9417
9976
|
}, {
|
|
9418
9977
|
id: 'actions',
|
|
9419
9978
|
label: 'Actions',
|
|
9420
|
-
width: '
|
|
9979
|
+
width: '15%',
|
|
9421
9980
|
cell: function cell(row) {
|
|
9422
9981
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9423
9982
|
display: "flex"
|
|
@@ -9450,7 +10009,7 @@ function Listview(_ref) {
|
|
|
9450
10009
|
hasFilter: true,
|
|
9451
10010
|
isCheckboxTable: false,
|
|
9452
10011
|
count: data.count,
|
|
9453
|
-
columns: columns,
|
|
10012
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9454
10013
|
rows: data.results,
|
|
9455
10014
|
page: page,
|
|
9456
10015
|
handleChangePage: handleChangePage,
|
|
@@ -9507,15 +10066,44 @@ function EditPanelDialog(_ref) {
|
|
|
9507
10066
|
var isOpen = _ref.isOpen,
|
|
9508
10067
|
closeHandler = _ref.closeHandler,
|
|
9509
10068
|
onValueChange = _ref.onValueChange,
|
|
9510
|
-
|
|
10069
|
+
_submitHandler = _ref.submitHandler,
|
|
9511
10070
|
isError = _ref.isError,
|
|
9512
10071
|
name = _ref.name,
|
|
9513
10072
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9514
|
-
validation = _ref.validation
|
|
10073
|
+
validation = _ref.validation,
|
|
10074
|
+
rowData = _ref.rowData,
|
|
10075
|
+
tableName = _ref.tableName,
|
|
10076
|
+
config = _ref.config;
|
|
9515
10077
|
var _useSelector = useSelector(function (state) {
|
|
9516
10078
|
return state.userPanel;
|
|
9517
10079
|
}),
|
|
9518
10080
|
dialogData = _useSelector.dialogData;
|
|
10081
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10082
|
+
var _data$dept_head_detai;
|
|
10083
|
+
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) {
|
|
10084
|
+
setHead({
|
|
10085
|
+
value: data.dept_head_details[0].id,
|
|
10086
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10087
|
+
});
|
|
10088
|
+
}
|
|
10089
|
+
};
|
|
10090
|
+
var _useState = useState({
|
|
10091
|
+
value: '',
|
|
10092
|
+
label: 'Select'
|
|
10093
|
+
}),
|
|
10094
|
+
head = _useState[0],
|
|
10095
|
+
setHead = _useState[1];
|
|
10096
|
+
useEffect(function () {
|
|
10097
|
+
deptHeadDetails(rowData);
|
|
10098
|
+
}, [rowData]);
|
|
10099
|
+
var history = useHistory();
|
|
10100
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10101
|
+
console.log(rowData);
|
|
10102
|
+
history.push({
|
|
10103
|
+
pathname: config.routes.users.add.path,
|
|
10104
|
+
state: rowData
|
|
10105
|
+
});
|
|
10106
|
+
};
|
|
9519
10107
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9520
10108
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9521
10109
|
isOpen: isOpen,
|
|
@@ -9523,25 +10111,59 @@ function EditPanelDialog(_ref) {
|
|
|
9523
10111
|
headerText: "Edit " + name.toLowerCase(),
|
|
9524
10112
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9525
10113
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9526
|
-
submitHandler: submitHandler
|
|
9527
|
-
|
|
10114
|
+
submitHandler: function submitHandler() {
|
|
10115
|
+
return _submitHandler(head);
|
|
10116
|
+
},
|
|
10117
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9528
10118
|
hideCloseIcon: false,
|
|
9529
10119
|
modalBodyStyle: {
|
|
9530
|
-
|
|
9531
|
-
overflow: 'auto',
|
|
9532
|
-
margin: '0px'
|
|
10120
|
+
overflowY: 'visible'
|
|
9533
10121
|
},
|
|
9534
10122
|
footerStyle: {
|
|
9535
10123
|
justifyContent: 'end'
|
|
9536
10124
|
}
|
|
10125
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10126
|
+
display: "flex",
|
|
10127
|
+
justifyContent: "center",
|
|
10128
|
+
alignItems: "center",
|
|
10129
|
+
flexDirection: "column",
|
|
10130
|
+
style: {
|
|
10131
|
+
marginBottom: '30px'
|
|
10132
|
+
}
|
|
9537
10133
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9538
|
-
component: "div",
|
|
9539
10134
|
display: "flex",
|
|
9540
10135
|
justifyContent: "center",
|
|
9541
10136
|
alignItems: "center",
|
|
9542
10137
|
flexDirection: "column",
|
|
9543
|
-
|
|
9544
|
-
}, /*#__PURE__*/React.createElement(
|
|
10138
|
+
className: styles$7.baseAlert
|
|
10139
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10140
|
+
className: styles$7.alertDescContainer
|
|
10141
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10142
|
+
className: styles$7.iconLayout,
|
|
10143
|
+
style: {
|
|
10144
|
+
paddingTop: '4px'
|
|
10145
|
+
}
|
|
10146
|
+
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10147
|
+
color: "#CA8A04",
|
|
10148
|
+
width: "25",
|
|
10149
|
+
height: "20",
|
|
10150
|
+
className: styles$7.iconStyle
|
|
10151
|
+
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10152
|
+
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.",
|
|
10153
|
+
style: {
|
|
10154
|
+
fontWeight: 'normal'
|
|
10155
|
+
}
|
|
10156
|
+
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10157
|
+
buttonText: "Add user",
|
|
10158
|
+
type: "text",
|
|
10159
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10160
|
+
width: "9",
|
|
10161
|
+
height: "9",
|
|
10162
|
+
color: "#EC5D25"
|
|
10163
|
+
}),
|
|
10164
|
+
onClick: handleAddPageNavigation,
|
|
10165
|
+
className: styles$7.addUserButton
|
|
10166
|
+
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9545
10167
|
label: name + " name",
|
|
9546
10168
|
name: "name",
|
|
9547
10169
|
defaultValue: dialogData.data.name,
|
|
@@ -9550,7 +10172,49 @@ function EditPanelDialog(_ref) {
|
|
|
9550
10172
|
isError: isError,
|
|
9551
10173
|
validation: validation,
|
|
9552
10174
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9553
|
-
required: true
|
|
10175
|
+
required: true,
|
|
10176
|
+
style: tableName === 'department' && {
|
|
10177
|
+
width: '350px'
|
|
10178
|
+
}
|
|
10179
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10180
|
+
className: "iui__mt-15",
|
|
10181
|
+
style: {
|
|
10182
|
+
width: '100%'
|
|
10183
|
+
}
|
|
10184
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10185
|
+
label: "Department head",
|
|
10186
|
+
name: "name",
|
|
10187
|
+
defaultValue: head.label,
|
|
10188
|
+
placeholder: "",
|
|
10189
|
+
readOnly: true,
|
|
10190
|
+
style: {
|
|
10191
|
+
width: '350px'
|
|
10192
|
+
}
|
|
10193
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10194
|
+
className: "iui__mt-15",
|
|
10195
|
+
style: {
|
|
10196
|
+
width: '100%'
|
|
10197
|
+
}
|
|
10198
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10199
|
+
noResultsText: true,
|
|
10200
|
+
isMove: true,
|
|
10201
|
+
additional: {
|
|
10202
|
+
page: 1,
|
|
10203
|
+
departmentId: rowData.id
|
|
10204
|
+
},
|
|
10205
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10206
|
+
label: "Department head",
|
|
10207
|
+
value: head,
|
|
10208
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10209
|
+
var _value = _ref2._value;
|
|
10210
|
+
return setHead(_value);
|
|
10211
|
+
},
|
|
10212
|
+
loadOption: departmentHeadOptions,
|
|
10213
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10214
|
+
customLoadingText: "No users found in this department",
|
|
10215
|
+
customLoadingTextStyle: {
|
|
10216
|
+
color: '#374151'
|
|
10217
|
+
}
|
|
9554
10218
|
})));
|
|
9555
10219
|
}
|
|
9556
10220
|
|
|
@@ -9729,12 +10393,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9729
10393
|
var _useState13 = useState(false),
|
|
9730
10394
|
isSortingChangeTemp = _useState13[0],
|
|
9731
10395
|
setSortingChangeTemp = _useState13[1];
|
|
9732
|
-
var _useState14 = useState(
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
var _useState15 = useState(
|
|
9736
|
-
|
|
9737
|
-
|
|
10396
|
+
var _useState14 = useState([]),
|
|
10397
|
+
rowData = _useState14[0],
|
|
10398
|
+
setRowData = _useState14[1];
|
|
10399
|
+
var _useState15 = useState(1),
|
|
10400
|
+
page = _useState15[0],
|
|
10401
|
+
setPage = _useState15[1];
|
|
10402
|
+
var _useState16 = useState(5),
|
|
10403
|
+
rowsPerPage = _useState16[0],
|
|
10404
|
+
setRowsPerPage = _useState16[1];
|
|
9738
10405
|
var orderingParam = orderBy;
|
|
9739
10406
|
var _useSelector = useSelector(function (state) {
|
|
9740
10407
|
return state.userPanel;
|
|
@@ -9752,12 +10419,20 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9752
10419
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
9753
10420
|
setDataList(validatedValue);
|
|
9754
10421
|
};
|
|
10422
|
+
var _useState17 = useState(70),
|
|
10423
|
+
maxLengthForModal = _useState17[0],
|
|
10424
|
+
setMaxLengthForModal = _useState17[1];
|
|
10425
|
+
useEffect(function () {
|
|
10426
|
+
if (title === 'Business unit') {
|
|
10427
|
+
setMaxLengthForModal(150);
|
|
10428
|
+
}
|
|
10429
|
+
}, []);
|
|
9755
10430
|
var validation = {
|
|
9756
10431
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
9757
10432
|
regexOnBlur: null,
|
|
9758
10433
|
maxLimit: '',
|
|
9759
10434
|
minLimit: '',
|
|
9760
|
-
maxLength:
|
|
10435
|
+
maxLength: maxLengthForModal,
|
|
9761
10436
|
minLength: 0
|
|
9762
10437
|
};
|
|
9763
10438
|
useEffect(function () {
|
|
@@ -9830,6 +10505,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9830
10505
|
submitLabel: 'Save'
|
|
9831
10506
|
}, '', data));
|
|
9832
10507
|
setDataList(data.name);
|
|
10508
|
+
setRowData(data);
|
|
9833
10509
|
setEditModal(true);
|
|
9834
10510
|
};
|
|
9835
10511
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9844,6 +10520,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9844
10520
|
var payload = {
|
|
9845
10521
|
names: [dataList]
|
|
9846
10522
|
};
|
|
10523
|
+
if (tableName === 'department') {
|
|
10524
|
+
payload = {
|
|
10525
|
+
name: dataList,
|
|
10526
|
+
department_head_id: null
|
|
10527
|
+
};
|
|
10528
|
+
}
|
|
9847
10529
|
var message = title + " added successfully.";
|
|
9848
10530
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9849
10531
|
} else {
|
|
@@ -9857,9 +10539,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9857
10539
|
var message = title + " deleted successfully.";
|
|
9858
10540
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9859
10541
|
};
|
|
9860
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10542
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10543
|
+
if (optionalParams === void 0) {
|
|
10544
|
+
optionalParams = null;
|
|
10545
|
+
}
|
|
9861
10546
|
dispatch(userPanelShowLoader());
|
|
9862
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10547
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9863
10548
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9864
10549
|
dispatch(userPanelStopLoader());
|
|
9865
10550
|
if (type === 'delete') {
|
|
@@ -9901,8 +10586,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9901
10586
|
name: dataList
|
|
9902
10587
|
}]
|
|
9903
10588
|
};
|
|
10589
|
+
if (tableName === 'department') {
|
|
10590
|
+
payload = {
|
|
10591
|
+
name: dataList,
|
|
10592
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10593
|
+
};
|
|
10594
|
+
}
|
|
9904
10595
|
var message = title + " updated successfully.";
|
|
9905
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10596
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9906
10597
|
setErrorEdit(false);
|
|
9907
10598
|
} else {
|
|
9908
10599
|
setErrorEdit(true);
|
|
@@ -10009,7 +10700,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10009
10700
|
submitHandler: handleEditPanel,
|
|
10010
10701
|
isError: errorEdit,
|
|
10011
10702
|
isDisabledSubmitBtn: loading,
|
|
10012
|
-
validation: validation
|
|
10703
|
+
validation: validation,
|
|
10704
|
+
rowData: rowData,
|
|
10705
|
+
tableName: tableName,
|
|
10706
|
+
config: config
|
|
10013
10707
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10014
10708
|
config: config
|
|
10015
10709
|
}));
|