@itilite/iui-user-management 1.2.1 → 1.3.2
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 +971 -276
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +972 -277
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
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';
|
|
@@ -146,17 +146,11 @@ function r(e) {
|
|
|
146
146
|
var t,
|
|
147
147
|
f,
|
|
148
148
|
n = "";
|
|
149
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
150
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
151
|
-
} else for (t in e) {
|
|
152
|
-
e[t] && (n && (n += " "), n += t);
|
|
153
|
-
}
|
|
149
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t);
|
|
154
150
|
return n;
|
|
155
151
|
}
|
|
156
152
|
function clsx() {
|
|
157
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
158
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
159
|
-
}
|
|
153
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
160
154
|
return n;
|
|
161
155
|
}
|
|
162
156
|
|
|
@@ -360,6 +354,9 @@ var userAddEditUrl = {
|
|
|
360
354
|
approversSearch: function approversSearch() {
|
|
361
355
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
362
356
|
},
|
|
357
|
+
transferAppover: function transferAppover() {
|
|
358
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
359
|
+
},
|
|
363
360
|
preSignedUrl: function preSignedUrl() {
|
|
364
361
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
365
362
|
},
|
|
@@ -456,6 +453,14 @@ var userPanelUrl = {
|
|
|
456
453
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
457
454
|
}
|
|
458
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
|
+
};
|
|
459
464
|
|
|
460
465
|
var api = configs.api;
|
|
461
466
|
var NAoptionConfig = {
|
|
@@ -597,11 +602,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
597
602
|
return Promise.reject(e);
|
|
598
603
|
}
|
|
599
604
|
};
|
|
600
|
-
var
|
|
605
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
601
606
|
var page = _ref4.page,
|
|
602
607
|
product = _ref4.product,
|
|
603
|
-
userId = _ref4.userId
|
|
604
|
-
|
|
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;
|
|
605
652
|
try {
|
|
606
653
|
return Promise.resolve(_catch(function () {
|
|
607
654
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -647,9 +694,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
647
694
|
return Promise.reject(e);
|
|
648
695
|
}
|
|
649
696
|
};
|
|
650
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
651
|
-
var page =
|
|
652
|
-
tabelName =
|
|
697
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
698
|
+
var page = _ref6.page,
|
|
699
|
+
tabelName = _ref6.tabelName;
|
|
653
700
|
try {
|
|
654
701
|
return Promise.resolve(_catch(function () {
|
|
655
702
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -684,6 +731,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
684
731
|
return Promise.reject(e);
|
|
685
732
|
}
|
|
686
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
|
+
};
|
|
687
774
|
|
|
688
775
|
var UserRole = function UserRole(_ref) {
|
|
689
776
|
var _ref$list = _ref.list,
|
|
@@ -1152,10 +1239,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1152
1239
|
payload: tabId
|
|
1153
1240
|
};
|
|
1154
1241
|
};
|
|
1155
|
-
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
|
+
}
|
|
1156
1252
|
return function (dispatch) {
|
|
1157
1253
|
return new Promise(function (resolve, reject) {
|
|
1158
|
-
api$1.
|
|
1254
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1159
1255
|
dispatch(setUserActiveStatus({
|
|
1160
1256
|
is_active: activateVal !== 0,
|
|
1161
1257
|
id: id
|
|
@@ -1719,7 +1815,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1719
1815
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1720
1816
|
return function (dispatch) {
|
|
1721
1817
|
return new Promise(function (resolve, reject) {
|
|
1722
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1818
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1723
1819
|
resolve(res);
|
|
1724
1820
|
})["catch"](function (err) {
|
|
1725
1821
|
var _err$response17, _err$response17$data;
|
|
@@ -1755,6 +1851,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1755
1851
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1756
1852
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1757
1853
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1854
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1758
1855
|
|
|
1759
1856
|
var api$3 = configs.api;
|
|
1760
1857
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1804,14 +1901,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1804
1901
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1805
1902
|
return function (dispatch) {
|
|
1806
1903
|
return new Promise(function (resolve, reject) {
|
|
1807
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1904
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1808
1905
|
dispatch(getUserPanalData(getParam));
|
|
1809
1906
|
dispatch(closeDialog());
|
|
1810
1907
|
resolve(res);
|
|
1811
1908
|
})["catch"](function (err) {
|
|
1812
|
-
var _err$
|
|
1909
|
+
var _err$response3, _err$response3$data;
|
|
1813
1910
|
dispatch(userPanelStopLoader());
|
|
1814
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1911
|
+
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.');
|
|
1815
1912
|
});
|
|
1816
1913
|
});
|
|
1817
1914
|
};
|
|
@@ -1825,25 +1922,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1825
1922
|
dispatch(userPanelStopLoader());
|
|
1826
1923
|
resolve();
|
|
1827
1924
|
})["catch"](function (err) {
|
|
1828
|
-
var _err$
|
|
1829
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1925
|
+
var _err$response4, _err$response4$data;
|
|
1926
|
+
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.');
|
|
1830
1927
|
dispatch(userPanelStopLoader());
|
|
1831
1928
|
});
|
|
1832
1929
|
});
|
|
1833
1930
|
};
|
|
1834
1931
|
};
|
|
1835
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1932
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1836
1933
|
return function (dispatch) {
|
|
1837
1934
|
return new Promise(function (resolve, reject) {
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1935
|
+
if (tableName === 'department') {
|
|
1936
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1937
|
+
dispatch(getUserPanalData(getParam));
|
|
1938
|
+
dispatch(closeDialog());
|
|
1939
|
+
resolve();
|
|
1940
|
+
})["catch"](function (err) {
|
|
1941
|
+
var _err$response5, _err$response5$data;
|
|
1942
|
+
dispatch(userPanelStopLoader());
|
|
1943
|
+
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.');
|
|
1944
|
+
});
|
|
1945
|
+
} else {
|
|
1946
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1947
|
+
dispatch(getUserPanalData(getParam));
|
|
1948
|
+
dispatch(closeDialog());
|
|
1949
|
+
resolve();
|
|
1950
|
+
})["catch"](function (err) {
|
|
1951
|
+
var _err$response6, _err$response6$data;
|
|
1952
|
+
dispatch(userPanelStopLoader());
|
|
1953
|
+
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.');
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1847
1956
|
});
|
|
1848
1957
|
};
|
|
1849
1958
|
};
|
|
@@ -1855,8 +1964,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1855
1964
|
dispatch(closeDialog());
|
|
1856
1965
|
resolve(res);
|
|
1857
1966
|
})["catch"](function (err) {
|
|
1858
|
-
var _err$
|
|
1859
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1967
|
+
var _err$response7, _err$response7$data;
|
|
1968
|
+
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.');
|
|
1860
1969
|
});
|
|
1861
1970
|
});
|
|
1862
1971
|
};
|
|
@@ -3956,6 +4065,7 @@ var initialState$2 = {
|
|
|
3956
4065
|
previous: null,
|
|
3957
4066
|
results: []
|
|
3958
4067
|
},
|
|
4068
|
+
deptUsers: [],
|
|
3959
4069
|
loading: false
|
|
3960
4070
|
};
|
|
3961
4071
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4025,6 +4135,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4025
4135
|
loading: false
|
|
4026
4136
|
});
|
|
4027
4137
|
}
|
|
4138
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4139
|
+
{
|
|
4140
|
+
return _extends({}, state, {
|
|
4141
|
+
deptUsers: action.payload
|
|
4142
|
+
});
|
|
4143
|
+
}
|
|
4028
4144
|
default:
|
|
4029
4145
|
return state;
|
|
4030
4146
|
}
|
|
@@ -4803,6 +4919,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4803
4919
|
isILadmin = _useSelector2.isILadmin,
|
|
4804
4920
|
companyName = _useSelector2.companyName;
|
|
4805
4921
|
var history = useHistory();
|
|
4922
|
+
var location = useLocation();
|
|
4806
4923
|
var _useState = useState({
|
|
4807
4924
|
travel: false,
|
|
4808
4925
|
expense: false
|
|
@@ -5058,6 +5175,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5058
5175
|
var onAddModalClose = function onAddModalClose() {
|
|
5059
5176
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5060
5177
|
};
|
|
5178
|
+
useEffect(function () {
|
|
5179
|
+
var _location$state, _location$state2;
|
|
5180
|
+
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) {
|
|
5181
|
+
var _location$state3, _location$state4;
|
|
5182
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5183
|
+
department: {
|
|
5184
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5185
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5186
|
+
}
|
|
5187
|
+
}));
|
|
5188
|
+
}
|
|
5189
|
+
}, []);
|
|
5061
5190
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5062
5191
|
var title = '';
|
|
5063
5192
|
if (id === 'entity') {
|
|
@@ -5083,24 +5212,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5083
5212
|
}));
|
|
5084
5213
|
} else {
|
|
5085
5214
|
dispatch(showLoader());
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5215
|
+
var dataObj;
|
|
5216
|
+
if (addModalData.id === 'department') {
|
|
5217
|
+
dataObj = {
|
|
5218
|
+
name: validatedValue,
|
|
5219
|
+
department_head_id: null
|
|
5220
|
+
};
|
|
5221
|
+
} else {
|
|
5222
|
+
dataObj = {
|
|
5223
|
+
names: [validatedValue]
|
|
5224
|
+
};
|
|
5225
|
+
}
|
|
5226
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5227
|
+
var _extends4;
|
|
5090
5228
|
setAddModalData(_extends({}, addModalData, {
|
|
5091
5229
|
isOpen: false
|
|
5092
5230
|
}));
|
|
5093
5231
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5094
5232
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5098
|
-
|
|
5099
|
-
|
|
5233
|
+
if (addModalData.id === 'department') {
|
|
5234
|
+
var _extends2;
|
|
5235
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5236
|
+
value: res.data.result.id,
|
|
5237
|
+
label: res.data.result.name
|
|
5238
|
+
}, _extends2)));
|
|
5239
|
+
} else {
|
|
5240
|
+
var _extends3;
|
|
5241
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5242
|
+
value: res.data.value,
|
|
5243
|
+
label: res.data.label
|
|
5244
|
+
}, _extends3)));
|
|
5245
|
+
}
|
|
5246
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5100
5247
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5101
5248
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5102
|
-
var
|
|
5103
|
-
return _extends({}, prevState, (
|
|
5249
|
+
var _extends5;
|
|
5250
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5104
5251
|
});
|
|
5105
5252
|
dispatch(stopLoader());
|
|
5106
5253
|
});
|
|
@@ -5117,10 +5264,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5117
5264
|
};
|
|
5118
5265
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5119
5266
|
try {
|
|
5120
|
-
var
|
|
5267
|
+
var _temp5 = function _temp5() {
|
|
5121
5268
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5122
|
-
var
|
|
5123
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5269
|
+
var _extends6;
|
|
5270
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5124
5271
|
}
|
|
5125
5272
|
};
|
|
5126
5273
|
var _name = args._name,
|
|
@@ -5131,7 +5278,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5131
5278
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5132
5279
|
_args$_obj = args._obj,
|
|
5133
5280
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5134
|
-
var
|
|
5281
|
+
var _temp4 = function () {
|
|
5135
5282
|
if (_name === 'contact_number') {
|
|
5136
5283
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5137
5284
|
contact_number: _value.trim(),
|
|
@@ -5142,14 +5289,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5142
5289
|
updateError('country_code', _isError, _errorMsg);
|
|
5143
5290
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5144
5291
|
} else {
|
|
5145
|
-
var
|
|
5146
|
-
var
|
|
5147
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5292
|
+
var _temp3 = function _temp3() {
|
|
5293
|
+
var _extends7;
|
|
5294
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5148
5295
|
updateError(_name, _isError, _errorMsg);
|
|
5149
5296
|
};
|
|
5150
|
-
var
|
|
5297
|
+
var _temp2 = function () {
|
|
5151
5298
|
if (_name === 'profile_pic') {
|
|
5152
|
-
var
|
|
5299
|
+
var _temp = function () {
|
|
5153
5300
|
if (_obj.isUpload) {
|
|
5154
5301
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5155
5302
|
_value = _value.map(function (_val) {
|
|
@@ -5180,19 +5327,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5180
5327
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5181
5328
|
}
|
|
5182
5329
|
}();
|
|
5183
|
-
if (
|
|
5330
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
5184
5331
|
}
|
|
5185
5332
|
}();
|
|
5186
|
-
return
|
|
5333
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
5187
5334
|
}
|
|
5188
5335
|
}();
|
|
5189
|
-
return Promise.resolve(
|
|
5336
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
|
5190
5337
|
} catch (e) {
|
|
5191
5338
|
return Promise.reject(e);
|
|
5192
5339
|
}
|
|
5193
5340
|
};
|
|
5194
5341
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5195
|
-
var
|
|
5342
|
+
var _extends8;
|
|
5196
5343
|
var _name = args._name,
|
|
5197
5344
|
_value = args._value,
|
|
5198
5345
|
_isError = args._isError,
|
|
@@ -5201,11 +5348,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5201
5348
|
_name: _name,
|
|
5202
5349
|
_value: _value
|
|
5203
5350
|
});
|
|
5204
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5351
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5205
5352
|
updateError(_name, _isError, _errorMsg);
|
|
5206
5353
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5207
|
-
var
|
|
5208
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5354
|
+
var _extends9;
|
|
5355
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5209
5356
|
}
|
|
5210
5357
|
};
|
|
5211
5358
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5215,9 +5362,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5215
5362
|
return tag.id;
|
|
5216
5363
|
};
|
|
5217
5364
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5218
|
-
var
|
|
5365
|
+
var _extends10;
|
|
5219
5366
|
var e = args._event;
|
|
5220
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5367
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5221
5368
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5222
5369
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5223
5370
|
userTagType: true
|
|
@@ -5225,22 +5372,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5225
5372
|
}
|
|
5226
5373
|
};
|
|
5227
5374
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5228
|
-
var
|
|
5375
|
+
var _extends11;
|
|
5229
5376
|
var _name = _ref2._name,
|
|
5230
5377
|
_value = _ref2._value;
|
|
5231
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5378
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5232
5379
|
};
|
|
5233
5380
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5234
|
-
var
|
|
5381
|
+
var _extends12;
|
|
5235
5382
|
var _name = _ref3._name,
|
|
5236
5383
|
_value = _ref3._value;
|
|
5237
|
-
|
|
5384
|
+
console.log(_name, _value, 'travel');
|
|
5385
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5238
5386
|
};
|
|
5239
5387
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5240
|
-
var
|
|
5388
|
+
var _extends13;
|
|
5241
5389
|
var _name = _ref4._name,
|
|
5242
5390
|
_value = _ref4._value;
|
|
5243
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5391
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5244
5392
|
};
|
|
5245
5393
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5246
5394
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5274,39 +5422,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5274
5422
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5275
5423
|
};
|
|
5276
5424
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5277
|
-
var
|
|
5425
|
+
var _extends14;
|
|
5278
5426
|
var _name = args._name,
|
|
5279
5427
|
_value = args._value,
|
|
5280
5428
|
_isError = args._isError,
|
|
5281
5429
|
_errorMsg = args._errorMsg;
|
|
5282
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5430
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5283
5431
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5284
|
-
var
|
|
5285
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5432
|
+
var _extends15;
|
|
5433
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5286
5434
|
}
|
|
5287
5435
|
updateError(_name, _isError, _errorMsg);
|
|
5288
5436
|
};
|
|
5289
5437
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5290
|
-
var
|
|
5438
|
+
var _extends16;
|
|
5291
5439
|
var _name = args._name,
|
|
5292
5440
|
_value = args._value,
|
|
5293
5441
|
_isError = args._isError,
|
|
5294
5442
|
_errorMsg = args._errorMsg;
|
|
5295
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5443
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5296
5444
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5297
|
-
var
|
|
5298
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5445
|
+
var _extends17;
|
|
5446
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5299
5447
|
}
|
|
5300
5448
|
updateError(_name, _isError, _errorMsg);
|
|
5301
5449
|
};
|
|
5302
5450
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5303
5451
|
try {
|
|
5304
|
-
var
|
|
5305
|
-
var
|
|
5306
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5452
|
+
var _temp8 = function _temp8() {
|
|
5453
|
+
var _extends18;
|
|
5454
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5307
5455
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5308
|
-
var
|
|
5309
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5456
|
+
var _extends19;
|
|
5457
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5310
5458
|
}
|
|
5311
5459
|
updateError(_name, _isError, _errorMsg);
|
|
5312
5460
|
};
|
|
@@ -5344,9 +5492,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5344
5492
|
}
|
|
5345
5493
|
return Promise.resolve();
|
|
5346
5494
|
}
|
|
5347
|
-
var
|
|
5495
|
+
var _temp7 = function () {
|
|
5348
5496
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5349
|
-
var
|
|
5497
|
+
var _temp6 = function () {
|
|
5350
5498
|
if (_obj.isUpload) {
|
|
5351
5499
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5352
5500
|
if (_name === 'passport_photo') {
|
|
@@ -5390,10 +5538,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5390
5538
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5391
5539
|
}
|
|
5392
5540
|
}();
|
|
5393
|
-
if (
|
|
5541
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
5394
5542
|
}
|
|
5395
5543
|
}();
|
|
5396
|
-
return Promise.resolve(
|
|
5544
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
|
5397
5545
|
} catch (e) {
|
|
5398
5546
|
return Promise.reject(e);
|
|
5399
5547
|
}
|
|
@@ -5412,8 +5560,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5412
5560
|
return _errorArray;
|
|
5413
5561
|
});
|
|
5414
5562
|
setErrorMsgs(function (prevState) {
|
|
5415
|
-
var
|
|
5416
|
-
return _extends({}, prevState, (
|
|
5563
|
+
var _extends20;
|
|
5564
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5417
5565
|
});
|
|
5418
5566
|
};
|
|
5419
5567
|
var dispatch = useDispatch();
|
|
@@ -5719,7 +5867,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5719
5867
|
}, [renderFields.expenseApprovers]);
|
|
5720
5868
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5721
5869
|
try {
|
|
5722
|
-
var
|
|
5870
|
+
var _temp10 = function _temp10() {
|
|
5723
5871
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5724
5872
|
dispatch(stopLoader());
|
|
5725
5873
|
return data;
|
|
@@ -5735,12 +5883,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5735
5883
|
userID: editUserId
|
|
5736
5884
|
});
|
|
5737
5885
|
});
|
|
5738
|
-
var
|
|
5886
|
+
var _temp9 = _forTo(docs, function (i) {
|
|
5739
5887
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5740
5888
|
data.push(res);
|
|
5741
5889
|
});
|
|
5742
5890
|
});
|
|
5743
|
-
return Promise.resolve(
|
|
5891
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9));
|
|
5744
5892
|
} catch (e) {
|
|
5745
5893
|
return Promise.reject(e);
|
|
5746
5894
|
}
|
|
@@ -5896,27 +6044,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5896
6044
|
if (_isError) {
|
|
5897
6045
|
setErrorArray(_errorArray);
|
|
5898
6046
|
setErrorMsgs(_errorMsgs);
|
|
5899
|
-
|
|
6047
|
+
var _loop = function _loop() {
|
|
5900
6048
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
5901
6049
|
if (_errorMsgs[_key3]) {
|
|
5902
|
-
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
}
|
|
5916
|
-
}();
|
|
5917
|
-
if (_ret === "break") break;
|
|
6050
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
6051
|
+
setAdditionalInfoFlag('open');
|
|
6052
|
+
}
|
|
6053
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
6054
|
+
if (el) {
|
|
6055
|
+
setTimeout(function () {
|
|
6056
|
+
el.scrollIntoView({
|
|
6057
|
+
behavior: 'smooth',
|
|
6058
|
+
block: 'center'
|
|
6059
|
+
});
|
|
6060
|
+
}, 500);
|
|
6061
|
+
return "break";
|
|
6062
|
+
}
|
|
5918
6063
|
}
|
|
5919
6064
|
}
|
|
6065
|
+
};
|
|
6066
|
+
for (var _key3 in _errorMsgs) {
|
|
6067
|
+
var _ret = _loop();
|
|
6068
|
+
if (_ret === "break") break;
|
|
5920
6069
|
}
|
|
5921
6070
|
return Promise.resolve();
|
|
5922
6071
|
}
|
|
@@ -5946,27 +6095,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5946
6095
|
}
|
|
5947
6096
|
setErrorArray(Object.keys(err));
|
|
5948
6097
|
setErrorMsgs(err);
|
|
5949
|
-
|
|
6098
|
+
var _loop2 = function _loop2() {
|
|
5950
6099
|
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5951
6100
|
if (err[_key4]) {
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
}
|
|
5966
|
-
}();
|
|
5967
|
-
if (_ret2 === "break") break;
|
|
6101
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6102
|
+
setAdditionalInfoFlag('open');
|
|
6103
|
+
}
|
|
6104
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6105
|
+
if (el) {
|
|
6106
|
+
setTimeout(function () {
|
|
6107
|
+
el.scrollIntoView({
|
|
6108
|
+
behavior: 'smooth',
|
|
6109
|
+
block: 'center'
|
|
6110
|
+
});
|
|
6111
|
+
}, 500);
|
|
6112
|
+
return "break";
|
|
6113
|
+
}
|
|
5968
6114
|
}
|
|
5969
6115
|
}
|
|
6116
|
+
};
|
|
6117
|
+
for (var _key4 in err) {
|
|
6118
|
+
var _ret2 = _loop2();
|
|
6119
|
+
if (_ret2 === "break") break;
|
|
5970
6120
|
}
|
|
5971
6121
|
} else if (typeof err === 'string') {
|
|
5972
6122
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5995,27 +6145,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5995
6145
|
}
|
|
5996
6146
|
setErrorArray(Object.keys(err));
|
|
5997
6147
|
setErrorMsgs(err);
|
|
5998
|
-
|
|
6148
|
+
var _loop3 = function _loop3() {
|
|
5999
6149
|
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6000
6150
|
if (err[_key5]) {
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
}
|
|
6015
|
-
}();
|
|
6016
|
-
if (_ret3 === "break") break;
|
|
6151
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6152
|
+
setAdditionalInfoFlag('open');
|
|
6153
|
+
}
|
|
6154
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6155
|
+
if (el) {
|
|
6156
|
+
setTimeout(function () {
|
|
6157
|
+
el.scrollIntoView({
|
|
6158
|
+
behavior: 'smooth',
|
|
6159
|
+
block: 'center'
|
|
6160
|
+
});
|
|
6161
|
+
}, 500);
|
|
6162
|
+
return "break";
|
|
6163
|
+
}
|
|
6017
6164
|
}
|
|
6018
6165
|
}
|
|
6166
|
+
};
|
|
6167
|
+
for (var _key5 in err) {
|
|
6168
|
+
var _ret3 = _loop3();
|
|
6169
|
+
if (_ret3 === "break") break;
|
|
6019
6170
|
}
|
|
6020
6171
|
} else if (typeof err === 'string') {
|
|
6021
6172
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6739,7 +6890,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6739
6890
|
};
|
|
6740
6891
|
};
|
|
6741
6892
|
|
|
6742
|
-
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"};
|
|
6893
|
+
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"};
|
|
6743
6894
|
|
|
6744
6895
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6745
6896
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6808,7 +6959,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6808
6959
|
file: doc
|
|
6809
6960
|
});
|
|
6810
6961
|
});
|
|
6811
|
-
var
|
|
6962
|
+
var _temp = _forTo(docs, function (i) {
|
|
6812
6963
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6813
6964
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6814
6965
|
if (validatedRes.data.status) {
|
|
@@ -6848,7 +6999,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6848
6999
|
})).then(function () {});
|
|
6849
7000
|
});
|
|
6850
7001
|
});
|
|
6851
|
-
return Promise.resolve(
|
|
7002
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
6852
7003
|
} catch (e) {
|
|
6853
7004
|
return Promise.reject(e);
|
|
6854
7005
|
}
|
|
@@ -8225,9 +8376,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8225
8376
|
cell: function cell(row) {
|
|
8226
8377
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8227
8378
|
component: "div",
|
|
8228
|
-
width:
|
|
8379
|
+
width: 80
|
|
8229
8380
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
8230
|
-
title: "This user hasn't logged
|
|
8381
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8231
8382
|
arrow: true,
|
|
8232
8383
|
classes: {
|
|
8233
8384
|
arrow: classes.arrow,
|
|
@@ -8235,7 +8386,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8235
8386
|
},
|
|
8236
8387
|
placement: "top-start"
|
|
8237
8388
|
}, /*#__PURE__*/React.createElement("div", {
|
|
8238
|
-
className: clsx(styles$5.
|
|
8389
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8239
8390
|
}, "Invited")) : null);
|
|
8240
8391
|
}
|
|
8241
8392
|
}, {
|
|
@@ -8336,7 +8487,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8336
8487
|
options.push({
|
|
8337
8488
|
label: 'Resend invite',
|
|
8338
8489
|
handler: function handler() {
|
|
8339
|
-
return toggleInviteModal(row.id, 'single');
|
|
8490
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8340
8491
|
}
|
|
8341
8492
|
});
|
|
8342
8493
|
}
|
|
@@ -8508,6 +8659,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8508
8659
|
});
|
|
8509
8660
|
};
|
|
8510
8661
|
|
|
8662
|
+
function InfoYellowIcon(props) {
|
|
8663
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8664
|
+
width: props.width,
|
|
8665
|
+
height: props.height,
|
|
8666
|
+
viewBox: "0 0 20 20",
|
|
8667
|
+
fill: "none",
|
|
8668
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8669
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8670
|
+
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",
|
|
8671
|
+
fill: "#CA8A04"
|
|
8672
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8673
|
+
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",
|
|
8674
|
+
fill: "#CA8A04"
|
|
8675
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8676
|
+
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",
|
|
8677
|
+
fill: "#CA8A04"
|
|
8678
|
+
}));
|
|
8679
|
+
}
|
|
8680
|
+
|
|
8681
|
+
function RedWarningIcon(props) {
|
|
8682
|
+
var _props$color = props.color,
|
|
8683
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8684
|
+
_props$size = props.size,
|
|
8685
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8686
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8687
|
+
width: size,
|
|
8688
|
+
height: size,
|
|
8689
|
+
viewBox: "0 0 14 14",
|
|
8690
|
+
fill: color,
|
|
8691
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8692
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8693
|
+
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",
|
|
8694
|
+
fill: color
|
|
8695
|
+
}));
|
|
8696
|
+
}
|
|
8697
|
+
|
|
8511
8698
|
function InviteInfoIcon() {
|
|
8512
8699
|
return /*#__PURE__*/React.createElement("svg", {
|
|
8513
8700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8525,7 +8712,8 @@ function InviteInfoIcon() {
|
|
|
8525
8712
|
}
|
|
8526
8713
|
|
|
8527
8714
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8528
|
-
var env$7 = configs.env
|
|
8715
|
+
var env$7 = configs.env,
|
|
8716
|
+
api$7 = configs.api;
|
|
8529
8717
|
var UndoButton = function UndoButton(_ref) {
|
|
8530
8718
|
var onUndo = _ref.onUndo,
|
|
8531
8719
|
msg = _ref.msg;
|
|
@@ -8563,27 +8751,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8563
8751
|
isDataFetching = _useSelector.isDataFetching,
|
|
8564
8752
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8565
8753
|
tabValue = _useSelector.tabValue;
|
|
8566
|
-
var
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
searchValue = _useState2[0],
|
|
8583
|
-
setSearchValue = _useState2[1];
|
|
8754
|
+
var newSelecteds = userListInfo.results;
|
|
8755
|
+
var _React$useState = React.useState(''),
|
|
8756
|
+
deactivateUser = _React$useState[0],
|
|
8757
|
+
setDeactivateUser = _React$useState[1];
|
|
8758
|
+
var _React$useState2 = React.useState(null),
|
|
8759
|
+
defaultId = _React$useState2[0],
|
|
8760
|
+
setDefaultId = _React$useState2[1];
|
|
8761
|
+
var _React$useState3 = React.useState(1),
|
|
8762
|
+
page = _React$useState3[0],
|
|
8763
|
+
setPage = _React$useState3[1];
|
|
8764
|
+
var _useState = useState([]),
|
|
8765
|
+
selectedUsersNotApprover = _useState[0],
|
|
8766
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8767
|
+
var _useState2 = useState([]),
|
|
8768
|
+
selectedUsersApprover = _useState2[0],
|
|
8769
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8584
8770
|
var _useState3 = useState(false),
|
|
8585
|
-
|
|
8586
|
-
|
|
8771
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8772
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8773
|
+
var _React$useState4 = React.useState(''),
|
|
8774
|
+
user = _React$useState4[0],
|
|
8775
|
+
setUser = _React$useState4[1];
|
|
8776
|
+
var _useState4 = useState(10),
|
|
8777
|
+
rowsPerPage = _useState4[0],
|
|
8778
|
+
setRowsPerPage = _useState4[1];
|
|
8779
|
+
var _React$useState5 = React.useState({}),
|
|
8780
|
+
selected = _React$useState5[0],
|
|
8781
|
+
setSelected = _React$useState5[1];
|
|
8782
|
+
var _React$useState6 = React.useState('asc'),
|
|
8783
|
+
order = _React$useState6[0],
|
|
8784
|
+
setOrder = _React$useState6[1];
|
|
8785
|
+
var _React$useState7 = React.useState(false),
|
|
8786
|
+
deactivateSingle = _React$useState7[0],
|
|
8787
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8788
|
+
var _React$useState8 = React.useState('first_name'),
|
|
8789
|
+
orderBy = _React$useState8[0],
|
|
8790
|
+
setOrderBy = _React$useState8[1];
|
|
8791
|
+
var _useState5 = useState(''),
|
|
8792
|
+
searchValue = _useState5[0],
|
|
8793
|
+
setSearchValue = _useState5[1];
|
|
8794
|
+
var _useState6 = useState(false),
|
|
8795
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8796
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8587
8797
|
var _useSelector2 = useSelector(function (state) {
|
|
8588
8798
|
return state.common;
|
|
8589
8799
|
}),
|
|
@@ -8591,36 +8801,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8591
8801
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8592
8802
|
isILadmin = _useSelector2.isILadmin,
|
|
8593
8803
|
companyName = _useSelector2.companyName;
|
|
8594
|
-
var _useState4 = useState(false),
|
|
8595
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8596
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8597
|
-
var _useState5 = useState(false),
|
|
8598
|
-
isFileDownloading = _useState5[0],
|
|
8599
|
-
setDownlStatus = _useState5[1];
|
|
8600
|
-
var _useState6 = useState(false),
|
|
8601
|
-
isSortingChange = _useState6[0],
|
|
8602
|
-
setSortingChange = _useState6[1];
|
|
8603
8804
|
var _useState7 = useState(false),
|
|
8604
|
-
|
|
8605
|
-
|
|
8805
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8806
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8606
8807
|
var _useState8 = useState(false),
|
|
8607
|
-
|
|
8608
|
-
|
|
8808
|
+
approveeStatus = _useState8[0],
|
|
8809
|
+
setApproveeStatus = _useState8[1];
|
|
8609
8810
|
var _useState9 = useState(false),
|
|
8610
|
-
|
|
8611
|
-
|
|
8811
|
+
isFileDownloading = _useState9[0],
|
|
8812
|
+
setDownlStatus = _useState9[1];
|
|
8612
8813
|
var _useState10 = useState(false),
|
|
8613
|
-
|
|
8614
|
-
|
|
8814
|
+
isSortingChange = _useState10[0],
|
|
8815
|
+
setSortingChange = _useState10[1];
|
|
8615
8816
|
var _useState11 = useState(false),
|
|
8616
|
-
|
|
8617
|
-
|
|
8618
|
-
var _useState12 = useState(
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
var
|
|
8622
|
-
|
|
8623
|
-
|
|
8817
|
+
isSearchingChange = _useState11[0],
|
|
8818
|
+
setSearchingChange = _useState11[1];
|
|
8819
|
+
var _useState12 = useState(false),
|
|
8820
|
+
isSortingChangeTemp = _useState12[0],
|
|
8821
|
+
setSortingChangeTemp = _useState12[1];
|
|
8822
|
+
var _useState13 = useState(false),
|
|
8823
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8824
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8825
|
+
var _useState14 = useState(false),
|
|
8826
|
+
isApiFetching = _useState14[0],
|
|
8827
|
+
setisApiFetching = _useState14[1];
|
|
8828
|
+
var _useState15 = useState({
|
|
8829
|
+
value: '',
|
|
8830
|
+
label: 'Select approver'
|
|
8831
|
+
}),
|
|
8832
|
+
approverRole = _useState15[0],
|
|
8833
|
+
setApproverRole = _useState15[1];
|
|
8834
|
+
var _useState16 = useState(false),
|
|
8835
|
+
showInviteModal = _useState16[0],
|
|
8836
|
+
setToggleInviteModal = _useState16[1];
|
|
8837
|
+
var _useState17 = useState(''),
|
|
8838
|
+
userIds = _useState17[0],
|
|
8839
|
+
setUserIds = _useState17[1];
|
|
8840
|
+
var _React$useState9 = React.useState(false),
|
|
8841
|
+
overlayMenu = _React$useState9[0],
|
|
8842
|
+
setOverlayMenu = _React$useState9[1];
|
|
8843
|
+
var _useState18 = useState(''),
|
|
8844
|
+
userFirstName = _useState18[0],
|
|
8845
|
+
setUserFirstName = _useState18[1];
|
|
8846
|
+
var _useState19 = useState(''),
|
|
8847
|
+
userLastName = _useState19[0],
|
|
8848
|
+
setUserLastName = _useState19[1];
|
|
8849
|
+
var _useState20 = useState(true),
|
|
8850
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8851
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8624
8852
|
useScrollPosition(function (_ref3) {
|
|
8625
8853
|
var prevPos = _ref3.prevPos,
|
|
8626
8854
|
currPos = _ref3.currPos;
|
|
@@ -8641,47 +8869,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8641
8869
|
behavior: 'smooth'
|
|
8642
8870
|
});
|
|
8643
8871
|
};
|
|
8644
|
-
var _React$
|
|
8645
|
-
signup_page = _React$
|
|
8646
|
-
setSignUpPage = _React$
|
|
8647
|
-
var
|
|
8648
|
-
signup_rowsPerPage =
|
|
8649
|
-
setSignUpRowsPerPage =
|
|
8650
|
-
var _React$
|
|
8651
|
-
signup_order = _React$
|
|
8652
|
-
setSignUpOrder = _React$
|
|
8653
|
-
var _React$
|
|
8654
|
-
signup_orderBy = _React$
|
|
8655
|
-
setSignUpOrderBy = _React$
|
|
8656
|
-
var
|
|
8657
|
-
signup_searchValue =
|
|
8658
|
-
set_signup_SearchValue =
|
|
8659
|
-
var
|
|
8660
|
-
isSignUpSortingChange =
|
|
8661
|
-
setSignUpSortingChange =
|
|
8662
|
-
var
|
|
8663
|
-
isSignUpSearchingChange =
|
|
8664
|
-
setSignUpSearchingChange =
|
|
8665
|
-
var
|
|
8666
|
-
isSignUpSortingChangeTemp =
|
|
8667
|
-
setSignUpSortingChangeTemp =
|
|
8668
|
-
var
|
|
8669
|
-
isSignUpSearchingChangeTemp =
|
|
8670
|
-
setSignUpSearchingChangeTemp =
|
|
8872
|
+
var _React$useState10 = React.useState(1),
|
|
8873
|
+
signup_page = _React$useState10[0],
|
|
8874
|
+
setSignUpPage = _React$useState10[1];
|
|
8875
|
+
var _useState21 = useState(5),
|
|
8876
|
+
signup_rowsPerPage = _useState21[0],
|
|
8877
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8878
|
+
var _React$useState11 = React.useState('asc'),
|
|
8879
|
+
signup_order = _React$useState11[0],
|
|
8880
|
+
setSignUpOrder = _React$useState11[1];
|
|
8881
|
+
var _React$useState12 = React.useState('fname'),
|
|
8882
|
+
signup_orderBy = _React$useState12[0],
|
|
8883
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8884
|
+
var _useState22 = useState(''),
|
|
8885
|
+
signup_searchValue = _useState22[0],
|
|
8886
|
+
set_signup_SearchValue = _useState22[1];
|
|
8887
|
+
var _useState23 = useState(false),
|
|
8888
|
+
isSignUpSortingChange = _useState23[0],
|
|
8889
|
+
setSignUpSortingChange = _useState23[1];
|
|
8890
|
+
var _useState24 = useState(false),
|
|
8891
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8892
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8893
|
+
var _useState25 = useState(false),
|
|
8894
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8895
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8896
|
+
var _useState26 = useState(false),
|
|
8897
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8898
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8671
8899
|
var _useSelector3 = useSelector(function (state) {
|
|
8672
8900
|
return state.userList;
|
|
8673
8901
|
}),
|
|
8674
8902
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8903
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8904
|
+
history.push(config.routes.notification.path);
|
|
8905
|
+
};
|
|
8675
8906
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8676
8907
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8677
8908
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8678
8909
|
return false;
|
|
8679
8910
|
}
|
|
8680
|
-
|
|
8911
|
+
if (selectedUsersApprover.length) {
|
|
8912
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8913
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8914
|
+
var _selected = Object.values(selected).flat();
|
|
8915
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8916
|
+
return _selected.includes(item.id.toString());
|
|
8917
|
+
});
|
|
8918
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8919
|
+
return _selected.includes(item.id.toString());
|
|
8920
|
+
});
|
|
8921
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8922
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8923
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8924
|
+
} else {
|
|
8925
|
+
setOpenDeActivateModalFlag(true);
|
|
8926
|
+
}
|
|
8681
8927
|
};
|
|
8682
8928
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8683
8929
|
setOpenDeActivateModalFlag(false);
|
|
8684
8930
|
};
|
|
8931
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8932
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8933
|
+
};
|
|
8685
8934
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8686
8935
|
history.push(config.routes.users.add.path);
|
|
8687
8936
|
};
|
|
@@ -8729,12 +8978,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8729
8978
|
};
|
|
8730
8979
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8731
8980
|
var _extends2;
|
|
8732
|
-
var
|
|
8981
|
+
var selectedId = [];
|
|
8982
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8983
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8984
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8733
8985
|
return n.is_active;
|
|
8734
|
-
}).map(function (obj) {
|
|
8735
|
-
return obj.id.toString();
|
|
8736
8986
|
});
|
|
8737
|
-
|
|
8987
|
+
_newSelecteds.map(function (obj) {
|
|
8988
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
8989
|
+
if (obj.roles.is_approver === true) {
|
|
8990
|
+
_selectedUsersApprover.push(obj);
|
|
8991
|
+
} else if (obj.roles.is_approver === false) {
|
|
8992
|
+
_selectedUsersNotApprover.push(obj);
|
|
8993
|
+
}
|
|
8994
|
+
}
|
|
8995
|
+
selectedId.push(obj.id.toString());
|
|
8996
|
+
});
|
|
8997
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
8998
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
8999
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8738
9000
|
};
|
|
8739
9001
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8740
9002
|
var _extends3;
|
|
@@ -8761,49 +9023,145 @@ var UserList = function UserList(_ref2) {
|
|
|
8761
9023
|
setSignUpSearchingChange(true);
|
|
8762
9024
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8763
9025
|
};
|
|
8764
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9026
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8765
9027
|
var _extends4;
|
|
8766
9028
|
var selectedTemp = _extends({}, selected);
|
|
8767
9029
|
if (!(page in selectedTemp)) {
|
|
8768
9030
|
selectedTemp[page] = [];
|
|
8769
9031
|
}
|
|
8770
9032
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8771
|
-
var
|
|
9033
|
+
var _newSelected = [];
|
|
8772
9034
|
if (selectedIndex === -1) {
|
|
8773
|
-
|
|
9035
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8774
9036
|
} else if (selectedIndex === 0) {
|
|
8775
|
-
|
|
9037
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8776
9038
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8777
|
-
|
|
9039
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8778
9040
|
} else if (selectedIndex > 0) {
|
|
8779
|
-
|
|
9041
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9042
|
+
}
|
|
9043
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9044
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9045
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9046
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9047
|
+
return id !== item.id.toString();
|
|
9048
|
+
});
|
|
9049
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9050
|
+
return item.id.toString() !== id;
|
|
9051
|
+
});
|
|
9052
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9053
|
+
if (data.roles.is_approver === true) {
|
|
9054
|
+
_SelectedUsersApprover.push(data);
|
|
9055
|
+
} else if (data.roles.is_approver === false) {
|
|
9056
|
+
_SelectedUsersNotApprover.push(data);
|
|
9057
|
+
}
|
|
8780
9058
|
}
|
|
8781
|
-
|
|
9059
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9060
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9061
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8782
9062
|
};
|
|
9063
|
+
useEffect(function () {
|
|
9064
|
+
setApproverRole({
|
|
9065
|
+
value: '',
|
|
9066
|
+
label: 'Select approver'
|
|
9067
|
+
});
|
|
9068
|
+
setDefaultId(null);
|
|
9069
|
+
setIsDisabledSubmitBtn(true);
|
|
9070
|
+
setApproveeStatus(false);
|
|
9071
|
+
if (deactivateSingle === true) {
|
|
9072
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9073
|
+
if (response.data["default"].id) {
|
|
9074
|
+
setDefaultId(response.data["default"].id);
|
|
9075
|
+
setApproverRole({
|
|
9076
|
+
value: '',
|
|
9077
|
+
label: response.data["default"].email
|
|
9078
|
+
});
|
|
9079
|
+
setIsDisabledSubmitBtn(false);
|
|
9080
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9081
|
+
}
|
|
9082
|
+
});
|
|
9083
|
+
}
|
|
9084
|
+
}, [deactivateSingle]);
|
|
8783
9085
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8784
9086
|
setRowsPerPage(+event.target.value);
|
|
8785
9087
|
setPage(1);
|
|
8786
9088
|
setSelected({});
|
|
9089
|
+
setSelectedUsersNotApprover([]);
|
|
9090
|
+
setSelectedUsersApprover([]);
|
|
8787
9091
|
setSortingChange(true);
|
|
8788
9092
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8789
9093
|
};
|
|
8790
9094
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8791
9095
|
var isActive = e.target.checked;
|
|
8792
|
-
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
9096
|
+
var _isApprover;
|
|
9097
|
+
newSelecteds.map(function (item) {
|
|
9098
|
+
if (item.id === id) {
|
|
9099
|
+
_isApprover = item.roles.is_approver;
|
|
9100
|
+
if (_isApprover === true && isActive === false) {
|
|
9101
|
+
setDeactivateSingle(true);
|
|
9102
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9103
|
+
setUser(item);
|
|
9104
|
+
} else {
|
|
9105
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9106
|
+
if (!isActive) {
|
|
9107
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9108
|
+
var _extends5;
|
|
9109
|
+
var selectedTemp = _extends({}, selected);
|
|
9110
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9111
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9112
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9113
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9114
|
+
return item.id != id;
|
|
9115
|
+
});
|
|
9116
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9117
|
+
return item.id != id;
|
|
9118
|
+
});
|
|
9119
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9120
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9121
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9122
|
+
}
|
|
9123
|
+
}
|
|
9124
|
+
});
|
|
8799
9125
|
}
|
|
8800
9126
|
}
|
|
8801
9127
|
});
|
|
8802
9128
|
};
|
|
9129
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9130
|
+
var _value = _ref4._value;
|
|
9131
|
+
if (_value.data.approvee_status) {
|
|
9132
|
+
setApproveeStatus(true);
|
|
9133
|
+
} else {
|
|
9134
|
+
setApproveeStatus(false);
|
|
9135
|
+
}
|
|
9136
|
+
setDefaultId(_value.data.id);
|
|
9137
|
+
setApproverRole(_value);
|
|
9138
|
+
setIsDisabledSubmitBtn(false);
|
|
9139
|
+
};
|
|
9140
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9141
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9142
|
+
setOpenDeActivateModalFlag(false);
|
|
9143
|
+
setDeactivateSingle(false);
|
|
9144
|
+
setSelected({});
|
|
9145
|
+
setSelectedUsersNotApprover([]);
|
|
9146
|
+
setSelectedUsersApprover([]);
|
|
9147
|
+
};
|
|
8803
9148
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8804
9149
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8805
9150
|
setOpenDeActivateModalFlag(false);
|
|
8806
9151
|
setSelected({});
|
|
9152
|
+
setSelectedUsersNotApprover([]);
|
|
9153
|
+
setSelectedUsersApprover([]);
|
|
9154
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9155
|
+
};
|
|
9156
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9157
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9158
|
+
return item.id;
|
|
9159
|
+
});
|
|
9160
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9161
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9162
|
+
setSelected({});
|
|
9163
|
+
setSelectedUsersNotApprover([]);
|
|
9164
|
+
setSelectedUsersApprover([]);
|
|
8807
9165
|
};
|
|
8808
9166
|
var importUserHandler = function importUserHandler() {
|
|
8809
9167
|
setOpenImportUsersModal(true);
|
|
@@ -8820,13 +9178,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8820
9178
|
email: email
|
|
8821
9179
|
}));
|
|
8822
9180
|
};
|
|
8823
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8824
|
-
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
9181
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9182
|
+
if (type === undefined) {
|
|
9183
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9184
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9185
|
+
return false;
|
|
9186
|
+
}
|
|
8828
9187
|
}
|
|
8829
9188
|
setUserIds(ids);
|
|
9189
|
+
setUserFirstName(firstName);
|
|
9190
|
+
setUserLastName(lastName);
|
|
9191
|
+
setToggleInviteModal(!showInviteModal);
|
|
9192
|
+
};
|
|
9193
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8830
9194
|
setToggleInviteModal(!showInviteModal);
|
|
8831
9195
|
};
|
|
8832
9196
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8899,6 +9263,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8899
9263
|
userId: userId
|
|
8900
9264
|
}));
|
|
8901
9265
|
};
|
|
9266
|
+
var knowMore = function knowMore() {
|
|
9267
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9268
|
+
};
|
|
8902
9269
|
var dispatch = useDispatch();
|
|
8903
9270
|
useEffect(function () {
|
|
8904
9271
|
if (isTokenVerified === true) {
|
|
@@ -9150,7 +9517,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9150
9517
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9151
9518
|
variant: "body2",
|
|
9152
9519
|
className: clsx(styles$5.description)
|
|
9153
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9520
|
+
}, "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", {
|
|
9521
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9522
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9523
|
+
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
9154
9524
|
data: signupRequestListInfo,
|
|
9155
9525
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9156
9526
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9182,6 +9552,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9182
9552
|
}))
|
|
9183
9553
|
}]
|
|
9184
9554
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9555
|
+
isOpen: deactivateSingle,
|
|
9556
|
+
closeHandler: function closeHandler() {
|
|
9557
|
+
setDeactivateSingle(false);
|
|
9558
|
+
},
|
|
9559
|
+
cancelLabel: "Cancel",
|
|
9560
|
+
submitLabel: "Deactivate",
|
|
9561
|
+
submitHandler: handleDeactivateUser,
|
|
9562
|
+
headerText: "Deactivate this user?",
|
|
9563
|
+
width: "400px",
|
|
9564
|
+
subHanderText: "",
|
|
9565
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9566
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9567
|
+
modalClass: "deactivateSingleModal",
|
|
9568
|
+
modalBodyStyle: {
|
|
9569
|
+
overflowY: 'unset'
|
|
9570
|
+
}
|
|
9571
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9572
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9573
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9574
|
+
className: styles$5.deactivateAlert
|
|
9575
|
+
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9576
|
+
width: "9",
|
|
9577
|
+
height: "9"
|
|
9578
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9579
|
+
variant: "body2"
|
|
9580
|
+
}, /*#__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", {
|
|
9581
|
+
onClick: knowMore,
|
|
9582
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9583
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9584
|
+
className: "iui__mt-15"
|
|
9585
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9586
|
+
isMove: true,
|
|
9587
|
+
additional: {
|
|
9588
|
+
page: 1,
|
|
9589
|
+
product: 'travel',
|
|
9590
|
+
userId: user.id
|
|
9591
|
+
},
|
|
9592
|
+
label: "Transfer approver role to",
|
|
9593
|
+
value: approverRole,
|
|
9594
|
+
onValueChange: selectApprover,
|
|
9595
|
+
loadOption: transferRoleOptions,
|
|
9596
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9597
|
+
customLoadingText: "No results found"
|
|
9598
|
+
}), approveeStatus && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9599
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9600
|
+
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9601
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9602
|
+
}, "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, {
|
|
9185
9603
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9186
9604
|
closeHandler: closeDeActivateModal,
|
|
9187
9605
|
cancelLabel: "Cancel",
|
|
@@ -9208,8 +9626,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9208
9626
|
}, '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, {
|
|
9209
9627
|
className: styles$5.description
|
|
9210
9628
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9629
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9630
|
+
closeHandler: closeDeActiveModal,
|
|
9631
|
+
cancelLabel: "Cancel",
|
|
9632
|
+
submitLabel: "Deactivate safe users",
|
|
9633
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9634
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9635
|
+
customButtonLabel: "Deactivate all users",
|
|
9636
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9637
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9638
|
+
width: "640px",
|
|
9639
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9640
|
+
headerText: "Deactivate users?",
|
|
9641
|
+
modalBodyStyle: {
|
|
9642
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9643
|
+
}
|
|
9644
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9645
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9646
|
+
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9647
|
+
color: "#9A6700",
|
|
9648
|
+
size: "14"
|
|
9649
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9650
|
+
variant: "body2"
|
|
9651
|
+
}, "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", {
|
|
9652
|
+
onClick: knowMore,
|
|
9653
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9654
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9655
|
+
className: "iui__my-15"
|
|
9656
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9657
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9658
|
+
}, "Users with roles"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9659
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9660
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9661
|
+
var _item$data;
|
|
9662
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9663
|
+
key: index,
|
|
9664
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9665
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9666
|
+
firstName: item.first_name,
|
|
9667
|
+
lastName: item.last_name,
|
|
9668
|
+
isLetterAvatar: "true",
|
|
9669
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9670
|
+
secondaryText: item.email,
|
|
9671
|
+
letterAvatarTextColor: "black",
|
|
9672
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9673
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9674
|
+
}), /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9675
|
+
color: "#9A6700",
|
|
9676
|
+
size: "14"
|
|
9677
|
+
}));
|
|
9678
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9679
|
+
style: {
|
|
9680
|
+
borderColor: '#E5E9ED'
|
|
9681
|
+
}
|
|
9682
|
+
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9683
|
+
className: "iui__my-15"
|
|
9684
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9685
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9686
|
+
}, "Safe users"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9687
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9688
|
+
}, "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) {
|
|
9689
|
+
var _item$data2;
|
|
9690
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9691
|
+
key: index,
|
|
9692
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9693
|
+
}, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
9694
|
+
firstName: item.first_name,
|
|
9695
|
+
lastName: item.last_name,
|
|
9696
|
+
isLetterAvatar: "true",
|
|
9697
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9698
|
+
secondaryText: item.email,
|
|
9699
|
+
letterAvatarTextColor: "black",
|
|
9700
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9701
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9702
|
+
}));
|
|
9703
|
+
}))) : null), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9211
9704
|
isOpen: showInviteModal,
|
|
9212
|
-
closeHandler:
|
|
9705
|
+
closeHandler: function closeHandler() {
|
|
9706
|
+
return toggleInviteModalClose();
|
|
9707
|
+
},
|
|
9213
9708
|
cancelLabel: "Cancel",
|
|
9214
9709
|
headerText: "Resend Invites?",
|
|
9215
9710
|
submitLabel: "Send",
|
|
@@ -9241,7 +9736,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9241
9736
|
fontSize: '14px',
|
|
9242
9737
|
color: '#374151'
|
|
9243
9738
|
}
|
|
9244
|
-
}, "This invitation will be sent to
|
|
9739
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9740
|
+
style: {
|
|
9741
|
+
fontSize: '14px',
|
|
9742
|
+
color: '#374151',
|
|
9743
|
+
fontWeight: 'bold'
|
|
9744
|
+
}
|
|
9745
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React.createElement(BulkUploadModal, {
|
|
9245
9746
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9246
9747
|
closeImportUsersModal: closeImportUsersModal,
|
|
9247
9748
|
closeImportModal: closeImportModal
|
|
@@ -9250,8 +9751,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9250
9751
|
errMsg: hasVerificationError
|
|
9251
9752
|
}));
|
|
9252
9753
|
};
|
|
9253
|
-
var TabLabelCount = function TabLabelCount(
|
|
9254
|
-
var count =
|
|
9754
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9755
|
+
var count = _ref5.count;
|
|
9255
9756
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9256
9757
|
className: styles$5.TabLabelCount
|
|
9257
9758
|
}, " ", count, " ");
|
|
@@ -9326,11 +9827,12 @@ function Header(props) {
|
|
|
9326
9827
|
})));
|
|
9327
9828
|
}
|
|
9328
9829
|
|
|
9329
|
-
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"};
|
|
9830
|
+
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"};
|
|
9330
9831
|
|
|
9331
9832
|
function Listview(_ref) {
|
|
9332
9833
|
var data = _ref.data,
|
|
9333
9834
|
name = _ref.name,
|
|
9835
|
+
tableName = _ref.tableName,
|
|
9334
9836
|
handleEditDialog = _ref.handleEditDialog,
|
|
9335
9837
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9336
9838
|
orderBy = _ref.orderBy,
|
|
@@ -9343,16 +9845,82 @@ function Listview(_ref) {
|
|
|
9343
9845
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9344
9846
|
page = _ref.page,
|
|
9345
9847
|
rowsPerPage = _ref.rowsPerPage;
|
|
9848
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9849
|
+
var _data$dept_head_detai;
|
|
9850
|
+
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) {
|
|
9851
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9346
9854
|
var columns = [{
|
|
9347
9855
|
id: 'name',
|
|
9348
9856
|
label: name,
|
|
9349
|
-
width: '
|
|
9857
|
+
width: '40%',
|
|
9858
|
+
sortable: true,
|
|
9859
|
+
cell: function cell(row) {
|
|
9860
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9861
|
+
component: "div"
|
|
9862
|
+
}, row.name);
|
|
9863
|
+
}
|
|
9864
|
+
}, {
|
|
9865
|
+
id: 'no_of_users',
|
|
9866
|
+
label: 'Number of users',
|
|
9867
|
+
width: '40%',
|
|
9868
|
+
sortable: true,
|
|
9869
|
+
cell: function cell(row) {
|
|
9870
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9871
|
+
component: "div"
|
|
9872
|
+
}, row.no_of_users);
|
|
9873
|
+
}
|
|
9874
|
+
}, {
|
|
9875
|
+
id: 'actions',
|
|
9876
|
+
label: 'Actions',
|
|
9877
|
+
width: '20%',
|
|
9878
|
+
cell: function cell(row) {
|
|
9879
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9880
|
+
display: "flex"
|
|
9881
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9882
|
+
buttonText: "Edit",
|
|
9883
|
+
className: styles$7.buttonWidth,
|
|
9884
|
+
onClick: function onClick() {
|
|
9885
|
+
return handleEditDialog(row);
|
|
9886
|
+
}
|
|
9887
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9888
|
+
buttonText: "Delete",
|
|
9889
|
+
className: styles$7.buttonWidth,
|
|
9890
|
+
onClick: function onClick() {
|
|
9891
|
+
return handleDeleteDialog(row, true);
|
|
9892
|
+
}
|
|
9893
|
+
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9894
|
+
buttonText: "Delete",
|
|
9895
|
+
className: styles$7.buttonWidth,
|
|
9896
|
+
onClick: function onClick() {
|
|
9897
|
+
return handleDeleteDialog(row, false);
|
|
9898
|
+
}
|
|
9899
|
+
}));
|
|
9900
|
+
}
|
|
9901
|
+
}];
|
|
9902
|
+
var departmentColumns = [{
|
|
9903
|
+
id: 'name',
|
|
9904
|
+
label: name,
|
|
9905
|
+
width: '30%',
|
|
9350
9906
|
sortable: true,
|
|
9351
9907
|
cell: function cell(row) {
|
|
9352
9908
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9353
9909
|
component: "div"
|
|
9354
9910
|
}, row.name);
|
|
9355
9911
|
}
|
|
9912
|
+
}, {
|
|
9913
|
+
id: 'department_head',
|
|
9914
|
+
label: 'Department head',
|
|
9915
|
+
width: '30%',
|
|
9916
|
+
sortable: true,
|
|
9917
|
+
cell: function cell(row) {
|
|
9918
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9919
|
+
component: "div"
|
|
9920
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9921
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9922
|
+
}, "Assigned by default"));
|
|
9923
|
+
}
|
|
9356
9924
|
}, {
|
|
9357
9925
|
id: 'no_of_users',
|
|
9358
9926
|
label: 'Number of users',
|
|
@@ -9366,7 +9934,7 @@ function Listview(_ref) {
|
|
|
9366
9934
|
}, {
|
|
9367
9935
|
id: 'actions',
|
|
9368
9936
|
label: 'Actions',
|
|
9369
|
-
width: '
|
|
9937
|
+
width: '15%',
|
|
9370
9938
|
cell: function cell(row) {
|
|
9371
9939
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9372
9940
|
display: "flex"
|
|
@@ -9399,7 +9967,7 @@ function Listview(_ref) {
|
|
|
9399
9967
|
hasFilter: true,
|
|
9400
9968
|
isCheckboxTable: false,
|
|
9401
9969
|
count: data.count,
|
|
9402
|
-
columns: columns,
|
|
9970
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9403
9971
|
rows: data.results,
|
|
9404
9972
|
page: page,
|
|
9405
9973
|
handleChangePage: handleChangePage,
|
|
@@ -9456,15 +10024,44 @@ function EditPanelDialog(_ref) {
|
|
|
9456
10024
|
var isOpen = _ref.isOpen,
|
|
9457
10025
|
closeHandler = _ref.closeHandler,
|
|
9458
10026
|
onValueChange = _ref.onValueChange,
|
|
9459
|
-
|
|
10027
|
+
_submitHandler = _ref.submitHandler,
|
|
9460
10028
|
isError = _ref.isError,
|
|
9461
10029
|
name = _ref.name,
|
|
9462
10030
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9463
|
-
validation = _ref.validation
|
|
10031
|
+
validation = _ref.validation,
|
|
10032
|
+
rowData = _ref.rowData,
|
|
10033
|
+
tableName = _ref.tableName,
|
|
10034
|
+
config = _ref.config;
|
|
9464
10035
|
var _useSelector = useSelector(function (state) {
|
|
9465
10036
|
return state.userPanel;
|
|
9466
10037
|
}),
|
|
9467
10038
|
dialogData = _useSelector.dialogData;
|
|
10039
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10040
|
+
var _data$dept_head_detai;
|
|
10041
|
+
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) {
|
|
10042
|
+
setHead({
|
|
10043
|
+
value: data.dept_head_details[0].id,
|
|
10044
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10045
|
+
});
|
|
10046
|
+
}
|
|
10047
|
+
};
|
|
10048
|
+
var _useState = useState({
|
|
10049
|
+
value: '',
|
|
10050
|
+
label: 'Select'
|
|
10051
|
+
}),
|
|
10052
|
+
head = _useState[0],
|
|
10053
|
+
setHead = _useState[1];
|
|
10054
|
+
useEffect(function () {
|
|
10055
|
+
deptHeadDetails(rowData);
|
|
10056
|
+
}, [rowData]);
|
|
10057
|
+
var history = useHistory();
|
|
10058
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10059
|
+
console.log(rowData);
|
|
10060
|
+
history.push({
|
|
10061
|
+
pathname: config.routes.users.add.path,
|
|
10062
|
+
state: rowData
|
|
10063
|
+
});
|
|
10064
|
+
};
|
|
9468
10065
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9469
10066
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9470
10067
|
isOpen: isOpen,
|
|
@@ -9472,25 +10069,59 @@ function EditPanelDialog(_ref) {
|
|
|
9472
10069
|
headerText: "Edit " + name.toLowerCase(),
|
|
9473
10070
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9474
10071
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9475
|
-
submitHandler: submitHandler
|
|
9476
|
-
|
|
10072
|
+
submitHandler: function submitHandler() {
|
|
10073
|
+
return _submitHandler(head);
|
|
10074
|
+
},
|
|
10075
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9477
10076
|
hideCloseIcon: false,
|
|
9478
10077
|
modalBodyStyle: {
|
|
9479
|
-
|
|
9480
|
-
overflow: 'auto',
|
|
9481
|
-
margin: '0px'
|
|
10078
|
+
overflowY: 'visible'
|
|
9482
10079
|
},
|
|
9483
10080
|
footerStyle: {
|
|
9484
10081
|
justifyContent: 'end'
|
|
9485
10082
|
}
|
|
10083
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10084
|
+
display: "flex",
|
|
10085
|
+
justifyContent: "center",
|
|
10086
|
+
alignItems: "center",
|
|
10087
|
+
flexDirection: "column",
|
|
10088
|
+
style: {
|
|
10089
|
+
marginBottom: '30px'
|
|
10090
|
+
}
|
|
9486
10091
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9487
|
-
component: "div",
|
|
9488
10092
|
display: "flex",
|
|
9489
10093
|
justifyContent: "center",
|
|
9490
10094
|
alignItems: "center",
|
|
9491
10095
|
flexDirection: "column",
|
|
9492
|
-
|
|
9493
|
-
}, /*#__PURE__*/React.createElement(
|
|
10096
|
+
className: styles$7.baseAlert
|
|
10097
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10098
|
+
className: styles$7.alertDescContainer
|
|
10099
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
10100
|
+
className: styles$7.iconLayout,
|
|
10101
|
+
style: {
|
|
10102
|
+
paddingTop: '4px'
|
|
10103
|
+
}
|
|
10104
|
+
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
10105
|
+
color: "#CA8A04",
|
|
10106
|
+
width: "25",
|
|
10107
|
+
height: "20",
|
|
10108
|
+
className: styles$7.iconStyle
|
|
10109
|
+
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
10110
|
+
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.",
|
|
10111
|
+
style: {
|
|
10112
|
+
fontWeight: 'normal'
|
|
10113
|
+
}
|
|
10114
|
+
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
10115
|
+
buttonText: "Add user",
|
|
10116
|
+
type: "text",
|
|
10117
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
10118
|
+
width: "9",
|
|
10119
|
+
height: "9",
|
|
10120
|
+
color: "#EC5D25"
|
|
10121
|
+
}),
|
|
10122
|
+
onClick: handleAddPageNavigation,
|
|
10123
|
+
className: styles$7.addUserButton
|
|
10124
|
+
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9494
10125
|
label: name + " name",
|
|
9495
10126
|
name: "name",
|
|
9496
10127
|
defaultValue: dialogData.data.name,
|
|
@@ -9499,7 +10130,49 @@ function EditPanelDialog(_ref) {
|
|
|
9499
10130
|
isError: isError,
|
|
9500
10131
|
validation: validation,
|
|
9501
10132
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9502
|
-
required: true
|
|
10133
|
+
required: true,
|
|
10134
|
+
style: tableName === 'department' && {
|
|
10135
|
+
width: '350px'
|
|
10136
|
+
}
|
|
10137
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10138
|
+
className: "iui__mt-15",
|
|
10139
|
+
style: {
|
|
10140
|
+
width: '100%'
|
|
10141
|
+
}
|
|
10142
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
10143
|
+
label: "Department head",
|
|
10144
|
+
name: "name",
|
|
10145
|
+
defaultValue: head.label,
|
|
10146
|
+
placeholder: "",
|
|
10147
|
+
readOnly: true,
|
|
10148
|
+
style: {
|
|
10149
|
+
width: '350px'
|
|
10150
|
+
}
|
|
10151
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
10152
|
+
className: "iui__mt-15",
|
|
10153
|
+
style: {
|
|
10154
|
+
width: '100%'
|
|
10155
|
+
}
|
|
10156
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
10157
|
+
noResultsText: true,
|
|
10158
|
+
isMove: true,
|
|
10159
|
+
additional: {
|
|
10160
|
+
page: 1,
|
|
10161
|
+
departmentId: rowData.id
|
|
10162
|
+
},
|
|
10163
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10164
|
+
label: "Department head",
|
|
10165
|
+
value: head,
|
|
10166
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10167
|
+
var _value = _ref2._value;
|
|
10168
|
+
return setHead(_value);
|
|
10169
|
+
},
|
|
10170
|
+
loadOption: departmentHeadOptions,
|
|
10171
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10172
|
+
customLoadingText: "No users found in this department",
|
|
10173
|
+
customLoadingTextStyle: {
|
|
10174
|
+
color: '#374151'
|
|
10175
|
+
}
|
|
9503
10176
|
})));
|
|
9504
10177
|
}
|
|
9505
10178
|
|
|
@@ -9678,12 +10351,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9678
10351
|
var _useState13 = useState(false),
|
|
9679
10352
|
isSortingChangeTemp = _useState13[0],
|
|
9680
10353
|
setSortingChangeTemp = _useState13[1];
|
|
9681
|
-
var _useState14 = useState(
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
var _useState15 = useState(
|
|
9685
|
-
|
|
9686
|
-
|
|
10354
|
+
var _useState14 = useState([]),
|
|
10355
|
+
rowData = _useState14[0],
|
|
10356
|
+
setRowData = _useState14[1];
|
|
10357
|
+
var _useState15 = useState(1),
|
|
10358
|
+
page = _useState15[0],
|
|
10359
|
+
setPage = _useState15[1];
|
|
10360
|
+
var _useState16 = useState(5),
|
|
10361
|
+
rowsPerPage = _useState16[0],
|
|
10362
|
+
setRowsPerPage = _useState16[1];
|
|
9687
10363
|
var orderingParam = orderBy;
|
|
9688
10364
|
var _useSelector = useSelector(function (state) {
|
|
9689
10365
|
return state.userPanel;
|
|
@@ -9779,6 +10455,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9779
10455
|
submitLabel: 'Save'
|
|
9780
10456
|
}, '', data));
|
|
9781
10457
|
setDataList(data.name);
|
|
10458
|
+
setRowData(data);
|
|
9782
10459
|
setEditModal(true);
|
|
9783
10460
|
};
|
|
9784
10461
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9793,6 +10470,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9793
10470
|
var payload = {
|
|
9794
10471
|
names: [dataList]
|
|
9795
10472
|
};
|
|
10473
|
+
if (tableName === 'department') {
|
|
10474
|
+
payload = {
|
|
10475
|
+
name: dataList,
|
|
10476
|
+
department_head_id: null
|
|
10477
|
+
};
|
|
10478
|
+
}
|
|
9796
10479
|
var message = title + " added successfully.";
|
|
9797
10480
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9798
10481
|
} else {
|
|
@@ -9806,9 +10489,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9806
10489
|
var message = title + " deleted successfully.";
|
|
9807
10490
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9808
10491
|
};
|
|
9809
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10492
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10493
|
+
if (optionalParams === void 0) {
|
|
10494
|
+
optionalParams = null;
|
|
10495
|
+
}
|
|
9810
10496
|
dispatch(userPanelShowLoader());
|
|
9811
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10497
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9812
10498
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9813
10499
|
dispatch(userPanelStopLoader());
|
|
9814
10500
|
if (type === 'delete') {
|
|
@@ -9850,8 +10536,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9850
10536
|
name: dataList
|
|
9851
10537
|
}]
|
|
9852
10538
|
};
|
|
10539
|
+
if (tableName === 'department') {
|
|
10540
|
+
payload = {
|
|
10541
|
+
name: dataList,
|
|
10542
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10543
|
+
};
|
|
10544
|
+
}
|
|
9853
10545
|
var message = title + " updated successfully.";
|
|
9854
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10546
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9855
10547
|
setErrorEdit(false);
|
|
9856
10548
|
} else {
|
|
9857
10549
|
setErrorEdit(true);
|
|
@@ -9958,7 +10650,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9958
10650
|
submitHandler: handleEditPanel,
|
|
9959
10651
|
isError: errorEdit,
|
|
9960
10652
|
isDisabledSubmitBtn: loading,
|
|
9961
|
-
validation: validation
|
|
10653
|
+
validation: validation,
|
|
10654
|
+
rowData: rowData,
|
|
10655
|
+
tableName: tableName,
|
|
10656
|
+
config: config
|
|
9962
10657
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
9963
10658
|
config: config
|
|
9964
10659
|
}));
|