@itilite/iui-user-management 0.4.42 → 0.4.51
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 +979 -304
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +980 -305
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
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
|
|
@@ -1519,25 +1621,6 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1519
1621
|
});
|
|
1520
1622
|
};
|
|
1521
1623
|
};
|
|
1522
|
-
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1523
|
-
return function (dispatch) {
|
|
1524
|
-
return new Promise(function (resolve, reject) {
|
|
1525
|
-
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1526
|
-
dispatch(fetchUserSignupRequests({
|
|
1527
|
-
ordering: 'asc',
|
|
1528
|
-
length: 5,
|
|
1529
|
-
page: 1,
|
|
1530
|
-
search: ''
|
|
1531
|
-
}));
|
|
1532
|
-
resolve();
|
|
1533
|
-
})["catch"](function (err) {
|
|
1534
|
-
var _err$response8, _err$response8$data;
|
|
1535
|
-
IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response8 = err.response) === null || _err$response8 === void 0 ? void 0 : (_err$response8$data = _err$response8.data) === null || _err$response8$data === void 0 ? void 0 : _err$response8$data.message) || 'Opps, Something went wrong.');
|
|
1536
|
-
reject(err);
|
|
1537
|
-
});
|
|
1538
|
-
});
|
|
1539
|
-
};
|
|
1540
|
-
};
|
|
1541
1624
|
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1542
1625
|
return function (dispatch) {
|
|
1543
1626
|
return new Promise(function (resolve, reject) {
|
|
@@ -1716,7 +1799,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1716
1799
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1717
1800
|
return function (dispatch) {
|
|
1718
1801
|
return new Promise(function (resolve, reject) {
|
|
1719
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1802
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1720
1803
|
resolve(res);
|
|
1721
1804
|
})["catch"](function (err) {
|
|
1722
1805
|
var _err$response17, _err$response17$data;
|
|
@@ -1752,6 +1835,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1752
1835
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1753
1836
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1754
1837
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1838
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1755
1839
|
|
|
1756
1840
|
var api$3 = utils.configs.api;
|
|
1757
1841
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1801,14 +1885,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1801
1885
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1802
1886
|
return function (dispatch) {
|
|
1803
1887
|
return new Promise(function (resolve, reject) {
|
|
1804
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1888
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1805
1889
|
dispatch(getUserPanalData(getParam));
|
|
1806
1890
|
dispatch(closeDialog());
|
|
1807
1891
|
resolve(res);
|
|
1808
1892
|
})["catch"](function (err) {
|
|
1809
|
-
var _err$
|
|
1893
|
+
var _err$response3, _err$response3$data;
|
|
1810
1894
|
dispatch(userPanelStopLoader());
|
|
1811
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1895
|
+
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
1896
|
});
|
|
1813
1897
|
});
|
|
1814
1898
|
};
|
|
@@ -1822,25 +1906,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1822
1906
|
dispatch(userPanelStopLoader());
|
|
1823
1907
|
resolve();
|
|
1824
1908
|
})["catch"](function (err) {
|
|
1825
|
-
var _err$
|
|
1826
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1909
|
+
var _err$response4, _err$response4$data;
|
|
1910
|
+
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
1911
|
dispatch(userPanelStopLoader());
|
|
1828
1912
|
});
|
|
1829
1913
|
});
|
|
1830
1914
|
};
|
|
1831
1915
|
};
|
|
1832
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1916
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1833
1917
|
return function (dispatch) {
|
|
1834
1918
|
return new Promise(function (resolve, reject) {
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1919
|
+
if (tableName === 'department') {
|
|
1920
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1921
|
+
dispatch(getUserPanalData(getParam));
|
|
1922
|
+
dispatch(closeDialog());
|
|
1923
|
+
resolve();
|
|
1924
|
+
})["catch"](function (err) {
|
|
1925
|
+
var _err$response5, _err$response5$data;
|
|
1926
|
+
dispatch(userPanelStopLoader());
|
|
1927
|
+
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.');
|
|
1928
|
+
});
|
|
1929
|
+
} else {
|
|
1930
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1931
|
+
dispatch(getUserPanalData(getParam));
|
|
1932
|
+
dispatch(closeDialog());
|
|
1933
|
+
resolve();
|
|
1934
|
+
})["catch"](function (err) {
|
|
1935
|
+
var _err$response6, _err$response6$data;
|
|
1936
|
+
dispatch(userPanelStopLoader());
|
|
1937
|
+
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.');
|
|
1938
|
+
});
|
|
1939
|
+
}
|
|
1844
1940
|
});
|
|
1845
1941
|
};
|
|
1846
1942
|
};
|
|
@@ -1852,8 +1948,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1852
1948
|
dispatch(closeDialog());
|
|
1853
1949
|
resolve(res);
|
|
1854
1950
|
})["catch"](function (err) {
|
|
1855
|
-
var _err$
|
|
1856
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1951
|
+
var _err$response7, _err$response7$data;
|
|
1952
|
+
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
1953
|
});
|
|
1858
1954
|
});
|
|
1859
1955
|
};
|
|
@@ -2942,8 +3038,8 @@ var workInfo = [{
|
|
|
2942
3038
|
validation: {
|
|
2943
3039
|
regexOnChange: null,
|
|
2944
3040
|
regexOnBlur: [{
|
|
2945
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
2946
|
-
message: "Only alphabets, numbers and
|
|
3041
|
+
regex: /^[(A-Z)(a-z)(0-9)\-_& ]*$/,
|
|
3042
|
+
message: "Only alphabets, numbers, - and _ & are allowed."
|
|
2947
3043
|
}],
|
|
2948
3044
|
maxLimit: '',
|
|
2949
3045
|
minLimit: '',
|
|
@@ -3031,8 +3127,8 @@ var workInfo = [{
|
|
|
3031
3127
|
validation: {
|
|
3032
3128
|
regexOnChange: null,
|
|
3033
3129
|
regexOnBlur: [{
|
|
3034
|
-
regex: /^[A-Za-z0-9
|
|
3035
|
-
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3130
|
+
regex: /^[A-Za-z0-9 \-_.,&'()\/]*$/,
|
|
3131
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) _ - , / are allowed."
|
|
3036
3132
|
}, {
|
|
3037
3133
|
regex: /^[a-zA-Z]/,
|
|
3038
3134
|
message: 'Designation should start with alphabets'
|
|
@@ -3043,31 +3139,6 @@ var workInfo = [{
|
|
|
3043
3139
|
minLength: 0
|
|
3044
3140
|
},
|
|
3045
3141
|
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
3142
|
}, {
|
|
3072
3143
|
id: 9,
|
|
3073
3144
|
label: 'Base location',
|
|
@@ -3978,6 +4049,7 @@ var initialState$2 = {
|
|
|
3978
4049
|
previous: null,
|
|
3979
4050
|
results: []
|
|
3980
4051
|
},
|
|
4052
|
+
deptUsers: [],
|
|
3981
4053
|
loading: false
|
|
3982
4054
|
};
|
|
3983
4055
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4047,6 +4119,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4047
4119
|
loading: false
|
|
4048
4120
|
});
|
|
4049
4121
|
}
|
|
4122
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4123
|
+
{
|
|
4124
|
+
return _extends({}, state, {
|
|
4125
|
+
deptUsers: action.payload
|
|
4126
|
+
});
|
|
4127
|
+
}
|
|
4050
4128
|
default:
|
|
4051
4129
|
return state;
|
|
4052
4130
|
}
|
|
@@ -4825,6 +4903,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4825
4903
|
isILadmin = _useSelector2.isILadmin,
|
|
4826
4904
|
companyName = _useSelector2.companyName;
|
|
4827
4905
|
var history = reactRouterDom.useHistory();
|
|
4906
|
+
var location = reactRouterDom.useLocation();
|
|
4828
4907
|
var _useState = React.useState({
|
|
4829
4908
|
travel: false,
|
|
4830
4909
|
expense: false
|
|
@@ -4893,11 +4972,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4893
4972
|
},
|
|
4894
4973
|
designation: '',
|
|
4895
4974
|
base_location: '',
|
|
4896
|
-
|
|
4975
|
+
manager_id: {
|
|
4897
4976
|
value: '',
|
|
4898
4977
|
label: 'Select Manager'
|
|
4899
4978
|
},
|
|
4900
|
-
|
|
4979
|
+
skip_manager_id: {
|
|
4901
4980
|
value: '',
|
|
4902
4981
|
label: 'Select Manager'
|
|
4903
4982
|
},
|
|
@@ -4914,8 +4993,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4914
4993
|
business_unit: 0,
|
|
4915
4994
|
department: 0,
|
|
4916
4995
|
currency: 0,
|
|
4917
|
-
|
|
4918
|
-
|
|
4996
|
+
manager_id: 0,
|
|
4997
|
+
skip_manager_id: 0
|
|
4919
4998
|
}),
|
|
4920
4999
|
cacheForAsyncDropdown = _useState4[0],
|
|
4921
5000
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5069,6 +5148,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5069
5148
|
var _useState25 = React.useState([]),
|
|
5070
5149
|
uploadedFiles = _useState25[0],
|
|
5071
5150
|
setUploadedFiles = _useState25[1];
|
|
5151
|
+
var _useState26 = React.useState(70),
|
|
5152
|
+
maxLengthForModal = _useState26[0],
|
|
5153
|
+
setMaxLengthForModal = _useState26[1];
|
|
5072
5154
|
var defaultAddModalData = {
|
|
5073
5155
|
isOpen: false,
|
|
5074
5156
|
isError: false,
|
|
@@ -5081,25 +5163,41 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5081
5163
|
regexOnBlur: null,
|
|
5082
5164
|
maxLimit: '',
|
|
5083
5165
|
minLimit: '',
|
|
5084
|
-
maxLength:
|
|
5166
|
+
maxLength: maxLengthForModal,
|
|
5085
5167
|
minLength: 0
|
|
5086
5168
|
};
|
|
5087
|
-
var
|
|
5088
|
-
addModalData =
|
|
5089
|
-
setAddModalData =
|
|
5169
|
+
var _useState27 = React.useState(defaultAddModalData),
|
|
5170
|
+
addModalData = _useState27[0],
|
|
5171
|
+
setAddModalData = _useState27[1];
|
|
5090
5172
|
var onAddModalClose = function onAddModalClose() {
|
|
5091
5173
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5092
5174
|
};
|
|
5175
|
+
React.useEffect(function () {
|
|
5176
|
+
var _location$state, _location$state2;
|
|
5177
|
+
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) {
|
|
5178
|
+
var _location$state3, _location$state4;
|
|
5179
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5180
|
+
department: {
|
|
5181
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5182
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5183
|
+
}
|
|
5184
|
+
}));
|
|
5185
|
+
}
|
|
5186
|
+
}, []);
|
|
5093
5187
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5094
5188
|
var title = '';
|
|
5095
5189
|
if (id === 'entity') {
|
|
5096
5190
|
title = 'Entity';
|
|
5191
|
+
setMaxLengthForModal(70);
|
|
5097
5192
|
} else if (id === 'department') {
|
|
5098
5193
|
title = 'Department';
|
|
5194
|
+
setMaxLengthForModal(70);
|
|
5099
5195
|
} else if (id === 'business_unit') {
|
|
5196
|
+
setMaxLengthForModal(150);
|
|
5100
5197
|
title = 'Business unit';
|
|
5101
5198
|
} else if (id === 'employee_level') {
|
|
5102
5199
|
title = 'Employee level';
|
|
5200
|
+
setMaxLengthForModal(70);
|
|
5103
5201
|
}
|
|
5104
5202
|
setAddModalData(_extends({}, addModalData, {
|
|
5105
5203
|
isOpen: true,
|
|
@@ -5115,24 +5213,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5115
5213
|
}));
|
|
5116
5214
|
} else {
|
|
5117
5215
|
dispatch(showLoader());
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5216
|
+
var dataObj;
|
|
5217
|
+
if (addModalData.id === 'department') {
|
|
5218
|
+
dataObj = {
|
|
5219
|
+
name: validatedValue,
|
|
5220
|
+
department_head_id: null
|
|
5221
|
+
};
|
|
5222
|
+
} else {
|
|
5223
|
+
dataObj = {
|
|
5224
|
+
names: [validatedValue]
|
|
5225
|
+
};
|
|
5226
|
+
}
|
|
5227
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5228
|
+
var _extends4;
|
|
5122
5229
|
setAddModalData(_extends({}, addModalData, {
|
|
5123
5230
|
isOpen: false
|
|
5124
5231
|
}));
|
|
5125
5232
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5126
5233
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5131
|
-
|
|
5234
|
+
if (addModalData.id === 'department') {
|
|
5235
|
+
var _extends2;
|
|
5236
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5237
|
+
value: res.data.result.id,
|
|
5238
|
+
label: res.data.result.name
|
|
5239
|
+
}, _extends2)));
|
|
5240
|
+
} else {
|
|
5241
|
+
var _extends3;
|
|
5242
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5243
|
+
value: res.data.value,
|
|
5244
|
+
label: res.data.label
|
|
5245
|
+
}, _extends3)));
|
|
5246
|
+
}
|
|
5247
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5132
5248
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5133
5249
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5134
|
-
var
|
|
5135
|
-
return _extends({}, prevState, (
|
|
5250
|
+
var _extends5;
|
|
5251
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5136
5252
|
});
|
|
5137
5253
|
dispatch(stopLoader());
|
|
5138
5254
|
});
|
|
@@ -5151,8 +5267,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5151
5267
|
try {
|
|
5152
5268
|
var _temp5 = function _temp5() {
|
|
5153
5269
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5154
|
-
var
|
|
5155
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5270
|
+
var _extends6;
|
|
5271
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5156
5272
|
}
|
|
5157
5273
|
};
|
|
5158
5274
|
var _name = args._name,
|
|
@@ -5175,8 +5291,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5175
5291
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5176
5292
|
} else {
|
|
5177
5293
|
var _temp3 = function _temp3() {
|
|
5178
|
-
var
|
|
5179
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5294
|
+
var _extends7;
|
|
5295
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5180
5296
|
updateError(_name, _isError, _errorMsg);
|
|
5181
5297
|
};
|
|
5182
5298
|
var _temp2 = function () {
|
|
@@ -5224,16 +5340,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5224
5340
|
}
|
|
5225
5341
|
};
|
|
5226
5342
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5227
|
-
var
|
|
5343
|
+
var _extends8;
|
|
5228
5344
|
var _name = args._name,
|
|
5229
5345
|
_value = args._value,
|
|
5230
5346
|
_isError = args._isError,
|
|
5231
5347
|
_errorMsg = args._errorMsg;
|
|
5232
|
-
|
|
5348
|
+
console.log(_name, _value);
|
|
5349
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5233
5350
|
updateError(_name, _isError, _errorMsg);
|
|
5234
5351
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5235
|
-
var
|
|
5236
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5352
|
+
var _extends9;
|
|
5353
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5237
5354
|
}
|
|
5238
5355
|
};
|
|
5239
5356
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5243,9 +5360,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5243
5360
|
return tag.id;
|
|
5244
5361
|
};
|
|
5245
5362
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5246
|
-
var
|
|
5363
|
+
var _extends10;
|
|
5247
5364
|
var e = args._event;
|
|
5248
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5365
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5249
5366
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5250
5367
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5251
5368
|
userTagType: true
|
|
@@ -5253,22 +5370,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5253
5370
|
}
|
|
5254
5371
|
};
|
|
5255
5372
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5256
|
-
var
|
|
5373
|
+
var _extends11;
|
|
5257
5374
|
var _name = _ref2._name,
|
|
5258
5375
|
_value = _ref2._value;
|
|
5259
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5376
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5260
5377
|
};
|
|
5261
5378
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5262
|
-
var
|
|
5379
|
+
var _extends12;
|
|
5263
5380
|
var _name = _ref3._name,
|
|
5264
5381
|
_value = _ref3._value;
|
|
5265
|
-
|
|
5382
|
+
console.log(_name, _value, 'travel');
|
|
5383
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5266
5384
|
};
|
|
5267
5385
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5268
|
-
var
|
|
5386
|
+
var _extends13;
|
|
5269
5387
|
var _name = _ref4._name,
|
|
5270
5388
|
_value = _ref4._value;
|
|
5271
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5389
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5272
5390
|
};
|
|
5273
5391
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5274
5392
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5302,39 +5420,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5302
5420
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5303
5421
|
};
|
|
5304
5422
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5305
|
-
var
|
|
5423
|
+
var _extends14;
|
|
5306
5424
|
var _name = args._name,
|
|
5307
5425
|
_value = args._value,
|
|
5308
5426
|
_isError = args._isError,
|
|
5309
5427
|
_errorMsg = args._errorMsg;
|
|
5310
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5428
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5311
5429
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5312
|
-
var
|
|
5313
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5430
|
+
var _extends15;
|
|
5431
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5314
5432
|
}
|
|
5315
5433
|
updateError(_name, _isError, _errorMsg);
|
|
5316
5434
|
};
|
|
5317
5435
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5318
|
-
var
|
|
5436
|
+
var _extends16;
|
|
5319
5437
|
var _name = args._name,
|
|
5320
5438
|
_value = args._value,
|
|
5321
5439
|
_isError = args._isError,
|
|
5322
5440
|
_errorMsg = args._errorMsg;
|
|
5323
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5441
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5324
5442
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5325
|
-
var
|
|
5326
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5443
|
+
var _extends17;
|
|
5444
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5327
5445
|
}
|
|
5328
5446
|
updateError(_name, _isError, _errorMsg);
|
|
5329
5447
|
};
|
|
5330
5448
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5331
5449
|
try {
|
|
5332
5450
|
var _temp8 = function _temp8() {
|
|
5333
|
-
var
|
|
5334
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5451
|
+
var _extends18;
|
|
5452
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5335
5453
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5336
|
-
var
|
|
5337
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5454
|
+
var _extends19;
|
|
5455
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5338
5456
|
}
|
|
5339
5457
|
updateError(_name, _isError, _errorMsg);
|
|
5340
5458
|
};
|
|
@@ -5440,8 +5558,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5440
5558
|
return _errorArray;
|
|
5441
5559
|
});
|
|
5442
5560
|
setErrorMsgs(function (prevState) {
|
|
5443
|
-
var
|
|
5444
|
-
return _extends({}, prevState, (
|
|
5561
|
+
var _extends20;
|
|
5562
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5445
5563
|
});
|
|
5446
5564
|
};
|
|
5447
5565
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5515,14 +5633,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5515
5633
|
value: '',
|
|
5516
5634
|
label: 'Select employee level'
|
|
5517
5635
|
},
|
|
5518
|
-
|
|
5636
|
+
manager_id: res.employee_info.manager ? {
|
|
5519
5637
|
value: res.employee_info.manager,
|
|
5520
5638
|
label: res.employee_info.manager
|
|
5521
5639
|
} : {
|
|
5522
5640
|
value: '',
|
|
5523
5641
|
label: 'Select Manager'
|
|
5524
5642
|
},
|
|
5525
|
-
|
|
5643
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5526
5644
|
value: res.employee_info.skip_manager,
|
|
5527
5645
|
label: res.employee_info.skip_manager
|
|
5528
5646
|
} : {
|
|
@@ -5794,13 +5912,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5794
5912
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5795
5913
|
return Promise.resolve();
|
|
5796
5914
|
}
|
|
5797
|
-
|
|
5915
|
+
console.log(employeeInfoInput, 'data');
|
|
5916
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5798
5917
|
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5799
|
-
delete employeeInfoInput.manager;
|
|
5800
5918
|
}
|
|
5801
|
-
if (employeeInfoInput.
|
|
5919
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5802
5920
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5803
|
-
delete employeeInfoInput.skip_manager;
|
|
5804
5921
|
}
|
|
5805
5922
|
var payload = {
|
|
5806
5923
|
personalInfoInput: personalInfoInput,
|
|
@@ -5859,8 +5976,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5859
5976
|
}
|
|
5860
5977
|
}
|
|
5861
5978
|
for (var _key in employeeInfo) {
|
|
5979
|
+
console.log('key', _key);
|
|
5862
5980
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5863
|
-
|
|
5981
|
+
var _employeeInfoInput$_k;
|
|
5982
|
+
console.log('employeeInfo0000', (_employeeInfoInput$_k = employeeInfoInput[_key]) === null || _employeeInfoInput$_k === void 0 ? void 0 : _employeeInfoInput$_k.value, 'sajkdhjasj');
|
|
5983
|
+
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
5984
|
_isError = true;
|
|
5865
5985
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5866
5986
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -5947,12 +6067,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5947
6067
|
setErrorArray(_errorArray);
|
|
5948
6068
|
setErrorMsgs(_errorMsgs);
|
|
5949
6069
|
var _loop = function _loop() {
|
|
5950
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
5951
|
-
if (_errorMsgs[
|
|
5952
|
-
if (
|
|
6070
|
+
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6071
|
+
if (_errorMsgs[_key3]) {
|
|
6072
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5953
6073
|
setAdditionalInfoFlag('open');
|
|
5954
6074
|
}
|
|
5955
|
-
var el = document.getElementById(
|
|
6075
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5956
6076
|
if (el) {
|
|
5957
6077
|
setTimeout(function () {
|
|
5958
6078
|
el.scrollIntoView({
|
|
@@ -5960,14 +6080,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5960
6080
|
block: 'center'
|
|
5961
6081
|
});
|
|
5962
6082
|
}, 500);
|
|
5963
|
-
return
|
|
6083
|
+
return 1;
|
|
5964
6084
|
}
|
|
5965
6085
|
}
|
|
5966
6086
|
}
|
|
5967
6087
|
};
|
|
5968
6088
|
for (var _key3 in _errorMsgs) {
|
|
5969
|
-
|
|
5970
|
-
if (_ret === "break") break;
|
|
6089
|
+
if (_loop()) break;
|
|
5971
6090
|
}
|
|
5972
6091
|
}
|
|
5973
6092
|
if (!_isError) {
|
|
@@ -5998,12 +6117,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5998
6117
|
setErrorArray(Object.keys(err));
|
|
5999
6118
|
setErrorMsgs(err);
|
|
6000
6119
|
var _loop2 = function _loop2() {
|
|
6001
|
-
if (Object.hasOwnProperty.call(err,
|
|
6002
|
-
if (err[
|
|
6003
|
-
if (
|
|
6120
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6121
|
+
if (err[_key4]) {
|
|
6122
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6004
6123
|
setAdditionalInfoFlag('open');
|
|
6005
6124
|
}
|
|
6006
|
-
var el = document.getElementById(
|
|
6125
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6007
6126
|
if (el) {
|
|
6008
6127
|
setTimeout(function () {
|
|
6009
6128
|
el.scrollIntoView({
|
|
@@ -6011,14 +6130,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6011
6130
|
block: 'center'
|
|
6012
6131
|
});
|
|
6013
6132
|
}, 500);
|
|
6014
|
-
return
|
|
6133
|
+
return 1;
|
|
6015
6134
|
}
|
|
6016
6135
|
}
|
|
6017
6136
|
}
|
|
6018
6137
|
};
|
|
6019
6138
|
for (var _key4 in err) {
|
|
6020
|
-
|
|
6021
|
-
if (_ret2 === "break") break;
|
|
6139
|
+
if (_loop2()) break;
|
|
6022
6140
|
}
|
|
6023
6141
|
} else if (typeof err === 'string') {
|
|
6024
6142
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6048,12 +6166,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6048
6166
|
setErrorArray(Object.keys(err));
|
|
6049
6167
|
setErrorMsgs(err);
|
|
6050
6168
|
var _loop3 = function _loop3() {
|
|
6051
|
-
if (Object.hasOwnProperty.call(err,
|
|
6052
|
-
if (err[
|
|
6053
|
-
if (
|
|
6169
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6170
|
+
if (err[_key5]) {
|
|
6171
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6054
6172
|
setAdditionalInfoFlag('open');
|
|
6055
6173
|
}
|
|
6056
|
-
var el = document.getElementById(
|
|
6174
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6057
6175
|
if (el) {
|
|
6058
6176
|
setTimeout(function () {
|
|
6059
6177
|
el.scrollIntoView({
|
|
@@ -6061,14 +6179,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6061
6179
|
block: 'center'
|
|
6062
6180
|
});
|
|
6063
6181
|
}, 500);
|
|
6064
|
-
return
|
|
6182
|
+
return 1;
|
|
6065
6183
|
}
|
|
6066
6184
|
}
|
|
6067
6185
|
}
|
|
6068
6186
|
};
|
|
6069
6187
|
for (var _key5 in err) {
|
|
6070
|
-
|
|
6071
|
-
if (_ret3 === "break") break;
|
|
6188
|
+
if (_loop3()) break;
|
|
6072
6189
|
}
|
|
6073
6190
|
} else if (typeof err === 'string') {
|
|
6074
6191
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6793,7 +6910,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6793
6910
|
};
|
|
6794
6911
|
};
|
|
6795
6912
|
|
|
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"};
|
|
6913
|
+
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
6914
|
|
|
6798
6915
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6799
6916
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8279,9 +8396,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8279
8396
|
cell: function cell(row) {
|
|
8280
8397
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8281
8398
|
component: "div",
|
|
8282
|
-
width:
|
|
8399
|
+
width: 80
|
|
8283
8400
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8284
|
-
title: "This user hasn't logged
|
|
8401
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8285
8402
|
arrow: true,
|
|
8286
8403
|
classes: {
|
|
8287
8404
|
arrow: classes.arrow,
|
|
@@ -8289,7 +8406,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8289
8406
|
},
|
|
8290
8407
|
placement: "top-start"
|
|
8291
8408
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8292
|
-
className: clsx(styles$5.
|
|
8409
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8293
8410
|
}, "Invited")) : null);
|
|
8294
8411
|
}
|
|
8295
8412
|
}, {
|
|
@@ -8390,7 +8507,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8390
8507
|
options.push({
|
|
8391
8508
|
label: 'Resend invite',
|
|
8392
8509
|
handler: function handler() {
|
|
8393
|
-
return toggleInviteModal(row.id, 'single');
|
|
8510
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8394
8511
|
}
|
|
8395
8512
|
});
|
|
8396
8513
|
}
|
|
@@ -8417,6 +8534,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8417
8534
|
endIcon: null,
|
|
8418
8535
|
outlinedBtn: false,
|
|
8419
8536
|
className: "threedotMenuBtn",
|
|
8537
|
+
MoreHorizIcon: true,
|
|
8420
8538
|
placement: "bottom-end"
|
|
8421
8539
|
}));
|
|
8422
8540
|
},
|
|
@@ -8562,6 +8680,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8562
8680
|
});
|
|
8563
8681
|
};
|
|
8564
8682
|
|
|
8683
|
+
function InfoYellowIcon(props) {
|
|
8684
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8685
|
+
width: props.width,
|
|
8686
|
+
height: props.height,
|
|
8687
|
+
viewBox: "0 0 20 20",
|
|
8688
|
+
fill: "none",
|
|
8689
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8690
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8691
|
+
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",
|
|
8692
|
+
fill: "#CA8A04"
|
|
8693
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8694
|
+
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",
|
|
8695
|
+
fill: "#CA8A04"
|
|
8696
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8697
|
+
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",
|
|
8698
|
+
fill: "#CA8A04"
|
|
8699
|
+
}));
|
|
8700
|
+
}
|
|
8701
|
+
|
|
8702
|
+
function RedWarningIcon(props) {
|
|
8703
|
+
var _props$color = props.color,
|
|
8704
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8705
|
+
_props$size = props.size,
|
|
8706
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8707
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8708
|
+
width: size,
|
|
8709
|
+
height: size,
|
|
8710
|
+
viewBox: "0 0 14 14",
|
|
8711
|
+
fill: color,
|
|
8712
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8713
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8714
|
+
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",
|
|
8715
|
+
fill: color
|
|
8716
|
+
}));
|
|
8717
|
+
}
|
|
8718
|
+
|
|
8565
8719
|
function InviteInfoIcon() {
|
|
8566
8720
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8567
8721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8579,7 +8733,8 @@ function InviteInfoIcon() {
|
|
|
8579
8733
|
}
|
|
8580
8734
|
|
|
8581
8735
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8582
|
-
var env$7 = utils.configs.env
|
|
8736
|
+
var env$7 = utils.configs.env,
|
|
8737
|
+
api$7 = utils.configs.api;
|
|
8583
8738
|
var UndoButton = function UndoButton(_ref) {
|
|
8584
8739
|
var onUndo = _ref.onUndo,
|
|
8585
8740
|
msg = _ref.msg;
|
|
@@ -8617,27 +8772,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8617
8772
|
isDataFetching = _useSelector.isDataFetching,
|
|
8618
8773
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8619
8774
|
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];
|
|
8775
|
+
var newSelecteds = userListInfo.results;
|
|
8776
|
+
var _React$useState = React__default.useState(''),
|
|
8777
|
+
deactivateUser = _React$useState[0],
|
|
8778
|
+
setDeactivateUser = _React$useState[1];
|
|
8779
|
+
var _React$useState2 = React__default.useState(null),
|
|
8780
|
+
defaultId = _React$useState2[0],
|
|
8781
|
+
setDefaultId = _React$useState2[1];
|
|
8782
|
+
var _React$useState3 = React__default.useState(1),
|
|
8783
|
+
page = _React$useState3[0],
|
|
8784
|
+
setPage = _React$useState3[1];
|
|
8785
|
+
var _useState = React.useState([]),
|
|
8786
|
+
selectedUsersNotApprover = _useState[0],
|
|
8787
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8788
|
+
var _useState2 = React.useState([]),
|
|
8789
|
+
selectedUsersApprover = _useState2[0],
|
|
8790
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8638
8791
|
var _useState3 = React.useState(false),
|
|
8639
|
-
|
|
8640
|
-
|
|
8792
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8793
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8794
|
+
var _React$useState4 = React__default.useState(''),
|
|
8795
|
+
user = _React$useState4[0],
|
|
8796
|
+
setUser = _React$useState4[1];
|
|
8797
|
+
var _useState4 = React.useState(10),
|
|
8798
|
+
rowsPerPage = _useState4[0],
|
|
8799
|
+
setRowsPerPage = _useState4[1];
|
|
8800
|
+
var _React$useState5 = React__default.useState({}),
|
|
8801
|
+
selected = _React$useState5[0],
|
|
8802
|
+
setSelected = _React$useState5[1];
|
|
8803
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8804
|
+
order = _React$useState6[0],
|
|
8805
|
+
setOrder = _React$useState6[1];
|
|
8806
|
+
var _React$useState7 = React__default.useState(false),
|
|
8807
|
+
deactivateSingle = _React$useState7[0],
|
|
8808
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8809
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8810
|
+
orderBy = _React$useState8[0],
|
|
8811
|
+
setOrderBy = _React$useState8[1];
|
|
8812
|
+
var _useState5 = React.useState(''),
|
|
8813
|
+
searchValue = _useState5[0],
|
|
8814
|
+
setSearchValue = _useState5[1];
|
|
8815
|
+
var _useState6 = React.useState(false),
|
|
8816
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8817
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8641
8818
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
8642
8819
|
return state.common;
|
|
8643
8820
|
}),
|
|
@@ -8645,36 +8822,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8645
8822
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8646
8823
|
isILadmin = _useSelector2.isILadmin,
|
|
8647
8824
|
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
8825
|
var _useState7 = React.useState(false),
|
|
8658
|
-
|
|
8659
|
-
|
|
8826
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8827
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8660
8828
|
var _useState8 = React.useState(false),
|
|
8661
|
-
|
|
8662
|
-
|
|
8829
|
+
approveeStatus = _useState8[0],
|
|
8830
|
+
setApproveeStatus = _useState8[1];
|
|
8663
8831
|
var _useState9 = React.useState(false),
|
|
8664
|
-
|
|
8665
|
-
|
|
8832
|
+
isFileDownloading = _useState9[0],
|
|
8833
|
+
setDownlStatus = _useState9[1];
|
|
8666
8834
|
var _useState10 = React.useState(false),
|
|
8667
|
-
|
|
8668
|
-
|
|
8835
|
+
isSortingChange = _useState10[0],
|
|
8836
|
+
setSortingChange = _useState10[1];
|
|
8669
8837
|
var _useState11 = React.useState(false),
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
var _useState12 = React.useState(
|
|
8673
|
-
|
|
8674
|
-
|
|
8675
|
-
var
|
|
8676
|
-
|
|
8677
|
-
|
|
8838
|
+
isSearchingChange = _useState11[0],
|
|
8839
|
+
setSearchingChange = _useState11[1];
|
|
8840
|
+
var _useState12 = React.useState(false),
|
|
8841
|
+
isSortingChangeTemp = _useState12[0],
|
|
8842
|
+
setSortingChangeTemp = _useState12[1];
|
|
8843
|
+
var _useState13 = React.useState(false),
|
|
8844
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8845
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8846
|
+
var _useState14 = React.useState(false),
|
|
8847
|
+
isApiFetching = _useState14[0],
|
|
8848
|
+
setisApiFetching = _useState14[1];
|
|
8849
|
+
var _useState15 = React.useState({
|
|
8850
|
+
value: '',
|
|
8851
|
+
label: 'Select approver'
|
|
8852
|
+
}),
|
|
8853
|
+
approverRole = _useState15[0],
|
|
8854
|
+
setApproverRole = _useState15[1];
|
|
8855
|
+
var _useState16 = React.useState(false),
|
|
8856
|
+
showInviteModal = _useState16[0],
|
|
8857
|
+
setToggleInviteModal = _useState16[1];
|
|
8858
|
+
var _useState17 = React.useState(''),
|
|
8859
|
+
userIds = _useState17[0],
|
|
8860
|
+
setUserIds = _useState17[1];
|
|
8861
|
+
var _React$useState9 = React__default.useState(false),
|
|
8862
|
+
overlayMenu = _React$useState9[0],
|
|
8863
|
+
setOverlayMenu = _React$useState9[1];
|
|
8864
|
+
var _useState18 = React.useState(''),
|
|
8865
|
+
userFirstName = _useState18[0],
|
|
8866
|
+
setUserFirstName = _useState18[1];
|
|
8867
|
+
var _useState19 = React.useState(''),
|
|
8868
|
+
userLastName = _useState19[0],
|
|
8869
|
+
setUserLastName = _useState19[1];
|
|
8870
|
+
var _useState20 = React.useState(true),
|
|
8871
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8872
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8678
8873
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8679
8874
|
var prevPos = _ref3.prevPos,
|
|
8680
8875
|
currPos = _ref3.currPos;
|
|
@@ -8695,47 +8890,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8695
8890
|
behavior: 'smooth'
|
|
8696
8891
|
});
|
|
8697
8892
|
};
|
|
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 =
|
|
8893
|
+
var _React$useState10 = React__default.useState(1),
|
|
8894
|
+
signup_page = _React$useState10[0],
|
|
8895
|
+
setSignUpPage = _React$useState10[1];
|
|
8896
|
+
var _useState21 = React.useState(5),
|
|
8897
|
+
signup_rowsPerPage = _useState21[0],
|
|
8898
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8899
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8900
|
+
signup_order = _React$useState11[0],
|
|
8901
|
+
setSignUpOrder = _React$useState11[1];
|
|
8902
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8903
|
+
signup_orderBy = _React$useState12[0],
|
|
8904
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8905
|
+
var _useState22 = React.useState(''),
|
|
8906
|
+
signup_searchValue = _useState22[0],
|
|
8907
|
+
set_signup_SearchValue = _useState22[1];
|
|
8908
|
+
var _useState23 = React.useState(false),
|
|
8909
|
+
isSignUpSortingChange = _useState23[0],
|
|
8910
|
+
setSignUpSortingChange = _useState23[1];
|
|
8911
|
+
var _useState24 = React.useState(false),
|
|
8912
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8913
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8914
|
+
var _useState25 = React.useState(false),
|
|
8915
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8916
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8917
|
+
var _useState26 = React.useState(false),
|
|
8918
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8919
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8725
8920
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8726
8921
|
return state.userList;
|
|
8727
8922
|
}),
|
|
8728
8923
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8924
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8925
|
+
history.push(config.routes.notification.path);
|
|
8926
|
+
};
|
|
8729
8927
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8730
8928
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8731
8929
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8732
8930
|
return false;
|
|
8733
8931
|
}
|
|
8734
|
-
|
|
8932
|
+
if (selectedUsersApprover.length) {
|
|
8933
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8934
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8935
|
+
var _selected = Object.values(selected).flat();
|
|
8936
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8937
|
+
return _selected.includes(item.id.toString());
|
|
8938
|
+
});
|
|
8939
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8940
|
+
return _selected.includes(item.id.toString());
|
|
8941
|
+
});
|
|
8942
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8943
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8944
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8945
|
+
} else {
|
|
8946
|
+
setOpenDeActivateModalFlag(true);
|
|
8947
|
+
}
|
|
8735
8948
|
};
|
|
8736
8949
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8737
8950
|
setOpenDeActivateModalFlag(false);
|
|
8738
8951
|
};
|
|
8952
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8953
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8954
|
+
};
|
|
8739
8955
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8740
8956
|
history.push(config.routes.users.add.path);
|
|
8741
8957
|
};
|
|
@@ -8749,28 +8965,31 @@ var UserList = function UserList(_ref2) {
|
|
|
8749
8965
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8750
8966
|
};
|
|
8751
8967
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8767
|
-
|
|
8768
|
-
|
|
8769
|
-
|
|
8968
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React__default.createElement(UndoButton, {
|
|
8969
|
+
onUndo: function onUndo() {
|
|
8970
|
+
return IUIToastMessageService$7.setUndoClicked(true);
|
|
8971
|
+
},
|
|
8972
|
+
msg: "Sign-up request rejected"
|
|
8973
|
+
}), function (res) {
|
|
8974
|
+
if (res === false) {
|
|
8975
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8976
|
+
if (res.status === true) {
|
|
8977
|
+
dispatch(showDataFetchingStatus());
|
|
8978
|
+
dispatch(fetchUserSignupRequests({
|
|
8979
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8980
|
+
length: signup_rowsPerPage,
|
|
8981
|
+
page: signup_page,
|
|
8982
|
+
search: signup_searchValue.trim(),
|
|
8983
|
+
pagename: 'company'
|
|
8984
|
+
})).then(function () {
|
|
8985
|
+
return dispatch(stopDataFetchingStatus());
|
|
8986
|
+
});
|
|
8987
|
+
}
|
|
8988
|
+
})["catch"](function (err) {
|
|
8989
|
+
console.log(err);
|
|
8770
8990
|
});
|
|
8771
8991
|
}
|
|
8772
|
-
|
|
8773
|
-
console.log(err);
|
|
8992
|
+
IUIToastMessageService$7.setUndoClicked(false);
|
|
8774
8993
|
});
|
|
8775
8994
|
};
|
|
8776
8995
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -8783,12 +9002,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8783
9002
|
};
|
|
8784
9003
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8785
9004
|
var _extends2;
|
|
8786
|
-
var
|
|
9005
|
+
var selectedId = [];
|
|
9006
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9007
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9008
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8787
9009
|
return n.is_active;
|
|
8788
|
-
}).map(function (obj) {
|
|
8789
|
-
return obj.id.toString();
|
|
8790
9010
|
});
|
|
8791
|
-
|
|
9011
|
+
_newSelecteds.map(function (obj) {
|
|
9012
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9013
|
+
if (obj.roles.is_approver === true) {
|
|
9014
|
+
_selectedUsersApprover.push(obj);
|
|
9015
|
+
} else if (obj.roles.is_approver === false) {
|
|
9016
|
+
_selectedUsersNotApprover.push(obj);
|
|
9017
|
+
}
|
|
9018
|
+
}
|
|
9019
|
+
selectedId.push(obj.id.toString());
|
|
9020
|
+
});
|
|
9021
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9022
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9023
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8792
9024
|
};
|
|
8793
9025
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8794
9026
|
var _extends3;
|
|
@@ -8806,58 +9038,156 @@ var UserList = function UserList(_ref2) {
|
|
|
8806
9038
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8807
9039
|
};
|
|
8808
9040
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9041
|
+
setPage(1);
|
|
8809
9042
|
setSearchValue(value);
|
|
8810
9043
|
setSearchingChange(true);
|
|
8811
9044
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8812
9045
|
};
|
|
8813
9046
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9047
|
+
setPage(1);
|
|
8814
9048
|
set_signup_SearchValue(value);
|
|
8815
9049
|
setSignUpSearchingChange(true);
|
|
8816
9050
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8817
9051
|
};
|
|
8818
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9052
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8819
9053
|
var _extends4;
|
|
8820
9054
|
var selectedTemp = _extends({}, selected);
|
|
8821
9055
|
if (!(page in selectedTemp)) {
|
|
8822
9056
|
selectedTemp[page] = [];
|
|
8823
9057
|
}
|
|
8824
9058
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8825
|
-
var
|
|
9059
|
+
var _newSelected = [];
|
|
8826
9060
|
if (selectedIndex === -1) {
|
|
8827
|
-
|
|
9061
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8828
9062
|
} else if (selectedIndex === 0) {
|
|
8829
|
-
|
|
9063
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8830
9064
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8831
|
-
|
|
9065
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8832
9066
|
} else if (selectedIndex > 0) {
|
|
8833
|
-
|
|
9067
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8834
9068
|
}
|
|
8835
|
-
|
|
9069
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9070
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9071
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9072
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9073
|
+
return id !== item.id.toString();
|
|
9074
|
+
});
|
|
9075
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9076
|
+
return item.id.toString() !== id;
|
|
9077
|
+
});
|
|
9078
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9079
|
+
if (data.roles.is_approver === true) {
|
|
9080
|
+
_SelectedUsersApprover.push(data);
|
|
9081
|
+
} else if (data.roles.is_approver === false) {
|
|
9082
|
+
_SelectedUsersNotApprover.push(data);
|
|
9083
|
+
}
|
|
9084
|
+
}
|
|
9085
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9086
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9087
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8836
9088
|
};
|
|
9089
|
+
React.useEffect(function () {
|
|
9090
|
+
setApproverRole({
|
|
9091
|
+
value: '',
|
|
9092
|
+
label: 'Select approver'
|
|
9093
|
+
});
|
|
9094
|
+
setDefaultId(null);
|
|
9095
|
+
setIsDisabledSubmitBtn(true);
|
|
9096
|
+
setApproveeStatus(false);
|
|
9097
|
+
if (deactivateSingle === true) {
|
|
9098
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9099
|
+
if (response.data["default"].id) {
|
|
9100
|
+
setDefaultId(response.data["default"].id);
|
|
9101
|
+
setApproverRole({
|
|
9102
|
+
value: '',
|
|
9103
|
+
label: response.data["default"].email
|
|
9104
|
+
});
|
|
9105
|
+
setIsDisabledSubmitBtn(false);
|
|
9106
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9107
|
+
}
|
|
9108
|
+
});
|
|
9109
|
+
}
|
|
9110
|
+
}, [deactivateSingle]);
|
|
8837
9111
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8838
9112
|
setRowsPerPage(+event.target.value);
|
|
8839
9113
|
setPage(1);
|
|
8840
9114
|
setSelected({});
|
|
9115
|
+
setSelectedUsersNotApprover([]);
|
|
9116
|
+
setSelectedUsersApprover([]);
|
|
8841
9117
|
setSortingChange(true);
|
|
8842
9118
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8843
9119
|
};
|
|
8844
9120
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8845
9121
|
var isActive = e.target.checked;
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
9122
|
+
var _isApprover;
|
|
9123
|
+
newSelecteds.map(function (item) {
|
|
9124
|
+
if (item.id === id) {
|
|
9125
|
+
_isApprover = item.roles.is_approver;
|
|
9126
|
+
if (_isApprover === true && isActive === false) {
|
|
9127
|
+
setDeactivateSingle(true);
|
|
9128
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9129
|
+
setUser(item);
|
|
9130
|
+
} else {
|
|
9131
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9132
|
+
if (!isActive) {
|
|
9133
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9134
|
+
var _extends5;
|
|
9135
|
+
var selectedTemp = _extends({}, selected);
|
|
9136
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9137
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9138
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9139
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9140
|
+
return item.id != id;
|
|
9141
|
+
});
|
|
9142
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9143
|
+
return item.id != id;
|
|
9144
|
+
});
|
|
9145
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9146
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9147
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9148
|
+
}
|
|
9149
|
+
}
|
|
9150
|
+
});
|
|
8853
9151
|
}
|
|
8854
9152
|
}
|
|
8855
9153
|
});
|
|
8856
9154
|
};
|
|
9155
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9156
|
+
var _value = _ref4._value;
|
|
9157
|
+
if (_value.data.approvee_status) {
|
|
9158
|
+
setApproveeStatus(true);
|
|
9159
|
+
} else {
|
|
9160
|
+
setApproveeStatus(false);
|
|
9161
|
+
}
|
|
9162
|
+
setDefaultId(_value.data.id);
|
|
9163
|
+
setApproverRole(_value);
|
|
9164
|
+
setIsDisabledSubmitBtn(false);
|
|
9165
|
+
};
|
|
9166
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9167
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9168
|
+
setOpenDeActivateModalFlag(false);
|
|
9169
|
+
setDeactivateSingle(false);
|
|
9170
|
+
setSelected({});
|
|
9171
|
+
setSelectedUsersNotApprover([]);
|
|
9172
|
+
setSelectedUsersApprover([]);
|
|
9173
|
+
};
|
|
8857
9174
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8858
9175
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8859
9176
|
setOpenDeActivateModalFlag(false);
|
|
8860
9177
|
setSelected({});
|
|
9178
|
+
setSelectedUsersNotApprover([]);
|
|
9179
|
+
setSelectedUsersApprover([]);
|
|
9180
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9181
|
+
};
|
|
9182
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9183
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9184
|
+
return item.id;
|
|
9185
|
+
});
|
|
9186
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9187
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9188
|
+
setSelected({});
|
|
9189
|
+
setSelectedUsersNotApprover([]);
|
|
9190
|
+
setSelectedUsersApprover([]);
|
|
8861
9191
|
};
|
|
8862
9192
|
var importUserHandler = function importUserHandler() {
|
|
8863
9193
|
setOpenImportUsersModal(true);
|
|
@@ -8874,13 +9204,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8874
9204
|
email: email
|
|
8875
9205
|
}));
|
|
8876
9206
|
};
|
|
8877
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
8881
|
-
|
|
9207
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9208
|
+
if (type === undefined) {
|
|
9209
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9210
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9211
|
+
return false;
|
|
9212
|
+
}
|
|
8882
9213
|
}
|
|
8883
9214
|
setUserIds(ids);
|
|
9215
|
+
setUserFirstName(firstName);
|
|
9216
|
+
setUserLastName(lastName);
|
|
9217
|
+
setToggleInviteModal(!showInviteModal);
|
|
9218
|
+
};
|
|
9219
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8884
9220
|
setToggleInviteModal(!showInviteModal);
|
|
8885
9221
|
};
|
|
8886
9222
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8953,6 +9289,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8953
9289
|
userId: userId
|
|
8954
9290
|
}));
|
|
8955
9291
|
};
|
|
9292
|
+
var knowMore = function knowMore() {
|
|
9293
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9294
|
+
};
|
|
8956
9295
|
var dispatch = reactRedux.useDispatch();
|
|
8957
9296
|
React.useEffect(function () {
|
|
8958
9297
|
if (isTokenVerified === true) {
|
|
@@ -9204,7 +9543,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9204
9543
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9205
9544
|
variant: "body2",
|
|
9206
9545
|
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
|
|
9546
|
+
}, "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", {
|
|
9547
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9548
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9549
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9208
9550
|
data: signupRequestListInfo,
|
|
9209
9551
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9210
9552
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9236,6 +9578,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9236
9578
|
}))
|
|
9237
9579
|
}]
|
|
9238
9580
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9581
|
+
isOpen: deactivateSingle,
|
|
9582
|
+
closeHandler: function closeHandler() {
|
|
9583
|
+
setDeactivateSingle(false);
|
|
9584
|
+
},
|
|
9585
|
+
cancelLabel: "Cancel",
|
|
9586
|
+
submitLabel: "Deactivate",
|
|
9587
|
+
submitHandler: handleDeactivateUser,
|
|
9588
|
+
headerText: "Deactivate this user?",
|
|
9589
|
+
width: "400px",
|
|
9590
|
+
subHanderText: "",
|
|
9591
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9592
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9593
|
+
modalClass: "deactivateSingleModal",
|
|
9594
|
+
modalBodyStyle: {
|
|
9595
|
+
overflowY: 'unset'
|
|
9596
|
+
}
|
|
9597
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9598
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9599
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9600
|
+
className: styles$5.deactivateAlert
|
|
9601
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9602
|
+
width: "9",
|
|
9603
|
+
height: "9"
|
|
9604
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9605
|
+
variant: "body2"
|
|
9606
|
+
}, /*#__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", {
|
|
9607
|
+
onClick: knowMore,
|
|
9608
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9609
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9610
|
+
className: "iui__mt-15"
|
|
9611
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9612
|
+
isMove: true,
|
|
9613
|
+
additional: {
|
|
9614
|
+
page: 1,
|
|
9615
|
+
product: 'travel',
|
|
9616
|
+
userId: user.id
|
|
9617
|
+
},
|
|
9618
|
+
label: "Transfer approver role to",
|
|
9619
|
+
value: approverRole,
|
|
9620
|
+
onValueChange: selectApprover,
|
|
9621
|
+
loadOption: transferRoleOptions,
|
|
9622
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9623
|
+
customLoadingText: "No results found"
|
|
9624
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9625
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9626
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9627
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9628
|
+
}, "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
9629
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9240
9630
|
closeHandler: closeDeActivateModal,
|
|
9241
9631
|
cancelLabel: "Cancel",
|
|
@@ -9262,8 +9652,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9262
9652
|
}, '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
9653
|
className: styles$5.description
|
|
9264
9654
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9655
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9656
|
+
closeHandler: closeDeActiveModal,
|
|
9657
|
+
cancelLabel: "Cancel",
|
|
9658
|
+
submitLabel: "Deactivate safe users",
|
|
9659
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9660
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9661
|
+
customButtonLabel: "Deactivate all users",
|
|
9662
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9663
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9664
|
+
width: "640px",
|
|
9665
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9666
|
+
headerText: "Deactivate users?",
|
|
9667
|
+
modalBodyStyle: {
|
|
9668
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9669
|
+
}
|
|
9670
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9671
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9672
|
+
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9673
|
+
color: "#9A6700",
|
|
9674
|
+
size: "14"
|
|
9675
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9676
|
+
variant: "body2"
|
|
9677
|
+
}, "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", {
|
|
9678
|
+
onClick: knowMore,
|
|
9679
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9680
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9681
|
+
className: "iui__my-15"
|
|
9682
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9683
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9684
|
+
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9685
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9686
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9687
|
+
var _item$data;
|
|
9688
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9689
|
+
key: index,
|
|
9690
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9691
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9692
|
+
firstName: item.first_name,
|
|
9693
|
+
lastName: item.last_name,
|
|
9694
|
+
isLetterAvatar: "true",
|
|
9695
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9696
|
+
secondaryText: item.email,
|
|
9697
|
+
letterAvatarTextColor: "black",
|
|
9698
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9699
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9700
|
+
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9701
|
+
color: "#9A6700",
|
|
9702
|
+
size: "14"
|
|
9703
|
+
}));
|
|
9704
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
9705
|
+
style: {
|
|
9706
|
+
borderColor: '#E5E9ED'
|
|
9707
|
+
}
|
|
9708
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9709
|
+
className: "iui__my-15"
|
|
9710
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9711
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9712
|
+
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9713
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9714
|
+
}, "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) {
|
|
9715
|
+
var _item$data2;
|
|
9716
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9717
|
+
key: index,
|
|
9718
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9719
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9720
|
+
firstName: item.first_name,
|
|
9721
|
+
lastName: item.last_name,
|
|
9722
|
+
isLetterAvatar: "true",
|
|
9723
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9724
|
+
secondaryText: item.email,
|
|
9725
|
+
letterAvatarTextColor: "black",
|
|
9726
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9727
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9728
|
+
}));
|
|
9729
|
+
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9265
9730
|
isOpen: showInviteModal,
|
|
9266
|
-
closeHandler:
|
|
9731
|
+
closeHandler: function closeHandler() {
|
|
9732
|
+
return toggleInviteModalClose();
|
|
9733
|
+
},
|
|
9267
9734
|
cancelLabel: "Cancel",
|
|
9268
9735
|
headerText: "Resend Invites?",
|
|
9269
9736
|
submitLabel: "Send",
|
|
@@ -9295,7 +9762,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9295
9762
|
fontSize: '14px',
|
|
9296
9763
|
color: '#374151'
|
|
9297
9764
|
}
|
|
9298
|
-
}, "This invitation will be sent to
|
|
9765
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9766
|
+
style: {
|
|
9767
|
+
fontSize: '14px',
|
|
9768
|
+
color: '#374151',
|
|
9769
|
+
fontWeight: 'bold'
|
|
9770
|
+
}
|
|
9771
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9299
9772
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9300
9773
|
closeImportUsersModal: closeImportUsersModal,
|
|
9301
9774
|
closeImportModal: closeImportModal
|
|
@@ -9304,8 +9777,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9304
9777
|
errMsg: hasVerificationError
|
|
9305
9778
|
}));
|
|
9306
9779
|
};
|
|
9307
|
-
var TabLabelCount = function TabLabelCount(
|
|
9308
|
-
var count =
|
|
9780
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9781
|
+
var count = _ref5.count;
|
|
9309
9782
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9310
9783
|
className: styles$5.TabLabelCount
|
|
9311
9784
|
}, " ", count, " ");
|
|
@@ -9380,11 +9853,12 @@ function Header(props) {
|
|
|
9380
9853
|
})));
|
|
9381
9854
|
}
|
|
9382
9855
|
|
|
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"};
|
|
9856
|
+
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
9857
|
|
|
9385
9858
|
function Listview(_ref) {
|
|
9386
9859
|
var data = _ref.data,
|
|
9387
9860
|
name = _ref.name,
|
|
9861
|
+
tableName = _ref.tableName,
|
|
9388
9862
|
handleEditDialog = _ref.handleEditDialog,
|
|
9389
9863
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9390
9864
|
orderBy = _ref.orderBy,
|
|
@@ -9397,16 +9871,82 @@ function Listview(_ref) {
|
|
|
9397
9871
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9398
9872
|
page = _ref.page,
|
|
9399
9873
|
rowsPerPage = _ref.rowsPerPage;
|
|
9874
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9875
|
+
var _data$dept_head_detai;
|
|
9876
|
+
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) {
|
|
9877
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9878
|
+
}
|
|
9879
|
+
};
|
|
9400
9880
|
var columns = [{
|
|
9401
9881
|
id: 'name',
|
|
9402
9882
|
label: name,
|
|
9403
|
-
width: '
|
|
9883
|
+
width: '40%',
|
|
9404
9884
|
sortable: true,
|
|
9405
9885
|
cell: function cell(row) {
|
|
9406
9886
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9407
9887
|
component: "div"
|
|
9408
9888
|
}, row.name);
|
|
9409
9889
|
}
|
|
9890
|
+
}, {
|
|
9891
|
+
id: 'no_of_users',
|
|
9892
|
+
label: 'Number of users',
|
|
9893
|
+
width: '40%',
|
|
9894
|
+
sortable: true,
|
|
9895
|
+
cell: function cell(row) {
|
|
9896
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9897
|
+
component: "div"
|
|
9898
|
+
}, row.no_of_users);
|
|
9899
|
+
}
|
|
9900
|
+
}, {
|
|
9901
|
+
id: 'actions',
|
|
9902
|
+
label: 'Actions',
|
|
9903
|
+
width: '20%',
|
|
9904
|
+
cell: function cell(row) {
|
|
9905
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9906
|
+
display: "flex"
|
|
9907
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9908
|
+
buttonText: "Edit",
|
|
9909
|
+
className: styles$7.buttonWidth,
|
|
9910
|
+
onClick: function onClick() {
|
|
9911
|
+
return handleEditDialog(row);
|
|
9912
|
+
}
|
|
9913
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9914
|
+
buttonText: "Delete",
|
|
9915
|
+
className: styles$7.buttonWidth,
|
|
9916
|
+
onClick: function onClick() {
|
|
9917
|
+
return handleDeleteDialog(row, true);
|
|
9918
|
+
}
|
|
9919
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9920
|
+
buttonText: "Delete",
|
|
9921
|
+
className: styles$7.buttonWidth,
|
|
9922
|
+
onClick: function onClick() {
|
|
9923
|
+
return handleDeleteDialog(row, false);
|
|
9924
|
+
}
|
|
9925
|
+
}));
|
|
9926
|
+
}
|
|
9927
|
+
}];
|
|
9928
|
+
var departmentColumns = [{
|
|
9929
|
+
id: 'name',
|
|
9930
|
+
label: name,
|
|
9931
|
+
width: '30%',
|
|
9932
|
+
sortable: true,
|
|
9933
|
+
cell: function cell(row) {
|
|
9934
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9935
|
+
component: "div"
|
|
9936
|
+
}, row.name);
|
|
9937
|
+
}
|
|
9938
|
+
}, {
|
|
9939
|
+
id: 'department_head',
|
|
9940
|
+
label: 'Department head',
|
|
9941
|
+
width: '30%',
|
|
9942
|
+
sortable: true,
|
|
9943
|
+
cell: function cell(row) {
|
|
9944
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9945
|
+
component: "div"
|
|
9946
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9947
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9948
|
+
}, "Assigned by default"));
|
|
9949
|
+
}
|
|
9410
9950
|
}, {
|
|
9411
9951
|
id: 'no_of_users',
|
|
9412
9952
|
label: 'Number of users',
|
|
@@ -9420,7 +9960,7 @@ function Listview(_ref) {
|
|
|
9420
9960
|
}, {
|
|
9421
9961
|
id: 'actions',
|
|
9422
9962
|
label: 'Actions',
|
|
9423
|
-
width: '
|
|
9963
|
+
width: '15%',
|
|
9424
9964
|
cell: function cell(row) {
|
|
9425
9965
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9426
9966
|
display: "flex"
|
|
@@ -9453,7 +9993,7 @@ function Listview(_ref) {
|
|
|
9453
9993
|
hasFilter: true,
|
|
9454
9994
|
isCheckboxTable: false,
|
|
9455
9995
|
count: data.count,
|
|
9456
|
-
columns: columns,
|
|
9996
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9457
9997
|
rows: data.results,
|
|
9458
9998
|
page: page,
|
|
9459
9999
|
handleChangePage: handleChangePage,
|
|
@@ -9510,15 +10050,44 @@ function EditPanelDialog(_ref) {
|
|
|
9510
10050
|
var isOpen = _ref.isOpen,
|
|
9511
10051
|
closeHandler = _ref.closeHandler,
|
|
9512
10052
|
onValueChange = _ref.onValueChange,
|
|
9513
|
-
|
|
10053
|
+
_submitHandler = _ref.submitHandler,
|
|
9514
10054
|
isError = _ref.isError,
|
|
9515
10055
|
name = _ref.name,
|
|
9516
10056
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9517
|
-
validation = _ref.validation
|
|
10057
|
+
validation = _ref.validation,
|
|
10058
|
+
rowData = _ref.rowData,
|
|
10059
|
+
tableName = _ref.tableName,
|
|
10060
|
+
config = _ref.config;
|
|
9518
10061
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9519
10062
|
return state.userPanel;
|
|
9520
10063
|
}),
|
|
9521
10064
|
dialogData = _useSelector.dialogData;
|
|
10065
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10066
|
+
var _data$dept_head_detai;
|
|
10067
|
+
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) {
|
|
10068
|
+
setHead({
|
|
10069
|
+
value: data.dept_head_details[0].id,
|
|
10070
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10071
|
+
});
|
|
10072
|
+
}
|
|
10073
|
+
};
|
|
10074
|
+
var _useState = React.useState({
|
|
10075
|
+
value: '',
|
|
10076
|
+
label: 'Select'
|
|
10077
|
+
}),
|
|
10078
|
+
head = _useState[0],
|
|
10079
|
+
setHead = _useState[1];
|
|
10080
|
+
React.useEffect(function () {
|
|
10081
|
+
deptHeadDetails(rowData);
|
|
10082
|
+
}, [rowData]);
|
|
10083
|
+
var history = reactRouterDom.useHistory();
|
|
10084
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10085
|
+
console.log(rowData);
|
|
10086
|
+
history.push({
|
|
10087
|
+
pathname: config.routes.users.add.path,
|
|
10088
|
+
state: rowData
|
|
10089
|
+
});
|
|
10090
|
+
};
|
|
9522
10091
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9523
10092
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9524
10093
|
isOpen: isOpen,
|
|
@@ -9526,25 +10095,59 @@ function EditPanelDialog(_ref) {
|
|
|
9526
10095
|
headerText: "Edit " + name.toLowerCase(),
|
|
9527
10096
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9528
10097
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9529
|
-
submitHandler: submitHandler
|
|
9530
|
-
|
|
10098
|
+
submitHandler: function submitHandler() {
|
|
10099
|
+
return _submitHandler(head);
|
|
10100
|
+
},
|
|
10101
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9531
10102
|
hideCloseIcon: false,
|
|
9532
10103
|
modalBodyStyle: {
|
|
9533
|
-
|
|
9534
|
-
overflow: 'auto',
|
|
9535
|
-
margin: '0px'
|
|
10104
|
+
overflowY: 'visible'
|
|
9536
10105
|
},
|
|
9537
10106
|
footerStyle: {
|
|
9538
10107
|
justifyContent: 'end'
|
|
9539
10108
|
}
|
|
10109
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10110
|
+
display: "flex",
|
|
10111
|
+
justifyContent: "center",
|
|
10112
|
+
alignItems: "center",
|
|
10113
|
+
flexDirection: "column",
|
|
10114
|
+
style: {
|
|
10115
|
+
marginBottom: '30px'
|
|
10116
|
+
}
|
|
9540
10117
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9541
|
-
component: "div",
|
|
9542
10118
|
display: "flex",
|
|
9543
10119
|
justifyContent: "center",
|
|
9544
10120
|
alignItems: "center",
|
|
9545
10121
|
flexDirection: "column",
|
|
9546
|
-
|
|
9547
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10122
|
+
className: styles$7.baseAlert
|
|
10123
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10124
|
+
className: styles$7.alertDescContainer
|
|
10125
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10126
|
+
className: styles$7.iconLayout,
|
|
10127
|
+
style: {
|
|
10128
|
+
paddingTop: '4px'
|
|
10129
|
+
}
|
|
10130
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10131
|
+
color: "#CA8A04",
|
|
10132
|
+
width: "25",
|
|
10133
|
+
height: "20",
|
|
10134
|
+
className: styles$7.iconStyle
|
|
10135
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10136
|
+
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.",
|
|
10137
|
+
style: {
|
|
10138
|
+
fontWeight: 'normal'
|
|
10139
|
+
}
|
|
10140
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10141
|
+
buttonText: "Add user",
|
|
10142
|
+
type: "text",
|
|
10143
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10144
|
+
width: "9",
|
|
10145
|
+
height: "9",
|
|
10146
|
+
color: "#EC5D25"
|
|
10147
|
+
}),
|
|
10148
|
+
onClick: handleAddPageNavigation,
|
|
10149
|
+
className: styles$7.addUserButton
|
|
10150
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9548
10151
|
label: name + " name",
|
|
9549
10152
|
name: "name",
|
|
9550
10153
|
defaultValue: dialogData.data.name,
|
|
@@ -9553,7 +10156,49 @@ function EditPanelDialog(_ref) {
|
|
|
9553
10156
|
isError: isError,
|
|
9554
10157
|
validation: validation,
|
|
9555
10158
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9556
|
-
required: true
|
|
10159
|
+
required: true,
|
|
10160
|
+
style: tableName === 'department' && {
|
|
10161
|
+
width: '350px'
|
|
10162
|
+
}
|
|
10163
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10164
|
+
className: "iui__mt-15",
|
|
10165
|
+
style: {
|
|
10166
|
+
width: '100%'
|
|
10167
|
+
}
|
|
10168
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10169
|
+
label: "Department head",
|
|
10170
|
+
name: "name",
|
|
10171
|
+
defaultValue: head.label,
|
|
10172
|
+
placeholder: "",
|
|
10173
|
+
readOnly: true,
|
|
10174
|
+
style: {
|
|
10175
|
+
width: '350px'
|
|
10176
|
+
}
|
|
10177
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10178
|
+
className: "iui__mt-15",
|
|
10179
|
+
style: {
|
|
10180
|
+
width: '100%'
|
|
10181
|
+
}
|
|
10182
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10183
|
+
noResultsText: true,
|
|
10184
|
+
isMove: true,
|
|
10185
|
+
additional: {
|
|
10186
|
+
page: 1,
|
|
10187
|
+
departmentId: rowData.id
|
|
10188
|
+
},
|
|
10189
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10190
|
+
label: "Department head",
|
|
10191
|
+
value: head,
|
|
10192
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10193
|
+
var _value = _ref2._value;
|
|
10194
|
+
return setHead(_value);
|
|
10195
|
+
},
|
|
10196
|
+
loadOption: departmentHeadOptions,
|
|
10197
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10198
|
+
customLoadingText: "No users found in this department",
|
|
10199
|
+
customLoadingTextStyle: {
|
|
10200
|
+
color: '#374151'
|
|
10201
|
+
}
|
|
9557
10202
|
})));
|
|
9558
10203
|
}
|
|
9559
10204
|
|
|
@@ -9732,12 +10377,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9732
10377
|
var _useState13 = React.useState(false),
|
|
9733
10378
|
isSortingChangeTemp = _useState13[0],
|
|
9734
10379
|
setSortingChangeTemp = _useState13[1];
|
|
9735
|
-
var _useState14 = React.useState(
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
var _useState15 = React.useState(
|
|
9739
|
-
|
|
9740
|
-
|
|
10380
|
+
var _useState14 = React.useState([]),
|
|
10381
|
+
rowData = _useState14[0],
|
|
10382
|
+
setRowData = _useState14[1];
|
|
10383
|
+
var _useState15 = React.useState(1),
|
|
10384
|
+
page = _useState15[0],
|
|
10385
|
+
setPage = _useState15[1];
|
|
10386
|
+
var _useState16 = React.useState(5),
|
|
10387
|
+
rowsPerPage = _useState16[0],
|
|
10388
|
+
setRowsPerPage = _useState16[1];
|
|
9741
10389
|
var orderingParam = orderBy;
|
|
9742
10390
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9743
10391
|
return state.userPanel;
|
|
@@ -9755,12 +10403,20 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9755
10403
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
9756
10404
|
setDataList(validatedValue);
|
|
9757
10405
|
};
|
|
10406
|
+
var _useState17 = React.useState(70),
|
|
10407
|
+
maxLengthForModal = _useState17[0],
|
|
10408
|
+
setMaxLengthForModal = _useState17[1];
|
|
10409
|
+
React.useEffect(function () {
|
|
10410
|
+
if (title === 'Business unit') {
|
|
10411
|
+
setMaxLengthForModal(150);
|
|
10412
|
+
}
|
|
10413
|
+
}, []);
|
|
9758
10414
|
var validation = {
|
|
9759
10415
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
9760
10416
|
regexOnBlur: null,
|
|
9761
10417
|
maxLimit: '',
|
|
9762
10418
|
minLimit: '',
|
|
9763
|
-
maxLength:
|
|
10419
|
+
maxLength: maxLengthForModal,
|
|
9764
10420
|
minLength: 0
|
|
9765
10421
|
};
|
|
9766
10422
|
React.useEffect(function () {
|
|
@@ -9833,6 +10489,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9833
10489
|
submitLabel: 'Save'
|
|
9834
10490
|
}, '', data));
|
|
9835
10491
|
setDataList(data.name);
|
|
10492
|
+
setRowData(data);
|
|
9836
10493
|
setEditModal(true);
|
|
9837
10494
|
};
|
|
9838
10495
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9847,6 +10504,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9847
10504
|
var payload = {
|
|
9848
10505
|
names: [dataList]
|
|
9849
10506
|
};
|
|
10507
|
+
if (tableName === 'department') {
|
|
10508
|
+
payload = {
|
|
10509
|
+
name: dataList,
|
|
10510
|
+
department_head_id: null
|
|
10511
|
+
};
|
|
10512
|
+
}
|
|
9850
10513
|
var message = title + " added successfully.";
|
|
9851
10514
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9852
10515
|
} else {
|
|
@@ -9860,9 +10523,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9860
10523
|
var message = title + " deleted successfully.";
|
|
9861
10524
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9862
10525
|
};
|
|
9863
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10526
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10527
|
+
if (optionalParams === void 0) {
|
|
10528
|
+
optionalParams = null;
|
|
10529
|
+
}
|
|
9864
10530
|
dispatch(userPanelShowLoader());
|
|
9865
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10531
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9866
10532
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9867
10533
|
dispatch(userPanelStopLoader());
|
|
9868
10534
|
if (type === 'delete') {
|
|
@@ -9904,8 +10570,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9904
10570
|
name: dataList
|
|
9905
10571
|
}]
|
|
9906
10572
|
};
|
|
10573
|
+
if (tableName === 'department') {
|
|
10574
|
+
payload = {
|
|
10575
|
+
name: dataList,
|
|
10576
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10577
|
+
};
|
|
10578
|
+
}
|
|
9907
10579
|
var message = title + " updated successfully.";
|
|
9908
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10580
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9909
10581
|
setErrorEdit(false);
|
|
9910
10582
|
} else {
|
|
9911
10583
|
setErrorEdit(true);
|
|
@@ -10012,7 +10684,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10012
10684
|
submitHandler: handleEditPanel,
|
|
10013
10685
|
isError: errorEdit,
|
|
10014
10686
|
isDisabledSubmitBtn: loading,
|
|
10015
|
-
validation: validation
|
|
10687
|
+
validation: validation,
|
|
10688
|
+
rowData: rowData,
|
|
10689
|
+
tableName: tableName,
|
|
10690
|
+
config: config
|
|
10016
10691
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
10017
10692
|
config: config
|
|
10018
10693
|
}));
|