@itilite/iui-user-management 0.4.208 → 0.4.209
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 +63 -14
- package/dist/index.js +682 -225
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +683 -226
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
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
|
+
_approversSearch: function _approversSearch() {
|
|
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._approversSearch() + "user_id=" + userId + "&page=" + page).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,
|
|
@@ -1054,12 +1147,6 @@ var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
|
1054
1147
|
payload: payload
|
|
1055
1148
|
};
|
|
1056
1149
|
};
|
|
1057
|
-
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1058
|
-
return {
|
|
1059
|
-
type: SET_BULK_DEACTIVATED_USERS,
|
|
1060
|
-
payload: payload
|
|
1061
|
-
};
|
|
1062
|
-
};
|
|
1063
1150
|
var showDataFetchingStatus = function showDataFetchingStatus(payload) {
|
|
1064
1151
|
return {
|
|
1065
1152
|
type: SHOW_LOADER$1,
|
|
@@ -1120,36 +1207,25 @@ var exportUsers = function exportUsers(payload) {
|
|
|
1120
1207
|
});
|
|
1121
1208
|
};
|
|
1122
1209
|
};
|
|
1123
|
-
var deActivateUsers = function deActivateUsers(ids) {
|
|
1124
|
-
return function (dispatch) {
|
|
1125
|
-
return new Promise(function (resolve, reject) {
|
|
1126
|
-
api$1.post("" + userListUrl.bulkDeactivate(), {
|
|
1127
|
-
user_ids: ids
|
|
1128
|
-
}).then(function (res) {
|
|
1129
|
-
dispatch(setBulkDeactivatedUsers(ids));
|
|
1130
|
-
IUIToastMessageService.sNotify(ids.length + ' Users deactivated successfully');
|
|
1131
|
-
resolve();
|
|
1132
|
-
})["catch"](function (err) {
|
|
1133
|
-
if (!err.response.data.status) {
|
|
1134
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1135
|
-
reject(err);
|
|
1136
|
-
return;
|
|
1137
|
-
}
|
|
1138
|
-
reject(err);
|
|
1139
|
-
});
|
|
1140
|
-
});
|
|
1141
|
-
};
|
|
1142
|
-
};
|
|
1143
1210
|
var updateTabValue = function updateTabValue(tabId) {
|
|
1144
1211
|
return {
|
|
1145
1212
|
type: SET_TAB_VALUE,
|
|
1146
1213
|
payload: tabId
|
|
1147
1214
|
};
|
|
1148
1215
|
};
|
|
1149
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1216
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1217
|
+
if (roleTransfer === void 0) {
|
|
1218
|
+
roleTransfer = false;
|
|
1219
|
+
}
|
|
1220
|
+
var _payload = {
|
|
1221
|
+
role_transfer: roleTransfer
|
|
1222
|
+
};
|
|
1223
|
+
if (roleTransfer) {
|
|
1224
|
+
_payload['new_approver_user_id'] = newApproverUserId;
|
|
1225
|
+
}
|
|
1150
1226
|
return function (dispatch) {
|
|
1151
1227
|
return new Promise(function (resolve, reject) {
|
|
1152
|
-
api$1.
|
|
1228
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1153
1229
|
dispatch(setUserActiveStatus({
|
|
1154
1230
|
is_active: activateVal !== 0,
|
|
1155
1231
|
id: id
|
|
@@ -1713,7 +1789,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1713
1789
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1714
1790
|
return function (dispatch) {
|
|
1715
1791
|
return new Promise(function (resolve, reject) {
|
|
1716
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1792
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1717
1793
|
resolve(res);
|
|
1718
1794
|
})["catch"](function (err) {
|
|
1719
1795
|
var _err$response17, _err$response17$data;
|
|
@@ -1749,6 +1825,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1749
1825
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1750
1826
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1751
1827
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1828
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1752
1829
|
|
|
1753
1830
|
var api$3 = configs.api;
|
|
1754
1831
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1798,14 +1875,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1798
1875
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1799
1876
|
return function (dispatch) {
|
|
1800
1877
|
return new Promise(function (resolve, reject) {
|
|
1801
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1878
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1802
1879
|
dispatch(getUserPanalData(getParam));
|
|
1803
1880
|
dispatch(closeDialog());
|
|
1804
1881
|
resolve(res);
|
|
1805
1882
|
})["catch"](function (err) {
|
|
1806
|
-
var _err$
|
|
1883
|
+
var _err$response3, _err$response3$data;
|
|
1807
1884
|
dispatch(userPanelStopLoader());
|
|
1808
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1885
|
+
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
1886
|
});
|
|
1810
1887
|
});
|
|
1811
1888
|
};
|
|
@@ -1819,25 +1896,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1819
1896
|
dispatch(userPanelStopLoader());
|
|
1820
1897
|
resolve();
|
|
1821
1898
|
})["catch"](function (err) {
|
|
1822
|
-
var _err$
|
|
1823
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1899
|
+
var _err$response4, _err$response4$data;
|
|
1900
|
+
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
1901
|
dispatch(userPanelStopLoader());
|
|
1825
1902
|
});
|
|
1826
1903
|
});
|
|
1827
1904
|
};
|
|
1828
1905
|
};
|
|
1829
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1906
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1830
1907
|
return function (dispatch) {
|
|
1831
1908
|
return new Promise(function (resolve, reject) {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1909
|
+
if (tableName === 'department') {
|
|
1910
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1911
|
+
dispatch(getUserPanalData(getParam));
|
|
1912
|
+
dispatch(closeDialog());
|
|
1913
|
+
resolve();
|
|
1914
|
+
})["catch"](function (err) {
|
|
1915
|
+
var _err$response5, _err$response5$data;
|
|
1916
|
+
dispatch(userPanelStopLoader());
|
|
1917
|
+
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.');
|
|
1918
|
+
});
|
|
1919
|
+
} else {
|
|
1920
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1921
|
+
dispatch(getUserPanalData(getParam));
|
|
1922
|
+
dispatch(closeDialog());
|
|
1923
|
+
resolve();
|
|
1924
|
+
})["catch"](function (err) {
|
|
1925
|
+
var _err$response6, _err$response6$data;
|
|
1926
|
+
dispatch(userPanelStopLoader());
|
|
1927
|
+
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.');
|
|
1928
|
+
});
|
|
1929
|
+
}
|
|
1841
1930
|
});
|
|
1842
1931
|
};
|
|
1843
1932
|
};
|
|
@@ -1849,8 +1938,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1849
1938
|
dispatch(closeDialog());
|
|
1850
1939
|
resolve(res);
|
|
1851
1940
|
})["catch"](function (err) {
|
|
1852
|
-
var _err$
|
|
1853
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1941
|
+
var _err$response7, _err$response7$data;
|
|
1942
|
+
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
1943
|
});
|
|
1855
1944
|
});
|
|
1856
1945
|
};
|
|
@@ -3950,6 +4039,7 @@ var initialState$2 = {
|
|
|
3950
4039
|
previous: null,
|
|
3951
4040
|
results: []
|
|
3952
4041
|
},
|
|
4042
|
+
deptUsers: [],
|
|
3953
4043
|
loading: false
|
|
3954
4044
|
};
|
|
3955
4045
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4019,6 +4109,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4019
4109
|
loading: false
|
|
4020
4110
|
});
|
|
4021
4111
|
}
|
|
4112
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4113
|
+
{
|
|
4114
|
+
return _extends({}, state, {
|
|
4115
|
+
deptUsers: action.payload
|
|
4116
|
+
});
|
|
4117
|
+
}
|
|
4022
4118
|
default:
|
|
4023
4119
|
return state;
|
|
4024
4120
|
}
|
|
@@ -4797,6 +4893,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4797
4893
|
isILadmin = _useSelector2.isILadmin,
|
|
4798
4894
|
companyName = _useSelector2.companyName;
|
|
4799
4895
|
var history = useHistory();
|
|
4896
|
+
var location = useLocation();
|
|
4800
4897
|
var _useState = useState({
|
|
4801
4898
|
travel: false,
|
|
4802
4899
|
expense: false
|
|
@@ -5052,6 +5149,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5052
5149
|
var onAddModalClose = function onAddModalClose() {
|
|
5053
5150
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5054
5151
|
};
|
|
5152
|
+
useEffect(function () {
|
|
5153
|
+
var _location$state, _location$state2;
|
|
5154
|
+
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) {
|
|
5155
|
+
var _location$state3, _location$state4;
|
|
5156
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5157
|
+
department: {
|
|
5158
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5159
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5160
|
+
}
|
|
5161
|
+
}));
|
|
5162
|
+
}
|
|
5163
|
+
}, []);
|
|
5055
5164
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5056
5165
|
var title = '';
|
|
5057
5166
|
if (id === 'entity') {
|
|
@@ -5077,24 +5186,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5077
5186
|
}));
|
|
5078
5187
|
} else {
|
|
5079
5188
|
dispatch(showLoader());
|
|
5080
|
-
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
|
|
5189
|
+
var dataObj;
|
|
5190
|
+
if (addModalData.id === 'department') {
|
|
5191
|
+
dataObj = {
|
|
5192
|
+
name: validatedValue,
|
|
5193
|
+
department_head_id: null
|
|
5194
|
+
};
|
|
5195
|
+
} else {
|
|
5196
|
+
dataObj = {
|
|
5197
|
+
names: [validatedValue]
|
|
5198
|
+
};
|
|
5199
|
+
}
|
|
5200
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5201
|
+
var _extends4;
|
|
5084
5202
|
setAddModalData(_extends({}, addModalData, {
|
|
5085
5203
|
isOpen: false
|
|
5086
5204
|
}));
|
|
5087
5205
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5088
5206
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5207
|
+
if (addModalData.id === 'department') {
|
|
5208
|
+
var _extends2;
|
|
5209
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5210
|
+
value: res.data.result.id,
|
|
5211
|
+
label: res.data.result.name
|
|
5212
|
+
}, _extends2)));
|
|
5213
|
+
} else {
|
|
5214
|
+
var _extends3;
|
|
5215
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5216
|
+
value: res.data.value,
|
|
5217
|
+
label: res.data.label
|
|
5218
|
+
}, _extends3)));
|
|
5219
|
+
}
|
|
5220
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5094
5221
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5095
5222
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5096
|
-
var
|
|
5097
|
-
return _extends({}, prevState, (
|
|
5223
|
+
var _extends5;
|
|
5224
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5098
5225
|
});
|
|
5099
5226
|
dispatch(stopLoader());
|
|
5100
5227
|
});
|
|
@@ -5113,8 +5240,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5113
5240
|
try {
|
|
5114
5241
|
var _temp5 = function _temp5() {
|
|
5115
5242
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5116
|
-
var
|
|
5117
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5243
|
+
var _extends6;
|
|
5244
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5118
5245
|
}
|
|
5119
5246
|
};
|
|
5120
5247
|
var _name = args._name,
|
|
@@ -5137,8 +5264,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5137
5264
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5138
5265
|
} else {
|
|
5139
5266
|
var _temp3 = function _temp3() {
|
|
5140
|
-
var
|
|
5141
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5267
|
+
var _extends7;
|
|
5268
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5142
5269
|
updateError(_name, _isError, _errorMsg);
|
|
5143
5270
|
};
|
|
5144
5271
|
var _temp2 = function () {
|
|
@@ -5186,7 +5313,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5186
5313
|
}
|
|
5187
5314
|
};
|
|
5188
5315
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5189
|
-
var
|
|
5316
|
+
var _extends8;
|
|
5190
5317
|
var _name = args._name,
|
|
5191
5318
|
_value = args._value,
|
|
5192
5319
|
_isError = args._isError,
|
|
@@ -5195,11 +5322,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5195
5322
|
_name: _name,
|
|
5196
5323
|
_value: _value
|
|
5197
5324
|
});
|
|
5198
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5325
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5199
5326
|
updateError(_name, _isError, _errorMsg);
|
|
5200
5327
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5201
|
-
var
|
|
5202
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5328
|
+
var _extends9;
|
|
5329
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5203
5330
|
}
|
|
5204
5331
|
};
|
|
5205
5332
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5209,9 +5336,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5209
5336
|
return tag.id;
|
|
5210
5337
|
};
|
|
5211
5338
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5212
|
-
var
|
|
5339
|
+
var _extends10;
|
|
5213
5340
|
var e = args._event;
|
|
5214
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5341
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5215
5342
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5216
5343
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5217
5344
|
userTagType: true
|
|
@@ -5219,22 +5346,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5219
5346
|
}
|
|
5220
5347
|
};
|
|
5221
5348
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5222
|
-
var
|
|
5349
|
+
var _extends11;
|
|
5223
5350
|
var _name = _ref2._name,
|
|
5224
5351
|
_value = _ref2._value;
|
|
5225
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5352
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5226
5353
|
};
|
|
5227
5354
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5228
|
-
var
|
|
5355
|
+
var _extends12;
|
|
5229
5356
|
var _name = _ref3._name,
|
|
5230
5357
|
_value = _ref3._value;
|
|
5231
|
-
|
|
5358
|
+
console.log(_name, _value, 'travel');
|
|
5359
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5232
5360
|
};
|
|
5233
5361
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5234
|
-
var
|
|
5362
|
+
var _extends13;
|
|
5235
5363
|
var _name = _ref4._name,
|
|
5236
5364
|
_value = _ref4._value;
|
|
5237
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5365
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5238
5366
|
};
|
|
5239
5367
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5240
5368
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5268,39 +5396,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5268
5396
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5269
5397
|
};
|
|
5270
5398
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5271
|
-
var
|
|
5399
|
+
var _extends14;
|
|
5272
5400
|
var _name = args._name,
|
|
5273
5401
|
_value = args._value,
|
|
5274
5402
|
_isError = args._isError,
|
|
5275
5403
|
_errorMsg = args._errorMsg;
|
|
5276
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5404
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5277
5405
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5278
|
-
var
|
|
5279
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5406
|
+
var _extends15;
|
|
5407
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5280
5408
|
}
|
|
5281
5409
|
updateError(_name, _isError, _errorMsg);
|
|
5282
5410
|
};
|
|
5283
5411
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5284
|
-
var
|
|
5412
|
+
var _extends16;
|
|
5285
5413
|
var _name = args._name,
|
|
5286
5414
|
_value = args._value,
|
|
5287
5415
|
_isError = args._isError,
|
|
5288
5416
|
_errorMsg = args._errorMsg;
|
|
5289
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5417
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5290
5418
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5291
|
-
var
|
|
5292
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5419
|
+
var _extends17;
|
|
5420
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5293
5421
|
}
|
|
5294
5422
|
updateError(_name, _isError, _errorMsg);
|
|
5295
5423
|
};
|
|
5296
5424
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5297
5425
|
try {
|
|
5298
5426
|
var _temp8 = function _temp8() {
|
|
5299
|
-
var
|
|
5300
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5427
|
+
var _extends18;
|
|
5428
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5301
5429
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5302
|
-
var
|
|
5303
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5430
|
+
var _extends19;
|
|
5431
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5304
5432
|
}
|
|
5305
5433
|
updateError(_name, _isError, _errorMsg);
|
|
5306
5434
|
};
|
|
@@ -5406,8 +5534,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5406
5534
|
return _errorArray;
|
|
5407
5535
|
});
|
|
5408
5536
|
setErrorMsgs(function (prevState) {
|
|
5409
|
-
var
|
|
5410
|
-
return _extends({}, prevState, (
|
|
5537
|
+
var _extends20;
|
|
5538
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5411
5539
|
});
|
|
5412
5540
|
};
|
|
5413
5541
|
var dispatch = useDispatch();
|
|
@@ -6736,7 +6864,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6736
6864
|
};
|
|
6737
6865
|
};
|
|
6738
6866
|
|
|
6739
|
-
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_","
|
|
6867
|
+
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","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6740
6868
|
|
|
6741
6869
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6742
6870
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8222,9 +8350,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8222
8350
|
cell: function cell(row) {
|
|
8223
8351
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8224
8352
|
component: "div",
|
|
8225
|
-
width:
|
|
8353
|
+
width: 60
|
|
8226
8354
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8227
|
-
title: "This user hasn't logged
|
|
8355
|
+
title: "This user hasn't logged on to the platform yet",
|
|
8228
8356
|
arrow: true,
|
|
8229
8357
|
classes: {
|
|
8230
8358
|
arrow: classes.arrow,
|
|
@@ -8232,7 +8360,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8232
8360
|
},
|
|
8233
8361
|
placement: "top-start"
|
|
8234
8362
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8235
|
-
className: clsx(styles$5.
|
|
8363
|
+
className: clsx(styles$5.tooltipText)
|
|
8236
8364
|
}, "Invited")) : null);
|
|
8237
8365
|
}
|
|
8238
8366
|
}, {
|
|
@@ -8333,7 +8461,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8333
8461
|
options.push({
|
|
8334
8462
|
label: 'Resend invite',
|
|
8335
8463
|
handler: function handler() {
|
|
8336
|
-
return toggleInviteModal(row.id, 'single'
|
|
8464
|
+
return toggleInviteModal(row.id, 'single');
|
|
8337
8465
|
}
|
|
8338
8466
|
});
|
|
8339
8467
|
}
|
|
@@ -8505,6 +8633,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8505
8633
|
});
|
|
8506
8634
|
};
|
|
8507
8635
|
|
|
8636
|
+
function InfoYellowIcon(props) {
|
|
8637
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8638
|
+
width: props.width,
|
|
8639
|
+
height: props.height,
|
|
8640
|
+
viewBox: "0 0 20 20",
|
|
8641
|
+
fill: "none",
|
|
8642
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8643
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8644
|
+
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",
|
|
8645
|
+
fill: "#CA8A04"
|
|
8646
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8647
|
+
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",
|
|
8648
|
+
fill: "#CA8A04"
|
|
8649
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8650
|
+
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",
|
|
8651
|
+
fill: "#CA8A04"
|
|
8652
|
+
}));
|
|
8653
|
+
}
|
|
8654
|
+
|
|
8655
|
+
function RedWarningIcon(props) {
|
|
8656
|
+
var _props$color = props.color,
|
|
8657
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8658
|
+
_props$size = props.size,
|
|
8659
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8660
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8661
|
+
width: size,
|
|
8662
|
+
height: size,
|
|
8663
|
+
viewBox: "0 0 14 14",
|
|
8664
|
+
fill: color,
|
|
8665
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8666
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8667
|
+
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",
|
|
8668
|
+
fill: color
|
|
8669
|
+
}));
|
|
8670
|
+
}
|
|
8671
|
+
|
|
8508
8672
|
function InviteInfoIcon() {
|
|
8509
8673
|
return /*#__PURE__*/React.createElement("svg", {
|
|
8510
8674
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8522,7 +8686,8 @@ function InviteInfoIcon() {
|
|
|
8522
8686
|
}
|
|
8523
8687
|
|
|
8524
8688
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8525
|
-
var env$7 = configs.env
|
|
8689
|
+
var env$7 = configs.env,
|
|
8690
|
+
api$7 = configs.api;
|
|
8526
8691
|
var UndoButton = function UndoButton(_ref) {
|
|
8527
8692
|
var onUndo = _ref.onUndo,
|
|
8528
8693
|
msg = _ref.msg;
|
|
@@ -8560,21 +8725,33 @@ var UserList = function UserList(_ref2) {
|
|
|
8560
8725
|
isDataFetching = _useSelector.isDataFetching,
|
|
8561
8726
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8562
8727
|
tabValue = _useSelector.tabValue;
|
|
8563
|
-
var
|
|
8564
|
-
|
|
8565
|
-
|
|
8728
|
+
var newSelecteds = userListInfo.results;
|
|
8729
|
+
var _React$useState = React.useState(''),
|
|
8730
|
+
deactivateUser = _React$useState[0],
|
|
8731
|
+
setDeactivateUser = _React$useState[1];
|
|
8732
|
+
var _React$useState2 = React.useState(null),
|
|
8733
|
+
setDefaultId = _React$useState2[1];
|
|
8734
|
+
var _React$useState3 = React.useState(1),
|
|
8735
|
+
page = _React$useState3[0],
|
|
8736
|
+
setPage = _React$useState3[1];
|
|
8737
|
+
var _React$useState4 = React.useState(''),
|
|
8738
|
+
user = _React$useState4[0],
|
|
8739
|
+
setUser = _React$useState4[1];
|
|
8566
8740
|
var _useState = useState(10),
|
|
8567
8741
|
rowsPerPage = _useState[0],
|
|
8568
8742
|
setRowsPerPage = _useState[1];
|
|
8569
|
-
var _React$
|
|
8570
|
-
selected = _React$
|
|
8571
|
-
setSelected = _React$
|
|
8572
|
-
var _React$
|
|
8573
|
-
order = _React$
|
|
8574
|
-
setOrder = _React$
|
|
8575
|
-
var _React$
|
|
8576
|
-
|
|
8577
|
-
|
|
8743
|
+
var _React$useState5 = React.useState({}),
|
|
8744
|
+
selected = _React$useState5[0],
|
|
8745
|
+
setSelected = _React$useState5[1];
|
|
8746
|
+
var _React$useState6 = React.useState('asc'),
|
|
8747
|
+
order = _React$useState6[0],
|
|
8748
|
+
setOrder = _React$useState6[1];
|
|
8749
|
+
var _React$useState7 = React.useState(false),
|
|
8750
|
+
deactivateSingle = _React$useState7[0],
|
|
8751
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8752
|
+
var _React$useState8 = React.useState('first_name'),
|
|
8753
|
+
orderBy = _React$useState8[0],
|
|
8754
|
+
setOrderBy = _React$useState8[1];
|
|
8578
8755
|
var _useState2 = useState(''),
|
|
8579
8756
|
searchValue = _useState2[0],
|
|
8580
8757
|
setSearchValue = _useState2[1];
|
|
@@ -8592,38 +8769,44 @@ var UserList = function UserList(_ref2) {
|
|
|
8592
8769
|
isOpenImportUsersModal = _useState4[0],
|
|
8593
8770
|
setOpenImportUsersModal = _useState4[1];
|
|
8594
8771
|
var _useState5 = useState(false),
|
|
8595
|
-
|
|
8596
|
-
|
|
8772
|
+
approveeStatus = _useState5[0],
|
|
8773
|
+
setApproveeStatus = _useState5[1];
|
|
8597
8774
|
var _useState6 = useState(false),
|
|
8598
|
-
|
|
8599
|
-
|
|
8775
|
+
isFileDownloading = _useState6[0],
|
|
8776
|
+
setDownlStatus = _useState6[1];
|
|
8600
8777
|
var _useState7 = useState(false),
|
|
8601
|
-
|
|
8602
|
-
|
|
8778
|
+
isSortingChange = _useState7[0],
|
|
8779
|
+
setSortingChange = _useState7[1];
|
|
8603
8780
|
var _useState8 = useState(false),
|
|
8604
|
-
|
|
8605
|
-
|
|
8781
|
+
isSearchingChange = _useState8[0],
|
|
8782
|
+
setSearchingChange = _useState8[1];
|
|
8606
8783
|
var _useState9 = useState(false),
|
|
8607
|
-
|
|
8608
|
-
|
|
8784
|
+
isSortingChangeTemp = _useState9[0],
|
|
8785
|
+
setSortingChangeTemp = _useState9[1];
|
|
8609
8786
|
var _useState10 = useState(false),
|
|
8610
|
-
|
|
8611
|
-
|
|
8787
|
+
isSearchingChangeTemp = _useState10[0],
|
|
8788
|
+
setSearchingChangeTemp = _useState10[1];
|
|
8612
8789
|
var _useState11 = useState(false),
|
|
8613
|
-
|
|
8614
|
-
|
|
8615
|
-
var _useState12 = useState(
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
var _useState13 = useState(
|
|
8622
|
-
|
|
8623
|
-
|
|
8790
|
+
isApiFetching = _useState11[0],
|
|
8791
|
+
setisApiFetching = _useState11[1];
|
|
8792
|
+
var _useState12 = useState({
|
|
8793
|
+
value: '',
|
|
8794
|
+
label: 'Select approver'
|
|
8795
|
+
}),
|
|
8796
|
+
approverRole = _useState12[0],
|
|
8797
|
+
setApproverRole = _useState12[1];
|
|
8798
|
+
var _useState13 = useState(false),
|
|
8799
|
+
showInviteModal = _useState13[0],
|
|
8800
|
+
setToggleInviteModal = _useState13[1];
|
|
8624
8801
|
var _useState14 = useState(''),
|
|
8625
|
-
|
|
8626
|
-
|
|
8802
|
+
userIds = _useState14[0],
|
|
8803
|
+
setUserIds = _useState14[1];
|
|
8804
|
+
var _React$useState9 = React.useState(false),
|
|
8805
|
+
overlayMenu = _React$useState9[0],
|
|
8806
|
+
setOverlayMenu = _React$useState9[1];
|
|
8807
|
+
var _useState15 = useState(true),
|
|
8808
|
+
isDisabledSubmitBtn = _useState15[0],
|
|
8809
|
+
setIsDisabledSubmitBtn = _useState15[1];
|
|
8627
8810
|
useScrollPosition(function (_ref3) {
|
|
8628
8811
|
var prevPos = _ref3.prevPos,
|
|
8629
8812
|
currPos = _ref3.currPos;
|
|
@@ -8644,37 +8827,40 @@ var UserList = function UserList(_ref2) {
|
|
|
8644
8827
|
behavior: 'smooth'
|
|
8645
8828
|
});
|
|
8646
8829
|
};
|
|
8647
|
-
var _React$
|
|
8648
|
-
signup_page = _React$
|
|
8649
|
-
setSignUpPage = _React$
|
|
8650
|
-
var
|
|
8651
|
-
signup_rowsPerPage =
|
|
8652
|
-
setSignUpRowsPerPage =
|
|
8653
|
-
var _React$
|
|
8654
|
-
signup_order = _React$
|
|
8655
|
-
setSignUpOrder = _React$
|
|
8656
|
-
var _React$
|
|
8657
|
-
signup_orderBy = _React$
|
|
8658
|
-
setSignUpOrderBy = _React$
|
|
8659
|
-
var
|
|
8660
|
-
signup_searchValue =
|
|
8661
|
-
set_signup_SearchValue =
|
|
8662
|
-
var _useState17 = useState(false),
|
|
8663
|
-
isSignUpSortingChange = _useState17[0],
|
|
8664
|
-
setSignUpSortingChange = _useState17[1];
|
|
8830
|
+
var _React$useState10 = React.useState(1),
|
|
8831
|
+
signup_page = _React$useState10[0],
|
|
8832
|
+
setSignUpPage = _React$useState10[1];
|
|
8833
|
+
var _useState16 = useState(5),
|
|
8834
|
+
signup_rowsPerPage = _useState16[0],
|
|
8835
|
+
setSignUpRowsPerPage = _useState16[1];
|
|
8836
|
+
var _React$useState11 = React.useState('asc'),
|
|
8837
|
+
signup_order = _React$useState11[0],
|
|
8838
|
+
setSignUpOrder = _React$useState11[1];
|
|
8839
|
+
var _React$useState12 = React.useState('fname'),
|
|
8840
|
+
signup_orderBy = _React$useState12[0],
|
|
8841
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8842
|
+
var _useState17 = useState(''),
|
|
8843
|
+
signup_searchValue = _useState17[0],
|
|
8844
|
+
set_signup_SearchValue = _useState17[1];
|
|
8665
8845
|
var _useState18 = useState(false),
|
|
8666
|
-
|
|
8667
|
-
|
|
8846
|
+
isSignUpSortingChange = _useState18[0],
|
|
8847
|
+
setSignUpSortingChange = _useState18[1];
|
|
8668
8848
|
var _useState19 = useState(false),
|
|
8669
|
-
|
|
8670
|
-
|
|
8849
|
+
isSignUpSearchingChange = _useState19[0],
|
|
8850
|
+
setSignUpSearchingChange = _useState19[1];
|
|
8671
8851
|
var _useState20 = useState(false),
|
|
8672
|
-
|
|
8673
|
-
|
|
8852
|
+
isSignUpSortingChangeTemp = _useState20[0],
|
|
8853
|
+
setSignUpSortingChangeTemp = _useState20[1];
|
|
8854
|
+
var _useState21 = useState(false),
|
|
8855
|
+
isSignUpSearchingChangeTemp = _useState21[0],
|
|
8856
|
+
setSignUpSearchingChangeTemp = _useState21[1];
|
|
8674
8857
|
var _useSelector3 = useSelector(function (state) {
|
|
8675
8858
|
return state.userList;
|
|
8676
8859
|
}),
|
|
8677
8860
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8861
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8862
|
+
history.push(config.routes.notification.path);
|
|
8863
|
+
};
|
|
8678
8864
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8679
8865
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8680
8866
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
@@ -8732,12 +8918,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8732
8918
|
};
|
|
8733
8919
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8734
8920
|
var _extends2;
|
|
8735
|
-
var
|
|
8921
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8736
8922
|
return n.is_active;
|
|
8737
8923
|
}).map(function (obj) {
|
|
8738
8924
|
return obj.id.toString();
|
|
8739
8925
|
});
|
|
8740
|
-
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] =
|
|
8926
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = _newSelecteds, _extends2)));
|
|
8741
8927
|
};
|
|
8742
8928
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8743
8929
|
var _extends3;
|
|
@@ -8771,18 +8957,43 @@ var UserList = function UserList(_ref2) {
|
|
|
8771
8957
|
selectedTemp[page] = [];
|
|
8772
8958
|
}
|
|
8773
8959
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8774
|
-
var
|
|
8960
|
+
var _newSelected = [];
|
|
8775
8961
|
if (selectedIndex === -1) {
|
|
8776
|
-
|
|
8962
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8777
8963
|
} else if (selectedIndex === 0) {
|
|
8778
|
-
|
|
8964
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8779
8965
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8780
|
-
|
|
8966
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8781
8967
|
} else if (selectedIndex > 0) {
|
|
8782
|
-
|
|
8968
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
8783
8969
|
}
|
|
8784
|
-
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] =
|
|
8970
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8785
8971
|
};
|
|
8972
|
+
useEffect(function () {
|
|
8973
|
+
setApproverRole({
|
|
8974
|
+
value: '',
|
|
8975
|
+
label: 'Select approver'
|
|
8976
|
+
});
|
|
8977
|
+
setIsDisabledSubmitBtn(true);
|
|
8978
|
+
setApproveeStatus(false);
|
|
8979
|
+
if (deactivateSingle === true) {
|
|
8980
|
+
api$7.get(userAddEditUrl._approversSearch() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
8981
|
+
setDefaultId(response.data["default"].id);
|
|
8982
|
+
response.data.results.map(function (item) {
|
|
8983
|
+
if (response.data["default"].id === item.id) {
|
|
8984
|
+
setApproverRole({
|
|
8985
|
+
value: '',
|
|
8986
|
+
label: item.email
|
|
8987
|
+
});
|
|
8988
|
+
setIsDisabledSubmitBtn(false);
|
|
8989
|
+
if (item.approvee_status) {
|
|
8990
|
+
setApproveeStatus(true);
|
|
8991
|
+
}
|
|
8992
|
+
}
|
|
8993
|
+
});
|
|
8994
|
+
});
|
|
8995
|
+
}
|
|
8996
|
+
}, [deactivateSingle]);
|
|
8786
8997
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8787
8998
|
setRowsPerPage(+event.target.value);
|
|
8788
8999
|
setPage(1);
|
|
@@ -8792,20 +9003,43 @@ var UserList = function UserList(_ref2) {
|
|
|
8792
9003
|
};
|
|
8793
9004
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8794
9005
|
var isActive = e.target.checked;
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
9006
|
+
var _isApprover;
|
|
9007
|
+
newSelecteds.map(function (item) {
|
|
9008
|
+
if (item.id === id) {
|
|
9009
|
+
_isApprover = item.roles.is_approver;
|
|
9010
|
+
if (_isApprover === true && isActive === false) {
|
|
9011
|
+
setDeactivateSingle(true);
|
|
9012
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9013
|
+
setUser(item);
|
|
9014
|
+
} else {
|
|
9015
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9016
|
+
if (!isActive) {
|
|
9017
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9018
|
+
var _extends5;
|
|
9019
|
+
var selectedTemp = _extends({}, selected);
|
|
9020
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9021
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9022
|
+
}
|
|
9023
|
+
}
|
|
9024
|
+
});
|
|
8802
9025
|
}
|
|
8803
9026
|
}
|
|
8804
9027
|
});
|
|
8805
9028
|
};
|
|
9029
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9030
|
+
var _value = _ref4._value;
|
|
9031
|
+
if (_value.data.approvee_status) {
|
|
9032
|
+
setApproveeStatus(true);
|
|
9033
|
+
} else {
|
|
9034
|
+
setApproveeStatus(false);
|
|
9035
|
+
}
|
|
9036
|
+
setApproverRole(_value);
|
|
9037
|
+
setIsDisabledSubmitBtn(false);
|
|
9038
|
+
};
|
|
8806
9039
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8807
|
-
dispatch(
|
|
9040
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, approverRole.data.id));
|
|
8808
9041
|
setOpenDeActivateModalFlag(false);
|
|
9042
|
+
setDeactivateSingle(false);
|
|
8809
9043
|
setSelected({});
|
|
8810
9044
|
};
|
|
8811
9045
|
var importUserHandler = function importUserHandler() {
|
|
@@ -8823,19 +9057,13 @@ var UserList = function UserList(_ref2) {
|
|
|
8823
9057
|
email: email
|
|
8824
9058
|
}));
|
|
8825
9059
|
};
|
|
8826
|
-
var toggleInviteModal = function toggleInviteModal(ids, type
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
8831
|
-
}
|
|
9060
|
+
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
9061
|
+
console.log(type);
|
|
9062
|
+
if (!type && (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined)) {
|
|
9063
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9064
|
+
return false;
|
|
8832
9065
|
}
|
|
8833
9066
|
setUserIds(ids);
|
|
8834
|
-
setUserFirstName(firstName);
|
|
8835
|
-
setUserLastName(lastName);
|
|
8836
|
-
setToggleInviteModal(!showInviteModal);
|
|
8837
|
-
};
|
|
8838
|
-
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8839
9067
|
setToggleInviteModal(!showInviteModal);
|
|
8840
9068
|
};
|
|
8841
9069
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -9159,7 +9387,11 @@ var UserList = function UserList(_ref2) {
|
|
|
9159
9387
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9160
9388
|
variant: "body2",
|
|
9161
9389
|
className: clsx(styles$5.description)
|
|
9162
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9390
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement(IUITypography, {
|
|
9391
|
+
variant: "span",
|
|
9392
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9393
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9394
|
+
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9163
9395
|
data: signupRequestListInfo,
|
|
9164
9396
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9165
9397
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9191,6 +9423,45 @@ var UserList = function UserList(_ref2) {
|
|
|
9191
9423
|
}))
|
|
9192
9424
|
}]
|
|
9193
9425
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9426
|
+
isOpen: deactivateSingle,
|
|
9427
|
+
closeHandler: function closeHandler() {
|
|
9428
|
+
setDeactivateSingle(false);
|
|
9429
|
+
},
|
|
9430
|
+
cancelLabel: "Cancel",
|
|
9431
|
+
submitLabel: "Deactivate",
|
|
9432
|
+
submitHandler: handleDeactivateUsers,
|
|
9433
|
+
headerText: "Deactivate this user?",
|
|
9434
|
+
width: "400px",
|
|
9435
|
+
subHanderText: "",
|
|
9436
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9437
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn
|
|
9438
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9439
|
+
className: styles$5.deactivateSingle
|
|
9440
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9441
|
+
className: styles$5.deactivateAlert
|
|
9442
|
+
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9443
|
+
width: "9",
|
|
9444
|
+
height: "9"
|
|
9445
|
+
}), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9446
|
+
className: "iui__my-15"
|
|
9447
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9448
|
+
isMove: true,
|
|
9449
|
+
additional: {
|
|
9450
|
+
page: 1,
|
|
9451
|
+
product: 'travel',
|
|
9452
|
+
userId: user.id
|
|
9453
|
+
},
|
|
9454
|
+
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
9455
|
+
label: "Transfer approver role to",
|
|
9456
|
+
value: approverRole,
|
|
9457
|
+
onValueChange: selectApprover,
|
|
9458
|
+
loadOption: transferRoleOptions,
|
|
9459
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9460
|
+
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9461
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9462
|
+
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9463
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9464
|
+
}, "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, {
|
|
9194
9465
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9195
9466
|
closeHandler: closeDeActivateModal,
|
|
9196
9467
|
cancelLabel: "Cancel",
|
|
@@ -9218,9 +9489,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9218
9489
|
className: styles$5.description
|
|
9219
9490
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9220
9491
|
isOpen: showInviteModal,
|
|
9221
|
-
closeHandler:
|
|
9222
|
-
return toggleInviteModalClose();
|
|
9223
|
-
},
|
|
9492
|
+
closeHandler: toggleInviteModal,
|
|
9224
9493
|
cancelLabel: "Cancel",
|
|
9225
9494
|
headerText: "Resend Invites?",
|
|
9226
9495
|
submitLabel: "Send",
|
|
@@ -9252,13 +9521,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9252
9521
|
fontSize: '14px',
|
|
9253
9522
|
color: '#374151'
|
|
9254
9523
|
}
|
|
9255
|
-
}, "This invitation will be sent to
|
|
9256
|
-
style: {
|
|
9257
|
-
fontSize: '14px',
|
|
9258
|
-
color: '#374151',
|
|
9259
|
-
fontWeight: 'bold'
|
|
9260
|
-
}
|
|
9261
|
-
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9524
|
+
}, "This invitation will be sent to users who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9262
9525
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9263
9526
|
closeImportUsersModal: closeImportUsersModal,
|
|
9264
9527
|
closeImportModal: closeImportModal
|
|
@@ -9267,8 +9530,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9267
9530
|
errMsg: hasVerificationError
|
|
9268
9531
|
}));
|
|
9269
9532
|
};
|
|
9270
|
-
var TabLabelCount = function TabLabelCount(
|
|
9271
|
-
var count =
|
|
9533
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9534
|
+
var count = _ref5.count;
|
|
9272
9535
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9273
9536
|
className: styles$5.TabLabelCount
|
|
9274
9537
|
}, " ", count, " ");
|
|
@@ -9343,11 +9606,12 @@ function Header(props) {
|
|
|
9343
9606
|
})));
|
|
9344
9607
|
}
|
|
9345
9608
|
|
|
9346
|
-
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"};
|
|
9609
|
+
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"};
|
|
9347
9610
|
|
|
9348
9611
|
function Listview(_ref) {
|
|
9349
9612
|
var data = _ref.data,
|
|
9350
9613
|
name = _ref.name,
|
|
9614
|
+
tableName = _ref.tableName,
|
|
9351
9615
|
handleEditDialog = _ref.handleEditDialog,
|
|
9352
9616
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9353
9617
|
orderBy = _ref.orderBy,
|
|
@@ -9360,16 +9624,82 @@ function Listview(_ref) {
|
|
|
9360
9624
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9361
9625
|
page = _ref.page,
|
|
9362
9626
|
rowsPerPage = _ref.rowsPerPage;
|
|
9627
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9628
|
+
var _data$dept_head_detai;
|
|
9629
|
+
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) {
|
|
9630
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9631
|
+
}
|
|
9632
|
+
};
|
|
9363
9633
|
var columns = [{
|
|
9364
9634
|
id: 'name',
|
|
9365
9635
|
label: name,
|
|
9366
|
-
width: '
|
|
9636
|
+
width: '40%',
|
|
9637
|
+
sortable: true,
|
|
9638
|
+
cell: function cell(row) {
|
|
9639
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9640
|
+
component: "div"
|
|
9641
|
+
}, row.name);
|
|
9642
|
+
}
|
|
9643
|
+
}, {
|
|
9644
|
+
id: 'no_of_users',
|
|
9645
|
+
label: 'Number of users',
|
|
9646
|
+
width: '40%',
|
|
9647
|
+
sortable: true,
|
|
9648
|
+
cell: function cell(row) {
|
|
9649
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9650
|
+
component: "div"
|
|
9651
|
+
}, row.no_of_users);
|
|
9652
|
+
}
|
|
9653
|
+
}, {
|
|
9654
|
+
id: 'actions',
|
|
9655
|
+
label: 'Actions',
|
|
9656
|
+
width: '20%',
|
|
9657
|
+
cell: function cell(row) {
|
|
9658
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9659
|
+
display: "flex"
|
|
9660
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9661
|
+
buttonText: "Edit",
|
|
9662
|
+
className: styles$7.buttonWidth,
|
|
9663
|
+
onClick: function onClick() {
|
|
9664
|
+
return handleEditDialog(row);
|
|
9665
|
+
}
|
|
9666
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9667
|
+
buttonText: "Delete",
|
|
9668
|
+
className: styles$7.buttonWidth,
|
|
9669
|
+
onClick: function onClick() {
|
|
9670
|
+
return handleDeleteDialog(row, true);
|
|
9671
|
+
}
|
|
9672
|
+
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9673
|
+
buttonText: "Delete",
|
|
9674
|
+
className: styles$7.buttonWidth,
|
|
9675
|
+
onClick: function onClick() {
|
|
9676
|
+
return handleDeleteDialog(row, false);
|
|
9677
|
+
}
|
|
9678
|
+
}));
|
|
9679
|
+
}
|
|
9680
|
+
}];
|
|
9681
|
+
var departmentColumns = [{
|
|
9682
|
+
id: 'name',
|
|
9683
|
+
label: name,
|
|
9684
|
+
width: '30%',
|
|
9367
9685
|
sortable: true,
|
|
9368
9686
|
cell: function cell(row) {
|
|
9369
9687
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9370
9688
|
component: "div"
|
|
9371
9689
|
}, row.name);
|
|
9372
9690
|
}
|
|
9691
|
+
}, {
|
|
9692
|
+
id: 'department_head',
|
|
9693
|
+
label: 'Department head',
|
|
9694
|
+
width: '30%',
|
|
9695
|
+
sortable: true,
|
|
9696
|
+
cell: function cell(row) {
|
|
9697
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9698
|
+
component: "div"
|
|
9699
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9700
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9701
|
+
}, "Assigned by default"));
|
|
9702
|
+
}
|
|
9373
9703
|
}, {
|
|
9374
9704
|
id: 'no_of_users',
|
|
9375
9705
|
label: 'Number of users',
|
|
@@ -9383,7 +9713,7 @@ function Listview(_ref) {
|
|
|
9383
9713
|
}, {
|
|
9384
9714
|
id: 'actions',
|
|
9385
9715
|
label: 'Actions',
|
|
9386
|
-
width: '
|
|
9716
|
+
width: '15%',
|
|
9387
9717
|
cell: function cell(row) {
|
|
9388
9718
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9389
9719
|
display: "flex"
|
|
@@ -9416,7 +9746,7 @@ function Listview(_ref) {
|
|
|
9416
9746
|
hasFilter: true,
|
|
9417
9747
|
isCheckboxTable: false,
|
|
9418
9748
|
count: data.count,
|
|
9419
|
-
columns: columns,
|
|
9749
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9420
9750
|
rows: data.results,
|
|
9421
9751
|
page: page,
|
|
9422
9752
|
handleChangePage: handleChangePage,
|
|
@@ -9473,15 +9803,44 @@ function EditPanelDialog(_ref) {
|
|
|
9473
9803
|
var isOpen = _ref.isOpen,
|
|
9474
9804
|
closeHandler = _ref.closeHandler,
|
|
9475
9805
|
onValueChange = _ref.onValueChange,
|
|
9476
|
-
|
|
9806
|
+
_submitHandler = _ref.submitHandler,
|
|
9477
9807
|
isError = _ref.isError,
|
|
9478
9808
|
name = _ref.name,
|
|
9479
9809
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9480
|
-
validation = _ref.validation
|
|
9810
|
+
validation = _ref.validation,
|
|
9811
|
+
rowData = _ref.rowData,
|
|
9812
|
+
tableName = _ref.tableName,
|
|
9813
|
+
config = _ref.config;
|
|
9481
9814
|
var _useSelector = useSelector(function (state) {
|
|
9482
9815
|
return state.userPanel;
|
|
9483
9816
|
}),
|
|
9484
9817
|
dialogData = _useSelector.dialogData;
|
|
9818
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9819
|
+
var _data$dept_head_detai;
|
|
9820
|
+
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) {
|
|
9821
|
+
setHead({
|
|
9822
|
+
value: data.dept_head_details[0].id,
|
|
9823
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9824
|
+
});
|
|
9825
|
+
}
|
|
9826
|
+
};
|
|
9827
|
+
var _useState = useState({
|
|
9828
|
+
value: '',
|
|
9829
|
+
label: 'Select'
|
|
9830
|
+
}),
|
|
9831
|
+
head = _useState[0],
|
|
9832
|
+
setHead = _useState[1];
|
|
9833
|
+
useEffect(function () {
|
|
9834
|
+
deptHeadDetails(rowData);
|
|
9835
|
+
}, [rowData]);
|
|
9836
|
+
var history = useHistory();
|
|
9837
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9838
|
+
console.log(rowData);
|
|
9839
|
+
history.push({
|
|
9840
|
+
pathname: config.routes.users.add.path,
|
|
9841
|
+
state: rowData
|
|
9842
|
+
});
|
|
9843
|
+
};
|
|
9485
9844
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9486
9845
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9487
9846
|
isOpen: isOpen,
|
|
@@ -9489,25 +9848,59 @@ function EditPanelDialog(_ref) {
|
|
|
9489
9848
|
headerText: "Edit " + name.toLowerCase(),
|
|
9490
9849
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9491
9850
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9492
|
-
submitHandler: submitHandler
|
|
9493
|
-
|
|
9851
|
+
submitHandler: function submitHandler() {
|
|
9852
|
+
return _submitHandler(head);
|
|
9853
|
+
},
|
|
9854
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9494
9855
|
hideCloseIcon: false,
|
|
9495
9856
|
modalBodyStyle: {
|
|
9496
|
-
|
|
9497
|
-
overflow: 'auto',
|
|
9498
|
-
margin: '0px'
|
|
9857
|
+
overflowY: 'visible'
|
|
9499
9858
|
},
|
|
9500
9859
|
footerStyle: {
|
|
9501
9860
|
justifyContent: 'end'
|
|
9502
9861
|
}
|
|
9862
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9863
|
+
display: "flex",
|
|
9864
|
+
justifyContent: "center",
|
|
9865
|
+
alignItems: "center",
|
|
9866
|
+
flexDirection: "column",
|
|
9867
|
+
style: {
|
|
9868
|
+
marginBottom: '30px'
|
|
9869
|
+
}
|
|
9503
9870
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9504
|
-
component: "div",
|
|
9505
9871
|
display: "flex",
|
|
9506
9872
|
justifyContent: "center",
|
|
9507
9873
|
alignItems: "center",
|
|
9508
9874
|
flexDirection: "column",
|
|
9509
|
-
|
|
9510
|
-
}, /*#__PURE__*/React.createElement(
|
|
9875
|
+
className: styles$7.baseAlert
|
|
9876
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9877
|
+
className: styles$7.alertDescContainer
|
|
9878
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9879
|
+
className: styles$7.iconLayout,
|
|
9880
|
+
style: {
|
|
9881
|
+
paddingTop: '4px'
|
|
9882
|
+
}
|
|
9883
|
+
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
9884
|
+
color: "#CA8A04",
|
|
9885
|
+
width: "25",
|
|
9886
|
+
height: "20",
|
|
9887
|
+
className: styles$7.iconStyle
|
|
9888
|
+
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
9889
|
+
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.",
|
|
9890
|
+
style: {
|
|
9891
|
+
fontWeight: 'normal'
|
|
9892
|
+
}
|
|
9893
|
+
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
9894
|
+
buttonText: "Add user",
|
|
9895
|
+
type: "text",
|
|
9896
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9897
|
+
width: "9",
|
|
9898
|
+
height: "9",
|
|
9899
|
+
color: "#EC5D25"
|
|
9900
|
+
}),
|
|
9901
|
+
onClick: handleAddPageNavigation,
|
|
9902
|
+
className: styles$7.addUserButton
|
|
9903
|
+
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9511
9904
|
label: name + " name",
|
|
9512
9905
|
name: "name",
|
|
9513
9906
|
defaultValue: dialogData.data.name,
|
|
@@ -9516,7 +9909,49 @@ function EditPanelDialog(_ref) {
|
|
|
9516
9909
|
isError: isError,
|
|
9517
9910
|
validation: validation,
|
|
9518
9911
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9519
|
-
required: true
|
|
9912
|
+
required: true,
|
|
9913
|
+
style: tableName === 'department' && {
|
|
9914
|
+
width: '350px'
|
|
9915
|
+
}
|
|
9916
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9917
|
+
className: "iui__mt-15",
|
|
9918
|
+
style: {
|
|
9919
|
+
width: '100%'
|
|
9920
|
+
}
|
|
9921
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9922
|
+
label: "Department head",
|
|
9923
|
+
name: "name",
|
|
9924
|
+
defaultValue: head.label,
|
|
9925
|
+
placeholder: "",
|
|
9926
|
+
readOnly: true,
|
|
9927
|
+
style: {
|
|
9928
|
+
width: '350px'
|
|
9929
|
+
}
|
|
9930
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9931
|
+
className: "iui__mt-15",
|
|
9932
|
+
style: {
|
|
9933
|
+
width: '100%'
|
|
9934
|
+
}
|
|
9935
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9936
|
+
noResultsText: true,
|
|
9937
|
+
isMove: true,
|
|
9938
|
+
additional: {
|
|
9939
|
+
page: 1,
|
|
9940
|
+
departmentId: rowData.id
|
|
9941
|
+
},
|
|
9942
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9943
|
+
label: "Department head",
|
|
9944
|
+
value: head,
|
|
9945
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9946
|
+
var _value = _ref2._value;
|
|
9947
|
+
return setHead(_value);
|
|
9948
|
+
},
|
|
9949
|
+
loadOption: departmentHeadOptions,
|
|
9950
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9951
|
+
customLoadingText: "No users found in this department",
|
|
9952
|
+
customLoadingTextStyle: {
|
|
9953
|
+
color: '#374151'
|
|
9954
|
+
}
|
|
9520
9955
|
})));
|
|
9521
9956
|
}
|
|
9522
9957
|
|
|
@@ -9695,12 +10130,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9695
10130
|
var _useState13 = useState(false),
|
|
9696
10131
|
isSortingChangeTemp = _useState13[0],
|
|
9697
10132
|
setSortingChangeTemp = _useState13[1];
|
|
9698
|
-
var _useState14 = useState(
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
var _useState15 = useState(
|
|
9702
|
-
|
|
9703
|
-
|
|
10133
|
+
var _useState14 = useState([]),
|
|
10134
|
+
rowData = _useState14[0],
|
|
10135
|
+
setRowData = _useState14[1];
|
|
10136
|
+
var _useState15 = useState(1),
|
|
10137
|
+
page = _useState15[0],
|
|
10138
|
+
setPage = _useState15[1];
|
|
10139
|
+
var _useState16 = useState(5),
|
|
10140
|
+
rowsPerPage = _useState16[0],
|
|
10141
|
+
setRowsPerPage = _useState16[1];
|
|
9704
10142
|
var orderingParam = orderBy;
|
|
9705
10143
|
var _useSelector = useSelector(function (state) {
|
|
9706
10144
|
return state.userPanel;
|
|
@@ -9796,6 +10234,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9796
10234
|
submitLabel: 'Save'
|
|
9797
10235
|
}, '', data));
|
|
9798
10236
|
setDataList(data.name);
|
|
10237
|
+
setRowData(data);
|
|
9799
10238
|
setEditModal(true);
|
|
9800
10239
|
};
|
|
9801
10240
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9810,6 +10249,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9810
10249
|
var payload = {
|
|
9811
10250
|
names: [dataList]
|
|
9812
10251
|
};
|
|
10252
|
+
if (tableName === 'department') {
|
|
10253
|
+
payload = {
|
|
10254
|
+
name: dataList,
|
|
10255
|
+
department_head_id: null
|
|
10256
|
+
};
|
|
10257
|
+
}
|
|
9813
10258
|
var message = title + " added successfully.";
|
|
9814
10259
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9815
10260
|
} else {
|
|
@@ -9823,9 +10268,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9823
10268
|
var message = title + " deleted successfully.";
|
|
9824
10269
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9825
10270
|
};
|
|
9826
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10271
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10272
|
+
if (optionalParams === void 0) {
|
|
10273
|
+
optionalParams = null;
|
|
10274
|
+
}
|
|
9827
10275
|
dispatch(userPanelShowLoader());
|
|
9828
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10276
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9829
10277
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9830
10278
|
dispatch(userPanelStopLoader());
|
|
9831
10279
|
if (type === 'delete') {
|
|
@@ -9867,8 +10315,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9867
10315
|
name: dataList
|
|
9868
10316
|
}]
|
|
9869
10317
|
};
|
|
10318
|
+
if (tableName === 'department') {
|
|
10319
|
+
payload = {
|
|
10320
|
+
name: dataList,
|
|
10321
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10322
|
+
};
|
|
10323
|
+
}
|
|
9870
10324
|
var message = title + " updated successfully.";
|
|
9871
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10325
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9872
10326
|
setErrorEdit(false);
|
|
9873
10327
|
} else {
|
|
9874
10328
|
setErrorEdit(true);
|
|
@@ -9975,7 +10429,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9975
10429
|
submitHandler: handleEditPanel,
|
|
9976
10430
|
isError: errorEdit,
|
|
9977
10431
|
isDisabledSubmitBtn: loading,
|
|
9978
|
-
validation: validation
|
|
10432
|
+
validation: validation,
|
|
10433
|
+
rowData: rowData,
|
|
10434
|
+
tableName: tableName,
|
|
10435
|
+
config: config
|
|
9979
10436
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
9980
10437
|
config: config
|
|
9981
10438
|
}));
|