@itilite/iui-user-management 0.4.42 → 0.4.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +88 -0
- package/dist/index.js +950 -256
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +951 -257
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.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'
|
|
@@ -3043,31 +3158,6 @@ var workInfo = [{
|
|
|
3043
3158
|
minLength: 0
|
|
3044
3159
|
},
|
|
3045
3160
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3046
|
-
}, {
|
|
3047
|
-
id: 7,
|
|
3048
|
-
label: 'Manager',
|
|
3049
|
-
name: 'manager',
|
|
3050
|
-
required: false,
|
|
3051
|
-
type: 'async_select',
|
|
3052
|
-
fullWidth: false,
|
|
3053
|
-
visibility: true,
|
|
3054
|
-
readOnly: false,
|
|
3055
|
-
placeholder: 'Select manager',
|
|
3056
|
-
tabelName: 'manager',
|
|
3057
|
-
product: 'travel',
|
|
3058
|
-
loadOption: approversOptions
|
|
3059
|
-
}, {
|
|
3060
|
-
id: 8,
|
|
3061
|
-
label: 'Skip manager',
|
|
3062
|
-
name: 'skip_manager',
|
|
3063
|
-
required: false,
|
|
3064
|
-
type: 'async_select',
|
|
3065
|
-
fullWidth: false,
|
|
3066
|
-
visibility: true,
|
|
3067
|
-
readOnly: false,
|
|
3068
|
-
placeholder: 'Select manager',
|
|
3069
|
-
product: 'travel',
|
|
3070
|
-
loadOption: approversOptions
|
|
3071
3161
|
}, {
|
|
3072
3162
|
id: 9,
|
|
3073
3163
|
label: 'Base location',
|
|
@@ -3978,6 +4068,7 @@ var initialState$2 = {
|
|
|
3978
4068
|
previous: null,
|
|
3979
4069
|
results: []
|
|
3980
4070
|
},
|
|
4071
|
+
deptUsers: [],
|
|
3981
4072
|
loading: false
|
|
3982
4073
|
};
|
|
3983
4074
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4047,6 +4138,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4047
4138
|
loading: false
|
|
4048
4139
|
});
|
|
4049
4140
|
}
|
|
4141
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4142
|
+
{
|
|
4143
|
+
return _extends({}, state, {
|
|
4144
|
+
deptUsers: action.payload
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4050
4147
|
default:
|
|
4051
4148
|
return state;
|
|
4052
4149
|
}
|
|
@@ -4825,6 +4922,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4825
4922
|
isILadmin = _useSelector2.isILadmin,
|
|
4826
4923
|
companyName = _useSelector2.companyName;
|
|
4827
4924
|
var history = reactRouterDom.useHistory();
|
|
4925
|
+
var location = reactRouterDom.useLocation();
|
|
4828
4926
|
var _useState = React.useState({
|
|
4829
4927
|
travel: false,
|
|
4830
4928
|
expense: false
|
|
@@ -4893,11 +4991,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4893
4991
|
},
|
|
4894
4992
|
designation: '',
|
|
4895
4993
|
base_location: '',
|
|
4896
|
-
|
|
4994
|
+
manager_id: {
|
|
4897
4995
|
value: '',
|
|
4898
4996
|
label: 'Select Manager'
|
|
4899
4997
|
},
|
|
4900
|
-
|
|
4998
|
+
skip_manager_id: {
|
|
4901
4999
|
value: '',
|
|
4902
5000
|
label: 'Select Manager'
|
|
4903
5001
|
},
|
|
@@ -4914,8 +5012,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4914
5012
|
business_unit: 0,
|
|
4915
5013
|
department: 0,
|
|
4916
5014
|
currency: 0,
|
|
4917
|
-
|
|
4918
|
-
|
|
5015
|
+
manager_id: 0,
|
|
5016
|
+
skip_manager_id: 0
|
|
4919
5017
|
}),
|
|
4920
5018
|
cacheForAsyncDropdown = _useState4[0],
|
|
4921
5019
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5069,6 +5167,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5069
5167
|
var _useState25 = React.useState([]),
|
|
5070
5168
|
uploadedFiles = _useState25[0],
|
|
5071
5169
|
setUploadedFiles = _useState25[1];
|
|
5170
|
+
var _useState26 = React.useState(70),
|
|
5171
|
+
maxLengthForModal = _useState26[0],
|
|
5172
|
+
setMaxLengthForModal = _useState26[1];
|
|
5072
5173
|
var defaultAddModalData = {
|
|
5073
5174
|
isOpen: false,
|
|
5074
5175
|
isError: false,
|
|
@@ -5081,25 +5182,41 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5081
5182
|
regexOnBlur: null,
|
|
5082
5183
|
maxLimit: '',
|
|
5083
5184
|
minLimit: '',
|
|
5084
|
-
maxLength:
|
|
5185
|
+
maxLength: maxLengthForModal,
|
|
5085
5186
|
minLength: 0
|
|
5086
5187
|
};
|
|
5087
|
-
var
|
|
5088
|
-
addModalData =
|
|
5089
|
-
setAddModalData =
|
|
5188
|
+
var _useState27 = React.useState(defaultAddModalData),
|
|
5189
|
+
addModalData = _useState27[0],
|
|
5190
|
+
setAddModalData = _useState27[1];
|
|
5090
5191
|
var onAddModalClose = function onAddModalClose() {
|
|
5091
5192
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5092
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
|
+
}, []);
|
|
5093
5206
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5094
5207
|
var title = '';
|
|
5095
5208
|
if (id === 'entity') {
|
|
5096
5209
|
title = 'Entity';
|
|
5210
|
+
setMaxLengthForModal(70);
|
|
5097
5211
|
} else if (id === 'department') {
|
|
5098
5212
|
title = 'Department';
|
|
5213
|
+
setMaxLengthForModal(70);
|
|
5099
5214
|
} else if (id === 'business_unit') {
|
|
5215
|
+
setMaxLengthForModal(150);
|
|
5100
5216
|
title = 'Business unit';
|
|
5101
5217
|
} else if (id === 'employee_level') {
|
|
5102
5218
|
title = 'Employee level';
|
|
5219
|
+
setMaxLengthForModal(70);
|
|
5103
5220
|
}
|
|
5104
5221
|
setAddModalData(_extends({}, addModalData, {
|
|
5105
5222
|
isOpen: true,
|
|
@@ -5115,24 +5232,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5115
5232
|
}));
|
|
5116
5233
|
} else {
|
|
5117
5234
|
dispatch(showLoader());
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
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;
|
|
5122
5248
|
setAddModalData(_extends({}, addModalData, {
|
|
5123
5249
|
isOpen: false
|
|
5124
5250
|
}));
|
|
5125
5251
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5126
5252
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
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)));
|
|
5265
|
+
}
|
|
5266
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5132
5267
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5133
5268
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5134
|
-
var
|
|
5135
|
-
return _extends({}, prevState, (
|
|
5269
|
+
var _extends5;
|
|
5270
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5136
5271
|
});
|
|
5137
5272
|
dispatch(stopLoader());
|
|
5138
5273
|
});
|
|
@@ -5151,8 +5286,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5151
5286
|
try {
|
|
5152
5287
|
var _temp5 = function _temp5() {
|
|
5153
5288
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5154
|
-
var
|
|
5155
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5289
|
+
var _extends6;
|
|
5290
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5156
5291
|
}
|
|
5157
5292
|
};
|
|
5158
5293
|
var _name = args._name,
|
|
@@ -5175,8 +5310,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5175
5310
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5176
5311
|
} else {
|
|
5177
5312
|
var _temp3 = function _temp3() {
|
|
5178
|
-
var
|
|
5179
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5313
|
+
var _extends7;
|
|
5314
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5180
5315
|
updateError(_name, _isError, _errorMsg);
|
|
5181
5316
|
};
|
|
5182
5317
|
var _temp2 = function () {
|
|
@@ -5224,16 +5359,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5224
5359
|
}
|
|
5225
5360
|
};
|
|
5226
5361
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5227
|
-
var
|
|
5362
|
+
var _extends8;
|
|
5228
5363
|
var _name = args._name,
|
|
5229
5364
|
_value = args._value,
|
|
5230
5365
|
_isError = args._isError,
|
|
5231
5366
|
_errorMsg = args._errorMsg;
|
|
5232
|
-
|
|
5367
|
+
console.log(_name, _value);
|
|
5368
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5233
5369
|
updateError(_name, _isError, _errorMsg);
|
|
5234
5370
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5235
|
-
var
|
|
5236
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5371
|
+
var _extends9;
|
|
5372
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5237
5373
|
}
|
|
5238
5374
|
};
|
|
5239
5375
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5243,9 +5379,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5243
5379
|
return tag.id;
|
|
5244
5380
|
};
|
|
5245
5381
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5246
|
-
var
|
|
5382
|
+
var _extends10;
|
|
5247
5383
|
var e = args._event;
|
|
5248
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5384
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5249
5385
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5250
5386
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5251
5387
|
userTagType: true
|
|
@@ -5253,22 +5389,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5253
5389
|
}
|
|
5254
5390
|
};
|
|
5255
5391
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5256
|
-
var
|
|
5392
|
+
var _extends11;
|
|
5257
5393
|
var _name = _ref2._name,
|
|
5258
5394
|
_value = _ref2._value;
|
|
5259
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5395
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5260
5396
|
};
|
|
5261
5397
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5262
|
-
var
|
|
5398
|
+
var _extends12;
|
|
5263
5399
|
var _name = _ref3._name,
|
|
5264
5400
|
_value = _ref3._value;
|
|
5265
|
-
|
|
5401
|
+
console.log(_name, _value, 'travel');
|
|
5402
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5266
5403
|
};
|
|
5267
5404
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5268
|
-
var
|
|
5405
|
+
var _extends13;
|
|
5269
5406
|
var _name = _ref4._name,
|
|
5270
5407
|
_value = _ref4._value;
|
|
5271
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5408
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5272
5409
|
};
|
|
5273
5410
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5274
5411
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5302,39 +5439,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5302
5439
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5303
5440
|
};
|
|
5304
5441
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5305
|
-
var
|
|
5442
|
+
var _extends14;
|
|
5306
5443
|
var _name = args._name,
|
|
5307
5444
|
_value = args._value,
|
|
5308
5445
|
_isError = args._isError,
|
|
5309
5446
|
_errorMsg = args._errorMsg;
|
|
5310
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5447
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5311
5448
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5312
|
-
var
|
|
5313
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5449
|
+
var _extends15;
|
|
5450
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5314
5451
|
}
|
|
5315
5452
|
updateError(_name, _isError, _errorMsg);
|
|
5316
5453
|
};
|
|
5317
5454
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5318
|
-
var
|
|
5455
|
+
var _extends16;
|
|
5319
5456
|
var _name = args._name,
|
|
5320
5457
|
_value = args._value,
|
|
5321
5458
|
_isError = args._isError,
|
|
5322
5459
|
_errorMsg = args._errorMsg;
|
|
5323
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5460
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5324
5461
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5325
|
-
var
|
|
5326
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5462
|
+
var _extends17;
|
|
5463
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5327
5464
|
}
|
|
5328
5465
|
updateError(_name, _isError, _errorMsg);
|
|
5329
5466
|
};
|
|
5330
5467
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5331
5468
|
try {
|
|
5332
5469
|
var _temp8 = function _temp8() {
|
|
5333
|
-
var
|
|
5334
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5470
|
+
var _extends18;
|
|
5471
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5335
5472
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5336
|
-
var
|
|
5337
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5473
|
+
var _extends19;
|
|
5474
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5338
5475
|
}
|
|
5339
5476
|
updateError(_name, _isError, _errorMsg);
|
|
5340
5477
|
};
|
|
@@ -5440,8 +5577,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5440
5577
|
return _errorArray;
|
|
5441
5578
|
});
|
|
5442
5579
|
setErrorMsgs(function (prevState) {
|
|
5443
|
-
var
|
|
5444
|
-
return _extends({}, prevState, (
|
|
5580
|
+
var _extends20;
|
|
5581
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5445
5582
|
});
|
|
5446
5583
|
};
|
|
5447
5584
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5515,14 +5652,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5515
5652
|
value: '',
|
|
5516
5653
|
label: 'Select employee level'
|
|
5517
5654
|
},
|
|
5518
|
-
|
|
5655
|
+
manager_id: res.employee_info.manager ? {
|
|
5519
5656
|
value: res.employee_info.manager,
|
|
5520
5657
|
label: res.employee_info.manager
|
|
5521
5658
|
} : {
|
|
5522
5659
|
value: '',
|
|
5523
5660
|
label: 'Select Manager'
|
|
5524
5661
|
},
|
|
5525
|
-
|
|
5662
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5526
5663
|
value: res.employee_info.skip_manager,
|
|
5527
5664
|
label: res.employee_info.skip_manager
|
|
5528
5665
|
} : {
|
|
@@ -5794,13 +5931,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5794
5931
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5795
5932
|
return Promise.resolve();
|
|
5796
5933
|
}
|
|
5797
|
-
|
|
5934
|
+
console.log(employeeInfoInput, 'data');
|
|
5935
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5798
5936
|
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5799
|
-
delete employeeInfoInput.manager;
|
|
5800
5937
|
}
|
|
5801
|
-
if (employeeInfoInput.
|
|
5938
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5802
5939
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5803
|
-
delete employeeInfoInput.skip_manager;
|
|
5804
5940
|
}
|
|
5805
5941
|
var payload = {
|
|
5806
5942
|
personalInfoInput: personalInfoInput,
|
|
@@ -5859,8 +5995,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5859
5995
|
}
|
|
5860
5996
|
}
|
|
5861
5997
|
for (var _key in employeeInfo) {
|
|
5998
|
+
console.log('key', _key);
|
|
5862
5999
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5863
|
-
|
|
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) {
|
|
5864
6003
|
_isError = true;
|
|
5865
6004
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5866
6005
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -5947,12 +6086,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5947
6086
|
setErrorArray(_errorArray);
|
|
5948
6087
|
setErrorMsgs(_errorMsgs);
|
|
5949
6088
|
var _loop = function _loop() {
|
|
5950
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
5951
|
-
if (_errorMsgs[
|
|
5952
|
-
if (
|
|
6089
|
+
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6090
|
+
if (_errorMsgs[_key3]) {
|
|
6091
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5953
6092
|
setAdditionalInfoFlag('open');
|
|
5954
6093
|
}
|
|
5955
|
-
var el = document.getElementById(
|
|
6094
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5956
6095
|
if (el) {
|
|
5957
6096
|
setTimeout(function () {
|
|
5958
6097
|
el.scrollIntoView({
|
|
@@ -5998,12 +6137,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5998
6137
|
setErrorArray(Object.keys(err));
|
|
5999
6138
|
setErrorMsgs(err);
|
|
6000
6139
|
var _loop2 = function _loop2() {
|
|
6001
|
-
if (Object.hasOwnProperty.call(err,
|
|
6002
|
-
if (err[
|
|
6003
|
-
if (
|
|
6140
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6141
|
+
if (err[_key4]) {
|
|
6142
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6004
6143
|
setAdditionalInfoFlag('open');
|
|
6005
6144
|
}
|
|
6006
|
-
var el = document.getElementById(
|
|
6145
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6007
6146
|
if (el) {
|
|
6008
6147
|
setTimeout(function () {
|
|
6009
6148
|
el.scrollIntoView({
|
|
@@ -6048,12 +6187,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6048
6187
|
setErrorArray(Object.keys(err));
|
|
6049
6188
|
setErrorMsgs(err);
|
|
6050
6189
|
var _loop3 = function _loop3() {
|
|
6051
|
-
if (Object.hasOwnProperty.call(err,
|
|
6052
|
-
if (err[
|
|
6053
|
-
if (
|
|
6190
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6191
|
+
if (err[_key5]) {
|
|
6192
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6054
6193
|
setAdditionalInfoFlag('open');
|
|
6055
6194
|
}
|
|
6056
|
-
var el = document.getElementById(
|
|
6195
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6057
6196
|
if (el) {
|
|
6058
6197
|
setTimeout(function () {
|
|
6059
6198
|
el.scrollIntoView({
|
|
@@ -6793,7 +6932,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6793
6932
|
};
|
|
6794
6933
|
};
|
|
6795
6934
|
|
|
6796
|
-
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"};
|
|
6797
6936
|
|
|
6798
6937
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6799
6938
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8279,9 +8418,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8279
8418
|
cell: function cell(row) {
|
|
8280
8419
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8281
8420
|
component: "div",
|
|
8282
|
-
width:
|
|
8421
|
+
width: 80
|
|
8283
8422
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8284
|
-
title: "This user hasn't logged
|
|
8423
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8285
8424
|
arrow: true,
|
|
8286
8425
|
classes: {
|
|
8287
8426
|
arrow: classes.arrow,
|
|
@@ -8289,7 +8428,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8289
8428
|
},
|
|
8290
8429
|
placement: "top-start"
|
|
8291
8430
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8292
|
-
className: clsx(styles$5.
|
|
8431
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8293
8432
|
}, "Invited")) : null);
|
|
8294
8433
|
}
|
|
8295
8434
|
}, {
|
|
@@ -8390,7 +8529,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8390
8529
|
options.push({
|
|
8391
8530
|
label: 'Resend invite',
|
|
8392
8531
|
handler: function handler() {
|
|
8393
|
-
return toggleInviteModal(row.id, 'single');
|
|
8532
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8394
8533
|
}
|
|
8395
8534
|
});
|
|
8396
8535
|
}
|
|
@@ -8417,6 +8556,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8417
8556
|
endIcon: null,
|
|
8418
8557
|
outlinedBtn: false,
|
|
8419
8558
|
className: "threedotMenuBtn",
|
|
8559
|
+
MoreHorizIcon: true,
|
|
8420
8560
|
placement: "bottom-end"
|
|
8421
8561
|
}));
|
|
8422
8562
|
},
|
|
@@ -8562,6 +8702,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8562
8702
|
});
|
|
8563
8703
|
};
|
|
8564
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
|
+
|
|
8565
8741
|
function InviteInfoIcon() {
|
|
8566
8742
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8567
8743
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8579,7 +8755,8 @@ function InviteInfoIcon() {
|
|
|
8579
8755
|
}
|
|
8580
8756
|
|
|
8581
8757
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8582
|
-
var env$7 = utils.configs.env
|
|
8758
|
+
var env$7 = utils.configs.env,
|
|
8759
|
+
api$7 = utils.configs.api;
|
|
8583
8760
|
var UndoButton = function UndoButton(_ref) {
|
|
8584
8761
|
var onUndo = _ref.onUndo,
|
|
8585
8762
|
msg = _ref.msg;
|
|
@@ -8617,27 +8794,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8617
8794
|
isDataFetching = _useSelector.isDataFetching,
|
|
8618
8795
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8619
8796
|
tabValue = _useSelector.tabValue;
|
|
8620
|
-
var
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
searchValue = _useState2[0],
|
|
8637
|
-
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];
|
|
8638
8813
|
var _useState3 = React.useState(false),
|
|
8639
|
-
|
|
8640
|
-
|
|
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];
|
|
8641
8840
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
8642
8841
|
return state.common;
|
|
8643
8842
|
}),
|
|
@@ -8645,36 +8844,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8645
8844
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8646
8845
|
isILadmin = _useSelector2.isILadmin,
|
|
8647
8846
|
companyName = _useSelector2.companyName;
|
|
8648
|
-
var _useState4 = React.useState(false),
|
|
8649
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8650
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8651
|
-
var _useState5 = React.useState(false),
|
|
8652
|
-
isFileDownloading = _useState5[0],
|
|
8653
|
-
setDownlStatus = _useState5[1];
|
|
8654
|
-
var _useState6 = React.useState(false),
|
|
8655
|
-
isSortingChange = _useState6[0],
|
|
8656
|
-
setSortingChange = _useState6[1];
|
|
8657
8847
|
var _useState7 = React.useState(false),
|
|
8658
|
-
|
|
8659
|
-
|
|
8848
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8849
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8660
8850
|
var _useState8 = React.useState(false),
|
|
8661
|
-
|
|
8662
|
-
|
|
8851
|
+
approveeStatus = _useState8[0],
|
|
8852
|
+
setApproveeStatus = _useState8[1];
|
|
8663
8853
|
var _useState9 = React.useState(false),
|
|
8664
|
-
|
|
8665
|
-
|
|
8854
|
+
isFileDownloading = _useState9[0],
|
|
8855
|
+
setDownlStatus = _useState9[1];
|
|
8666
8856
|
var _useState10 = React.useState(false),
|
|
8667
|
-
|
|
8668
|
-
|
|
8857
|
+
isSortingChange = _useState10[0],
|
|
8858
|
+
setSortingChange = _useState10[1];
|
|
8669
8859
|
var _useState11 = React.useState(false),
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
var _useState12 = React.useState(
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
var
|
|
8676
|
-
|
|
8677
|
-
|
|
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];
|
|
8678
8895
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8679
8896
|
var prevPos = _ref3.prevPos,
|
|
8680
8897
|
currPos = _ref3.currPos;
|
|
@@ -8695,47 +8912,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8695
8912
|
behavior: 'smooth'
|
|
8696
8913
|
});
|
|
8697
8914
|
};
|
|
8698
|
-
var _React$
|
|
8699
|
-
signup_page = _React$
|
|
8700
|
-
setSignUpPage = _React$
|
|
8701
|
-
var
|
|
8702
|
-
signup_rowsPerPage =
|
|
8703
|
-
setSignUpRowsPerPage =
|
|
8704
|
-
var _React$
|
|
8705
|
-
signup_order = _React$
|
|
8706
|
-
setSignUpOrder = _React$
|
|
8707
|
-
var _React$
|
|
8708
|
-
signup_orderBy = _React$
|
|
8709
|
-
setSignUpOrderBy = _React$
|
|
8710
|
-
var
|
|
8711
|
-
signup_searchValue =
|
|
8712
|
-
set_signup_SearchValue =
|
|
8713
|
-
var
|
|
8714
|
-
isSignUpSortingChange =
|
|
8715
|
-
setSignUpSortingChange =
|
|
8716
|
-
var
|
|
8717
|
-
isSignUpSearchingChange =
|
|
8718
|
-
setSignUpSearchingChange =
|
|
8719
|
-
var
|
|
8720
|
-
isSignUpSortingChangeTemp =
|
|
8721
|
-
setSignUpSortingChangeTemp =
|
|
8722
|
-
var
|
|
8723
|
-
isSignUpSearchingChangeTemp =
|
|
8724
|
-
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];
|
|
8725
8942
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8726
8943
|
return state.userList;
|
|
8727
8944
|
}),
|
|
8728
8945
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8946
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8947
|
+
history.push(config.routes.notification.path);
|
|
8948
|
+
};
|
|
8729
8949
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8730
8950
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8731
8951
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8732
8952
|
return false;
|
|
8733
8953
|
}
|
|
8734
|
-
|
|
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
|
+
}
|
|
8735
8970
|
};
|
|
8736
8971
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8737
8972
|
setOpenDeActivateModalFlag(false);
|
|
8738
8973
|
};
|
|
8974
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8975
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8976
|
+
};
|
|
8739
8977
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8740
8978
|
history.push(config.routes.users.add.path);
|
|
8741
8979
|
};
|
|
@@ -8783,12 +9021,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8783
9021
|
};
|
|
8784
9022
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8785
9023
|
var _extends2;
|
|
8786
|
-
var
|
|
9024
|
+
var selectedId = [];
|
|
9025
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9026
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9027
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8787
9028
|
return n.is_active;
|
|
8788
|
-
}).map(function (obj) {
|
|
8789
|
-
return obj.id.toString();
|
|
8790
9029
|
});
|
|
8791
|
-
|
|
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);
|
|
8792
9043
|
};
|
|
8793
9044
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8794
9045
|
var _extends3;
|
|
@@ -8806,58 +9057,156 @@ var UserList = function UserList(_ref2) {
|
|
|
8806
9057
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8807
9058
|
};
|
|
8808
9059
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9060
|
+
setPage(1);
|
|
8809
9061
|
setSearchValue(value);
|
|
8810
9062
|
setSearchingChange(true);
|
|
8811
9063
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8812
9064
|
};
|
|
8813
9065
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9066
|
+
setPage(1);
|
|
8814
9067
|
set_signup_SearchValue(value);
|
|
8815
9068
|
setSignUpSearchingChange(true);
|
|
8816
9069
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8817
9070
|
};
|
|
8818
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9071
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8819
9072
|
var _extends4;
|
|
8820
9073
|
var selectedTemp = _extends({}, selected);
|
|
8821
9074
|
if (!(page in selectedTemp)) {
|
|
8822
9075
|
selectedTemp[page] = [];
|
|
8823
9076
|
}
|
|
8824
9077
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8825
|
-
var
|
|
9078
|
+
var _newSelected = [];
|
|
8826
9079
|
if (selectedIndex === -1) {
|
|
8827
|
-
|
|
9080
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8828
9081
|
} else if (selectedIndex === 0) {
|
|
8829
|
-
|
|
9082
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8830
9083
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8831
|
-
|
|
9084
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8832
9085
|
} else if (selectedIndex > 0) {
|
|
8833
|
-
|
|
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
|
+
}
|
|
8834
9103
|
}
|
|
8835
|
-
|
|
9104
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9105
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9106
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8836
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]);
|
|
8837
9130
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8838
9131
|
setRowsPerPage(+event.target.value);
|
|
8839
9132
|
setPage(1);
|
|
8840
9133
|
setSelected({});
|
|
9134
|
+
setSelectedUsersNotApprover([]);
|
|
9135
|
+
setSelectedUsersApprover([]);
|
|
8841
9136
|
setSortingChange(true);
|
|
8842
9137
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8843
9138
|
};
|
|
8844
9139
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8845
9140
|
var isActive = e.target.checked;
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
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
|
+
});
|
|
8853
9170
|
}
|
|
8854
9171
|
}
|
|
8855
9172
|
});
|
|
8856
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
|
+
};
|
|
8857
9193
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8858
9194
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8859
9195
|
setOpenDeActivateModalFlag(false);
|
|
8860
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([]);
|
|
8861
9210
|
};
|
|
8862
9211
|
var importUserHandler = function importUserHandler() {
|
|
8863
9212
|
setOpenImportUsersModal(true);
|
|
@@ -8874,13 +9223,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8874
9223
|
email: email
|
|
8875
9224
|
}));
|
|
8876
9225
|
};
|
|
8877
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
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
|
+
}
|
|
8882
9232
|
}
|
|
8883
9233
|
setUserIds(ids);
|
|
9234
|
+
setUserFirstName(firstName);
|
|
9235
|
+
setUserLastName(lastName);
|
|
9236
|
+
setToggleInviteModal(!showInviteModal);
|
|
9237
|
+
};
|
|
9238
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8884
9239
|
setToggleInviteModal(!showInviteModal);
|
|
8885
9240
|
};
|
|
8886
9241
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8953,6 +9308,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8953
9308
|
userId: userId
|
|
8954
9309
|
}));
|
|
8955
9310
|
};
|
|
9311
|
+
var knowMore = function knowMore() {
|
|
9312
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9313
|
+
};
|
|
8956
9314
|
var dispatch = reactRedux.useDispatch();
|
|
8957
9315
|
React.useEffect(function () {
|
|
8958
9316
|
if (isTokenVerified === true) {
|
|
@@ -9204,7 +9562,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9204
9562
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9205
9563
|
variant: "body2",
|
|
9206
9564
|
className: clsx(styles$5.description)
|
|
9207
|
-
}, "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, {
|
|
9208
9569
|
data: signupRequestListInfo,
|
|
9209
9570
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9210
9571
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9236,6 +9597,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9236
9597
|
}))
|
|
9237
9598
|
}]
|
|
9238
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, {
|
|
9239
9648
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9240
9649
|
closeHandler: closeDeActivateModal,
|
|
9241
9650
|
cancelLabel: "Cancel",
|
|
@@ -9262,8 +9671,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9262
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, {
|
|
9263
9672
|
className: styles$5.description
|
|
9264
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, {
|
|
9265
9749
|
isOpen: showInviteModal,
|
|
9266
|
-
closeHandler:
|
|
9750
|
+
closeHandler: function closeHandler() {
|
|
9751
|
+
return toggleInviteModalClose();
|
|
9752
|
+
},
|
|
9267
9753
|
cancelLabel: "Cancel",
|
|
9268
9754
|
headerText: "Resend Invites?",
|
|
9269
9755
|
submitLabel: "Send",
|
|
@@ -9295,7 +9781,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9295
9781
|
fontSize: '14px',
|
|
9296
9782
|
color: '#374151'
|
|
9297
9783
|
}
|
|
9298
|
-
}, "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, {
|
|
9299
9791
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9300
9792
|
closeImportUsersModal: closeImportUsersModal,
|
|
9301
9793
|
closeImportModal: closeImportModal
|
|
@@ -9304,8 +9796,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9304
9796
|
errMsg: hasVerificationError
|
|
9305
9797
|
}));
|
|
9306
9798
|
};
|
|
9307
|
-
var TabLabelCount = function TabLabelCount(
|
|
9308
|
-
var count =
|
|
9799
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9800
|
+
var count = _ref5.count;
|
|
9309
9801
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9310
9802
|
className: styles$5.TabLabelCount
|
|
9311
9803
|
}, " ", count, " ");
|
|
@@ -9380,11 +9872,12 @@ function Header(props) {
|
|
|
9380
9872
|
})));
|
|
9381
9873
|
}
|
|
9382
9874
|
|
|
9383
|
-
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"};
|
|
9384
9876
|
|
|
9385
9877
|
function Listview(_ref) {
|
|
9386
9878
|
var data = _ref.data,
|
|
9387
9879
|
name = _ref.name,
|
|
9880
|
+
tableName = _ref.tableName,
|
|
9388
9881
|
handleEditDialog = _ref.handleEditDialog,
|
|
9389
9882
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9390
9883
|
orderBy = _ref.orderBy,
|
|
@@ -9397,16 +9890,82 @@ function Listview(_ref) {
|
|
|
9397
9890
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9398
9891
|
page = _ref.page,
|
|
9399
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
|
+
};
|
|
9400
9899
|
var columns = [{
|
|
9401
9900
|
id: 'name',
|
|
9402
9901
|
label: name,
|
|
9403
|
-
width: '
|
|
9902
|
+
width: '40%',
|
|
9404
9903
|
sortable: true,
|
|
9405
9904
|
cell: function cell(row) {
|
|
9406
9905
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9407
9906
|
component: "div"
|
|
9408
9907
|
}, row.name);
|
|
9409
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
|
+
}
|
|
9410
9969
|
}, {
|
|
9411
9970
|
id: 'no_of_users',
|
|
9412
9971
|
label: 'Number of users',
|
|
@@ -9420,7 +9979,7 @@ function Listview(_ref) {
|
|
|
9420
9979
|
}, {
|
|
9421
9980
|
id: 'actions',
|
|
9422
9981
|
label: 'Actions',
|
|
9423
|
-
width: '
|
|
9982
|
+
width: '15%',
|
|
9424
9983
|
cell: function cell(row) {
|
|
9425
9984
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9426
9985
|
display: "flex"
|
|
@@ -9453,7 +10012,7 @@ function Listview(_ref) {
|
|
|
9453
10012
|
hasFilter: true,
|
|
9454
10013
|
isCheckboxTable: false,
|
|
9455
10014
|
count: data.count,
|
|
9456
|
-
columns: columns,
|
|
10015
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9457
10016
|
rows: data.results,
|
|
9458
10017
|
page: page,
|
|
9459
10018
|
handleChangePage: handleChangePage,
|
|
@@ -9510,15 +10069,44 @@ function EditPanelDialog(_ref) {
|
|
|
9510
10069
|
var isOpen = _ref.isOpen,
|
|
9511
10070
|
closeHandler = _ref.closeHandler,
|
|
9512
10071
|
onValueChange = _ref.onValueChange,
|
|
9513
|
-
|
|
10072
|
+
_submitHandler = _ref.submitHandler,
|
|
9514
10073
|
isError = _ref.isError,
|
|
9515
10074
|
name = _ref.name,
|
|
9516
10075
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9517
|
-
validation = _ref.validation
|
|
10076
|
+
validation = _ref.validation,
|
|
10077
|
+
rowData = _ref.rowData,
|
|
10078
|
+
tableName = _ref.tableName,
|
|
10079
|
+
config = _ref.config;
|
|
9518
10080
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9519
10081
|
return state.userPanel;
|
|
9520
10082
|
}),
|
|
9521
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
|
+
};
|
|
9522
10110
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9523
10111
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9524
10112
|
isOpen: isOpen,
|
|
@@ -9526,25 +10114,59 @@ function EditPanelDialog(_ref) {
|
|
|
9526
10114
|
headerText: "Edit " + name.toLowerCase(),
|
|
9527
10115
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9528
10116
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9529
|
-
submitHandler: submitHandler
|
|
9530
|
-
|
|
10117
|
+
submitHandler: function submitHandler() {
|
|
10118
|
+
return _submitHandler(head);
|
|
10119
|
+
},
|
|
10120
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9531
10121
|
hideCloseIcon: false,
|
|
9532
10122
|
modalBodyStyle: {
|
|
9533
|
-
|
|
9534
|
-
overflow: 'auto',
|
|
9535
|
-
margin: '0px'
|
|
10123
|
+
overflowY: 'visible'
|
|
9536
10124
|
},
|
|
9537
10125
|
footerStyle: {
|
|
9538
10126
|
justifyContent: 'end'
|
|
9539
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
|
+
}
|
|
9540
10136
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9541
|
-
component: "div",
|
|
9542
10137
|
display: "flex",
|
|
9543
10138
|
justifyContent: "center",
|
|
9544
10139
|
alignItems: "center",
|
|
9545
10140
|
flexDirection: "column",
|
|
9546
|
-
|
|
9547
|
-
}, /*#__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, {
|
|
9548
10170
|
label: name + " name",
|
|
9549
10171
|
name: "name",
|
|
9550
10172
|
defaultValue: dialogData.data.name,
|
|
@@ -9553,7 +10175,49 @@ function EditPanelDialog(_ref) {
|
|
|
9553
10175
|
isError: isError,
|
|
9554
10176
|
validation: validation,
|
|
9555
10177
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9556
|
-
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
|
+
}
|
|
9557
10221
|
})));
|
|
9558
10222
|
}
|
|
9559
10223
|
|
|
@@ -9732,12 +10396,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9732
10396
|
var _useState13 = React.useState(false),
|
|
9733
10397
|
isSortingChangeTemp = _useState13[0],
|
|
9734
10398
|
setSortingChangeTemp = _useState13[1];
|
|
9735
|
-
var _useState14 = React.useState(
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
var _useState15 = React.useState(
|
|
9739
|
-
|
|
9740
|
-
|
|
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];
|
|
9741
10408
|
var orderingParam = orderBy;
|
|
9742
10409
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9743
10410
|
return state.userPanel;
|
|
@@ -9755,12 +10422,20 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9755
10422
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
9756
10423
|
setDataList(validatedValue);
|
|
9757
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
|
+
}, []);
|
|
9758
10433
|
var validation = {
|
|
9759
10434
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
9760
10435
|
regexOnBlur: null,
|
|
9761
10436
|
maxLimit: '',
|
|
9762
10437
|
minLimit: '',
|
|
9763
|
-
maxLength:
|
|
10438
|
+
maxLength: maxLengthForModal,
|
|
9764
10439
|
minLength: 0
|
|
9765
10440
|
};
|
|
9766
10441
|
React.useEffect(function () {
|
|
@@ -9833,6 +10508,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9833
10508
|
submitLabel: 'Save'
|
|
9834
10509
|
}, '', data));
|
|
9835
10510
|
setDataList(data.name);
|
|
10511
|
+
setRowData(data);
|
|
9836
10512
|
setEditModal(true);
|
|
9837
10513
|
};
|
|
9838
10514
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9847,6 +10523,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9847
10523
|
var payload = {
|
|
9848
10524
|
names: [dataList]
|
|
9849
10525
|
};
|
|
10526
|
+
if (tableName === 'department') {
|
|
10527
|
+
payload = {
|
|
10528
|
+
name: dataList,
|
|
10529
|
+
department_head_id: null
|
|
10530
|
+
};
|
|
10531
|
+
}
|
|
9850
10532
|
var message = title + " added successfully.";
|
|
9851
10533
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9852
10534
|
} else {
|
|
@@ -9860,9 +10542,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9860
10542
|
var message = title + " deleted successfully.";
|
|
9861
10543
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9862
10544
|
};
|
|
9863
|
-
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
|
+
}
|
|
9864
10549
|
dispatch(userPanelShowLoader());
|
|
9865
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10550
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9866
10551
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9867
10552
|
dispatch(userPanelStopLoader());
|
|
9868
10553
|
if (type === 'delete') {
|
|
@@ -9904,8 +10589,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9904
10589
|
name: dataList
|
|
9905
10590
|
}]
|
|
9906
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
|
+
}
|
|
9907
10598
|
var message = title + " updated successfully.";
|
|
9908
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10599
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9909
10600
|
setErrorEdit(false);
|
|
9910
10601
|
} else {
|
|
9911
10602
|
setErrorEdit(true);
|
|
@@ -10012,7 +10703,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10012
10703
|
submitHandler: handleEditPanel,
|
|
10013
10704
|
isError: errorEdit,
|
|
10014
10705
|
isDisabledSubmitBtn: loading,
|
|
10015
|
-
validation: validation
|
|
10706
|
+
validation: validation,
|
|
10707
|
+
rowData: rowData,
|
|
10708
|
+
tableName: tableName,
|
|
10709
|
+
config: config
|
|
10016
10710
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
10017
10711
|
config: config
|
|
10018
10712
|
}));
|