@itilite/iui-user-management 0.4.41 → 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 +1064 -315
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +1065 -316
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -357,6 +357,9 @@ var userAddEditUrl = {
|
|
|
357
357
|
approversSearch: function approversSearch() {
|
|
358
358
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
359
359
|
},
|
|
360
|
+
transferAppover: function transferAppover() {
|
|
361
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
362
|
+
},
|
|
360
363
|
preSignedUrl: function preSignedUrl() {
|
|
361
364
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
362
365
|
},
|
|
@@ -453,6 +456,14 @@ var userPanelUrl = {
|
|
|
453
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
454
457
|
}
|
|
455
458
|
};
|
|
459
|
+
var departmentUrl = {
|
|
460
|
+
departmentUrl: function departmentUrl() {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
462
|
+
},
|
|
463
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
456
467
|
|
|
457
468
|
var api = utils.configs.api;
|
|
458
469
|
var NAoptionConfig = {
|
|
@@ -594,11 +605,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
594
605
|
return Promise.reject(e);
|
|
595
606
|
}
|
|
596
607
|
};
|
|
597
|
-
var
|
|
608
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
598
609
|
var page = _ref4.page,
|
|
599
610
|
product = _ref4.product,
|
|
600
|
-
userId = _ref4.userId
|
|
601
|
-
|
|
611
|
+
userId = _ref4.userId;
|
|
612
|
+
try {
|
|
613
|
+
return Promise.resolve(_catch(function () {
|
|
614
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
615
|
+
return res.data;
|
|
616
|
+
})).then(function (response) {
|
|
617
|
+
var mappedValue = response.results.map(function (item) {
|
|
618
|
+
return {
|
|
619
|
+
value: item.email,
|
|
620
|
+
label: item.email,
|
|
621
|
+
type: 'detailed',
|
|
622
|
+
data: item
|
|
623
|
+
};
|
|
624
|
+
});
|
|
625
|
+
return {
|
|
626
|
+
options: mappedValue,
|
|
627
|
+
hasMore: !!response.next,
|
|
628
|
+
additional: {
|
|
629
|
+
page: page + 1,
|
|
630
|
+
product: product,
|
|
631
|
+
userId: userId
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
});
|
|
635
|
+
}, function () {
|
|
636
|
+
return {
|
|
637
|
+
options: [],
|
|
638
|
+
hasMore: false,
|
|
639
|
+
additional: {
|
|
640
|
+
page: 1,
|
|
641
|
+
product: product,
|
|
642
|
+
userId: userId
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}));
|
|
646
|
+
} catch (e) {
|
|
647
|
+
return Promise.reject(e);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
651
|
+
var page = _ref5.page,
|
|
652
|
+
product = _ref5.product,
|
|
653
|
+
userId = _ref5.userId,
|
|
654
|
+
placeholder = _ref5.placeholder;
|
|
602
655
|
try {
|
|
603
656
|
return Promise.resolve(_catch(function () {
|
|
604
657
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -644,9 +697,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
644
697
|
return Promise.reject(e);
|
|
645
698
|
}
|
|
646
699
|
};
|
|
647
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
648
|
-
var page =
|
|
649
|
-
tabelName =
|
|
700
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
701
|
+
var page = _ref6.page,
|
|
702
|
+
tabelName = _ref6.tabelName;
|
|
650
703
|
try {
|
|
651
704
|
return Promise.resolve(_catch(function () {
|
|
652
705
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -681,6 +734,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
681
734
|
return Promise.reject(e);
|
|
682
735
|
}
|
|
683
736
|
};
|
|
737
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
738
|
+
var page = _ref7.page,
|
|
739
|
+
departmentId = _ref7.departmentId;
|
|
740
|
+
try {
|
|
741
|
+
return Promise.resolve(_catch(function () {
|
|
742
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
743
|
+
return res.data;
|
|
744
|
+
})).then(function (response) {
|
|
745
|
+
var mappedValue = response.results.map(function (item) {
|
|
746
|
+
return {
|
|
747
|
+
value: item.id,
|
|
748
|
+
label: item.first_name + ' ' + item.last_name,
|
|
749
|
+
type: 'detailed',
|
|
750
|
+
data: item
|
|
751
|
+
};
|
|
752
|
+
});
|
|
753
|
+
console.log(response.next);
|
|
754
|
+
return {
|
|
755
|
+
options: mappedValue,
|
|
756
|
+
hasMore: !!response.next,
|
|
757
|
+
additional: {
|
|
758
|
+
page: page + 1,
|
|
759
|
+
departmentId: departmentId
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
});
|
|
763
|
+
}, function () {
|
|
764
|
+
return {
|
|
765
|
+
options: [],
|
|
766
|
+
hasMore: false,
|
|
767
|
+
additional: {
|
|
768
|
+
page: 1,
|
|
769
|
+
departmentId: departmentId
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
}));
|
|
773
|
+
} catch (e) {
|
|
774
|
+
return Promise.reject(e);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
684
777
|
|
|
685
778
|
var UserRole = function UserRole(_ref) {
|
|
686
779
|
var _ref$list = _ref.list,
|
|
@@ -1149,10 +1242,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1149
1242
|
payload: tabId
|
|
1150
1243
|
};
|
|
1151
1244
|
};
|
|
1152
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1245
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1246
|
+
if (roleTransfer === void 0) {
|
|
1247
|
+
roleTransfer = false;
|
|
1248
|
+
}
|
|
1249
|
+
var _payload = {
|
|
1250
|
+
role_transfer: roleTransfer
|
|
1251
|
+
};
|
|
1252
|
+
if (roleTransfer) {
|
|
1253
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1254
|
+
}
|
|
1153
1255
|
return function (dispatch) {
|
|
1154
1256
|
return new Promise(function (resolve, reject) {
|
|
1155
|
-
api$1.
|
|
1257
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1156
1258
|
dispatch(setUserActiveStatus({
|
|
1157
1259
|
is_active: activateVal !== 0,
|
|
1158
1260
|
id: id
|
|
@@ -1716,7 +1818,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1716
1818
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1717
1819
|
return function (dispatch) {
|
|
1718
1820
|
return new Promise(function (resolve, reject) {
|
|
1719
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1821
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1720
1822
|
resolve(res);
|
|
1721
1823
|
})["catch"](function (err) {
|
|
1722
1824
|
var _err$response17, _err$response17$data;
|
|
@@ -1752,6 +1854,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1752
1854
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1753
1855
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1754
1856
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1857
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1755
1858
|
|
|
1756
1859
|
var api$3 = utils.configs.api;
|
|
1757
1860
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1801,14 +1904,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1801
1904
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1802
1905
|
return function (dispatch) {
|
|
1803
1906
|
return new Promise(function (resolve, reject) {
|
|
1804
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1907
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1805
1908
|
dispatch(getUserPanalData(getParam));
|
|
1806
1909
|
dispatch(closeDialog());
|
|
1807
1910
|
resolve(res);
|
|
1808
1911
|
})["catch"](function (err) {
|
|
1809
|
-
var _err$
|
|
1912
|
+
var _err$response3, _err$response3$data;
|
|
1810
1913
|
dispatch(userPanelStopLoader());
|
|
1811
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1914
|
+
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.');
|
|
1812
1915
|
});
|
|
1813
1916
|
});
|
|
1814
1917
|
};
|
|
@@ -1822,25 +1925,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1822
1925
|
dispatch(userPanelStopLoader());
|
|
1823
1926
|
resolve();
|
|
1824
1927
|
})["catch"](function (err) {
|
|
1825
|
-
var _err$
|
|
1826
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1928
|
+
var _err$response4, _err$response4$data;
|
|
1929
|
+
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.');
|
|
1827
1930
|
dispatch(userPanelStopLoader());
|
|
1828
1931
|
});
|
|
1829
1932
|
});
|
|
1830
1933
|
};
|
|
1831
1934
|
};
|
|
1832
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1935
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1833
1936
|
return function (dispatch) {
|
|
1834
1937
|
return new Promise(function (resolve, reject) {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1938
|
+
if (tableName === 'department') {
|
|
1939
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1940
|
+
dispatch(getUserPanalData(getParam));
|
|
1941
|
+
dispatch(closeDialog());
|
|
1942
|
+
resolve();
|
|
1943
|
+
})["catch"](function (err) {
|
|
1944
|
+
var _err$response5, _err$response5$data;
|
|
1945
|
+
dispatch(userPanelStopLoader());
|
|
1946
|
+
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.');
|
|
1947
|
+
});
|
|
1948
|
+
} else {
|
|
1949
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1950
|
+
dispatch(getUserPanalData(getParam));
|
|
1951
|
+
dispatch(closeDialog());
|
|
1952
|
+
resolve();
|
|
1953
|
+
})["catch"](function (err) {
|
|
1954
|
+
var _err$response6, _err$response6$data;
|
|
1955
|
+
dispatch(userPanelStopLoader());
|
|
1956
|
+
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.');
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1844
1959
|
});
|
|
1845
1960
|
};
|
|
1846
1961
|
};
|
|
@@ -1852,8 +1967,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1852
1967
|
dispatch(closeDialog());
|
|
1853
1968
|
resolve(res);
|
|
1854
1969
|
})["catch"](function (err) {
|
|
1855
|
-
var _err$
|
|
1856
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1970
|
+
var _err$response7, _err$response7$data;
|
|
1971
|
+
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.');
|
|
1857
1972
|
});
|
|
1858
1973
|
});
|
|
1859
1974
|
};
|
|
@@ -2942,8 +3057,8 @@ var workInfo = [{
|
|
|
2942
3057
|
validation: {
|
|
2943
3058
|
regexOnChange: null,
|
|
2944
3059
|
regexOnBlur: [{
|
|
2945
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
2946
|
-
message: "Only alphabets, numbers and
|
|
3060
|
+
regex: /^[(A-Z)(a-z)(0-9)\-_& ]*$/,
|
|
3061
|
+
message: "Only alphabets, numbers, - and _ & are allowed."
|
|
2947
3062
|
}],
|
|
2948
3063
|
maxLimit: '',
|
|
2949
3064
|
minLimit: '',
|
|
@@ -3031,8 +3146,8 @@ var workInfo = [{
|
|
|
3031
3146
|
validation: {
|
|
3032
3147
|
regexOnChange: null,
|
|
3033
3148
|
regexOnBlur: [{
|
|
3034
|
-
regex: /^[A-Za-z0-9
|
|
3035
|
-
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3149
|
+
regex: /^[A-Za-z0-9 \-_.,&'()\/]*$/,
|
|
3150
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) _ - , / are allowed."
|
|
3036
3151
|
}, {
|
|
3037
3152
|
regex: /^[a-zA-Z]/,
|
|
3038
3153
|
message: 'Designation should start with alphabets'
|
|
@@ -3953,6 +4068,7 @@ var initialState$2 = {
|
|
|
3953
4068
|
previous: null,
|
|
3954
4069
|
results: []
|
|
3955
4070
|
},
|
|
4071
|
+
deptUsers: [],
|
|
3956
4072
|
loading: false
|
|
3957
4073
|
};
|
|
3958
4074
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4022,6 +4138,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4022
4138
|
loading: false
|
|
4023
4139
|
});
|
|
4024
4140
|
}
|
|
4141
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4142
|
+
{
|
|
4143
|
+
return _extends({}, state, {
|
|
4144
|
+
deptUsers: action.payload
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4025
4147
|
default:
|
|
4026
4148
|
return state;
|
|
4027
4149
|
}
|
|
@@ -4800,6 +4922,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4800
4922
|
isILadmin = _useSelector2.isILadmin,
|
|
4801
4923
|
companyName = _useSelector2.companyName;
|
|
4802
4924
|
var history = reactRouterDom.useHistory();
|
|
4925
|
+
var location = reactRouterDom.useLocation();
|
|
4803
4926
|
var _useState = React.useState({
|
|
4804
4927
|
travel: false,
|
|
4805
4928
|
expense: false
|
|
@@ -4868,6 +4991,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4868
4991
|
},
|
|
4869
4992
|
designation: '',
|
|
4870
4993
|
base_location: '',
|
|
4994
|
+
manager_id: {
|
|
4995
|
+
value: '',
|
|
4996
|
+
label: 'Select Manager'
|
|
4997
|
+
},
|
|
4998
|
+
skip_manager_id: {
|
|
4999
|
+
value: '',
|
|
5000
|
+
label: 'Select Manager'
|
|
5001
|
+
},
|
|
4871
5002
|
currency: {
|
|
4872
5003
|
value: defaultCurrency,
|
|
4873
5004
|
label: defaultCurrency
|
|
@@ -4880,7 +5011,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4880
5011
|
entity: 0,
|
|
4881
5012
|
business_unit: 0,
|
|
4882
5013
|
department: 0,
|
|
4883
|
-
currency: 0
|
|
5014
|
+
currency: 0,
|
|
5015
|
+
manager_id: 0,
|
|
5016
|
+
skip_manager_id: 0
|
|
4884
5017
|
}),
|
|
4885
5018
|
cacheForAsyncDropdown = _useState4[0],
|
|
4886
5019
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5034,6 +5167,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5034
5167
|
var _useState25 = React.useState([]),
|
|
5035
5168
|
uploadedFiles = _useState25[0],
|
|
5036
5169
|
setUploadedFiles = _useState25[1];
|
|
5170
|
+
var _useState26 = React.useState(70),
|
|
5171
|
+
maxLengthForModal = _useState26[0],
|
|
5172
|
+
setMaxLengthForModal = _useState26[1];
|
|
5037
5173
|
var defaultAddModalData = {
|
|
5038
5174
|
isOpen: false,
|
|
5039
5175
|
isError: false,
|
|
@@ -5046,25 +5182,41 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5046
5182
|
regexOnBlur: null,
|
|
5047
5183
|
maxLimit: '',
|
|
5048
5184
|
minLimit: '',
|
|
5049
|
-
maxLength:
|
|
5185
|
+
maxLength: maxLengthForModal,
|
|
5050
5186
|
minLength: 0
|
|
5051
5187
|
};
|
|
5052
|
-
var
|
|
5053
|
-
addModalData =
|
|
5054
|
-
setAddModalData =
|
|
5188
|
+
var _useState27 = React.useState(defaultAddModalData),
|
|
5189
|
+
addModalData = _useState27[0],
|
|
5190
|
+
setAddModalData = _useState27[1];
|
|
5055
5191
|
var onAddModalClose = function onAddModalClose() {
|
|
5056
5192
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5057
5193
|
};
|
|
5194
|
+
React.useEffect(function () {
|
|
5195
|
+
var _location$state, _location$state2;
|
|
5196
|
+
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) {
|
|
5197
|
+
var _location$state3, _location$state4;
|
|
5198
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5199
|
+
department: {
|
|
5200
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5201
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5202
|
+
}
|
|
5203
|
+
}));
|
|
5204
|
+
}
|
|
5205
|
+
}, []);
|
|
5058
5206
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5059
5207
|
var title = '';
|
|
5060
5208
|
if (id === 'entity') {
|
|
5061
5209
|
title = 'Entity';
|
|
5210
|
+
setMaxLengthForModal(70);
|
|
5062
5211
|
} else if (id === 'department') {
|
|
5063
5212
|
title = 'Department';
|
|
5213
|
+
setMaxLengthForModal(70);
|
|
5064
5214
|
} else if (id === 'business_unit') {
|
|
5215
|
+
setMaxLengthForModal(150);
|
|
5065
5216
|
title = 'Business unit';
|
|
5066
5217
|
} else if (id === 'employee_level') {
|
|
5067
5218
|
title = 'Employee level';
|
|
5219
|
+
setMaxLengthForModal(70);
|
|
5068
5220
|
}
|
|
5069
5221
|
setAddModalData(_extends({}, addModalData, {
|
|
5070
5222
|
isOpen: true,
|
|
@@ -5080,27 +5232,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5080
5232
|
}));
|
|
5081
5233
|
} else {
|
|
5082
5234
|
dispatch(showLoader());
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5235
|
+
var dataObj;
|
|
5236
|
+
if (addModalData.id === 'department') {
|
|
5237
|
+
dataObj = {
|
|
5238
|
+
name: validatedValue,
|
|
5239
|
+
department_head_id: null
|
|
5240
|
+
};
|
|
5241
|
+
} else {
|
|
5242
|
+
dataObj = {
|
|
5243
|
+
names: [validatedValue]
|
|
5244
|
+
};
|
|
5245
|
+
}
|
|
5246
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5247
|
+
var _extends4;
|
|
5087
5248
|
setAddModalData(_extends({}, addModalData, {
|
|
5088
5249
|
isOpen: false
|
|
5089
5250
|
}));
|
|
5090
5251
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5091
5252
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5253
|
+
if (addModalData.id === 'department') {
|
|
5254
|
+
var _extends2;
|
|
5255
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5256
|
+
value: res.data.result.id,
|
|
5257
|
+
label: res.data.result.name
|
|
5258
|
+
}, _extends2)));
|
|
5259
|
+
} else {
|
|
5260
|
+
var _extends3;
|
|
5261
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5262
|
+
value: res.data.value,
|
|
5263
|
+
label: res.data.label
|
|
5264
|
+
}, _extends3)));
|
|
5098
5265
|
}
|
|
5099
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5266
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5100
5267
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5101
5268
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5102
|
-
var
|
|
5103
|
-
return _extends({}, prevState, (
|
|
5269
|
+
var _extends5;
|
|
5270
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5104
5271
|
});
|
|
5105
5272
|
dispatch(stopLoader());
|
|
5106
5273
|
});
|
|
@@ -5119,8 +5286,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5119
5286
|
try {
|
|
5120
5287
|
var _temp5 = function _temp5() {
|
|
5121
5288
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5122
|
-
var
|
|
5123
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5289
|
+
var _extends6;
|
|
5290
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5124
5291
|
}
|
|
5125
5292
|
};
|
|
5126
5293
|
var _name = args._name,
|
|
@@ -5143,8 +5310,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5143
5310
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5144
5311
|
} else {
|
|
5145
5312
|
var _temp3 = function _temp3() {
|
|
5146
|
-
var
|
|
5147
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5313
|
+
var _extends7;
|
|
5314
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5148
5315
|
updateError(_name, _isError, _errorMsg);
|
|
5149
5316
|
};
|
|
5150
5317
|
var _temp2 = function () {
|
|
@@ -5192,16 +5359,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5192
5359
|
}
|
|
5193
5360
|
};
|
|
5194
5361
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5195
|
-
var
|
|
5362
|
+
var _extends8;
|
|
5196
5363
|
var _name = args._name,
|
|
5197
5364
|
_value = args._value,
|
|
5198
5365
|
_isError = args._isError,
|
|
5199
5366
|
_errorMsg = args._errorMsg;
|
|
5200
|
-
|
|
5367
|
+
console.log(_name, _value);
|
|
5368
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5201
5369
|
updateError(_name, _isError, _errorMsg);
|
|
5202
5370
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5203
|
-
var
|
|
5204
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5371
|
+
var _extends9;
|
|
5372
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5205
5373
|
}
|
|
5206
5374
|
};
|
|
5207
5375
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5211,9 +5379,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5211
5379
|
return tag.id;
|
|
5212
5380
|
};
|
|
5213
5381
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5214
|
-
var
|
|
5382
|
+
var _extends10;
|
|
5215
5383
|
var e = args._event;
|
|
5216
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5384
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5217
5385
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5218
5386
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5219
5387
|
userTagType: true
|
|
@@ -5221,22 +5389,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5221
5389
|
}
|
|
5222
5390
|
};
|
|
5223
5391
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5224
|
-
var
|
|
5392
|
+
var _extends11;
|
|
5225
5393
|
var _name = _ref2._name,
|
|
5226
5394
|
_value = _ref2._value;
|
|
5227
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5395
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5228
5396
|
};
|
|
5229
5397
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5230
|
-
var
|
|
5398
|
+
var _extends12;
|
|
5231
5399
|
var _name = _ref3._name,
|
|
5232
5400
|
_value = _ref3._value;
|
|
5233
|
-
|
|
5401
|
+
console.log(_name, _value, 'travel');
|
|
5402
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5234
5403
|
};
|
|
5235
5404
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5236
|
-
var
|
|
5405
|
+
var _extends13;
|
|
5237
5406
|
var _name = _ref4._name,
|
|
5238
5407
|
_value = _ref4._value;
|
|
5239
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5408
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5240
5409
|
};
|
|
5241
5410
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5242
5411
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5270,39 +5439,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5270
5439
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5271
5440
|
};
|
|
5272
5441
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5273
|
-
var
|
|
5442
|
+
var _extends14;
|
|
5274
5443
|
var _name = args._name,
|
|
5275
5444
|
_value = args._value,
|
|
5276
5445
|
_isError = args._isError,
|
|
5277
5446
|
_errorMsg = args._errorMsg;
|
|
5278
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5447
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5279
5448
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5280
|
-
var
|
|
5281
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5449
|
+
var _extends15;
|
|
5450
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5282
5451
|
}
|
|
5283
5452
|
updateError(_name, _isError, _errorMsg);
|
|
5284
5453
|
};
|
|
5285
5454
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5286
|
-
var
|
|
5455
|
+
var _extends16;
|
|
5287
5456
|
var _name = args._name,
|
|
5288
5457
|
_value = args._value,
|
|
5289
5458
|
_isError = args._isError,
|
|
5290
5459
|
_errorMsg = args._errorMsg;
|
|
5291
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5460
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5292
5461
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5293
|
-
var
|
|
5294
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5462
|
+
var _extends17;
|
|
5463
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5295
5464
|
}
|
|
5296
5465
|
updateError(_name, _isError, _errorMsg);
|
|
5297
5466
|
};
|
|
5298
5467
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5299
5468
|
try {
|
|
5300
5469
|
var _temp8 = function _temp8() {
|
|
5301
|
-
var
|
|
5302
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5470
|
+
var _extends18;
|
|
5471
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5303
5472
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5304
|
-
var
|
|
5305
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5473
|
+
var _extends19;
|
|
5474
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5306
5475
|
}
|
|
5307
5476
|
updateError(_name, _isError, _errorMsg);
|
|
5308
5477
|
};
|
|
@@ -5408,8 +5577,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5408
5577
|
return _errorArray;
|
|
5409
5578
|
});
|
|
5410
5579
|
setErrorMsgs(function (prevState) {
|
|
5411
|
-
var
|
|
5412
|
-
return _extends({}, prevState, (
|
|
5580
|
+
var _extends20;
|
|
5581
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5413
5582
|
});
|
|
5414
5583
|
};
|
|
5415
5584
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5483,6 +5652,20 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5483
5652
|
value: '',
|
|
5484
5653
|
label: 'Select employee level'
|
|
5485
5654
|
},
|
|
5655
|
+
manager_id: res.employee_info.manager ? {
|
|
5656
|
+
value: res.employee_info.manager,
|
|
5657
|
+
label: res.employee_info.manager
|
|
5658
|
+
} : {
|
|
5659
|
+
value: '',
|
|
5660
|
+
label: 'Select Manager'
|
|
5661
|
+
},
|
|
5662
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5663
|
+
value: res.employee_info.skip_manager,
|
|
5664
|
+
label: res.employee_info.skip_manager
|
|
5665
|
+
} : {
|
|
5666
|
+
value: '',
|
|
5667
|
+
label: 'Select Manager'
|
|
5668
|
+
},
|
|
5486
5669
|
employee_id: res.employee_info.employee_id || '',
|
|
5487
5670
|
entity: res.employee_info.entity ? {
|
|
5488
5671
|
value: res.employee_info.entity.id,
|
|
@@ -5748,6 +5931,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5748
5931
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5749
5932
|
return Promise.resolve();
|
|
5750
5933
|
}
|
|
5934
|
+
console.log(employeeInfoInput, 'data');
|
|
5935
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5936
|
+
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5937
|
+
}
|
|
5938
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5939
|
+
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5940
|
+
}
|
|
5751
5941
|
var payload = {
|
|
5752
5942
|
personalInfoInput: personalInfoInput,
|
|
5753
5943
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -5805,8 +5995,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5805
5995
|
}
|
|
5806
5996
|
}
|
|
5807
5997
|
for (var _key in employeeInfo) {
|
|
5998
|
+
console.log('key', _key);
|
|
5808
5999
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5809
|
-
|
|
6000
|
+
var _employeeInfoInput$_k;
|
|
6001
|
+
console.log('employeeInfo0000', (_employeeInfoInput$_k = employeeInfoInput[_key]) === null || _employeeInfoInput$_k === void 0 ? void 0 : _employeeInfoInput$_k.value, 'sajkdhjasj');
|
|
6002
|
+
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) {
|
|
5810
6003
|
_isError = true;
|
|
5811
6004
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5812
6005
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -5893,12 +6086,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5893
6086
|
setErrorArray(_errorArray);
|
|
5894
6087
|
setErrorMsgs(_errorMsgs);
|
|
5895
6088
|
var _loop = function _loop() {
|
|
5896
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
5897
|
-
if (_errorMsgs[
|
|
5898
|
-
if (
|
|
6089
|
+
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6090
|
+
if (_errorMsgs[_key3]) {
|
|
6091
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5899
6092
|
setAdditionalInfoFlag('open');
|
|
5900
6093
|
}
|
|
5901
|
-
var el = document.getElementById(
|
|
6094
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5902
6095
|
if (el) {
|
|
5903
6096
|
setTimeout(function () {
|
|
5904
6097
|
el.scrollIntoView({
|
|
@@ -5915,115 +6108,116 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5915
6108
|
var _ret = _loop();
|
|
5916
6109
|
if (_ret === "break") break;
|
|
5917
6110
|
}
|
|
5918
|
-
return Promise.resolve();
|
|
5919
6111
|
}
|
|
5920
|
-
if (
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
setFilesForDelete([]);
|
|
5931
|
-
setProfilePicDelete([]);
|
|
5932
|
-
})["catch"](function (err) {
|
|
5933
|
-
if (typeof err === 'object') {
|
|
5934
|
-
if (err.country_code) {
|
|
5935
|
-
err.contact_number = err.country_code;
|
|
5936
|
-
}
|
|
5937
|
-
if (err.contact_country_code) {
|
|
5938
|
-
err.contact_number = err.contact_country_code;
|
|
5939
|
-
}
|
|
5940
|
-
if (err.passport) {
|
|
5941
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5942
|
-
delete err.passport;
|
|
6112
|
+
if (!_isError) {
|
|
6113
|
+
if (isEditMode && editUserId || isProfile) {
|
|
6114
|
+
dispatch(showLoader());
|
|
6115
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
6116
|
+
if (isProfile) {
|
|
6117
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
6118
|
+
(config === null || config === void 0 ? void 0 : (_config$routes = config.routes) === null || _config$routes === void 0 ? void 0 : (_config$routes$profil = _config$routes.profile) === null || _config$routes$profil === void 0 ? void 0 : (_config$routes$profil2 = _config$routes$profil.redirectUrl) === null || _config$routes$profil2 === void 0 ? void 0 : _config$routes$profil2.submit) && history.push(config.routes.profile.redirectUrl.submit);
|
|
6119
|
+
} else {
|
|
6120
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
6121
|
+
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
5943
6122
|
}
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
6123
|
+
setFilesForDelete([]);
|
|
6124
|
+
setProfilePicDelete([]);
|
|
6125
|
+
})["catch"](function (err) {
|
|
6126
|
+
if (typeof err === 'object') {
|
|
6127
|
+
if (err.country_code) {
|
|
6128
|
+
err.contact_number = err.country_code;
|
|
6129
|
+
}
|
|
6130
|
+
if (err.contact_country_code) {
|
|
6131
|
+
err.contact_number = err.contact_country_code;
|
|
6132
|
+
}
|
|
6133
|
+
if (err.passport) {
|
|
6134
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6135
|
+
delete err.passport;
|
|
6136
|
+
}
|
|
6137
|
+
setErrorArray(Object.keys(err));
|
|
6138
|
+
setErrorMsgs(err);
|
|
6139
|
+
var _loop2 = function _loop2() {
|
|
6140
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6141
|
+
if (err[_key4]) {
|
|
6142
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6143
|
+
setAdditionalInfoFlag('open');
|
|
6144
|
+
}
|
|
6145
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6146
|
+
if (el) {
|
|
6147
|
+
setTimeout(function () {
|
|
6148
|
+
el.scrollIntoView({
|
|
6149
|
+
behavior: 'smooth',
|
|
6150
|
+
block: 'center'
|
|
6151
|
+
});
|
|
6152
|
+
}, 500);
|
|
6153
|
+
return "break";
|
|
6154
|
+
}
|
|
5961
6155
|
}
|
|
5962
6156
|
}
|
|
6157
|
+
};
|
|
6158
|
+
for (var _key4 in err) {
|
|
6159
|
+
var _ret2 = _loop2();
|
|
6160
|
+
if (_ret2 === "break") break;
|
|
5963
6161
|
}
|
|
5964
|
-
}
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
}
|
|
5969
|
-
} else if (typeof err === 'string') {
|
|
5970
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
5971
|
-
} else {
|
|
5972
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5973
|
-
}
|
|
5974
|
-
})["finally"](function () {
|
|
5975
|
-
dispatch(stopLoader());
|
|
5976
|
-
});
|
|
5977
|
-
} else {
|
|
5978
|
-
dispatch(showLoader());
|
|
5979
|
-
dispatch(createUser(payload)).then(function (res) {
|
|
5980
|
-
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5981
|
-
(config === null || config === void 0 ? void 0 : (_config$routes3 = config.routes) === null || _config$routes3 === void 0 ? void 0 : (_config$routes3$users = _config$routes3.users) === null || _config$routes3$users === void 0 ? void 0 : (_config$routes3$users2 = _config$routes3$users.list) === null || _config$routes3$users2 === void 0 ? void 0 : _config$routes3$users2.path) && history.push(config.routes.users.list.path);
|
|
5982
|
-
})["catch"](function (err) {
|
|
5983
|
-
if (typeof err === 'object') {
|
|
5984
|
-
if (err.country_code) {
|
|
5985
|
-
err.contact_number = err.country_code;
|
|
5986
|
-
}
|
|
5987
|
-
if (err.contact_country_code) {
|
|
5988
|
-
err.contact_number = err.contact_country_code;
|
|
5989
|
-
}
|
|
5990
|
-
if (err.passport) {
|
|
5991
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5992
|
-
delete err.passport;
|
|
6162
|
+
} else if (typeof err === 'string') {
|
|
6163
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6164
|
+
} else {
|
|
6165
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5993
6166
|
}
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6167
|
+
})["finally"](function () {
|
|
6168
|
+
dispatch(stopLoader());
|
|
6169
|
+
});
|
|
6170
|
+
} else {
|
|
6171
|
+
dispatch(showLoader());
|
|
6172
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
6173
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
6174
|
+
(config === null || config === void 0 ? void 0 : (_config$routes3 = config.routes) === null || _config$routes3 === void 0 ? void 0 : (_config$routes3$users = _config$routes3.users) === null || _config$routes3$users === void 0 ? void 0 : (_config$routes3$users2 = _config$routes3$users.list) === null || _config$routes3$users2 === void 0 ? void 0 : _config$routes3$users2.path) && history.push(config.routes.users.list.path);
|
|
6175
|
+
})["catch"](function (err) {
|
|
6176
|
+
if (typeof err === 'object') {
|
|
6177
|
+
if (err.country_code) {
|
|
6178
|
+
err.contact_number = err.country_code;
|
|
6179
|
+
}
|
|
6180
|
+
if (err.contact_country_code) {
|
|
6181
|
+
err.contact_number = err.contact_country_code;
|
|
6182
|
+
}
|
|
6183
|
+
if (err.passport) {
|
|
6184
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6185
|
+
delete err.passport;
|
|
6186
|
+
}
|
|
6187
|
+
setErrorArray(Object.keys(err));
|
|
6188
|
+
setErrorMsgs(err);
|
|
6189
|
+
var _loop3 = function _loop3() {
|
|
6190
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6191
|
+
if (err[_key5]) {
|
|
6192
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6193
|
+
setAdditionalInfoFlag('open');
|
|
6194
|
+
}
|
|
6195
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6196
|
+
if (el) {
|
|
6197
|
+
setTimeout(function () {
|
|
6198
|
+
el.scrollIntoView({
|
|
6199
|
+
behavior: 'smooth',
|
|
6200
|
+
block: 'center'
|
|
6201
|
+
});
|
|
6202
|
+
}, 500);
|
|
6203
|
+
return "break";
|
|
6204
|
+
}
|
|
6011
6205
|
}
|
|
6012
6206
|
}
|
|
6207
|
+
};
|
|
6208
|
+
for (var _key5 in err) {
|
|
6209
|
+
var _ret3 = _loop3();
|
|
6210
|
+
if (_ret3 === "break") break;
|
|
6013
6211
|
}
|
|
6014
|
-
}
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6212
|
+
} else if (typeof err === 'string') {
|
|
6213
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6214
|
+
} else {
|
|
6215
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6018
6216
|
}
|
|
6019
|
-
}
|
|
6020
|
-
|
|
6021
|
-
}
|
|
6022
|
-
|
|
6023
|
-
}
|
|
6024
|
-
})["finally"](function () {
|
|
6025
|
-
dispatch(stopLoader());
|
|
6026
|
-
});
|
|
6217
|
+
})["finally"](function () {
|
|
6218
|
+
dispatch(stopLoader());
|
|
6219
|
+
});
|
|
6220
|
+
}
|
|
6027
6221
|
}
|
|
6028
6222
|
return Promise.resolve();
|
|
6029
6223
|
} catch (e) {
|
|
@@ -6738,7 +6932,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6738
6932
|
};
|
|
6739
6933
|
};
|
|
6740
6934
|
|
|
6741
|
-
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"};
|
|
6935
|
+
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"};
|
|
6742
6936
|
|
|
6743
6937
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6744
6938
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8224,9 +8418,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8224
8418
|
cell: function cell(row) {
|
|
8225
8419
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8226
8420
|
component: "div",
|
|
8227
|
-
width:
|
|
8421
|
+
width: 80
|
|
8228
8422
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8229
|
-
title: "This user hasn't logged
|
|
8423
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8230
8424
|
arrow: true,
|
|
8231
8425
|
classes: {
|
|
8232
8426
|
arrow: classes.arrow,
|
|
@@ -8234,7 +8428,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8234
8428
|
},
|
|
8235
8429
|
placement: "top-start"
|
|
8236
8430
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8237
|
-
className: clsx(styles$5.
|
|
8431
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8238
8432
|
}, "Invited")) : null);
|
|
8239
8433
|
}
|
|
8240
8434
|
}, {
|
|
@@ -8335,7 +8529,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8335
8529
|
options.push({
|
|
8336
8530
|
label: 'Resend invite',
|
|
8337
8531
|
handler: function handler() {
|
|
8338
|
-
return toggleInviteModal(row.id, 'single');
|
|
8532
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8339
8533
|
}
|
|
8340
8534
|
});
|
|
8341
8535
|
}
|
|
@@ -8362,6 +8556,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8362
8556
|
endIcon: null,
|
|
8363
8557
|
outlinedBtn: false,
|
|
8364
8558
|
className: "threedotMenuBtn",
|
|
8559
|
+
MoreHorizIcon: true,
|
|
8365
8560
|
placement: "bottom-end"
|
|
8366
8561
|
}));
|
|
8367
8562
|
},
|
|
@@ -8507,6 +8702,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8507
8702
|
});
|
|
8508
8703
|
};
|
|
8509
8704
|
|
|
8705
|
+
function InfoYellowIcon(props) {
|
|
8706
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8707
|
+
width: props.width,
|
|
8708
|
+
height: props.height,
|
|
8709
|
+
viewBox: "0 0 20 20",
|
|
8710
|
+
fill: "none",
|
|
8711
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8712
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8713
|
+
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",
|
|
8714
|
+
fill: "#CA8A04"
|
|
8715
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8716
|
+
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",
|
|
8717
|
+
fill: "#CA8A04"
|
|
8718
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8719
|
+
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",
|
|
8720
|
+
fill: "#CA8A04"
|
|
8721
|
+
}));
|
|
8722
|
+
}
|
|
8723
|
+
|
|
8724
|
+
function RedWarningIcon(props) {
|
|
8725
|
+
var _props$color = props.color,
|
|
8726
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8727
|
+
_props$size = props.size,
|
|
8728
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8729
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8730
|
+
width: size,
|
|
8731
|
+
height: size,
|
|
8732
|
+
viewBox: "0 0 14 14",
|
|
8733
|
+
fill: color,
|
|
8734
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8735
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8736
|
+
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",
|
|
8737
|
+
fill: color
|
|
8738
|
+
}));
|
|
8739
|
+
}
|
|
8740
|
+
|
|
8510
8741
|
function InviteInfoIcon() {
|
|
8511
8742
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8512
8743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8524,7 +8755,8 @@ function InviteInfoIcon() {
|
|
|
8524
8755
|
}
|
|
8525
8756
|
|
|
8526
8757
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8527
|
-
var env$7 = utils.configs.env
|
|
8758
|
+
var env$7 = utils.configs.env,
|
|
8759
|
+
api$7 = utils.configs.api;
|
|
8528
8760
|
var UndoButton = function UndoButton(_ref) {
|
|
8529
8761
|
var onUndo = _ref.onUndo,
|
|
8530
8762
|
msg = _ref.msg;
|
|
@@ -8562,27 +8794,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8562
8794
|
isDataFetching = _useSelector.isDataFetching,
|
|
8563
8795
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8564
8796
|
tabValue = _useSelector.tabValue;
|
|
8565
|
-
var
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
searchValue = _useState2[0],
|
|
8582
|
-
setSearchValue = _useState2[1];
|
|
8797
|
+
var newSelecteds = userListInfo.results;
|
|
8798
|
+
var _React$useState = React__default.useState(''),
|
|
8799
|
+
deactivateUser = _React$useState[0],
|
|
8800
|
+
setDeactivateUser = _React$useState[1];
|
|
8801
|
+
var _React$useState2 = React__default.useState(null),
|
|
8802
|
+
defaultId = _React$useState2[0],
|
|
8803
|
+
setDefaultId = _React$useState2[1];
|
|
8804
|
+
var _React$useState3 = React__default.useState(1),
|
|
8805
|
+
page = _React$useState3[0],
|
|
8806
|
+
setPage = _React$useState3[1];
|
|
8807
|
+
var _useState = React.useState([]),
|
|
8808
|
+
selectedUsersNotApprover = _useState[0],
|
|
8809
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8810
|
+
var _useState2 = React.useState([]),
|
|
8811
|
+
selectedUsersApprover = _useState2[0],
|
|
8812
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8583
8813
|
var _useState3 = React.useState(false),
|
|
8584
|
-
|
|
8585
|
-
|
|
8814
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8815
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8816
|
+
var _React$useState4 = React__default.useState(''),
|
|
8817
|
+
user = _React$useState4[0],
|
|
8818
|
+
setUser = _React$useState4[1];
|
|
8819
|
+
var _useState4 = React.useState(10),
|
|
8820
|
+
rowsPerPage = _useState4[0],
|
|
8821
|
+
setRowsPerPage = _useState4[1];
|
|
8822
|
+
var _React$useState5 = React__default.useState({}),
|
|
8823
|
+
selected = _React$useState5[0],
|
|
8824
|
+
setSelected = _React$useState5[1];
|
|
8825
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8826
|
+
order = _React$useState6[0],
|
|
8827
|
+
setOrder = _React$useState6[1];
|
|
8828
|
+
var _React$useState7 = React__default.useState(false),
|
|
8829
|
+
deactivateSingle = _React$useState7[0],
|
|
8830
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8831
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8832
|
+
orderBy = _React$useState8[0],
|
|
8833
|
+
setOrderBy = _React$useState8[1];
|
|
8834
|
+
var _useState5 = React.useState(''),
|
|
8835
|
+
searchValue = _useState5[0],
|
|
8836
|
+
setSearchValue = _useState5[1];
|
|
8837
|
+
var _useState6 = React.useState(false),
|
|
8838
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8839
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8586
8840
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
8587
8841
|
return state.common;
|
|
8588
8842
|
}),
|
|
@@ -8590,36 +8844,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8590
8844
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8591
8845
|
isILadmin = _useSelector2.isILadmin,
|
|
8592
8846
|
companyName = _useSelector2.companyName;
|
|
8593
|
-
var _useState4 = React.useState(false),
|
|
8594
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8595
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8596
|
-
var _useState5 = React.useState(false),
|
|
8597
|
-
isFileDownloading = _useState5[0],
|
|
8598
|
-
setDownlStatus = _useState5[1];
|
|
8599
|
-
var _useState6 = React.useState(false),
|
|
8600
|
-
isSortingChange = _useState6[0],
|
|
8601
|
-
setSortingChange = _useState6[1];
|
|
8602
8847
|
var _useState7 = React.useState(false),
|
|
8603
|
-
|
|
8604
|
-
|
|
8848
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8849
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8605
8850
|
var _useState8 = React.useState(false),
|
|
8606
|
-
|
|
8607
|
-
|
|
8851
|
+
approveeStatus = _useState8[0],
|
|
8852
|
+
setApproveeStatus = _useState8[1];
|
|
8608
8853
|
var _useState9 = React.useState(false),
|
|
8609
|
-
|
|
8610
|
-
|
|
8854
|
+
isFileDownloading = _useState9[0],
|
|
8855
|
+
setDownlStatus = _useState9[1];
|
|
8611
8856
|
var _useState10 = React.useState(false),
|
|
8612
|
-
|
|
8613
|
-
|
|
8857
|
+
isSortingChange = _useState10[0],
|
|
8858
|
+
setSortingChange = _useState10[1];
|
|
8614
8859
|
var _useState11 = React.useState(false),
|
|
8615
|
-
|
|
8616
|
-
|
|
8617
|
-
var _useState12 = React.useState(
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
var
|
|
8621
|
-
|
|
8622
|
-
|
|
8860
|
+
isSearchingChange = _useState11[0],
|
|
8861
|
+
setSearchingChange = _useState11[1];
|
|
8862
|
+
var _useState12 = React.useState(false),
|
|
8863
|
+
isSortingChangeTemp = _useState12[0],
|
|
8864
|
+
setSortingChangeTemp = _useState12[1];
|
|
8865
|
+
var _useState13 = React.useState(false),
|
|
8866
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8867
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8868
|
+
var _useState14 = React.useState(false),
|
|
8869
|
+
isApiFetching = _useState14[0],
|
|
8870
|
+
setisApiFetching = _useState14[1];
|
|
8871
|
+
var _useState15 = React.useState({
|
|
8872
|
+
value: '',
|
|
8873
|
+
label: 'Select approver'
|
|
8874
|
+
}),
|
|
8875
|
+
approverRole = _useState15[0],
|
|
8876
|
+
setApproverRole = _useState15[1];
|
|
8877
|
+
var _useState16 = React.useState(false),
|
|
8878
|
+
showInviteModal = _useState16[0],
|
|
8879
|
+
setToggleInviteModal = _useState16[1];
|
|
8880
|
+
var _useState17 = React.useState(''),
|
|
8881
|
+
userIds = _useState17[0],
|
|
8882
|
+
setUserIds = _useState17[1];
|
|
8883
|
+
var _React$useState9 = React__default.useState(false),
|
|
8884
|
+
overlayMenu = _React$useState9[0],
|
|
8885
|
+
setOverlayMenu = _React$useState9[1];
|
|
8886
|
+
var _useState18 = React.useState(''),
|
|
8887
|
+
userFirstName = _useState18[0],
|
|
8888
|
+
setUserFirstName = _useState18[1];
|
|
8889
|
+
var _useState19 = React.useState(''),
|
|
8890
|
+
userLastName = _useState19[0],
|
|
8891
|
+
setUserLastName = _useState19[1];
|
|
8892
|
+
var _useState20 = React.useState(true),
|
|
8893
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8894
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8623
8895
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8624
8896
|
var prevPos = _ref3.prevPos,
|
|
8625
8897
|
currPos = _ref3.currPos;
|
|
@@ -8640,47 +8912,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8640
8912
|
behavior: 'smooth'
|
|
8641
8913
|
});
|
|
8642
8914
|
};
|
|
8643
|
-
var _React$
|
|
8644
|
-
signup_page = _React$
|
|
8645
|
-
setSignUpPage = _React$
|
|
8646
|
-
var
|
|
8647
|
-
signup_rowsPerPage =
|
|
8648
|
-
setSignUpRowsPerPage =
|
|
8649
|
-
var _React$
|
|
8650
|
-
signup_order = _React$
|
|
8651
|
-
setSignUpOrder = _React$
|
|
8652
|
-
var _React$
|
|
8653
|
-
signup_orderBy = _React$
|
|
8654
|
-
setSignUpOrderBy = _React$
|
|
8655
|
-
var
|
|
8656
|
-
signup_searchValue =
|
|
8657
|
-
set_signup_SearchValue =
|
|
8658
|
-
var
|
|
8659
|
-
isSignUpSortingChange =
|
|
8660
|
-
setSignUpSortingChange =
|
|
8661
|
-
var
|
|
8662
|
-
isSignUpSearchingChange =
|
|
8663
|
-
setSignUpSearchingChange =
|
|
8664
|
-
var
|
|
8665
|
-
isSignUpSortingChangeTemp =
|
|
8666
|
-
setSignUpSortingChangeTemp =
|
|
8667
|
-
var
|
|
8668
|
-
isSignUpSearchingChangeTemp =
|
|
8669
|
-
setSignUpSearchingChangeTemp =
|
|
8915
|
+
var _React$useState10 = React__default.useState(1),
|
|
8916
|
+
signup_page = _React$useState10[0],
|
|
8917
|
+
setSignUpPage = _React$useState10[1];
|
|
8918
|
+
var _useState21 = React.useState(5),
|
|
8919
|
+
signup_rowsPerPage = _useState21[0],
|
|
8920
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8921
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8922
|
+
signup_order = _React$useState11[0],
|
|
8923
|
+
setSignUpOrder = _React$useState11[1];
|
|
8924
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8925
|
+
signup_orderBy = _React$useState12[0],
|
|
8926
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8927
|
+
var _useState22 = React.useState(''),
|
|
8928
|
+
signup_searchValue = _useState22[0],
|
|
8929
|
+
set_signup_SearchValue = _useState22[1];
|
|
8930
|
+
var _useState23 = React.useState(false),
|
|
8931
|
+
isSignUpSortingChange = _useState23[0],
|
|
8932
|
+
setSignUpSortingChange = _useState23[1];
|
|
8933
|
+
var _useState24 = React.useState(false),
|
|
8934
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8935
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8936
|
+
var _useState25 = React.useState(false),
|
|
8937
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8938
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8939
|
+
var _useState26 = React.useState(false),
|
|
8940
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8941
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8670
8942
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8671
8943
|
return state.userList;
|
|
8672
8944
|
}),
|
|
8673
8945
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8946
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8947
|
+
history.push(config.routes.notification.path);
|
|
8948
|
+
};
|
|
8674
8949
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8675
8950
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8676
8951
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8677
8952
|
return false;
|
|
8678
8953
|
}
|
|
8679
|
-
|
|
8954
|
+
if (selectedUsersApprover.length) {
|
|
8955
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8956
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8957
|
+
var _selected = Object.values(selected).flat();
|
|
8958
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8959
|
+
return _selected.includes(item.id.toString());
|
|
8960
|
+
});
|
|
8961
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8962
|
+
return _selected.includes(item.id.toString());
|
|
8963
|
+
});
|
|
8964
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8965
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8966
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8967
|
+
} else {
|
|
8968
|
+
setOpenDeActivateModalFlag(true);
|
|
8969
|
+
}
|
|
8680
8970
|
};
|
|
8681
8971
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8682
8972
|
setOpenDeActivateModalFlag(false);
|
|
8683
8973
|
};
|
|
8974
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8975
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8976
|
+
};
|
|
8684
8977
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8685
8978
|
history.push(config.routes.users.add.path);
|
|
8686
8979
|
};
|
|
@@ -8728,12 +9021,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8728
9021
|
};
|
|
8729
9022
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8730
9023
|
var _extends2;
|
|
8731
|
-
var
|
|
9024
|
+
var selectedId = [];
|
|
9025
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9026
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9027
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8732
9028
|
return n.is_active;
|
|
8733
|
-
}).map(function (obj) {
|
|
8734
|
-
return obj.id.toString();
|
|
8735
9029
|
});
|
|
8736
|
-
|
|
9030
|
+
_newSelecteds.map(function (obj) {
|
|
9031
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9032
|
+
if (obj.roles.is_approver === true) {
|
|
9033
|
+
_selectedUsersApprover.push(obj);
|
|
9034
|
+
} else if (obj.roles.is_approver === false) {
|
|
9035
|
+
_selectedUsersNotApprover.push(obj);
|
|
9036
|
+
}
|
|
9037
|
+
}
|
|
9038
|
+
selectedId.push(obj.id.toString());
|
|
9039
|
+
});
|
|
9040
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9041
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9042
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8737
9043
|
};
|
|
8738
9044
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8739
9045
|
var _extends3;
|
|
@@ -8751,58 +9057,156 @@ var UserList = function UserList(_ref2) {
|
|
|
8751
9057
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8752
9058
|
};
|
|
8753
9059
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9060
|
+
setPage(1);
|
|
8754
9061
|
setSearchValue(value);
|
|
8755
9062
|
setSearchingChange(true);
|
|
8756
9063
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8757
9064
|
};
|
|
8758
9065
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9066
|
+
setPage(1);
|
|
8759
9067
|
set_signup_SearchValue(value);
|
|
8760
9068
|
setSignUpSearchingChange(true);
|
|
8761
9069
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8762
9070
|
};
|
|
8763
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9071
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8764
9072
|
var _extends4;
|
|
8765
9073
|
var selectedTemp = _extends({}, selected);
|
|
8766
9074
|
if (!(page in selectedTemp)) {
|
|
8767
9075
|
selectedTemp[page] = [];
|
|
8768
9076
|
}
|
|
8769
9077
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8770
|
-
var
|
|
9078
|
+
var _newSelected = [];
|
|
8771
9079
|
if (selectedIndex === -1) {
|
|
8772
|
-
|
|
9080
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8773
9081
|
} else if (selectedIndex === 0) {
|
|
8774
|
-
|
|
9082
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8775
9083
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8776
|
-
|
|
9084
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8777
9085
|
} else if (selectedIndex > 0) {
|
|
8778
|
-
|
|
9086
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9087
|
+
}
|
|
9088
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9089
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9090
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9091
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9092
|
+
return id !== item.id.toString();
|
|
9093
|
+
});
|
|
9094
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9095
|
+
return item.id.toString() !== id;
|
|
9096
|
+
});
|
|
9097
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9098
|
+
if (data.roles.is_approver === true) {
|
|
9099
|
+
_SelectedUsersApprover.push(data);
|
|
9100
|
+
} else if (data.roles.is_approver === false) {
|
|
9101
|
+
_SelectedUsersNotApprover.push(data);
|
|
9102
|
+
}
|
|
8779
9103
|
}
|
|
8780
|
-
|
|
9104
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9105
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9106
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8781
9107
|
};
|
|
9108
|
+
React.useEffect(function () {
|
|
9109
|
+
setApproverRole({
|
|
9110
|
+
value: '',
|
|
9111
|
+
label: 'Select approver'
|
|
9112
|
+
});
|
|
9113
|
+
setDefaultId(null);
|
|
9114
|
+
setIsDisabledSubmitBtn(true);
|
|
9115
|
+
setApproveeStatus(false);
|
|
9116
|
+
if (deactivateSingle === true) {
|
|
9117
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9118
|
+
if (response.data["default"].id) {
|
|
9119
|
+
setDefaultId(response.data["default"].id);
|
|
9120
|
+
setApproverRole({
|
|
9121
|
+
value: '',
|
|
9122
|
+
label: response.data["default"].email
|
|
9123
|
+
});
|
|
9124
|
+
setIsDisabledSubmitBtn(false);
|
|
9125
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9126
|
+
}
|
|
9127
|
+
});
|
|
9128
|
+
}
|
|
9129
|
+
}, [deactivateSingle]);
|
|
8782
9130
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8783
9131
|
setRowsPerPage(+event.target.value);
|
|
8784
9132
|
setPage(1);
|
|
8785
9133
|
setSelected({});
|
|
9134
|
+
setSelectedUsersNotApprover([]);
|
|
9135
|
+
setSelectedUsersApprover([]);
|
|
8786
9136
|
setSortingChange(true);
|
|
8787
9137
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8788
9138
|
};
|
|
8789
9139
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8790
9140
|
var isActive = e.target.checked;
|
|
8791
|
-
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
9141
|
+
var _isApprover;
|
|
9142
|
+
newSelecteds.map(function (item) {
|
|
9143
|
+
if (item.id === id) {
|
|
9144
|
+
_isApprover = item.roles.is_approver;
|
|
9145
|
+
if (_isApprover === true && isActive === false) {
|
|
9146
|
+
setDeactivateSingle(true);
|
|
9147
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9148
|
+
setUser(item);
|
|
9149
|
+
} else {
|
|
9150
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9151
|
+
if (!isActive) {
|
|
9152
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9153
|
+
var _extends5;
|
|
9154
|
+
var selectedTemp = _extends({}, selected);
|
|
9155
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9156
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9157
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9158
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9159
|
+
return item.id != id;
|
|
9160
|
+
});
|
|
9161
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9162
|
+
return item.id != id;
|
|
9163
|
+
});
|
|
9164
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9165
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9166
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9167
|
+
}
|
|
9168
|
+
}
|
|
9169
|
+
});
|
|
8798
9170
|
}
|
|
8799
9171
|
}
|
|
8800
9172
|
});
|
|
8801
9173
|
};
|
|
9174
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9175
|
+
var _value = _ref4._value;
|
|
9176
|
+
if (_value.data.approvee_status) {
|
|
9177
|
+
setApproveeStatus(true);
|
|
9178
|
+
} else {
|
|
9179
|
+
setApproveeStatus(false);
|
|
9180
|
+
}
|
|
9181
|
+
setDefaultId(_value.data.id);
|
|
9182
|
+
setApproverRole(_value);
|
|
9183
|
+
setIsDisabledSubmitBtn(false);
|
|
9184
|
+
};
|
|
9185
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9186
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9187
|
+
setOpenDeActivateModalFlag(false);
|
|
9188
|
+
setDeactivateSingle(false);
|
|
9189
|
+
setSelected({});
|
|
9190
|
+
setSelectedUsersNotApprover([]);
|
|
9191
|
+
setSelectedUsersApprover([]);
|
|
9192
|
+
};
|
|
8802
9193
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8803
9194
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8804
9195
|
setOpenDeActivateModalFlag(false);
|
|
8805
9196
|
setSelected({});
|
|
9197
|
+
setSelectedUsersNotApprover([]);
|
|
9198
|
+
setSelectedUsersApprover([]);
|
|
9199
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9200
|
+
};
|
|
9201
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9202
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9203
|
+
return item.id;
|
|
9204
|
+
});
|
|
9205
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9206
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9207
|
+
setSelected({});
|
|
9208
|
+
setSelectedUsersNotApprover([]);
|
|
9209
|
+
setSelectedUsersApprover([]);
|
|
8806
9210
|
};
|
|
8807
9211
|
var importUserHandler = function importUserHandler() {
|
|
8808
9212
|
setOpenImportUsersModal(true);
|
|
@@ -8819,13 +9223,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8819
9223
|
email: email
|
|
8820
9224
|
}));
|
|
8821
9225
|
};
|
|
8822
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8823
|
-
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
9226
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9227
|
+
if (type === undefined) {
|
|
9228
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9229
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9230
|
+
return false;
|
|
9231
|
+
}
|
|
8827
9232
|
}
|
|
8828
9233
|
setUserIds(ids);
|
|
9234
|
+
setUserFirstName(firstName);
|
|
9235
|
+
setUserLastName(lastName);
|
|
9236
|
+
setToggleInviteModal(!showInviteModal);
|
|
9237
|
+
};
|
|
9238
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8829
9239
|
setToggleInviteModal(!showInviteModal);
|
|
8830
9240
|
};
|
|
8831
9241
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8898,6 +9308,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8898
9308
|
userId: userId
|
|
8899
9309
|
}));
|
|
8900
9310
|
};
|
|
9311
|
+
var knowMore = function knowMore() {
|
|
9312
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9313
|
+
};
|
|
8901
9314
|
var dispatch = reactRedux.useDispatch();
|
|
8902
9315
|
React.useEffect(function () {
|
|
8903
9316
|
if (isTokenVerified === true) {
|
|
@@ -9149,7 +9562,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9149
9562
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9150
9563
|
variant: "body2",
|
|
9151
9564
|
className: clsx(styles$5.description)
|
|
9152
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9565
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9566
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9567
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9568
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9153
9569
|
data: signupRequestListInfo,
|
|
9154
9570
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9155
9571
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9181,6 +9597,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9181
9597
|
}))
|
|
9182
9598
|
}]
|
|
9183
9599
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9600
|
+
isOpen: deactivateSingle,
|
|
9601
|
+
closeHandler: function closeHandler() {
|
|
9602
|
+
setDeactivateSingle(false);
|
|
9603
|
+
},
|
|
9604
|
+
cancelLabel: "Cancel",
|
|
9605
|
+
submitLabel: "Deactivate",
|
|
9606
|
+
submitHandler: handleDeactivateUser,
|
|
9607
|
+
headerText: "Deactivate this user?",
|
|
9608
|
+
width: "400px",
|
|
9609
|
+
subHanderText: "",
|
|
9610
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9611
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9612
|
+
modalClass: "deactivateSingleModal",
|
|
9613
|
+
modalBodyStyle: {
|
|
9614
|
+
overflowY: 'unset'
|
|
9615
|
+
}
|
|
9616
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9617
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9618
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9619
|
+
className: styles$5.deactivateAlert
|
|
9620
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9621
|
+
width: "9",
|
|
9622
|
+
height: "9"
|
|
9623
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9624
|
+
variant: "body2"
|
|
9625
|
+
}, /*#__PURE__*/React__default.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__default.createElement("span", {
|
|
9626
|
+
onClick: knowMore,
|
|
9627
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9628
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9629
|
+
className: "iui__mt-15"
|
|
9630
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9631
|
+
isMove: true,
|
|
9632
|
+
additional: {
|
|
9633
|
+
page: 1,
|
|
9634
|
+
product: 'travel',
|
|
9635
|
+
userId: user.id
|
|
9636
|
+
},
|
|
9637
|
+
label: "Transfer approver role to",
|
|
9638
|
+
value: approverRole,
|
|
9639
|
+
onValueChange: selectApprover,
|
|
9640
|
+
loadOption: transferRoleOptions,
|
|
9641
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9642
|
+
customLoadingText: "No results found"
|
|
9643
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9644
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9645
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9646
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9647
|
+
}, "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__default.createElement(iuistyles.IUIModal, {
|
|
9184
9648
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9185
9649
|
closeHandler: closeDeActivateModal,
|
|
9186
9650
|
cancelLabel: "Cancel",
|
|
@@ -9207,8 +9671,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9207
9671
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9208
9672
|
className: styles$5.description
|
|
9209
9673
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9674
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9675
|
+
closeHandler: closeDeActiveModal,
|
|
9676
|
+
cancelLabel: "Cancel",
|
|
9677
|
+
submitLabel: "Deactivate safe users",
|
|
9678
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9679
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9680
|
+
customButtonLabel: "Deactivate all users",
|
|
9681
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9682
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9683
|
+
width: "640px",
|
|
9684
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9685
|
+
headerText: "Deactivate users?",
|
|
9686
|
+
modalBodyStyle: {
|
|
9687
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9688
|
+
}
|
|
9689
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9690
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9691
|
+
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9692
|
+
color: "#9A6700",
|
|
9693
|
+
size: "14"
|
|
9694
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9695
|
+
variant: "body2"
|
|
9696
|
+
}, "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__default.createElement("span", {
|
|
9697
|
+
onClick: knowMore,
|
|
9698
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9699
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9700
|
+
className: "iui__my-15"
|
|
9701
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9702
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9703
|
+
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9704
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9705
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9706
|
+
var _item$data;
|
|
9707
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9708
|
+
key: index,
|
|
9709
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9710
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9711
|
+
firstName: item.first_name,
|
|
9712
|
+
lastName: item.last_name,
|
|
9713
|
+
isLetterAvatar: "true",
|
|
9714
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9715
|
+
secondaryText: item.email,
|
|
9716
|
+
letterAvatarTextColor: "black",
|
|
9717
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9718
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9719
|
+
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9720
|
+
color: "#9A6700",
|
|
9721
|
+
size: "14"
|
|
9722
|
+
}));
|
|
9723
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
9724
|
+
style: {
|
|
9725
|
+
borderColor: '#E5E9ED'
|
|
9726
|
+
}
|
|
9727
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9728
|
+
className: "iui__my-15"
|
|
9729
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9730
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9731
|
+
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9732
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9733
|
+
}, "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) {
|
|
9734
|
+
var _item$data2;
|
|
9735
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9736
|
+
key: index,
|
|
9737
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9738
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9739
|
+
firstName: item.first_name,
|
|
9740
|
+
lastName: item.last_name,
|
|
9741
|
+
isLetterAvatar: "true",
|
|
9742
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9743
|
+
secondaryText: item.email,
|
|
9744
|
+
letterAvatarTextColor: "black",
|
|
9745
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9746
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9747
|
+
}));
|
|
9748
|
+
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9210
9749
|
isOpen: showInviteModal,
|
|
9211
|
-
closeHandler:
|
|
9750
|
+
closeHandler: function closeHandler() {
|
|
9751
|
+
return toggleInviteModalClose();
|
|
9752
|
+
},
|
|
9212
9753
|
cancelLabel: "Cancel",
|
|
9213
9754
|
headerText: "Resend Invites?",
|
|
9214
9755
|
submitLabel: "Send",
|
|
@@ -9240,7 +9781,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9240
9781
|
fontSize: '14px',
|
|
9241
9782
|
color: '#374151'
|
|
9242
9783
|
}
|
|
9243
|
-
}, "This invitation will be sent to
|
|
9784
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9785
|
+
style: {
|
|
9786
|
+
fontSize: '14px',
|
|
9787
|
+
color: '#374151',
|
|
9788
|
+
fontWeight: 'bold'
|
|
9789
|
+
}
|
|
9790
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9244
9791
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9245
9792
|
closeImportUsersModal: closeImportUsersModal,
|
|
9246
9793
|
closeImportModal: closeImportModal
|
|
@@ -9249,8 +9796,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9249
9796
|
errMsg: hasVerificationError
|
|
9250
9797
|
}));
|
|
9251
9798
|
};
|
|
9252
|
-
var TabLabelCount = function TabLabelCount(
|
|
9253
|
-
var count =
|
|
9799
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9800
|
+
var count = _ref5.count;
|
|
9254
9801
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9255
9802
|
className: styles$5.TabLabelCount
|
|
9256
9803
|
}, " ", count, " ");
|
|
@@ -9325,11 +9872,12 @@ function Header(props) {
|
|
|
9325
9872
|
})));
|
|
9326
9873
|
}
|
|
9327
9874
|
|
|
9328
|
-
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"};
|
|
9875
|
+
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"};
|
|
9329
9876
|
|
|
9330
9877
|
function Listview(_ref) {
|
|
9331
9878
|
var data = _ref.data,
|
|
9332
9879
|
name = _ref.name,
|
|
9880
|
+
tableName = _ref.tableName,
|
|
9333
9881
|
handleEditDialog = _ref.handleEditDialog,
|
|
9334
9882
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9335
9883
|
orderBy = _ref.orderBy,
|
|
@@ -9342,16 +9890,82 @@ function Listview(_ref) {
|
|
|
9342
9890
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9343
9891
|
page = _ref.page,
|
|
9344
9892
|
rowsPerPage = _ref.rowsPerPage;
|
|
9893
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9894
|
+
var _data$dept_head_detai;
|
|
9895
|
+
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) {
|
|
9896
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9897
|
+
}
|
|
9898
|
+
};
|
|
9345
9899
|
var columns = [{
|
|
9346
9900
|
id: 'name',
|
|
9347
9901
|
label: name,
|
|
9348
|
-
width: '
|
|
9902
|
+
width: '40%',
|
|
9349
9903
|
sortable: true,
|
|
9350
9904
|
cell: function cell(row) {
|
|
9351
9905
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9352
9906
|
component: "div"
|
|
9353
9907
|
}, row.name);
|
|
9354
9908
|
}
|
|
9909
|
+
}, {
|
|
9910
|
+
id: 'no_of_users',
|
|
9911
|
+
label: 'Number of users',
|
|
9912
|
+
width: '40%',
|
|
9913
|
+
sortable: true,
|
|
9914
|
+
cell: function cell(row) {
|
|
9915
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9916
|
+
component: "div"
|
|
9917
|
+
}, row.no_of_users);
|
|
9918
|
+
}
|
|
9919
|
+
}, {
|
|
9920
|
+
id: 'actions',
|
|
9921
|
+
label: 'Actions',
|
|
9922
|
+
width: '20%',
|
|
9923
|
+
cell: function cell(row) {
|
|
9924
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9925
|
+
display: "flex"
|
|
9926
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9927
|
+
buttonText: "Edit",
|
|
9928
|
+
className: styles$7.buttonWidth,
|
|
9929
|
+
onClick: function onClick() {
|
|
9930
|
+
return handleEditDialog(row);
|
|
9931
|
+
}
|
|
9932
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9933
|
+
buttonText: "Delete",
|
|
9934
|
+
className: styles$7.buttonWidth,
|
|
9935
|
+
onClick: function onClick() {
|
|
9936
|
+
return handleDeleteDialog(row, true);
|
|
9937
|
+
}
|
|
9938
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9939
|
+
buttonText: "Delete",
|
|
9940
|
+
className: styles$7.buttonWidth,
|
|
9941
|
+
onClick: function onClick() {
|
|
9942
|
+
return handleDeleteDialog(row, false);
|
|
9943
|
+
}
|
|
9944
|
+
}));
|
|
9945
|
+
}
|
|
9946
|
+
}];
|
|
9947
|
+
var departmentColumns = [{
|
|
9948
|
+
id: 'name',
|
|
9949
|
+
label: name,
|
|
9950
|
+
width: '30%',
|
|
9951
|
+
sortable: true,
|
|
9952
|
+
cell: function cell(row) {
|
|
9953
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9954
|
+
component: "div"
|
|
9955
|
+
}, row.name);
|
|
9956
|
+
}
|
|
9957
|
+
}, {
|
|
9958
|
+
id: 'department_head',
|
|
9959
|
+
label: 'Department head',
|
|
9960
|
+
width: '30%',
|
|
9961
|
+
sortable: true,
|
|
9962
|
+
cell: function cell(row) {
|
|
9963
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9964
|
+
component: "div"
|
|
9965
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9966
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9967
|
+
}, "Assigned by default"));
|
|
9968
|
+
}
|
|
9355
9969
|
}, {
|
|
9356
9970
|
id: 'no_of_users',
|
|
9357
9971
|
label: 'Number of users',
|
|
@@ -9365,7 +9979,7 @@ function Listview(_ref) {
|
|
|
9365
9979
|
}, {
|
|
9366
9980
|
id: 'actions',
|
|
9367
9981
|
label: 'Actions',
|
|
9368
|
-
width: '
|
|
9982
|
+
width: '15%',
|
|
9369
9983
|
cell: function cell(row) {
|
|
9370
9984
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9371
9985
|
display: "flex"
|
|
@@ -9398,7 +10012,7 @@ function Listview(_ref) {
|
|
|
9398
10012
|
hasFilter: true,
|
|
9399
10013
|
isCheckboxTable: false,
|
|
9400
10014
|
count: data.count,
|
|
9401
|
-
columns: columns,
|
|
10015
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9402
10016
|
rows: data.results,
|
|
9403
10017
|
page: page,
|
|
9404
10018
|
handleChangePage: handleChangePage,
|
|
@@ -9455,15 +10069,44 @@ function EditPanelDialog(_ref) {
|
|
|
9455
10069
|
var isOpen = _ref.isOpen,
|
|
9456
10070
|
closeHandler = _ref.closeHandler,
|
|
9457
10071
|
onValueChange = _ref.onValueChange,
|
|
9458
|
-
|
|
10072
|
+
_submitHandler = _ref.submitHandler,
|
|
9459
10073
|
isError = _ref.isError,
|
|
9460
10074
|
name = _ref.name,
|
|
9461
10075
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9462
|
-
validation = _ref.validation
|
|
10076
|
+
validation = _ref.validation,
|
|
10077
|
+
rowData = _ref.rowData,
|
|
10078
|
+
tableName = _ref.tableName,
|
|
10079
|
+
config = _ref.config;
|
|
9463
10080
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9464
10081
|
return state.userPanel;
|
|
9465
10082
|
}),
|
|
9466
10083
|
dialogData = _useSelector.dialogData;
|
|
10084
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10085
|
+
var _data$dept_head_detai;
|
|
10086
|
+
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) {
|
|
10087
|
+
setHead({
|
|
10088
|
+
value: data.dept_head_details[0].id,
|
|
10089
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10090
|
+
});
|
|
10091
|
+
}
|
|
10092
|
+
};
|
|
10093
|
+
var _useState = React.useState({
|
|
10094
|
+
value: '',
|
|
10095
|
+
label: 'Select'
|
|
10096
|
+
}),
|
|
10097
|
+
head = _useState[0],
|
|
10098
|
+
setHead = _useState[1];
|
|
10099
|
+
React.useEffect(function () {
|
|
10100
|
+
deptHeadDetails(rowData);
|
|
10101
|
+
}, [rowData]);
|
|
10102
|
+
var history = reactRouterDom.useHistory();
|
|
10103
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10104
|
+
console.log(rowData);
|
|
10105
|
+
history.push({
|
|
10106
|
+
pathname: config.routes.users.add.path,
|
|
10107
|
+
state: rowData
|
|
10108
|
+
});
|
|
10109
|
+
};
|
|
9467
10110
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9468
10111
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9469
10112
|
isOpen: isOpen,
|
|
@@ -9471,25 +10114,59 @@ function EditPanelDialog(_ref) {
|
|
|
9471
10114
|
headerText: "Edit " + name.toLowerCase(),
|
|
9472
10115
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9473
10116
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9474
|
-
submitHandler: submitHandler
|
|
9475
|
-
|
|
10117
|
+
submitHandler: function submitHandler() {
|
|
10118
|
+
return _submitHandler(head);
|
|
10119
|
+
},
|
|
10120
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9476
10121
|
hideCloseIcon: false,
|
|
9477
10122
|
modalBodyStyle: {
|
|
9478
|
-
|
|
9479
|
-
overflow: 'auto',
|
|
9480
|
-
margin: '0px'
|
|
10123
|
+
overflowY: 'visible'
|
|
9481
10124
|
},
|
|
9482
10125
|
footerStyle: {
|
|
9483
10126
|
justifyContent: 'end'
|
|
9484
10127
|
}
|
|
10128
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10129
|
+
display: "flex",
|
|
10130
|
+
justifyContent: "center",
|
|
10131
|
+
alignItems: "center",
|
|
10132
|
+
flexDirection: "column",
|
|
10133
|
+
style: {
|
|
10134
|
+
marginBottom: '30px'
|
|
10135
|
+
}
|
|
9485
10136
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9486
|
-
component: "div",
|
|
9487
10137
|
display: "flex",
|
|
9488
10138
|
justifyContent: "center",
|
|
9489
10139
|
alignItems: "center",
|
|
9490
10140
|
flexDirection: "column",
|
|
9491
|
-
|
|
9492
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10141
|
+
className: styles$7.baseAlert
|
|
10142
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10143
|
+
className: styles$7.alertDescContainer
|
|
10144
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10145
|
+
className: styles$7.iconLayout,
|
|
10146
|
+
style: {
|
|
10147
|
+
paddingTop: '4px'
|
|
10148
|
+
}
|
|
10149
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10150
|
+
color: "#CA8A04",
|
|
10151
|
+
width: "25",
|
|
10152
|
+
height: "20",
|
|
10153
|
+
className: styles$7.iconStyle
|
|
10154
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10155
|
+
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.",
|
|
10156
|
+
style: {
|
|
10157
|
+
fontWeight: 'normal'
|
|
10158
|
+
}
|
|
10159
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10160
|
+
buttonText: "Add user",
|
|
10161
|
+
type: "text",
|
|
10162
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10163
|
+
width: "9",
|
|
10164
|
+
height: "9",
|
|
10165
|
+
color: "#EC5D25"
|
|
10166
|
+
}),
|
|
10167
|
+
onClick: handleAddPageNavigation,
|
|
10168
|
+
className: styles$7.addUserButton
|
|
10169
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9493
10170
|
label: name + " name",
|
|
9494
10171
|
name: "name",
|
|
9495
10172
|
defaultValue: dialogData.data.name,
|
|
@@ -9498,7 +10175,49 @@ function EditPanelDialog(_ref) {
|
|
|
9498
10175
|
isError: isError,
|
|
9499
10176
|
validation: validation,
|
|
9500
10177
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9501
|
-
required: true
|
|
10178
|
+
required: true,
|
|
10179
|
+
style: tableName === 'department' && {
|
|
10180
|
+
width: '350px'
|
|
10181
|
+
}
|
|
10182
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10183
|
+
className: "iui__mt-15",
|
|
10184
|
+
style: {
|
|
10185
|
+
width: '100%'
|
|
10186
|
+
}
|
|
10187
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10188
|
+
label: "Department head",
|
|
10189
|
+
name: "name",
|
|
10190
|
+
defaultValue: head.label,
|
|
10191
|
+
placeholder: "",
|
|
10192
|
+
readOnly: true,
|
|
10193
|
+
style: {
|
|
10194
|
+
width: '350px'
|
|
10195
|
+
}
|
|
10196
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10197
|
+
className: "iui__mt-15",
|
|
10198
|
+
style: {
|
|
10199
|
+
width: '100%'
|
|
10200
|
+
}
|
|
10201
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10202
|
+
noResultsText: true,
|
|
10203
|
+
isMove: true,
|
|
10204
|
+
additional: {
|
|
10205
|
+
page: 1,
|
|
10206
|
+
departmentId: rowData.id
|
|
10207
|
+
},
|
|
10208
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10209
|
+
label: "Department head",
|
|
10210
|
+
value: head,
|
|
10211
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10212
|
+
var _value = _ref2._value;
|
|
10213
|
+
return setHead(_value);
|
|
10214
|
+
},
|
|
10215
|
+
loadOption: departmentHeadOptions,
|
|
10216
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10217
|
+
customLoadingText: "No users found in this department",
|
|
10218
|
+
customLoadingTextStyle: {
|
|
10219
|
+
color: '#374151'
|
|
10220
|
+
}
|
|
9502
10221
|
})));
|
|
9503
10222
|
}
|
|
9504
10223
|
|
|
@@ -9677,12 +10396,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9677
10396
|
var _useState13 = React.useState(false),
|
|
9678
10397
|
isSortingChangeTemp = _useState13[0],
|
|
9679
10398
|
setSortingChangeTemp = _useState13[1];
|
|
9680
|
-
var _useState14 = React.useState(
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
var _useState15 = React.useState(
|
|
9684
|
-
|
|
9685
|
-
|
|
10399
|
+
var _useState14 = React.useState([]),
|
|
10400
|
+
rowData = _useState14[0],
|
|
10401
|
+
setRowData = _useState14[1];
|
|
10402
|
+
var _useState15 = React.useState(1),
|
|
10403
|
+
page = _useState15[0],
|
|
10404
|
+
setPage = _useState15[1];
|
|
10405
|
+
var _useState16 = React.useState(5),
|
|
10406
|
+
rowsPerPage = _useState16[0],
|
|
10407
|
+
setRowsPerPage = _useState16[1];
|
|
9686
10408
|
var orderingParam = orderBy;
|
|
9687
10409
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9688
10410
|
return state.userPanel;
|
|
@@ -9700,12 +10422,20 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9700
10422
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
9701
10423
|
setDataList(validatedValue);
|
|
9702
10424
|
};
|
|
10425
|
+
var _useState17 = React.useState(70),
|
|
10426
|
+
maxLengthForModal = _useState17[0],
|
|
10427
|
+
setMaxLengthForModal = _useState17[1];
|
|
10428
|
+
React.useEffect(function () {
|
|
10429
|
+
if (title === 'Business unit') {
|
|
10430
|
+
setMaxLengthForModal(150);
|
|
10431
|
+
}
|
|
10432
|
+
}, []);
|
|
9703
10433
|
var validation = {
|
|
9704
10434
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
9705
10435
|
regexOnBlur: null,
|
|
9706
10436
|
maxLimit: '',
|
|
9707
10437
|
minLimit: '',
|
|
9708
|
-
maxLength:
|
|
10438
|
+
maxLength: maxLengthForModal,
|
|
9709
10439
|
minLength: 0
|
|
9710
10440
|
};
|
|
9711
10441
|
React.useEffect(function () {
|
|
@@ -9778,6 +10508,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9778
10508
|
submitLabel: 'Save'
|
|
9779
10509
|
}, '', data));
|
|
9780
10510
|
setDataList(data.name);
|
|
10511
|
+
setRowData(data);
|
|
9781
10512
|
setEditModal(true);
|
|
9782
10513
|
};
|
|
9783
10514
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9792,6 +10523,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9792
10523
|
var payload = {
|
|
9793
10524
|
names: [dataList]
|
|
9794
10525
|
};
|
|
10526
|
+
if (tableName === 'department') {
|
|
10527
|
+
payload = {
|
|
10528
|
+
name: dataList,
|
|
10529
|
+
department_head_id: null
|
|
10530
|
+
};
|
|
10531
|
+
}
|
|
9795
10532
|
var message = title + " added successfully.";
|
|
9796
10533
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9797
10534
|
} else {
|
|
@@ -9805,9 +10542,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9805
10542
|
var message = title + " deleted successfully.";
|
|
9806
10543
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9807
10544
|
};
|
|
9808
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10545
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10546
|
+
if (optionalParams === void 0) {
|
|
10547
|
+
optionalParams = null;
|
|
10548
|
+
}
|
|
9809
10549
|
dispatch(userPanelShowLoader());
|
|
9810
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10550
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9811
10551
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9812
10552
|
dispatch(userPanelStopLoader());
|
|
9813
10553
|
if (type === 'delete') {
|
|
@@ -9849,8 +10589,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9849
10589
|
name: dataList
|
|
9850
10590
|
}]
|
|
9851
10591
|
};
|
|
10592
|
+
if (tableName === 'department') {
|
|
10593
|
+
payload = {
|
|
10594
|
+
name: dataList,
|
|
10595
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10596
|
+
};
|
|
10597
|
+
}
|
|
9852
10598
|
var message = title + " updated successfully.";
|
|
9853
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10599
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9854
10600
|
setErrorEdit(false);
|
|
9855
10601
|
} else {
|
|
9856
10602
|
setErrorEdit(true);
|
|
@@ -9957,7 +10703,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9957
10703
|
submitHandler: handleEditPanel,
|
|
9958
10704
|
isError: errorEdit,
|
|
9959
10705
|
isDisabledSubmitBtn: loading,
|
|
9960
|
-
validation: validation
|
|
10706
|
+
validation: validation,
|
|
10707
|
+
rowData: rowData,
|
|
10708
|
+
tableName: tableName,
|
|
10709
|
+
config: config
|
|
9961
10710
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9962
10711
|
config: config
|
|
9963
10712
|
}));
|