@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.modern.js
CHANGED
|
@@ -9,7 +9,7 @@ import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
10
10
|
import moment from 'moment';
|
|
11
11
|
import { composeWithDevTools } from 'redux-devtools-extension';
|
|
12
|
-
import { useHistory } from 'react-router-dom';
|
|
12
|
+
import { useHistory, useLocation } from 'react-router-dom';
|
|
13
13
|
import { withStyles, makeStyles } from '@material-ui/core/styles';
|
|
14
14
|
import Tooltip from '@material-ui/core/Tooltip';
|
|
15
15
|
import Switch from '@material-ui/core/Switch';
|
|
@@ -354,6 +354,9 @@ var userAddEditUrl = {
|
|
|
354
354
|
approversSearch: function approversSearch() {
|
|
355
355
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
356
356
|
},
|
|
357
|
+
transferAppover: function transferAppover() {
|
|
358
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
+
},
|
|
357
360
|
preSignedUrl: function preSignedUrl() {
|
|
358
361
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
359
362
|
},
|
|
@@ -450,6 +453,14 @@ var userPanelUrl = {
|
|
|
450
453
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
451
454
|
}
|
|
452
455
|
};
|
|
456
|
+
var departmentUrl = {
|
|
457
|
+
departmentUrl: function departmentUrl() {
|
|
458
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
459
|
+
},
|
|
460
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
462
|
+
}
|
|
463
|
+
};
|
|
453
464
|
|
|
454
465
|
var api = configs.api;
|
|
455
466
|
var NAoptionConfig = {
|
|
@@ -591,11 +602,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
591
602
|
return Promise.reject(e);
|
|
592
603
|
}
|
|
593
604
|
};
|
|
594
|
-
var
|
|
605
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
595
606
|
var page = _ref4.page,
|
|
596
607
|
product = _ref4.product,
|
|
597
|
-
userId = _ref4.userId
|
|
598
|
-
|
|
608
|
+
userId = _ref4.userId;
|
|
609
|
+
try {
|
|
610
|
+
return Promise.resolve(_catch(function () {
|
|
611
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
612
|
+
return res.data;
|
|
613
|
+
})).then(function (response) {
|
|
614
|
+
var mappedValue = response.results.map(function (item) {
|
|
615
|
+
return {
|
|
616
|
+
value: item.email,
|
|
617
|
+
label: item.email,
|
|
618
|
+
type: 'detailed',
|
|
619
|
+
data: item
|
|
620
|
+
};
|
|
621
|
+
});
|
|
622
|
+
return {
|
|
623
|
+
options: mappedValue,
|
|
624
|
+
hasMore: !!response.next,
|
|
625
|
+
additional: {
|
|
626
|
+
page: page + 1,
|
|
627
|
+
product: product,
|
|
628
|
+
userId: userId
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
});
|
|
632
|
+
}, function () {
|
|
633
|
+
return {
|
|
634
|
+
options: [],
|
|
635
|
+
hasMore: false,
|
|
636
|
+
additional: {
|
|
637
|
+
page: 1,
|
|
638
|
+
product: product,
|
|
639
|
+
userId: userId
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
}));
|
|
643
|
+
} catch (e) {
|
|
644
|
+
return Promise.reject(e);
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
648
|
+
var page = _ref5.page,
|
|
649
|
+
product = _ref5.product,
|
|
650
|
+
userId = _ref5.userId,
|
|
651
|
+
placeholder = _ref5.placeholder;
|
|
599
652
|
try {
|
|
600
653
|
return Promise.resolve(_catch(function () {
|
|
601
654
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -641,9 +694,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
641
694
|
return Promise.reject(e);
|
|
642
695
|
}
|
|
643
696
|
};
|
|
644
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
645
|
-
var page =
|
|
646
|
-
tabelName =
|
|
697
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
698
|
+
var page = _ref6.page,
|
|
699
|
+
tabelName = _ref6.tabelName;
|
|
647
700
|
try {
|
|
648
701
|
return Promise.resolve(_catch(function () {
|
|
649
702
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -678,6 +731,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
678
731
|
return Promise.reject(e);
|
|
679
732
|
}
|
|
680
733
|
};
|
|
734
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
735
|
+
var page = _ref7.page,
|
|
736
|
+
departmentId = _ref7.departmentId;
|
|
737
|
+
try {
|
|
738
|
+
return Promise.resolve(_catch(function () {
|
|
739
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
740
|
+
return res.data;
|
|
741
|
+
})).then(function (response) {
|
|
742
|
+
var mappedValue = response.results.map(function (item) {
|
|
743
|
+
return {
|
|
744
|
+
value: item.id,
|
|
745
|
+
label: item.first_name + ' ' + item.last_name,
|
|
746
|
+
type: 'detailed',
|
|
747
|
+
data: item
|
|
748
|
+
};
|
|
749
|
+
});
|
|
750
|
+
console.log(response.next);
|
|
751
|
+
return {
|
|
752
|
+
options: mappedValue,
|
|
753
|
+
hasMore: !!response.next,
|
|
754
|
+
additional: {
|
|
755
|
+
page: page + 1,
|
|
756
|
+
departmentId: departmentId
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
});
|
|
760
|
+
}, function () {
|
|
761
|
+
return {
|
|
762
|
+
options: [],
|
|
763
|
+
hasMore: false,
|
|
764
|
+
additional: {
|
|
765
|
+
page: 1,
|
|
766
|
+
departmentId: departmentId
|
|
767
|
+
}
|
|
768
|
+
};
|
|
769
|
+
}));
|
|
770
|
+
} catch (e) {
|
|
771
|
+
return Promise.reject(e);
|
|
772
|
+
}
|
|
773
|
+
};
|
|
681
774
|
|
|
682
775
|
var UserRole = function UserRole(_ref) {
|
|
683
776
|
var _ref$list = _ref.list,
|
|
@@ -1146,10 +1239,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1146
1239
|
payload: tabId
|
|
1147
1240
|
};
|
|
1148
1241
|
};
|
|
1149
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1242
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1243
|
+
if (roleTransfer === void 0) {
|
|
1244
|
+
roleTransfer = false;
|
|
1245
|
+
}
|
|
1246
|
+
var _payload = {
|
|
1247
|
+
role_transfer: roleTransfer
|
|
1248
|
+
};
|
|
1249
|
+
if (roleTransfer) {
|
|
1250
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1251
|
+
}
|
|
1150
1252
|
return function (dispatch) {
|
|
1151
1253
|
return new Promise(function (resolve, reject) {
|
|
1152
|
-
api$1.
|
|
1254
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1153
1255
|
dispatch(setUserActiveStatus({
|
|
1154
1256
|
is_active: activateVal !== 0,
|
|
1155
1257
|
id: id
|
|
@@ -1516,25 +1618,6 @@ var makePrimaryAdmin = function makePrimaryAdmin(payload) {
|
|
|
1516
1618
|
});
|
|
1517
1619
|
};
|
|
1518
1620
|
};
|
|
1519
|
-
var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
1520
|
-
return function (dispatch) {
|
|
1521
|
-
return new Promise(function (resolve, reject) {
|
|
1522
|
-
api$2.patch(userAddEditUrl.undoRejectUserVerification(userId)).then(function (res) {
|
|
1523
|
-
dispatch(fetchUserSignupRequests({
|
|
1524
|
-
ordering: 'asc',
|
|
1525
|
-
length: 5,
|
|
1526
|
-
page: 1,
|
|
1527
|
-
search: ''
|
|
1528
|
-
}));
|
|
1529
|
-
resolve();
|
|
1530
|
-
})["catch"](function (err) {
|
|
1531
|
-
var _err$response8, _err$response8$data;
|
|
1532
|
-
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.');
|
|
1533
|
-
reject(err);
|
|
1534
|
-
});
|
|
1535
|
-
});
|
|
1536
|
-
};
|
|
1537
|
-
};
|
|
1538
1621
|
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1539
1622
|
return function (dispatch) {
|
|
1540
1623
|
return new Promise(function (resolve, reject) {
|
|
@@ -1713,7 +1796,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1713
1796
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1714
1797
|
return function (dispatch) {
|
|
1715
1798
|
return new Promise(function (resolve, reject) {
|
|
1716
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1799
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1717
1800
|
resolve(res);
|
|
1718
1801
|
})["catch"](function (err) {
|
|
1719
1802
|
var _err$response17, _err$response17$data;
|
|
@@ -1749,6 +1832,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1749
1832
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1750
1833
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1751
1834
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1835
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1752
1836
|
|
|
1753
1837
|
var api$3 = configs.api;
|
|
1754
1838
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1798,14 +1882,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1798
1882
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1799
1883
|
return function (dispatch) {
|
|
1800
1884
|
return new Promise(function (resolve, reject) {
|
|
1801
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1885
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1802
1886
|
dispatch(getUserPanalData(getParam));
|
|
1803
1887
|
dispatch(closeDialog());
|
|
1804
1888
|
resolve(res);
|
|
1805
1889
|
})["catch"](function (err) {
|
|
1806
|
-
var _err$
|
|
1890
|
+
var _err$response3, _err$response3$data;
|
|
1807
1891
|
dispatch(userPanelStopLoader());
|
|
1808
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1892
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1809
1893
|
});
|
|
1810
1894
|
});
|
|
1811
1895
|
};
|
|
@@ -1819,25 +1903,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1819
1903
|
dispatch(userPanelStopLoader());
|
|
1820
1904
|
resolve();
|
|
1821
1905
|
})["catch"](function (err) {
|
|
1822
|
-
var _err$
|
|
1823
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1906
|
+
var _err$response4, _err$response4$data;
|
|
1907
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
1824
1908
|
dispatch(userPanelStopLoader());
|
|
1825
1909
|
});
|
|
1826
1910
|
});
|
|
1827
1911
|
};
|
|
1828
1912
|
};
|
|
1829
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1913
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1830
1914
|
return function (dispatch) {
|
|
1831
1915
|
return new Promise(function (resolve, reject) {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1916
|
+
if (tableName === 'department') {
|
|
1917
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1918
|
+
dispatch(getUserPanalData(getParam));
|
|
1919
|
+
dispatch(closeDialog());
|
|
1920
|
+
resolve();
|
|
1921
|
+
})["catch"](function (err) {
|
|
1922
|
+
var _err$response5, _err$response5$data;
|
|
1923
|
+
dispatch(userPanelStopLoader());
|
|
1924
|
+
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.');
|
|
1925
|
+
});
|
|
1926
|
+
} else {
|
|
1927
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1928
|
+
dispatch(getUserPanalData(getParam));
|
|
1929
|
+
dispatch(closeDialog());
|
|
1930
|
+
resolve();
|
|
1931
|
+
})["catch"](function (err) {
|
|
1932
|
+
var _err$response6, _err$response6$data;
|
|
1933
|
+
dispatch(userPanelStopLoader());
|
|
1934
|
+
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.');
|
|
1935
|
+
});
|
|
1936
|
+
}
|
|
1841
1937
|
});
|
|
1842
1938
|
};
|
|
1843
1939
|
};
|
|
@@ -1849,8 +1945,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1849
1945
|
dispatch(closeDialog());
|
|
1850
1946
|
resolve(res);
|
|
1851
1947
|
})["catch"](function (err) {
|
|
1852
|
-
var _err$
|
|
1853
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1948
|
+
var _err$response7, _err$response7$data;
|
|
1949
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1854
1950
|
});
|
|
1855
1951
|
});
|
|
1856
1952
|
};
|
|
@@ -2939,8 +3035,8 @@ var workInfo = [{
|
|
|
2939
3035
|
validation: {
|
|
2940
3036
|
regexOnChange: null,
|
|
2941
3037
|
regexOnBlur: [{
|
|
2942
|
-
regex: /^[(A-Z)(a-z)(0-9)
|
|
2943
|
-
message: "Only alphabets, numbers and
|
|
3038
|
+
regex: /^[(A-Z)(a-z)(0-9)\-_& ]*$/,
|
|
3039
|
+
message: "Only alphabets, numbers, - and _ & are allowed."
|
|
2944
3040
|
}],
|
|
2945
3041
|
maxLimit: '',
|
|
2946
3042
|
minLimit: '',
|
|
@@ -3028,8 +3124,8 @@ var workInfo = [{
|
|
|
3028
3124
|
validation: {
|
|
3029
3125
|
regexOnChange: null,
|
|
3030
3126
|
regexOnBlur: [{
|
|
3031
|
-
regex: /^[A-Za-z0-9
|
|
3032
|
-
message: "Only alphabets, numbers & special characters . & ' ( ) - , / are allowed."
|
|
3127
|
+
regex: /^[A-Za-z0-9 \-_.,&'()\/]*$/,
|
|
3128
|
+
message: "Only alphabets, numbers & special characters . & ' ( ) _ - , / are allowed."
|
|
3033
3129
|
}, {
|
|
3034
3130
|
regex: /^[a-zA-Z]/,
|
|
3035
3131
|
message: 'Designation should start with alphabets'
|
|
@@ -3040,31 +3136,6 @@ var workInfo = [{
|
|
|
3040
3136
|
minLength: 0
|
|
3041
3137
|
},
|
|
3042
3138
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3043
|
-
}, {
|
|
3044
|
-
id: 7,
|
|
3045
|
-
label: 'Manager',
|
|
3046
|
-
name: 'manager',
|
|
3047
|
-
required: false,
|
|
3048
|
-
type: 'async_select',
|
|
3049
|
-
fullWidth: false,
|
|
3050
|
-
visibility: true,
|
|
3051
|
-
readOnly: false,
|
|
3052
|
-
placeholder: 'Select manager',
|
|
3053
|
-
tabelName: 'manager',
|
|
3054
|
-
product: 'travel',
|
|
3055
|
-
loadOption: approversOptions
|
|
3056
|
-
}, {
|
|
3057
|
-
id: 8,
|
|
3058
|
-
label: 'Skip manager',
|
|
3059
|
-
name: 'skip_manager',
|
|
3060
|
-
required: false,
|
|
3061
|
-
type: 'async_select',
|
|
3062
|
-
fullWidth: false,
|
|
3063
|
-
visibility: true,
|
|
3064
|
-
readOnly: false,
|
|
3065
|
-
placeholder: 'Select manager',
|
|
3066
|
-
product: 'travel',
|
|
3067
|
-
loadOption: approversOptions
|
|
3068
3139
|
}, {
|
|
3069
3140
|
id: 9,
|
|
3070
3141
|
label: 'Base location',
|
|
@@ -3975,6 +4046,7 @@ var initialState$2 = {
|
|
|
3975
4046
|
previous: null,
|
|
3976
4047
|
results: []
|
|
3977
4048
|
},
|
|
4049
|
+
deptUsers: [],
|
|
3978
4050
|
loading: false
|
|
3979
4051
|
};
|
|
3980
4052
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4044,6 +4116,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4044
4116
|
loading: false
|
|
4045
4117
|
});
|
|
4046
4118
|
}
|
|
4119
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4120
|
+
{
|
|
4121
|
+
return _extends({}, state, {
|
|
4122
|
+
deptUsers: action.payload
|
|
4123
|
+
});
|
|
4124
|
+
}
|
|
4047
4125
|
default:
|
|
4048
4126
|
return state;
|
|
4049
4127
|
}
|
|
@@ -4822,6 +4900,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4822
4900
|
isILadmin = _useSelector2.isILadmin,
|
|
4823
4901
|
companyName = _useSelector2.companyName;
|
|
4824
4902
|
var history = useHistory();
|
|
4903
|
+
var location = useLocation();
|
|
4825
4904
|
var _useState = useState({
|
|
4826
4905
|
travel: false,
|
|
4827
4906
|
expense: false
|
|
@@ -4890,11 +4969,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4890
4969
|
},
|
|
4891
4970
|
designation: '',
|
|
4892
4971
|
base_location: '',
|
|
4893
|
-
|
|
4972
|
+
manager_id: {
|
|
4894
4973
|
value: '',
|
|
4895
4974
|
label: 'Select Manager'
|
|
4896
4975
|
},
|
|
4897
|
-
|
|
4976
|
+
skip_manager_id: {
|
|
4898
4977
|
value: '',
|
|
4899
4978
|
label: 'Select Manager'
|
|
4900
4979
|
},
|
|
@@ -4911,8 +4990,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4911
4990
|
business_unit: 0,
|
|
4912
4991
|
department: 0,
|
|
4913
4992
|
currency: 0,
|
|
4914
|
-
|
|
4915
|
-
|
|
4993
|
+
manager_id: 0,
|
|
4994
|
+
skip_manager_id: 0
|
|
4916
4995
|
}),
|
|
4917
4996
|
cacheForAsyncDropdown = _useState4[0],
|
|
4918
4997
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5066,6 +5145,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5066
5145
|
var _useState25 = useState([]),
|
|
5067
5146
|
uploadedFiles = _useState25[0],
|
|
5068
5147
|
setUploadedFiles = _useState25[1];
|
|
5148
|
+
var _useState26 = useState(70),
|
|
5149
|
+
maxLengthForModal = _useState26[0],
|
|
5150
|
+
setMaxLengthForModal = _useState26[1];
|
|
5069
5151
|
var defaultAddModalData = {
|
|
5070
5152
|
isOpen: false,
|
|
5071
5153
|
isError: false,
|
|
@@ -5078,25 +5160,41 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5078
5160
|
regexOnBlur: null,
|
|
5079
5161
|
maxLimit: '',
|
|
5080
5162
|
minLimit: '',
|
|
5081
|
-
maxLength:
|
|
5163
|
+
maxLength: maxLengthForModal,
|
|
5082
5164
|
minLength: 0
|
|
5083
5165
|
};
|
|
5084
|
-
var
|
|
5085
|
-
addModalData =
|
|
5086
|
-
setAddModalData =
|
|
5166
|
+
var _useState27 = useState(defaultAddModalData),
|
|
5167
|
+
addModalData = _useState27[0],
|
|
5168
|
+
setAddModalData = _useState27[1];
|
|
5087
5169
|
var onAddModalClose = function onAddModalClose() {
|
|
5088
5170
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5089
5171
|
};
|
|
5172
|
+
useEffect(function () {
|
|
5173
|
+
var _location$state, _location$state2;
|
|
5174
|
+
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) {
|
|
5175
|
+
var _location$state3, _location$state4;
|
|
5176
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5177
|
+
department: {
|
|
5178
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5179
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5180
|
+
}
|
|
5181
|
+
}));
|
|
5182
|
+
}
|
|
5183
|
+
}, []);
|
|
5090
5184
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5091
5185
|
var title = '';
|
|
5092
5186
|
if (id === 'entity') {
|
|
5093
5187
|
title = 'Entity';
|
|
5188
|
+
setMaxLengthForModal(70);
|
|
5094
5189
|
} else if (id === 'department') {
|
|
5095
5190
|
title = 'Department';
|
|
5191
|
+
setMaxLengthForModal(70);
|
|
5096
5192
|
} else if (id === 'business_unit') {
|
|
5193
|
+
setMaxLengthForModal(150);
|
|
5097
5194
|
title = 'Business unit';
|
|
5098
5195
|
} else if (id === 'employee_level') {
|
|
5099
5196
|
title = 'Employee level';
|
|
5197
|
+
setMaxLengthForModal(70);
|
|
5100
5198
|
}
|
|
5101
5199
|
setAddModalData(_extends({}, addModalData, {
|
|
5102
5200
|
isOpen: true,
|
|
@@ -5112,24 +5210,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5112
5210
|
}));
|
|
5113
5211
|
} else {
|
|
5114
5212
|
dispatch(showLoader());
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5213
|
+
var dataObj;
|
|
5214
|
+
if (addModalData.id === 'department') {
|
|
5215
|
+
dataObj = {
|
|
5216
|
+
name: validatedValue,
|
|
5217
|
+
department_head_id: null
|
|
5218
|
+
};
|
|
5219
|
+
} else {
|
|
5220
|
+
dataObj = {
|
|
5221
|
+
names: [validatedValue]
|
|
5222
|
+
};
|
|
5223
|
+
}
|
|
5224
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5225
|
+
var _extends4;
|
|
5119
5226
|
setAddModalData(_extends({}, addModalData, {
|
|
5120
5227
|
isOpen: false
|
|
5121
5228
|
}));
|
|
5122
5229
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5123
5230
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5231
|
+
if (addModalData.id === 'department') {
|
|
5232
|
+
var _extends2;
|
|
5233
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5234
|
+
value: res.data.result.id,
|
|
5235
|
+
label: res.data.result.name
|
|
5236
|
+
}, _extends2)));
|
|
5237
|
+
} else {
|
|
5238
|
+
var _extends3;
|
|
5239
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5240
|
+
value: res.data.value,
|
|
5241
|
+
label: res.data.label
|
|
5242
|
+
}, _extends3)));
|
|
5243
|
+
}
|
|
5244
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5129
5245
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5130
5246
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5131
|
-
var
|
|
5132
|
-
return _extends({}, prevState, (
|
|
5247
|
+
var _extends5;
|
|
5248
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5133
5249
|
});
|
|
5134
5250
|
dispatch(stopLoader());
|
|
5135
5251
|
});
|
|
@@ -5148,8 +5264,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5148
5264
|
try {
|
|
5149
5265
|
var _temp5 = function _temp5() {
|
|
5150
5266
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5151
|
-
var
|
|
5152
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5267
|
+
var _extends6;
|
|
5268
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5153
5269
|
}
|
|
5154
5270
|
};
|
|
5155
5271
|
var _name = args._name,
|
|
@@ -5172,8 +5288,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5172
5288
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5173
5289
|
} else {
|
|
5174
5290
|
var _temp3 = function _temp3() {
|
|
5175
|
-
var
|
|
5176
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5291
|
+
var _extends7;
|
|
5292
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5177
5293
|
updateError(_name, _isError, _errorMsg);
|
|
5178
5294
|
};
|
|
5179
5295
|
var _temp2 = function () {
|
|
@@ -5221,16 +5337,17 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5221
5337
|
}
|
|
5222
5338
|
};
|
|
5223
5339
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5224
|
-
var
|
|
5340
|
+
var _extends8;
|
|
5225
5341
|
var _name = args._name,
|
|
5226
5342
|
_value = args._value,
|
|
5227
5343
|
_isError = args._isError,
|
|
5228
5344
|
_errorMsg = args._errorMsg;
|
|
5229
|
-
|
|
5345
|
+
console.log(_name, _value);
|
|
5346
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5230
5347
|
updateError(_name, _isError, _errorMsg);
|
|
5231
5348
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5232
|
-
var
|
|
5233
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5349
|
+
var _extends9;
|
|
5350
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5234
5351
|
}
|
|
5235
5352
|
};
|
|
5236
5353
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5240,9 +5357,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5240
5357
|
return tag.id;
|
|
5241
5358
|
};
|
|
5242
5359
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5243
|
-
var
|
|
5360
|
+
var _extends10;
|
|
5244
5361
|
var e = args._event;
|
|
5245
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5362
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5246
5363
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5247
5364
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5248
5365
|
userTagType: true
|
|
@@ -5250,22 +5367,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5250
5367
|
}
|
|
5251
5368
|
};
|
|
5252
5369
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5253
|
-
var
|
|
5370
|
+
var _extends11;
|
|
5254
5371
|
var _name = _ref2._name,
|
|
5255
5372
|
_value = _ref2._value;
|
|
5256
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5373
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5257
5374
|
};
|
|
5258
5375
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5259
|
-
var
|
|
5376
|
+
var _extends12;
|
|
5260
5377
|
var _name = _ref3._name,
|
|
5261
5378
|
_value = _ref3._value;
|
|
5262
|
-
|
|
5379
|
+
console.log(_name, _value, 'travel');
|
|
5380
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5263
5381
|
};
|
|
5264
5382
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5265
|
-
var
|
|
5383
|
+
var _extends13;
|
|
5266
5384
|
var _name = _ref4._name,
|
|
5267
5385
|
_value = _ref4._value;
|
|
5268
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5386
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5269
5387
|
};
|
|
5270
5388
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5271
5389
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5299,39 +5417,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5299
5417
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5300
5418
|
};
|
|
5301
5419
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5302
|
-
var
|
|
5420
|
+
var _extends14;
|
|
5303
5421
|
var _name = args._name,
|
|
5304
5422
|
_value = args._value,
|
|
5305
5423
|
_isError = args._isError,
|
|
5306
5424
|
_errorMsg = args._errorMsg;
|
|
5307
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5425
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5308
5426
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5309
|
-
var
|
|
5310
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5427
|
+
var _extends15;
|
|
5428
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5311
5429
|
}
|
|
5312
5430
|
updateError(_name, _isError, _errorMsg);
|
|
5313
5431
|
};
|
|
5314
5432
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5315
|
-
var
|
|
5433
|
+
var _extends16;
|
|
5316
5434
|
var _name = args._name,
|
|
5317
5435
|
_value = args._value,
|
|
5318
5436
|
_isError = args._isError,
|
|
5319
5437
|
_errorMsg = args._errorMsg;
|
|
5320
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5438
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5321
5439
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5322
|
-
var
|
|
5323
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5440
|
+
var _extends17;
|
|
5441
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5324
5442
|
}
|
|
5325
5443
|
updateError(_name, _isError, _errorMsg);
|
|
5326
5444
|
};
|
|
5327
5445
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5328
5446
|
try {
|
|
5329
5447
|
var _temp8 = function _temp8() {
|
|
5330
|
-
var
|
|
5331
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5448
|
+
var _extends18;
|
|
5449
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5332
5450
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5333
|
-
var
|
|
5334
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5451
|
+
var _extends19;
|
|
5452
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5335
5453
|
}
|
|
5336
5454
|
updateError(_name, _isError, _errorMsg);
|
|
5337
5455
|
};
|
|
@@ -5437,8 +5555,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5437
5555
|
return _errorArray;
|
|
5438
5556
|
});
|
|
5439
5557
|
setErrorMsgs(function (prevState) {
|
|
5440
|
-
var
|
|
5441
|
-
return _extends({}, prevState, (
|
|
5558
|
+
var _extends20;
|
|
5559
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5442
5560
|
});
|
|
5443
5561
|
};
|
|
5444
5562
|
var dispatch = useDispatch();
|
|
@@ -5512,14 +5630,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5512
5630
|
value: '',
|
|
5513
5631
|
label: 'Select employee level'
|
|
5514
5632
|
},
|
|
5515
|
-
|
|
5633
|
+
manager_id: res.employee_info.manager ? {
|
|
5516
5634
|
value: res.employee_info.manager,
|
|
5517
5635
|
label: res.employee_info.manager
|
|
5518
5636
|
} : {
|
|
5519
5637
|
value: '',
|
|
5520
5638
|
label: 'Select Manager'
|
|
5521
5639
|
},
|
|
5522
|
-
|
|
5640
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5523
5641
|
value: res.employee_info.skip_manager,
|
|
5524
5642
|
label: res.employee_info.skip_manager
|
|
5525
5643
|
} : {
|
|
@@ -5791,13 +5909,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5791
5909
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5792
5910
|
return Promise.resolve();
|
|
5793
5911
|
}
|
|
5794
|
-
|
|
5912
|
+
console.log(employeeInfoInput, 'data');
|
|
5913
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5795
5914
|
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5796
|
-
delete employeeInfoInput.manager;
|
|
5797
5915
|
}
|
|
5798
|
-
if (employeeInfoInput.
|
|
5916
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5799
5917
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5800
|
-
delete employeeInfoInput.skip_manager;
|
|
5801
5918
|
}
|
|
5802
5919
|
var payload = {
|
|
5803
5920
|
personalInfoInput: personalInfoInput,
|
|
@@ -5856,8 +5973,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5856
5973
|
}
|
|
5857
5974
|
}
|
|
5858
5975
|
for (var _key in employeeInfo) {
|
|
5976
|
+
console.log('key', _key);
|
|
5859
5977
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5860
|
-
|
|
5978
|
+
var _employeeInfoInput$_k;
|
|
5979
|
+
console.log('employeeInfo0000', (_employeeInfoInput$_k = employeeInfoInput[_key]) === null || _employeeInfoInput$_k === void 0 ? void 0 : _employeeInfoInput$_k.value, 'sajkdhjasj');
|
|
5980
|
+
if (employeeInfo[_key] === false && employeeInfoInput[_key] !== undefined && (typeof employeeInfoInput[_key] === 'string' && !employeeInfoInput[_key] || typeof employeeInfoInput[_key] === 'object' && !employeeInfoInput[_key].value || !employeeInfoInput[_key].value) === '' && fieldsVisibility.employee_info[_key] !== 2) {
|
|
5861
5981
|
_isError = true;
|
|
5862
5982
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5863
5983
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -5944,12 +6064,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5944
6064
|
setErrorArray(_errorArray);
|
|
5945
6065
|
setErrorMsgs(_errorMsgs);
|
|
5946
6066
|
var _loop = function _loop() {
|
|
5947
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
5948
|
-
if (_errorMsgs[
|
|
5949
|
-
if (
|
|
6067
|
+
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6068
|
+
if (_errorMsgs[_key3]) {
|
|
6069
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
5950
6070
|
setAdditionalInfoFlag('open');
|
|
5951
6071
|
}
|
|
5952
|
-
var el = document.getElementById(
|
|
6072
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
5953
6073
|
if (el) {
|
|
5954
6074
|
setTimeout(function () {
|
|
5955
6075
|
el.scrollIntoView({
|
|
@@ -5957,14 +6077,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5957
6077
|
block: 'center'
|
|
5958
6078
|
});
|
|
5959
6079
|
}, 500);
|
|
5960
|
-
return
|
|
6080
|
+
return 1;
|
|
5961
6081
|
}
|
|
5962
6082
|
}
|
|
5963
6083
|
}
|
|
5964
6084
|
};
|
|
5965
6085
|
for (var _key3 in _errorMsgs) {
|
|
5966
|
-
|
|
5967
|
-
if (_ret === "break") break;
|
|
6086
|
+
if (_loop()) break;
|
|
5968
6087
|
}
|
|
5969
6088
|
}
|
|
5970
6089
|
if (!_isError) {
|
|
@@ -5995,12 +6114,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5995
6114
|
setErrorArray(Object.keys(err));
|
|
5996
6115
|
setErrorMsgs(err);
|
|
5997
6116
|
var _loop2 = function _loop2() {
|
|
5998
|
-
if (Object.hasOwnProperty.call(err,
|
|
5999
|
-
if (err[
|
|
6000
|
-
if (
|
|
6117
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6118
|
+
if (err[_key4]) {
|
|
6119
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6001
6120
|
setAdditionalInfoFlag('open');
|
|
6002
6121
|
}
|
|
6003
|
-
var el = document.getElementById(
|
|
6122
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6004
6123
|
if (el) {
|
|
6005
6124
|
setTimeout(function () {
|
|
6006
6125
|
el.scrollIntoView({
|
|
@@ -6008,14 +6127,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6008
6127
|
block: 'center'
|
|
6009
6128
|
});
|
|
6010
6129
|
}, 500);
|
|
6011
|
-
return
|
|
6130
|
+
return 1;
|
|
6012
6131
|
}
|
|
6013
6132
|
}
|
|
6014
6133
|
}
|
|
6015
6134
|
};
|
|
6016
6135
|
for (var _key4 in err) {
|
|
6017
|
-
|
|
6018
|
-
if (_ret2 === "break") break;
|
|
6136
|
+
if (_loop2()) break;
|
|
6019
6137
|
}
|
|
6020
6138
|
} else if (typeof err === 'string') {
|
|
6021
6139
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6045,12 +6163,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6045
6163
|
setErrorArray(Object.keys(err));
|
|
6046
6164
|
setErrorMsgs(err);
|
|
6047
6165
|
var _loop3 = function _loop3() {
|
|
6048
|
-
if (Object.hasOwnProperty.call(err,
|
|
6049
|
-
if (err[
|
|
6050
|
-
if (
|
|
6166
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6167
|
+
if (err[_key5]) {
|
|
6168
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6051
6169
|
setAdditionalInfoFlag('open');
|
|
6052
6170
|
}
|
|
6053
|
-
var el = document.getElementById(
|
|
6171
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6054
6172
|
if (el) {
|
|
6055
6173
|
setTimeout(function () {
|
|
6056
6174
|
el.scrollIntoView({
|
|
@@ -6058,14 +6176,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6058
6176
|
block: 'center'
|
|
6059
6177
|
});
|
|
6060
6178
|
}, 500);
|
|
6061
|
-
return
|
|
6179
|
+
return 1;
|
|
6062
6180
|
}
|
|
6063
6181
|
}
|
|
6064
6182
|
}
|
|
6065
6183
|
};
|
|
6066
6184
|
for (var _key5 in err) {
|
|
6067
|
-
|
|
6068
|
-
if (_ret3 === "break") break;
|
|
6185
|
+
if (_loop3()) break;
|
|
6069
6186
|
}
|
|
6070
6187
|
} else if (typeof err === 'string') {
|
|
6071
6188
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6790,7 +6907,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6790
6907
|
};
|
|
6791
6908
|
};
|
|
6792
6909
|
|
|
6793
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6910
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltipTextDiv":"_1l4V-","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","deactivateAlert":"_3hvWz","warningSvg":"_2H6Bq","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn","deactivateSubmitBtn":"_1qxY-","deactivateCustomButtonClass":"_2YBWE"};
|
|
6794
6911
|
|
|
6795
6912
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6796
6913
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8276,9 +8393,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8276
8393
|
cell: function cell(row) {
|
|
8277
8394
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8278
8395
|
component: "div",
|
|
8279
|
-
width:
|
|
8396
|
+
width: 80
|
|
8280
8397
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8281
|
-
title: "This user hasn't logged
|
|
8398
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8282
8399
|
arrow: true,
|
|
8283
8400
|
classes: {
|
|
8284
8401
|
arrow: classes.arrow,
|
|
@@ -8286,7 +8403,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8286
8403
|
},
|
|
8287
8404
|
placement: "top-start"
|
|
8288
8405
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8289
|
-
className: clsx(styles$5.
|
|
8406
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8290
8407
|
}, "Invited")) : null);
|
|
8291
8408
|
}
|
|
8292
8409
|
}, {
|
|
@@ -8387,7 +8504,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8387
8504
|
options.push({
|
|
8388
8505
|
label: 'Resend invite',
|
|
8389
8506
|
handler: function handler() {
|
|
8390
|
-
return toggleInviteModal(row.id, 'single');
|
|
8507
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8391
8508
|
}
|
|
8392
8509
|
});
|
|
8393
8510
|
}
|
|
@@ -8414,6 +8531,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8414
8531
|
endIcon: null,
|
|
8415
8532
|
outlinedBtn: false,
|
|
8416
8533
|
className: "threedotMenuBtn",
|
|
8534
|
+
MoreHorizIcon: true,
|
|
8417
8535
|
placement: "bottom-end"
|
|
8418
8536
|
}));
|
|
8419
8537
|
},
|
|
@@ -8559,6 +8677,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8559
8677
|
});
|
|
8560
8678
|
};
|
|
8561
8679
|
|
|
8680
|
+
function InfoYellowIcon(props) {
|
|
8681
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8682
|
+
width: props.width,
|
|
8683
|
+
height: props.height,
|
|
8684
|
+
viewBox: "0 0 20 20",
|
|
8685
|
+
fill: "none",
|
|
8686
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8687
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8688
|
+
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",
|
|
8689
|
+
fill: "#CA8A04"
|
|
8690
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8691
|
+
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",
|
|
8692
|
+
fill: "#CA8A04"
|
|
8693
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8694
|
+
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",
|
|
8695
|
+
fill: "#CA8A04"
|
|
8696
|
+
}));
|
|
8697
|
+
}
|
|
8698
|
+
|
|
8699
|
+
function RedWarningIcon(props) {
|
|
8700
|
+
var _props$color = props.color,
|
|
8701
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8702
|
+
_props$size = props.size,
|
|
8703
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8704
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8705
|
+
width: size,
|
|
8706
|
+
height: size,
|
|
8707
|
+
viewBox: "0 0 14 14",
|
|
8708
|
+
fill: color,
|
|
8709
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8710
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8711
|
+
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",
|
|
8712
|
+
fill: color
|
|
8713
|
+
}));
|
|
8714
|
+
}
|
|
8715
|
+
|
|
8562
8716
|
function InviteInfoIcon() {
|
|
8563
8717
|
return /*#__PURE__*/React.createElement("svg", {
|
|
8564
8718
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8576,7 +8730,8 @@ function InviteInfoIcon() {
|
|
|
8576
8730
|
}
|
|
8577
8731
|
|
|
8578
8732
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8579
|
-
var env$7 = configs.env
|
|
8733
|
+
var env$7 = configs.env,
|
|
8734
|
+
api$7 = configs.api;
|
|
8580
8735
|
var UndoButton = function UndoButton(_ref) {
|
|
8581
8736
|
var onUndo = _ref.onUndo,
|
|
8582
8737
|
msg = _ref.msg;
|
|
@@ -8614,27 +8769,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8614
8769
|
isDataFetching = _useSelector.isDataFetching,
|
|
8615
8770
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8616
8771
|
tabValue = _useSelector.tabValue;
|
|
8617
|
-
var
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
searchValue = _useState2[0],
|
|
8634
|
-
setSearchValue = _useState2[1];
|
|
8772
|
+
var newSelecteds = userListInfo.results;
|
|
8773
|
+
var _React$useState = React.useState(''),
|
|
8774
|
+
deactivateUser = _React$useState[0],
|
|
8775
|
+
setDeactivateUser = _React$useState[1];
|
|
8776
|
+
var _React$useState2 = React.useState(null),
|
|
8777
|
+
defaultId = _React$useState2[0],
|
|
8778
|
+
setDefaultId = _React$useState2[1];
|
|
8779
|
+
var _React$useState3 = React.useState(1),
|
|
8780
|
+
page = _React$useState3[0],
|
|
8781
|
+
setPage = _React$useState3[1];
|
|
8782
|
+
var _useState = useState([]),
|
|
8783
|
+
selectedUsersNotApprover = _useState[0],
|
|
8784
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8785
|
+
var _useState2 = useState([]),
|
|
8786
|
+
selectedUsersApprover = _useState2[0],
|
|
8787
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8635
8788
|
var _useState3 = useState(false),
|
|
8636
|
-
|
|
8637
|
-
|
|
8789
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8790
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8791
|
+
var _React$useState4 = React.useState(''),
|
|
8792
|
+
user = _React$useState4[0],
|
|
8793
|
+
setUser = _React$useState4[1];
|
|
8794
|
+
var _useState4 = useState(10),
|
|
8795
|
+
rowsPerPage = _useState4[0],
|
|
8796
|
+
setRowsPerPage = _useState4[1];
|
|
8797
|
+
var _React$useState5 = React.useState({}),
|
|
8798
|
+
selected = _React$useState5[0],
|
|
8799
|
+
setSelected = _React$useState5[1];
|
|
8800
|
+
var _React$useState6 = React.useState('asc'),
|
|
8801
|
+
order = _React$useState6[0],
|
|
8802
|
+
setOrder = _React$useState6[1];
|
|
8803
|
+
var _React$useState7 = React.useState(false),
|
|
8804
|
+
deactivateSingle = _React$useState7[0],
|
|
8805
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8806
|
+
var _React$useState8 = React.useState('first_name'),
|
|
8807
|
+
orderBy = _React$useState8[0],
|
|
8808
|
+
setOrderBy = _React$useState8[1];
|
|
8809
|
+
var _useState5 = useState(''),
|
|
8810
|
+
searchValue = _useState5[0],
|
|
8811
|
+
setSearchValue = _useState5[1];
|
|
8812
|
+
var _useState6 = useState(false),
|
|
8813
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8814
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8638
8815
|
var _useSelector2 = useSelector(function (state) {
|
|
8639
8816
|
return state.common;
|
|
8640
8817
|
}),
|
|
@@ -8642,36 +8819,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8642
8819
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8643
8820
|
isILadmin = _useSelector2.isILadmin,
|
|
8644
8821
|
companyName = _useSelector2.companyName;
|
|
8645
|
-
var _useState4 = useState(false),
|
|
8646
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8647
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8648
|
-
var _useState5 = useState(false),
|
|
8649
|
-
isFileDownloading = _useState5[0],
|
|
8650
|
-
setDownlStatus = _useState5[1];
|
|
8651
|
-
var _useState6 = useState(false),
|
|
8652
|
-
isSortingChange = _useState6[0],
|
|
8653
|
-
setSortingChange = _useState6[1];
|
|
8654
8822
|
var _useState7 = useState(false),
|
|
8655
|
-
|
|
8656
|
-
|
|
8823
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8824
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8657
8825
|
var _useState8 = useState(false),
|
|
8658
|
-
|
|
8659
|
-
|
|
8826
|
+
approveeStatus = _useState8[0],
|
|
8827
|
+
setApproveeStatus = _useState8[1];
|
|
8660
8828
|
var _useState9 = useState(false),
|
|
8661
|
-
|
|
8662
|
-
|
|
8829
|
+
isFileDownloading = _useState9[0],
|
|
8830
|
+
setDownlStatus = _useState9[1];
|
|
8663
8831
|
var _useState10 = useState(false),
|
|
8664
|
-
|
|
8665
|
-
|
|
8832
|
+
isSortingChange = _useState10[0],
|
|
8833
|
+
setSortingChange = _useState10[1];
|
|
8666
8834
|
var _useState11 = useState(false),
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
var _useState12 = useState(
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
var
|
|
8673
|
-
|
|
8674
|
-
|
|
8835
|
+
isSearchingChange = _useState11[0],
|
|
8836
|
+
setSearchingChange = _useState11[1];
|
|
8837
|
+
var _useState12 = useState(false),
|
|
8838
|
+
isSortingChangeTemp = _useState12[0],
|
|
8839
|
+
setSortingChangeTemp = _useState12[1];
|
|
8840
|
+
var _useState13 = useState(false),
|
|
8841
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8842
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8843
|
+
var _useState14 = useState(false),
|
|
8844
|
+
isApiFetching = _useState14[0],
|
|
8845
|
+
setisApiFetching = _useState14[1];
|
|
8846
|
+
var _useState15 = useState({
|
|
8847
|
+
value: '',
|
|
8848
|
+
label: 'Select approver'
|
|
8849
|
+
}),
|
|
8850
|
+
approverRole = _useState15[0],
|
|
8851
|
+
setApproverRole = _useState15[1];
|
|
8852
|
+
var _useState16 = useState(false),
|
|
8853
|
+
showInviteModal = _useState16[0],
|
|
8854
|
+
setToggleInviteModal = _useState16[1];
|
|
8855
|
+
var _useState17 = useState(''),
|
|
8856
|
+
userIds = _useState17[0],
|
|
8857
|
+
setUserIds = _useState17[1];
|
|
8858
|
+
var _React$useState9 = React.useState(false),
|
|
8859
|
+
overlayMenu = _React$useState9[0],
|
|
8860
|
+
setOverlayMenu = _React$useState9[1];
|
|
8861
|
+
var _useState18 = useState(''),
|
|
8862
|
+
userFirstName = _useState18[0],
|
|
8863
|
+
setUserFirstName = _useState18[1];
|
|
8864
|
+
var _useState19 = useState(''),
|
|
8865
|
+
userLastName = _useState19[0],
|
|
8866
|
+
setUserLastName = _useState19[1];
|
|
8867
|
+
var _useState20 = useState(true),
|
|
8868
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8869
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8675
8870
|
useScrollPosition(function (_ref3) {
|
|
8676
8871
|
var prevPos = _ref3.prevPos,
|
|
8677
8872
|
currPos = _ref3.currPos;
|
|
@@ -8692,47 +8887,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8692
8887
|
behavior: 'smooth'
|
|
8693
8888
|
});
|
|
8694
8889
|
};
|
|
8695
|
-
var _React$
|
|
8696
|
-
signup_page = _React$
|
|
8697
|
-
setSignUpPage = _React$
|
|
8698
|
-
var
|
|
8699
|
-
signup_rowsPerPage =
|
|
8700
|
-
setSignUpRowsPerPage =
|
|
8701
|
-
var _React$
|
|
8702
|
-
signup_order = _React$
|
|
8703
|
-
setSignUpOrder = _React$
|
|
8704
|
-
var _React$
|
|
8705
|
-
signup_orderBy = _React$
|
|
8706
|
-
setSignUpOrderBy = _React$
|
|
8707
|
-
var
|
|
8708
|
-
signup_searchValue =
|
|
8709
|
-
set_signup_SearchValue =
|
|
8710
|
-
var
|
|
8711
|
-
isSignUpSortingChange =
|
|
8712
|
-
setSignUpSortingChange =
|
|
8713
|
-
var
|
|
8714
|
-
isSignUpSearchingChange =
|
|
8715
|
-
setSignUpSearchingChange =
|
|
8716
|
-
var
|
|
8717
|
-
isSignUpSortingChangeTemp =
|
|
8718
|
-
setSignUpSortingChangeTemp =
|
|
8719
|
-
var
|
|
8720
|
-
isSignUpSearchingChangeTemp =
|
|
8721
|
-
setSignUpSearchingChangeTemp =
|
|
8890
|
+
var _React$useState10 = React.useState(1),
|
|
8891
|
+
signup_page = _React$useState10[0],
|
|
8892
|
+
setSignUpPage = _React$useState10[1];
|
|
8893
|
+
var _useState21 = useState(5),
|
|
8894
|
+
signup_rowsPerPage = _useState21[0],
|
|
8895
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8896
|
+
var _React$useState11 = React.useState('asc'),
|
|
8897
|
+
signup_order = _React$useState11[0],
|
|
8898
|
+
setSignUpOrder = _React$useState11[1];
|
|
8899
|
+
var _React$useState12 = React.useState('fname'),
|
|
8900
|
+
signup_orderBy = _React$useState12[0],
|
|
8901
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8902
|
+
var _useState22 = useState(''),
|
|
8903
|
+
signup_searchValue = _useState22[0],
|
|
8904
|
+
set_signup_SearchValue = _useState22[1];
|
|
8905
|
+
var _useState23 = useState(false),
|
|
8906
|
+
isSignUpSortingChange = _useState23[0],
|
|
8907
|
+
setSignUpSortingChange = _useState23[1];
|
|
8908
|
+
var _useState24 = useState(false),
|
|
8909
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8910
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8911
|
+
var _useState25 = useState(false),
|
|
8912
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8913
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8914
|
+
var _useState26 = useState(false),
|
|
8915
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8916
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8722
8917
|
var _useSelector3 = useSelector(function (state) {
|
|
8723
8918
|
return state.userList;
|
|
8724
8919
|
}),
|
|
8725
8920
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8921
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8922
|
+
history.push(config.routes.notification.path);
|
|
8923
|
+
};
|
|
8726
8924
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8727
8925
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8728
8926
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8729
8927
|
return false;
|
|
8730
8928
|
}
|
|
8731
|
-
|
|
8929
|
+
if (selectedUsersApprover.length) {
|
|
8930
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8931
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8932
|
+
var _selected = Object.values(selected).flat();
|
|
8933
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8934
|
+
return _selected.includes(item.id.toString());
|
|
8935
|
+
});
|
|
8936
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8937
|
+
return _selected.includes(item.id.toString());
|
|
8938
|
+
});
|
|
8939
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8940
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8941
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8942
|
+
} else {
|
|
8943
|
+
setOpenDeActivateModalFlag(true);
|
|
8944
|
+
}
|
|
8732
8945
|
};
|
|
8733
8946
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8734
8947
|
setOpenDeActivateModalFlag(false);
|
|
8735
8948
|
};
|
|
8949
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8950
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8951
|
+
};
|
|
8736
8952
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8737
8953
|
history.push(config.routes.users.add.path);
|
|
8738
8954
|
};
|
|
@@ -8746,28 +8962,31 @@ var UserList = function UserList(_ref2) {
|
|
|
8746
8962
|
history.push(config.routes.users.add.path + "?" + config.routes.users.add.queryParamKeys.verifyUserId + "=" + userId);
|
|
8747
8963
|
};
|
|
8748
8964
|
var handleRejectUserClick = function handleRejectUserClick(userId) {
|
|
8749
|
-
|
|
8750
|
-
|
|
8751
|
-
|
|
8752
|
-
|
|
8753
|
-
|
|
8754
|
-
|
|
8755
|
-
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
|
|
8762
|
-
|
|
8763
|
-
|
|
8764
|
-
|
|
8765
|
-
|
|
8766
|
-
|
|
8965
|
+
IUIToastMessageService$7.undoNotify( /*#__PURE__*/React.createElement(UndoButton, {
|
|
8966
|
+
onUndo: function onUndo() {
|
|
8967
|
+
return IUIToastMessageService$7.setUndoClicked(true);
|
|
8968
|
+
},
|
|
8969
|
+
msg: "Sign-up request rejected"
|
|
8970
|
+
}), function (res) {
|
|
8971
|
+
if (res === false) {
|
|
8972
|
+
dispatch(rejectUserVerification(userId)).then(function (res) {
|
|
8973
|
+
if (res.status === true) {
|
|
8974
|
+
dispatch(showDataFetchingStatus());
|
|
8975
|
+
dispatch(fetchUserSignupRequests({
|
|
8976
|
+
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8977
|
+
length: signup_rowsPerPage,
|
|
8978
|
+
page: signup_page,
|
|
8979
|
+
search: signup_searchValue.trim(),
|
|
8980
|
+
pagename: 'company'
|
|
8981
|
+
})).then(function () {
|
|
8982
|
+
return dispatch(stopDataFetchingStatus());
|
|
8983
|
+
});
|
|
8984
|
+
}
|
|
8985
|
+
})["catch"](function (err) {
|
|
8986
|
+
console.log(err);
|
|
8767
8987
|
});
|
|
8768
8988
|
}
|
|
8769
|
-
|
|
8770
|
-
console.log(err);
|
|
8989
|
+
IUIToastMessageService$7.setUndoClicked(false);
|
|
8771
8990
|
});
|
|
8772
8991
|
};
|
|
8773
8992
|
var handleBulkActionHistoryClick = function handleBulkActionHistoryClick() {
|
|
@@ -8780,12 +8999,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8780
8999
|
};
|
|
8781
9000
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8782
9001
|
var _extends2;
|
|
8783
|
-
var
|
|
9002
|
+
var selectedId = [];
|
|
9003
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9004
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9005
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8784
9006
|
return n.is_active;
|
|
8785
|
-
}).map(function (obj) {
|
|
8786
|
-
return obj.id.toString();
|
|
8787
9007
|
});
|
|
8788
|
-
|
|
9008
|
+
_newSelecteds.map(function (obj) {
|
|
9009
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
9010
|
+
if (obj.roles.is_approver === true) {
|
|
9011
|
+
_selectedUsersApprover.push(obj);
|
|
9012
|
+
} else if (obj.roles.is_approver === false) {
|
|
9013
|
+
_selectedUsersNotApprover.push(obj);
|
|
9014
|
+
}
|
|
9015
|
+
}
|
|
9016
|
+
selectedId.push(obj.id.toString());
|
|
9017
|
+
});
|
|
9018
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9019
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9020
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8789
9021
|
};
|
|
8790
9022
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8791
9023
|
var _extends3;
|
|
@@ -8803,58 +9035,156 @@ var UserList = function UserList(_ref2) {
|
|
|
8803
9035
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8804
9036
|
};
|
|
8805
9037
|
var onSearchHandler = function onSearchHandler(value) {
|
|
9038
|
+
setPage(1);
|
|
8806
9039
|
setSearchValue(value);
|
|
8807
9040
|
setSearchingChange(true);
|
|
8808
9041
|
setSearchingChangeTemp(!isSearchingChangeTemp);
|
|
8809
9042
|
};
|
|
8810
9043
|
var onSignUpReqeustSearchHandler = function onSignUpReqeustSearchHandler(value) {
|
|
9044
|
+
setPage(1);
|
|
8811
9045
|
set_signup_SearchValue(value);
|
|
8812
9046
|
setSignUpSearchingChange(true);
|
|
8813
9047
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8814
9048
|
};
|
|
8815
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9049
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8816
9050
|
var _extends4;
|
|
8817
9051
|
var selectedTemp = _extends({}, selected);
|
|
8818
9052
|
if (!(page in selectedTemp)) {
|
|
8819
9053
|
selectedTemp[page] = [];
|
|
8820
9054
|
}
|
|
8821
9055
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8822
|
-
var
|
|
9056
|
+
var _newSelected = [];
|
|
8823
9057
|
if (selectedIndex === -1) {
|
|
8824
|
-
|
|
9058
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8825
9059
|
} else if (selectedIndex === 0) {
|
|
8826
|
-
|
|
9060
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8827
9061
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8828
|
-
|
|
9062
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8829
9063
|
} else if (selectedIndex > 0) {
|
|
8830
|
-
|
|
9064
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8831
9065
|
}
|
|
8832
|
-
|
|
9066
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9067
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9068
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9069
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9070
|
+
return id !== item.id.toString();
|
|
9071
|
+
});
|
|
9072
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9073
|
+
return item.id.toString() !== id;
|
|
9074
|
+
});
|
|
9075
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9076
|
+
if (data.roles.is_approver === true) {
|
|
9077
|
+
_SelectedUsersApprover.push(data);
|
|
9078
|
+
} else if (data.roles.is_approver === false) {
|
|
9079
|
+
_SelectedUsersNotApprover.push(data);
|
|
9080
|
+
}
|
|
9081
|
+
}
|
|
9082
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9083
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9084
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8833
9085
|
};
|
|
9086
|
+
useEffect(function () {
|
|
9087
|
+
setApproverRole({
|
|
9088
|
+
value: '',
|
|
9089
|
+
label: 'Select approver'
|
|
9090
|
+
});
|
|
9091
|
+
setDefaultId(null);
|
|
9092
|
+
setIsDisabledSubmitBtn(true);
|
|
9093
|
+
setApproveeStatus(false);
|
|
9094
|
+
if (deactivateSingle === true) {
|
|
9095
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9096
|
+
if (response.data["default"].id) {
|
|
9097
|
+
setDefaultId(response.data["default"].id);
|
|
9098
|
+
setApproverRole({
|
|
9099
|
+
value: '',
|
|
9100
|
+
label: response.data["default"].email
|
|
9101
|
+
});
|
|
9102
|
+
setIsDisabledSubmitBtn(false);
|
|
9103
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9104
|
+
}
|
|
9105
|
+
});
|
|
9106
|
+
}
|
|
9107
|
+
}, [deactivateSingle]);
|
|
8834
9108
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8835
9109
|
setRowsPerPage(+event.target.value);
|
|
8836
9110
|
setPage(1);
|
|
8837
9111
|
setSelected({});
|
|
9112
|
+
setSelectedUsersNotApprover([]);
|
|
9113
|
+
setSelectedUsersApprover([]);
|
|
8838
9114
|
setSortingChange(true);
|
|
8839
9115
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8840
9116
|
};
|
|
8841
9117
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8842
9118
|
var isActive = e.target.checked;
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
9119
|
+
var _isApprover;
|
|
9120
|
+
newSelecteds.map(function (item) {
|
|
9121
|
+
if (item.id === id) {
|
|
9122
|
+
_isApprover = item.roles.is_approver;
|
|
9123
|
+
if (_isApprover === true && isActive === false) {
|
|
9124
|
+
setDeactivateSingle(true);
|
|
9125
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9126
|
+
setUser(item);
|
|
9127
|
+
} else {
|
|
9128
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9129
|
+
if (!isActive) {
|
|
9130
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9131
|
+
var _extends5;
|
|
9132
|
+
var selectedTemp = _extends({}, selected);
|
|
9133
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9134
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9135
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9136
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9137
|
+
return item.id != id;
|
|
9138
|
+
});
|
|
9139
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9140
|
+
return item.id != id;
|
|
9141
|
+
});
|
|
9142
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9143
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9144
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9145
|
+
}
|
|
9146
|
+
}
|
|
9147
|
+
});
|
|
8850
9148
|
}
|
|
8851
9149
|
}
|
|
8852
9150
|
});
|
|
8853
9151
|
};
|
|
9152
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9153
|
+
var _value = _ref4._value;
|
|
9154
|
+
if (_value.data.approvee_status) {
|
|
9155
|
+
setApproveeStatus(true);
|
|
9156
|
+
} else {
|
|
9157
|
+
setApproveeStatus(false);
|
|
9158
|
+
}
|
|
9159
|
+
setDefaultId(_value.data.id);
|
|
9160
|
+
setApproverRole(_value);
|
|
9161
|
+
setIsDisabledSubmitBtn(false);
|
|
9162
|
+
};
|
|
9163
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9164
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9165
|
+
setOpenDeActivateModalFlag(false);
|
|
9166
|
+
setDeactivateSingle(false);
|
|
9167
|
+
setSelected({});
|
|
9168
|
+
setSelectedUsersNotApprover([]);
|
|
9169
|
+
setSelectedUsersApprover([]);
|
|
9170
|
+
};
|
|
8854
9171
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8855
9172
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8856
9173
|
setOpenDeActivateModalFlag(false);
|
|
8857
9174
|
setSelected({});
|
|
9175
|
+
setSelectedUsersNotApprover([]);
|
|
9176
|
+
setSelectedUsersApprover([]);
|
|
9177
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9178
|
+
};
|
|
9179
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9180
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9181
|
+
return item.id;
|
|
9182
|
+
});
|
|
9183
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9184
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9185
|
+
setSelected({});
|
|
9186
|
+
setSelectedUsersNotApprover([]);
|
|
9187
|
+
setSelectedUsersApprover([]);
|
|
8858
9188
|
};
|
|
8859
9189
|
var importUserHandler = function importUserHandler() {
|
|
8860
9190
|
setOpenImportUsersModal(true);
|
|
@@ -8871,13 +9201,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8871
9201
|
email: email
|
|
8872
9202
|
}));
|
|
8873
9203
|
};
|
|
8874
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
9204
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9205
|
+
if (type === undefined) {
|
|
9206
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9207
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9208
|
+
return false;
|
|
9209
|
+
}
|
|
8879
9210
|
}
|
|
8880
9211
|
setUserIds(ids);
|
|
9212
|
+
setUserFirstName(firstName);
|
|
9213
|
+
setUserLastName(lastName);
|
|
9214
|
+
setToggleInviteModal(!showInviteModal);
|
|
9215
|
+
};
|
|
9216
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8881
9217
|
setToggleInviteModal(!showInviteModal);
|
|
8882
9218
|
};
|
|
8883
9219
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8950,6 +9286,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8950
9286
|
userId: userId
|
|
8951
9287
|
}));
|
|
8952
9288
|
};
|
|
9289
|
+
var knowMore = function knowMore() {
|
|
9290
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9291
|
+
};
|
|
8953
9292
|
var dispatch = useDispatch();
|
|
8954
9293
|
useEffect(function () {
|
|
8955
9294
|
if (isTokenVerified === true) {
|
|
@@ -9201,7 +9540,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9201
9540
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9202
9541
|
variant: "body2",
|
|
9203
9542
|
className: clsx(styles$5.description)
|
|
9204
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9543
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9544
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9545
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9546
|
+
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9205
9547
|
data: signupRequestListInfo,
|
|
9206
9548
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9207
9549
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9233,6 +9575,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9233
9575
|
}))
|
|
9234
9576
|
}]
|
|
9235
9577
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9578
|
+
isOpen: deactivateSingle,
|
|
9579
|
+
closeHandler: function closeHandler() {
|
|
9580
|
+
setDeactivateSingle(false);
|
|
9581
|
+
},
|
|
9582
|
+
cancelLabel: "Cancel",
|
|
9583
|
+
submitLabel: "Deactivate",
|
|
9584
|
+
submitHandler: handleDeactivateUser,
|
|
9585
|
+
headerText: "Deactivate this user?",
|
|
9586
|
+
width: "400px",
|
|
9587
|
+
subHanderText: "",
|
|
9588
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9589
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9590
|
+
modalClass: "deactivateSingleModal",
|
|
9591
|
+
modalBodyStyle: {
|
|
9592
|
+
overflowY: 'unset'
|
|
9593
|
+
}
|
|
9594
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9595
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9596
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9597
|
+
className: styles$5.deactivateAlert
|
|
9598
|
+
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9599
|
+
width: "9",
|
|
9600
|
+
height: "9"
|
|
9601
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9602
|
+
variant: "body2"
|
|
9603
|
+
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9604
|
+
onClick: knowMore,
|
|
9605
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9606
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9607
|
+
className: "iui__mt-15"
|
|
9608
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9609
|
+
isMove: true,
|
|
9610
|
+
additional: {
|
|
9611
|
+
page: 1,
|
|
9612
|
+
product: 'travel',
|
|
9613
|
+
userId: user.id
|
|
9614
|
+
},
|
|
9615
|
+
label: "Transfer approver role to",
|
|
9616
|
+
value: approverRole,
|
|
9617
|
+
onValueChange: selectApprover,
|
|
9618
|
+
loadOption: transferRoleOptions,
|
|
9619
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9620
|
+
customLoadingText: "No results found"
|
|
9621
|
+
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9622
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9623
|
+
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9624
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9625
|
+
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9236
9626
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9237
9627
|
closeHandler: closeDeActivateModal,
|
|
9238
9628
|
cancelLabel: "Cancel",
|
|
@@ -9259,8 +9649,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9259
9649
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9260
9650
|
className: styles$5.description
|
|
9261
9651
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9652
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9653
|
+
closeHandler: closeDeActiveModal,
|
|
9654
|
+
cancelLabel: "Cancel",
|
|
9655
|
+
submitLabel: "Deactivate safe users",
|
|
9656
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9657
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9658
|
+
customButtonLabel: "Deactivate all users",
|
|
9659
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9660
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9661
|
+
width: "640px",
|
|
9662
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9663
|
+
headerText: "Deactivate users?",
|
|
9664
|
+
modalBodyStyle: {
|
|
9665
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9666
|
+
}
|
|
9667
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9668
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9669
|
+
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9670
|
+
color: "#9A6700",
|
|
9671
|
+
size: "14"
|
|
9672
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9673
|
+
variant: "body2"
|
|
9674
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9675
|
+
onClick: knowMore,
|
|
9676
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9677
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9678
|
+
className: "iui__my-15"
|
|
9679
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9680
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9681
|
+
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9682
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9683
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9684
|
+
var _item$data;
|
|
9685
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9686
|
+
key: index,
|
|
9687
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9688
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9689
|
+
firstName: item.first_name,
|
|
9690
|
+
lastName: item.last_name,
|
|
9691
|
+
isLetterAvatar: "true",
|
|
9692
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9693
|
+
secondaryText: item.email,
|
|
9694
|
+
letterAvatarTextColor: "black",
|
|
9695
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9696
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9697
|
+
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9698
|
+
color: "#9A6700",
|
|
9699
|
+
size: "14"
|
|
9700
|
+
}));
|
|
9701
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9702
|
+
style: {
|
|
9703
|
+
borderColor: '#E5E9ED'
|
|
9704
|
+
}
|
|
9705
|
+
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9706
|
+
className: "iui__my-15"
|
|
9707
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9708
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9709
|
+
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9710
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9711
|
+
}, "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) {
|
|
9712
|
+
var _item$data2;
|
|
9713
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9714
|
+
key: index,
|
|
9715
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9716
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9717
|
+
firstName: item.first_name,
|
|
9718
|
+
lastName: item.last_name,
|
|
9719
|
+
isLetterAvatar: "true",
|
|
9720
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9721
|
+
secondaryText: item.email,
|
|
9722
|
+
letterAvatarTextColor: "black",
|
|
9723
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9724
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9725
|
+
}));
|
|
9726
|
+
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9262
9727
|
isOpen: showInviteModal,
|
|
9263
|
-
closeHandler:
|
|
9728
|
+
closeHandler: function closeHandler() {
|
|
9729
|
+
return toggleInviteModalClose();
|
|
9730
|
+
},
|
|
9264
9731
|
cancelLabel: "Cancel",
|
|
9265
9732
|
headerText: "Resend Invites?",
|
|
9266
9733
|
submitLabel: "Send",
|
|
@@ -9292,7 +9759,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9292
9759
|
fontSize: '14px',
|
|
9293
9760
|
color: '#374151'
|
|
9294
9761
|
}
|
|
9295
|
-
}, "This invitation will be sent to
|
|
9762
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9763
|
+
style: {
|
|
9764
|
+
fontSize: '14px',
|
|
9765
|
+
color: '#374151',
|
|
9766
|
+
fontWeight: 'bold'
|
|
9767
|
+
}
|
|
9768
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9296
9769
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9297
9770
|
closeImportUsersModal: closeImportUsersModal,
|
|
9298
9771
|
closeImportModal: closeImportModal
|
|
@@ -9301,8 +9774,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9301
9774
|
errMsg: hasVerificationError
|
|
9302
9775
|
}));
|
|
9303
9776
|
};
|
|
9304
|
-
var TabLabelCount = function TabLabelCount(
|
|
9305
|
-
var count =
|
|
9777
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9778
|
+
var count = _ref5.count;
|
|
9306
9779
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9307
9780
|
className: styles$5.TabLabelCount
|
|
9308
9781
|
}, " ", count, " ");
|
|
@@ -9377,11 +9850,12 @@ function Header(props) {
|
|
|
9377
9850
|
})));
|
|
9378
9851
|
}
|
|
9379
9852
|
|
|
9380
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","buttonWidth":"_13tv0","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9853
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","rowText":"_2XKxl","lightColor":"_3uyfh","buttonWidth":"_13tv0","readOnlyInput":"_3yYuQ","addUserButton":"_1zbr_","alertDescContainer":"_3h8DM","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9381
9854
|
|
|
9382
9855
|
function Listview(_ref) {
|
|
9383
9856
|
var data = _ref.data,
|
|
9384
9857
|
name = _ref.name,
|
|
9858
|
+
tableName = _ref.tableName,
|
|
9385
9859
|
handleEditDialog = _ref.handleEditDialog,
|
|
9386
9860
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9387
9861
|
orderBy = _ref.orderBy,
|
|
@@ -9394,16 +9868,82 @@ function Listview(_ref) {
|
|
|
9394
9868
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9395
9869
|
page = _ref.page,
|
|
9396
9870
|
rowsPerPage = _ref.rowsPerPage;
|
|
9871
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9872
|
+
var _data$dept_head_detai;
|
|
9873
|
+
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) {
|
|
9874
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9875
|
+
}
|
|
9876
|
+
};
|
|
9397
9877
|
var columns = [{
|
|
9398
9878
|
id: 'name',
|
|
9399
9879
|
label: name,
|
|
9400
|
-
width: '
|
|
9880
|
+
width: '40%',
|
|
9401
9881
|
sortable: true,
|
|
9402
9882
|
cell: function cell(row) {
|
|
9403
9883
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9404
9884
|
component: "div"
|
|
9405
9885
|
}, row.name);
|
|
9406
9886
|
}
|
|
9887
|
+
}, {
|
|
9888
|
+
id: 'no_of_users',
|
|
9889
|
+
label: 'Number of users',
|
|
9890
|
+
width: '40%',
|
|
9891
|
+
sortable: true,
|
|
9892
|
+
cell: function cell(row) {
|
|
9893
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9894
|
+
component: "div"
|
|
9895
|
+
}, row.no_of_users);
|
|
9896
|
+
}
|
|
9897
|
+
}, {
|
|
9898
|
+
id: 'actions',
|
|
9899
|
+
label: 'Actions',
|
|
9900
|
+
width: '20%',
|
|
9901
|
+
cell: function cell(row) {
|
|
9902
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9903
|
+
display: "flex"
|
|
9904
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9905
|
+
buttonText: "Edit",
|
|
9906
|
+
className: styles$7.buttonWidth,
|
|
9907
|
+
onClick: function onClick() {
|
|
9908
|
+
return handleEditDialog(row);
|
|
9909
|
+
}
|
|
9910
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9911
|
+
buttonText: "Delete",
|
|
9912
|
+
className: styles$7.buttonWidth,
|
|
9913
|
+
onClick: function onClick() {
|
|
9914
|
+
return handleDeleteDialog(row, true);
|
|
9915
|
+
}
|
|
9916
|
+
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9917
|
+
buttonText: "Delete",
|
|
9918
|
+
className: styles$7.buttonWidth,
|
|
9919
|
+
onClick: function onClick() {
|
|
9920
|
+
return handleDeleteDialog(row, false);
|
|
9921
|
+
}
|
|
9922
|
+
}));
|
|
9923
|
+
}
|
|
9924
|
+
}];
|
|
9925
|
+
var departmentColumns = [{
|
|
9926
|
+
id: 'name',
|
|
9927
|
+
label: name,
|
|
9928
|
+
width: '30%',
|
|
9929
|
+
sortable: true,
|
|
9930
|
+
cell: function cell(row) {
|
|
9931
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9932
|
+
component: "div"
|
|
9933
|
+
}, row.name);
|
|
9934
|
+
}
|
|
9935
|
+
}, {
|
|
9936
|
+
id: 'department_head',
|
|
9937
|
+
label: 'Department head',
|
|
9938
|
+
width: '30%',
|
|
9939
|
+
sortable: true,
|
|
9940
|
+
cell: function cell(row) {
|
|
9941
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9942
|
+
component: "div"
|
|
9943
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9944
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9945
|
+
}, "Assigned by default"));
|
|
9946
|
+
}
|
|
9407
9947
|
}, {
|
|
9408
9948
|
id: 'no_of_users',
|
|
9409
9949
|
label: 'Number of users',
|
|
@@ -9417,7 +9957,7 @@ function Listview(_ref) {
|
|
|
9417
9957
|
}, {
|
|
9418
9958
|
id: 'actions',
|
|
9419
9959
|
label: 'Actions',
|
|
9420
|
-
width: '
|
|
9960
|
+
width: '15%',
|
|
9421
9961
|
cell: function cell(row) {
|
|
9422
9962
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9423
9963
|
display: "flex"
|
|
@@ -9450,7 +9990,7 @@ function Listview(_ref) {
|
|
|
9450
9990
|
hasFilter: true,
|
|
9451
9991
|
isCheckboxTable: false,
|
|
9452
9992
|
count: data.count,
|
|
9453
|
-
columns: columns,
|
|
9993
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9454
9994
|
rows: data.results,
|
|
9455
9995
|
page: page,
|
|
9456
9996
|
handleChangePage: handleChangePage,
|
|
@@ -9507,15 +10047,44 @@ function EditPanelDialog(_ref) {
|
|
|
9507
10047
|
var isOpen = _ref.isOpen,
|
|
9508
10048
|
closeHandler = _ref.closeHandler,
|
|
9509
10049
|
onValueChange = _ref.onValueChange,
|
|
9510
|
-
|
|
10050
|
+
_submitHandler = _ref.submitHandler,
|
|
9511
10051
|
isError = _ref.isError,
|
|
9512
10052
|
name = _ref.name,
|
|
9513
10053
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9514
|
-
validation = _ref.validation
|
|
10054
|
+
validation = _ref.validation,
|
|
10055
|
+
rowData = _ref.rowData,
|
|
10056
|
+
tableName = _ref.tableName,
|
|
10057
|
+
config = _ref.config;
|
|
9515
10058
|
var _useSelector = useSelector(function (state) {
|
|
9516
10059
|
return state.userPanel;
|
|
9517
10060
|
}),
|
|
9518
10061
|
dialogData = _useSelector.dialogData;
|
|
10062
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10063
|
+
var _data$dept_head_detai;
|
|
10064
|
+
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) {
|
|
10065
|
+
setHead({
|
|
10066
|
+
value: data.dept_head_details[0].id,
|
|
10067
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10068
|
+
});
|
|
10069
|
+
}
|
|
10070
|
+
};
|
|
10071
|
+
var _useState = useState({
|
|
10072
|
+
value: '',
|
|
10073
|
+
label: 'Select'
|
|
10074
|
+
}),
|
|
10075
|
+
head = _useState[0],
|
|
10076
|
+
setHead = _useState[1];
|
|
10077
|
+
useEffect(function () {
|
|
10078
|
+
deptHeadDetails(rowData);
|
|
10079
|
+
}, [rowData]);
|
|
10080
|
+
var history = useHistory();
|
|
10081
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10082
|
+
console.log(rowData);
|
|
10083
|
+
history.push({
|
|
10084
|
+
pathname: config.routes.users.add.path,
|
|
10085
|
+
state: rowData
|
|
10086
|
+
});
|
|
10087
|
+
};
|
|
9519
10088
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9520
10089
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9521
10090
|
isOpen: isOpen,
|
|
@@ -9523,25 +10092,59 @@ function EditPanelDialog(_ref) {
|
|
|
9523
10092
|
headerText: "Edit " + name.toLowerCase(),
|
|
9524
10093
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9525
10094
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9526
|
-
submitHandler: submitHandler
|
|
9527
|
-
|
|
10095
|
+
submitHandler: function submitHandler() {
|
|
10096
|
+
return _submitHandler(head);
|
|
10097
|
+
},
|
|
10098
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9528
10099
|
hideCloseIcon: false,
|
|
9529
10100
|
modalBodyStyle: {
|
|
9530
|
-
|
|
9531
|
-
overflow: 'auto',
|
|
9532
|
-
margin: '0px'
|
|
10101
|
+
overflowY: 'visible'
|
|
9533
10102
|
},
|
|
9534
10103
|
footerStyle: {
|
|
9535
10104
|
justifyContent: 'end'
|
|
9536
10105
|
}
|
|
10106
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10107
|
+
display: "flex",
|
|
10108
|
+
justifyContent: "center",
|
|
10109
|
+
alignItems: "center",
|
|
10110
|
+
flexDirection: "column",
|
|
10111
|
+
style: {
|
|
10112
|
+
marginBottom: '30px'
|
|
10113
|
+
}
|
|
9537
10114
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9538
|
-
component: "div",
|
|
9539
10115
|
display: "flex",
|
|
9540
10116
|
justifyContent: "center",
|
|
9541
10117
|
alignItems: "center",
|
|
9542
10118
|
flexDirection: "column",
|
|
9543
|
-
|
|
9544
|
-
}, /*#__PURE__*/React.createElement(
|
|
10119
|
+
className: styles$7.baseAlert
|
|
10120
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10121
|
+
className: styles$7.alertDescContainer
|
|
10122
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10123
|
+
className: styles$7.iconLayout,
|
|
10124
|
+
style: {
|
|
10125
|
+
paddingTop: '4px'
|
|
10126
|
+
}
|
|
10127
|
+
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10128
|
+
color: "#CA8A04",
|
|
10129
|
+
width: "25",
|
|
10130
|
+
height: "20",
|
|
10131
|
+
className: styles$7.iconStyle
|
|
10132
|
+
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10133
|
+
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.",
|
|
10134
|
+
style: {
|
|
10135
|
+
fontWeight: 'normal'
|
|
10136
|
+
}
|
|
10137
|
+
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10138
|
+
buttonText: "Add user",
|
|
10139
|
+
type: "text",
|
|
10140
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10141
|
+
width: "9",
|
|
10142
|
+
height: "9",
|
|
10143
|
+
color: "#EC5D25"
|
|
10144
|
+
}),
|
|
10145
|
+
onClick: handleAddPageNavigation,
|
|
10146
|
+
className: styles$7.addUserButton
|
|
10147
|
+
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9545
10148
|
label: name + " name",
|
|
9546
10149
|
name: "name",
|
|
9547
10150
|
defaultValue: dialogData.data.name,
|
|
@@ -9550,7 +10153,49 @@ function EditPanelDialog(_ref) {
|
|
|
9550
10153
|
isError: isError,
|
|
9551
10154
|
validation: validation,
|
|
9552
10155
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9553
|
-
required: true
|
|
10156
|
+
required: true,
|
|
10157
|
+
style: tableName === 'department' && {
|
|
10158
|
+
width: '350px'
|
|
10159
|
+
}
|
|
10160
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10161
|
+
className: "iui__mt-15",
|
|
10162
|
+
style: {
|
|
10163
|
+
width: '100%'
|
|
10164
|
+
}
|
|
10165
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10166
|
+
label: "Department head",
|
|
10167
|
+
name: "name",
|
|
10168
|
+
defaultValue: head.label,
|
|
10169
|
+
placeholder: "",
|
|
10170
|
+
readOnly: true,
|
|
10171
|
+
style: {
|
|
10172
|
+
width: '350px'
|
|
10173
|
+
}
|
|
10174
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10175
|
+
className: "iui__mt-15",
|
|
10176
|
+
style: {
|
|
10177
|
+
width: '100%'
|
|
10178
|
+
}
|
|
10179
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10180
|
+
noResultsText: true,
|
|
10181
|
+
isMove: true,
|
|
10182
|
+
additional: {
|
|
10183
|
+
page: 1,
|
|
10184
|
+
departmentId: rowData.id
|
|
10185
|
+
},
|
|
10186
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10187
|
+
label: "Department head",
|
|
10188
|
+
value: head,
|
|
10189
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10190
|
+
var _value = _ref2._value;
|
|
10191
|
+
return setHead(_value);
|
|
10192
|
+
},
|
|
10193
|
+
loadOption: departmentHeadOptions,
|
|
10194
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10195
|
+
customLoadingText: "No users found in this department",
|
|
10196
|
+
customLoadingTextStyle: {
|
|
10197
|
+
color: '#374151'
|
|
10198
|
+
}
|
|
9554
10199
|
})));
|
|
9555
10200
|
}
|
|
9556
10201
|
|
|
@@ -9729,12 +10374,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9729
10374
|
var _useState13 = useState(false),
|
|
9730
10375
|
isSortingChangeTemp = _useState13[0],
|
|
9731
10376
|
setSortingChangeTemp = _useState13[1];
|
|
9732
|
-
var _useState14 = useState(
|
|
9733
|
-
|
|
9734
|
-
|
|
9735
|
-
var _useState15 = useState(
|
|
9736
|
-
|
|
9737
|
-
|
|
10377
|
+
var _useState14 = useState([]),
|
|
10378
|
+
rowData = _useState14[0],
|
|
10379
|
+
setRowData = _useState14[1];
|
|
10380
|
+
var _useState15 = useState(1),
|
|
10381
|
+
page = _useState15[0],
|
|
10382
|
+
setPage = _useState15[1];
|
|
10383
|
+
var _useState16 = useState(5),
|
|
10384
|
+
rowsPerPage = _useState16[0],
|
|
10385
|
+
setRowsPerPage = _useState16[1];
|
|
9738
10386
|
var orderingParam = orderBy;
|
|
9739
10387
|
var _useSelector = useSelector(function (state) {
|
|
9740
10388
|
return state.userPanel;
|
|
@@ -9752,12 +10400,20 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9752
10400
|
var validatedValue = _value.replace(/\s+/g, ' ').trim();
|
|
9753
10401
|
setDataList(validatedValue);
|
|
9754
10402
|
};
|
|
10403
|
+
var _useState17 = useState(70),
|
|
10404
|
+
maxLengthForModal = _useState17[0],
|
|
10405
|
+
setMaxLengthForModal = _useState17[1];
|
|
10406
|
+
useEffect(function () {
|
|
10407
|
+
if (title === 'Business unit') {
|
|
10408
|
+
setMaxLengthForModal(150);
|
|
10409
|
+
}
|
|
10410
|
+
}, []);
|
|
9755
10411
|
var validation = {
|
|
9756
10412
|
regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
|
|
9757
10413
|
regexOnBlur: null,
|
|
9758
10414
|
maxLimit: '',
|
|
9759
10415
|
minLimit: '',
|
|
9760
|
-
maxLength:
|
|
10416
|
+
maxLength: maxLengthForModal,
|
|
9761
10417
|
minLength: 0
|
|
9762
10418
|
};
|
|
9763
10419
|
useEffect(function () {
|
|
@@ -9830,6 +10486,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9830
10486
|
submitLabel: 'Save'
|
|
9831
10487
|
}, '', data));
|
|
9832
10488
|
setDataList(data.name);
|
|
10489
|
+
setRowData(data);
|
|
9833
10490
|
setEditModal(true);
|
|
9834
10491
|
};
|
|
9835
10492
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9844,6 +10501,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9844
10501
|
var payload = {
|
|
9845
10502
|
names: [dataList]
|
|
9846
10503
|
};
|
|
10504
|
+
if (tableName === 'department') {
|
|
10505
|
+
payload = {
|
|
10506
|
+
name: dataList,
|
|
10507
|
+
department_head_id: null
|
|
10508
|
+
};
|
|
10509
|
+
}
|
|
9847
10510
|
var message = title + " added successfully.";
|
|
9848
10511
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9849
10512
|
} else {
|
|
@@ -9857,9 +10520,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9857
10520
|
var message = title + " deleted successfully.";
|
|
9858
10521
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9859
10522
|
};
|
|
9860
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10523
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10524
|
+
if (optionalParams === void 0) {
|
|
10525
|
+
optionalParams = null;
|
|
10526
|
+
}
|
|
9861
10527
|
dispatch(userPanelShowLoader());
|
|
9862
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10528
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9863
10529
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9864
10530
|
dispatch(userPanelStopLoader());
|
|
9865
10531
|
if (type === 'delete') {
|
|
@@ -9901,8 +10567,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9901
10567
|
name: dataList
|
|
9902
10568
|
}]
|
|
9903
10569
|
};
|
|
10570
|
+
if (tableName === 'department') {
|
|
10571
|
+
payload = {
|
|
10572
|
+
name: dataList,
|
|
10573
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10574
|
+
};
|
|
10575
|
+
}
|
|
9904
10576
|
var message = title + " updated successfully.";
|
|
9905
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10577
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9906
10578
|
setErrorEdit(false);
|
|
9907
10579
|
} else {
|
|
9908
10580
|
setErrorEdit(true);
|
|
@@ -10009,7 +10681,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
10009
10681
|
submitHandler: handleEditPanel,
|
|
10010
10682
|
isError: errorEdit,
|
|
10011
10683
|
isDisabledSubmitBtn: loading,
|
|
10012
|
-
validation: validation
|
|
10684
|
+
validation: validation,
|
|
10685
|
+
rowData: rowData,
|
|
10686
|
+
tableName: tableName,
|
|
10687
|
+
config: config
|
|
10013
10688
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
10014
10689
|
config: config
|
|
10015
10690
|
}));
|