@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.js
CHANGED
|
@@ -149,17 +149,11 @@ function r(e) {
|
|
|
149
149
|
var t,
|
|
150
150
|
f,
|
|
151
151
|
n = "";
|
|
152
|
-
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++)
|
|
153
|
-
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
154
|
-
} else for (t in e) {
|
|
155
|
-
e[t] && (n && (n += " "), n += t);
|
|
156
|
-
}
|
|
152
|
+
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);
|
|
157
153
|
return n;
|
|
158
154
|
}
|
|
159
155
|
function clsx() {
|
|
160
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
161
|
-
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
162
|
-
}
|
|
156
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
163
157
|
return n;
|
|
164
158
|
}
|
|
165
159
|
|
|
@@ -363,6 +357,9 @@ var userAddEditUrl = {
|
|
|
363
357
|
approversSearch: function approversSearch() {
|
|
364
358
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/company-approvers";
|
|
365
359
|
},
|
|
360
|
+
transferAppover: function transferAppover() {
|
|
361
|
+
return "api/v1/user-management/users/single-user/transfer-approver-role?";
|
|
362
|
+
},
|
|
366
363
|
preSignedUrl: function preSignedUrl() {
|
|
367
364
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/presigned-url";
|
|
368
365
|
},
|
|
@@ -459,6 +456,14 @@ var userPanelUrl = {
|
|
|
459
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
460
457
|
}
|
|
461
458
|
};
|
|
459
|
+
var departmentUrl = {
|
|
460
|
+
departmentUrl: function departmentUrl() {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
462
|
+
},
|
|
463
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
462
467
|
|
|
463
468
|
var api = utils.configs.api;
|
|
464
469
|
var NAoptionConfig = {
|
|
@@ -600,11 +605,53 @@ var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _r
|
|
|
600
605
|
return Promise.reject(e);
|
|
601
606
|
}
|
|
602
607
|
};
|
|
603
|
-
var
|
|
608
|
+
var transferRoleOptions = function transferRoleOptions(search, loadedOptions, _ref4) {
|
|
604
609
|
var page = _ref4.page,
|
|
605
610
|
product = _ref4.product,
|
|
606
|
-
userId = _ref4.userId
|
|
607
|
-
|
|
611
|
+
userId = _ref4.userId;
|
|
612
|
+
try {
|
|
613
|
+
return Promise.resolve(_catch(function () {
|
|
614
|
+
return Promise.resolve(api.get(userAddEditUrl.transferAppover() + "user_id=" + userId + "&page=" + page + "&search=" + search).then(function (res) {
|
|
615
|
+
return res.data;
|
|
616
|
+
})).then(function (response) {
|
|
617
|
+
var mappedValue = response.results.map(function (item) {
|
|
618
|
+
return {
|
|
619
|
+
value: item.email,
|
|
620
|
+
label: item.email,
|
|
621
|
+
type: 'detailed',
|
|
622
|
+
data: item
|
|
623
|
+
};
|
|
624
|
+
});
|
|
625
|
+
return {
|
|
626
|
+
options: mappedValue,
|
|
627
|
+
hasMore: !!response.next,
|
|
628
|
+
additional: {
|
|
629
|
+
page: page + 1,
|
|
630
|
+
product: product,
|
|
631
|
+
userId: userId
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
});
|
|
635
|
+
}, function () {
|
|
636
|
+
return {
|
|
637
|
+
options: [],
|
|
638
|
+
hasMore: false,
|
|
639
|
+
additional: {
|
|
640
|
+
page: 1,
|
|
641
|
+
product: product,
|
|
642
|
+
userId: userId
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
}));
|
|
646
|
+
} catch (e) {
|
|
647
|
+
return Promise.reject(e);
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
var approversOptions = function approversOptions(search, loadedOptions, _ref5) {
|
|
651
|
+
var page = _ref5.page,
|
|
652
|
+
product = _ref5.product,
|
|
653
|
+
userId = _ref5.userId,
|
|
654
|
+
placeholder = _ref5.placeholder;
|
|
608
655
|
try {
|
|
609
656
|
return Promise.resolve(_catch(function () {
|
|
610
657
|
return Promise.resolve(api.get(userAddEditUrl.approversSearch() + "?page=" + page + "&product=" + product + "&search=" + search + "&user_id=" + userId).then(function (res) {
|
|
@@ -650,9 +697,9 @@ var approversOptions = function approversOptions(search, loadedOptions, _ref4) {
|
|
|
650
697
|
return Promise.reject(e);
|
|
651
698
|
}
|
|
652
699
|
};
|
|
653
|
-
var countryOptions = function countryOptions(search, loadedOptions,
|
|
654
|
-
var page =
|
|
655
|
-
tabelName =
|
|
700
|
+
var countryOptions = function countryOptions(search, loadedOptions, _ref6) {
|
|
701
|
+
var page = _ref6.page,
|
|
702
|
+
tabelName = _ref6.tabelName;
|
|
656
703
|
try {
|
|
657
704
|
return Promise.resolve(_catch(function () {
|
|
658
705
|
return Promise.resolve(api.get(userAddEditUrl.countryPaginated() + "&search=" + search + "&page=" + page + "&info=" + tabelName).then(function (res) {
|
|
@@ -687,6 +734,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
687
734
|
return Promise.reject(e);
|
|
688
735
|
}
|
|
689
736
|
};
|
|
737
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref7) {
|
|
738
|
+
var page = _ref7.page,
|
|
739
|
+
departmentId = _ref7.departmentId;
|
|
740
|
+
try {
|
|
741
|
+
return Promise.resolve(_catch(function () {
|
|
742
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
743
|
+
return res.data;
|
|
744
|
+
})).then(function (response) {
|
|
745
|
+
var mappedValue = response.results.map(function (item) {
|
|
746
|
+
return {
|
|
747
|
+
value: item.id,
|
|
748
|
+
label: item.first_name + ' ' + item.last_name,
|
|
749
|
+
type: 'detailed',
|
|
750
|
+
data: item
|
|
751
|
+
};
|
|
752
|
+
});
|
|
753
|
+
console.log(response.next);
|
|
754
|
+
return {
|
|
755
|
+
options: mappedValue,
|
|
756
|
+
hasMore: !!response.next,
|
|
757
|
+
additional: {
|
|
758
|
+
page: page + 1,
|
|
759
|
+
departmentId: departmentId
|
|
760
|
+
}
|
|
761
|
+
};
|
|
762
|
+
});
|
|
763
|
+
}, function () {
|
|
764
|
+
return {
|
|
765
|
+
options: [],
|
|
766
|
+
hasMore: false,
|
|
767
|
+
additional: {
|
|
768
|
+
page: 1,
|
|
769
|
+
departmentId: departmentId
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
}));
|
|
773
|
+
} catch (e) {
|
|
774
|
+
return Promise.reject(e);
|
|
775
|
+
}
|
|
776
|
+
};
|
|
690
777
|
|
|
691
778
|
var UserRole = function UserRole(_ref) {
|
|
692
779
|
var _ref$list = _ref.list,
|
|
@@ -1155,10 +1242,19 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1155
1242
|
payload: tabId
|
|
1156
1243
|
};
|
|
1157
1244
|
};
|
|
1158
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1245
|
+
var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransfer, newApproverUserId) {
|
|
1246
|
+
if (roleTransfer === void 0) {
|
|
1247
|
+
roleTransfer = false;
|
|
1248
|
+
}
|
|
1249
|
+
var _payload = {
|
|
1250
|
+
role_transfer: roleTransfer
|
|
1251
|
+
};
|
|
1252
|
+
if (roleTransfer) {
|
|
1253
|
+
_payload.new_approver_user_id = newApproverUserId;
|
|
1254
|
+
}
|
|
1159
1255
|
return function (dispatch) {
|
|
1160
1256
|
return new Promise(function (resolve, reject) {
|
|
1161
|
-
api$1.
|
|
1257
|
+
api$1.put(userListUrl.updateActiveStatus + "user_id=" + id + "&activate=" + activateVal, _payload).then(function (res) {
|
|
1162
1258
|
dispatch(setUserActiveStatus({
|
|
1163
1259
|
is_active: activateVal !== 0,
|
|
1164
1260
|
id: id
|
|
@@ -1722,7 +1818,7 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
1722
1818
|
var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
1723
1819
|
return function (dispatch) {
|
|
1724
1820
|
return new Promise(function (resolve, reject) {
|
|
1725
|
-
api$2.post(userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1821
|
+
api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
|
|
1726
1822
|
resolve(res);
|
|
1727
1823
|
})["catch"](function (err) {
|
|
1728
1824
|
var _err$response17, _err$response17$data;
|
|
@@ -1758,6 +1854,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1758
1854
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1759
1855
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1760
1856
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1857
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1761
1858
|
|
|
1762
1859
|
var api$3 = utils.configs.api;
|
|
1763
1860
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1807,14 +1904,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1807
1904
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1808
1905
|
return function (dispatch) {
|
|
1809
1906
|
return new Promise(function (resolve, reject) {
|
|
1810
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1907
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1811
1908
|
dispatch(getUserPanalData(getParam));
|
|
1812
1909
|
dispatch(closeDialog());
|
|
1813
1910
|
resolve(res);
|
|
1814
1911
|
})["catch"](function (err) {
|
|
1815
|
-
var _err$
|
|
1912
|
+
var _err$response3, _err$response3$data;
|
|
1816
1913
|
dispatch(userPanelStopLoader());
|
|
1817
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1914
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1818
1915
|
});
|
|
1819
1916
|
});
|
|
1820
1917
|
};
|
|
@@ -1828,25 +1925,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1828
1925
|
dispatch(userPanelStopLoader());
|
|
1829
1926
|
resolve();
|
|
1830
1927
|
})["catch"](function (err) {
|
|
1831
|
-
var _err$
|
|
1832
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1928
|
+
var _err$response4, _err$response4$data;
|
|
1929
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
1833
1930
|
dispatch(userPanelStopLoader());
|
|
1834
1931
|
});
|
|
1835
1932
|
});
|
|
1836
1933
|
};
|
|
1837
1934
|
};
|
|
1838
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1935
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1839
1936
|
return function (dispatch) {
|
|
1840
1937
|
return new Promise(function (resolve, reject) {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1938
|
+
if (tableName === 'department') {
|
|
1939
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1940
|
+
dispatch(getUserPanalData(getParam));
|
|
1941
|
+
dispatch(closeDialog());
|
|
1942
|
+
resolve();
|
|
1943
|
+
})["catch"](function (err) {
|
|
1944
|
+
var _err$response5, _err$response5$data;
|
|
1945
|
+
dispatch(userPanelStopLoader());
|
|
1946
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
1947
|
+
});
|
|
1948
|
+
} else {
|
|
1949
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1950
|
+
dispatch(getUserPanalData(getParam));
|
|
1951
|
+
dispatch(closeDialog());
|
|
1952
|
+
resolve();
|
|
1953
|
+
})["catch"](function (err) {
|
|
1954
|
+
var _err$response6, _err$response6$data;
|
|
1955
|
+
dispatch(userPanelStopLoader());
|
|
1956
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1850
1959
|
});
|
|
1851
1960
|
};
|
|
1852
1961
|
};
|
|
@@ -1858,8 +1967,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1858
1967
|
dispatch(closeDialog());
|
|
1859
1968
|
resolve(res);
|
|
1860
1969
|
})["catch"](function (err) {
|
|
1861
|
-
var _err$
|
|
1862
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1970
|
+
var _err$response7, _err$response7$data;
|
|
1971
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1863
1972
|
});
|
|
1864
1973
|
});
|
|
1865
1974
|
};
|
|
@@ -3959,6 +4068,7 @@ var initialState$2 = {
|
|
|
3959
4068
|
previous: null,
|
|
3960
4069
|
results: []
|
|
3961
4070
|
},
|
|
4071
|
+
deptUsers: [],
|
|
3962
4072
|
loading: false
|
|
3963
4073
|
};
|
|
3964
4074
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4028,6 +4138,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4028
4138
|
loading: false
|
|
4029
4139
|
});
|
|
4030
4140
|
}
|
|
4141
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4142
|
+
{
|
|
4143
|
+
return _extends({}, state, {
|
|
4144
|
+
deptUsers: action.payload
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4031
4147
|
default:
|
|
4032
4148
|
return state;
|
|
4033
4149
|
}
|
|
@@ -4806,6 +4922,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4806
4922
|
isILadmin = _useSelector2.isILadmin,
|
|
4807
4923
|
companyName = _useSelector2.companyName;
|
|
4808
4924
|
var history = reactRouterDom.useHistory();
|
|
4925
|
+
var location = reactRouterDom.useLocation();
|
|
4809
4926
|
var _useState = React.useState({
|
|
4810
4927
|
travel: false,
|
|
4811
4928
|
expense: false
|
|
@@ -5061,6 +5178,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5061
5178
|
var onAddModalClose = function onAddModalClose() {
|
|
5062
5179
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5063
5180
|
};
|
|
5181
|
+
React.useEffect(function () {
|
|
5182
|
+
var _location$state, _location$state2;
|
|
5183
|
+
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) {
|
|
5184
|
+
var _location$state3, _location$state4;
|
|
5185
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, {
|
|
5186
|
+
department: {
|
|
5187
|
+
value: location === null || location === void 0 ? void 0 : (_location$state3 = location.state) === null || _location$state3 === void 0 ? void 0 : _location$state3.id,
|
|
5188
|
+
label: location === null || location === void 0 ? void 0 : (_location$state4 = location.state) === null || _location$state4 === void 0 ? void 0 : _location$state4.name
|
|
5189
|
+
}
|
|
5190
|
+
}));
|
|
5191
|
+
}
|
|
5192
|
+
}, []);
|
|
5064
5193
|
var onModalOpen = function onModalOpen(e, id) {
|
|
5065
5194
|
var title = '';
|
|
5066
5195
|
if (id === 'entity') {
|
|
@@ -5086,24 +5215,42 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5086
5215
|
}));
|
|
5087
5216
|
} else {
|
|
5088
5217
|
dispatch(showLoader());
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5218
|
+
var dataObj;
|
|
5219
|
+
if (addModalData.id === 'department') {
|
|
5220
|
+
dataObj = {
|
|
5221
|
+
name: validatedValue,
|
|
5222
|
+
department_head_id: null
|
|
5223
|
+
};
|
|
5224
|
+
} else {
|
|
5225
|
+
dataObj = {
|
|
5226
|
+
names: [validatedValue]
|
|
5227
|
+
};
|
|
5228
|
+
}
|
|
5229
|
+
dispatch(submitAddModalData(addModalData.id, dataObj)).then(function (res) {
|
|
5230
|
+
var _extends4;
|
|
5093
5231
|
setAddModalData(_extends({}, addModalData, {
|
|
5094
5232
|
isOpen: false
|
|
5095
5233
|
}));
|
|
5096
5234
|
IUIToastMessageService$4.sNotify(addModalData.title + " added successfully.");
|
|
5097
5235
|
var tempKey = addModalData.id === 'employee_level' ? 'emp_level' : addModalData.id;
|
|
5098
|
-
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5236
|
+
if (addModalData.id === 'department') {
|
|
5237
|
+
var _extends2;
|
|
5238
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends2 = {}, _extends2[tempKey] = {
|
|
5239
|
+
value: res.data.result.id,
|
|
5240
|
+
label: res.data.result.name
|
|
5241
|
+
}, _extends2)));
|
|
5242
|
+
} else {
|
|
5243
|
+
var _extends3;
|
|
5244
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends3 = {}, _extends3[tempKey] = {
|
|
5245
|
+
value: res.data.value,
|
|
5246
|
+
label: res.data.label
|
|
5247
|
+
}, _extends3)));
|
|
5248
|
+
}
|
|
5249
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends4 = {}, _extends4[tempKey] = true, _extends4)));
|
|
5103
5250
|
asyncSelectRefs.current[tempKey].current.blur();
|
|
5104
5251
|
clearCacheForAsyncDropdown(function (prevState) {
|
|
5105
|
-
var
|
|
5106
|
-
return _extends({}, prevState, (
|
|
5252
|
+
var _extends5;
|
|
5253
|
+
return _extends({}, prevState, (_extends5 = {}, _extends5[tempKey] = prevState[tempKey] + 1, _extends5));
|
|
5107
5254
|
});
|
|
5108
5255
|
dispatch(stopLoader());
|
|
5109
5256
|
});
|
|
@@ -5120,10 +5267,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5120
5267
|
};
|
|
5121
5268
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5122
5269
|
try {
|
|
5123
|
-
var
|
|
5270
|
+
var _temp5 = function _temp5() {
|
|
5124
5271
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5125
|
-
var
|
|
5126
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5272
|
+
var _extends6;
|
|
5273
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
5127
5274
|
}
|
|
5128
5275
|
};
|
|
5129
5276
|
var _name = args._name,
|
|
@@ -5134,7 +5281,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5134
5281
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5135
5282
|
_args$_obj = args._obj,
|
|
5136
5283
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5137
|
-
var
|
|
5284
|
+
var _temp4 = function () {
|
|
5138
5285
|
if (_name === 'contact_number') {
|
|
5139
5286
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5140
5287
|
contact_number: _value.trim(),
|
|
@@ -5145,14 +5292,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5145
5292
|
updateError('country_code', _isError, _errorMsg);
|
|
5146
5293
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5147
5294
|
} else {
|
|
5148
|
-
var
|
|
5149
|
-
var
|
|
5150
|
-
setPersonalInfoInput(_extends({}, personalInfoInput, (
|
|
5295
|
+
var _temp3 = function _temp3() {
|
|
5296
|
+
var _extends7;
|
|
5297
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5151
5298
|
updateError(_name, _isError, _errorMsg);
|
|
5152
5299
|
};
|
|
5153
|
-
var
|
|
5300
|
+
var _temp2 = function () {
|
|
5154
5301
|
if (_name === 'profile_pic') {
|
|
5155
|
-
var
|
|
5302
|
+
var _temp = function () {
|
|
5156
5303
|
if (_obj.isUpload) {
|
|
5157
5304
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5158
5305
|
_value = _value.map(function (_val) {
|
|
@@ -5183,19 +5330,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5183
5330
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5184
5331
|
}
|
|
5185
5332
|
}();
|
|
5186
|
-
if (
|
|
5333
|
+
if (_temp && _temp.then) return _temp.then(function () {});
|
|
5187
5334
|
}
|
|
5188
5335
|
}();
|
|
5189
|
-
return
|
|
5336
|
+
return _temp2 && _temp2.then ? _temp2.then(_temp3) : _temp3(_temp2);
|
|
5190
5337
|
}
|
|
5191
5338
|
}();
|
|
5192
|
-
return Promise.resolve(
|
|
5339
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp5) : _temp5(_temp4));
|
|
5193
5340
|
} catch (e) {
|
|
5194
5341
|
return Promise.reject(e);
|
|
5195
5342
|
}
|
|
5196
5343
|
};
|
|
5197
5344
|
var onEmployeeInfoChange = function onEmployeeInfoChange(args) {
|
|
5198
|
-
var
|
|
5345
|
+
var _extends8;
|
|
5199
5346
|
var _name = args._name,
|
|
5200
5347
|
_value = args._value,
|
|
5201
5348
|
_isError = args._isError,
|
|
@@ -5204,11 +5351,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5204
5351
|
_name: _name,
|
|
5205
5352
|
_value: _value
|
|
5206
5353
|
});
|
|
5207
|
-
setEmployeeInfoInput(_extends({}, employeeInfoInput, (
|
|
5354
|
+
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5208
5355
|
updateError(_name, _isError, _errorMsg);
|
|
5209
5356
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5210
|
-
var
|
|
5211
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5357
|
+
var _extends9;
|
|
5358
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends9 = {}, _extends9[_name] = true, _extends9)));
|
|
5212
5359
|
}
|
|
5213
5360
|
};
|
|
5214
5361
|
var getUserTagTypeId = function getUserTagTypeId(name) {
|
|
@@ -5218,9 +5365,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5218
5365
|
return tag.id;
|
|
5219
5366
|
};
|
|
5220
5367
|
var onUserTagTypeChange = function onUserTagTypeChange(args) {
|
|
5221
|
-
var
|
|
5368
|
+
var _extends10;
|
|
5222
5369
|
var e = args._event;
|
|
5223
|
-
setUserTagType(_extends({}, userTagType, (
|
|
5370
|
+
setUserTagType(_extends({}, userTagType, (_extends10 = {}, _extends10[e.target.name] = userTagType[e.target.name] ? false : getUserTagTypeId(e.target.name), _extends10)));
|
|
5224
5371
|
if (Object.hasOwnProperty.call(inputChangeLog, 'userTagType')) {
|
|
5225
5372
|
updateInputChangeLog(_extends({}, inputChangeLog, {
|
|
5226
5373
|
userTagType: true
|
|
@@ -5228,22 +5375,23 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5228
5375
|
}
|
|
5229
5376
|
};
|
|
5230
5377
|
var onCustomFieldsChange = function onCustomFieldsChange(_ref2) {
|
|
5231
|
-
var
|
|
5378
|
+
var _extends11;
|
|
5232
5379
|
var _name = _ref2._name,
|
|
5233
5380
|
_value = _ref2._value;
|
|
5234
|
-
setCustomFieldsInput(_extends({}, customFieldsInput, (
|
|
5381
|
+
setCustomFieldsInput(_extends({}, customFieldsInput, (_extends11 = {}, _extends11[_name] = _value, _extends11)));
|
|
5235
5382
|
};
|
|
5236
5383
|
var onTravelApproversInputChange = function onTravelApproversInputChange(_ref3) {
|
|
5237
|
-
var
|
|
5384
|
+
var _extends12;
|
|
5238
5385
|
var _name = _ref3._name,
|
|
5239
5386
|
_value = _ref3._value;
|
|
5240
|
-
|
|
5387
|
+
console.log(_name, _value, 'travel');
|
|
5388
|
+
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5241
5389
|
};
|
|
5242
5390
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
5243
|
-
var
|
|
5391
|
+
var _extends13;
|
|
5244
5392
|
var _name = _ref4._name,
|
|
5245
5393
|
_value = _ref4._value;
|
|
5246
|
-
setExpenseApproversInput(_extends({}, expenseApproversInput, (
|
|
5394
|
+
setExpenseApproversInput(_extends({}, expenseApproversInput, (_extends13 = {}, _extends13[_name] = _value, _extends13)));
|
|
5247
5395
|
};
|
|
5248
5396
|
var onMemInfoInputChange = function onMemInfoInputChange(index, key, val) {
|
|
5249
5397
|
var _membershipInfoInput = [].concat(membershipInfoInput);
|
|
@@ -5277,39 +5425,39 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5277
5425
|
setMembershipInfoInput(_membershipInfoInputTemp);
|
|
5278
5426
|
};
|
|
5279
5427
|
var travelPreferenceOnChange = function travelPreferenceOnChange(args) {
|
|
5280
|
-
var
|
|
5428
|
+
var _extends14;
|
|
5281
5429
|
var _name = args._name,
|
|
5282
5430
|
_value = args._value,
|
|
5283
5431
|
_isError = args._isError,
|
|
5284
5432
|
_errorMsg = args._errorMsg;
|
|
5285
|
-
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (
|
|
5433
|
+
settravelPreferenceInfo(_extends({}, travelPreferenceInfo, (_extends14 = {}, _extends14[_name] = _value, _extends14)));
|
|
5286
5434
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5287
|
-
var
|
|
5288
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5435
|
+
var _extends15;
|
|
5436
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends15 = {}, _extends15[_name] = true, _extends15)));
|
|
5289
5437
|
}
|
|
5290
5438
|
updateError(_name, _isError, _errorMsg);
|
|
5291
5439
|
};
|
|
5292
5440
|
var onSecureTraveelerInfoInputChange = function onSecureTraveelerInfoInputChange(args) {
|
|
5293
|
-
var
|
|
5441
|
+
var _extends16;
|
|
5294
5442
|
var _name = args._name,
|
|
5295
5443
|
_value = args._value,
|
|
5296
5444
|
_isError = args._isError,
|
|
5297
5445
|
_errorMsg = args._errorMsg;
|
|
5298
|
-
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (
|
|
5446
|
+
setSecureTravelInputInfo(_extends({}, secureTravelInputInfo, (_extends16 = {}, _extends16[_name] = _value, _extends16)));
|
|
5299
5447
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5300
|
-
var
|
|
5301
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5448
|
+
var _extends17;
|
|
5449
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends17 = {}, _extends17[_name] = true, _extends17)));
|
|
5302
5450
|
}
|
|
5303
5451
|
updateError(_name, _isError, _errorMsg);
|
|
5304
5452
|
};
|
|
5305
5453
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5306
5454
|
try {
|
|
5307
|
-
var
|
|
5308
|
-
var
|
|
5309
|
-
setPassportInfoInput(_extends({}, passportInfoInput, (
|
|
5455
|
+
var _temp8 = function _temp8() {
|
|
5456
|
+
var _extends18;
|
|
5457
|
+
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5310
5458
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5311
|
-
var
|
|
5312
|
-
updateInputChangeLog(_extends({}, inputChangeLog, (
|
|
5459
|
+
var _extends19;
|
|
5460
|
+
updateInputChangeLog(_extends({}, inputChangeLog, (_extends19 = {}, _extends19[_name] = true, _extends19)));
|
|
5313
5461
|
}
|
|
5314
5462
|
updateError(_name, _isError, _errorMsg);
|
|
5315
5463
|
};
|
|
@@ -5347,9 +5495,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5347
5495
|
}
|
|
5348
5496
|
return Promise.resolve();
|
|
5349
5497
|
}
|
|
5350
|
-
var
|
|
5498
|
+
var _temp7 = function () {
|
|
5351
5499
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5352
|
-
var
|
|
5500
|
+
var _temp6 = function () {
|
|
5353
5501
|
if (_obj.isUpload) {
|
|
5354
5502
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5355
5503
|
if (_name === 'passport_photo') {
|
|
@@ -5393,10 +5541,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5393
5541
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5394
5542
|
}
|
|
5395
5543
|
}();
|
|
5396
|
-
if (
|
|
5544
|
+
if (_temp6 && _temp6.then) return _temp6.then(function () {});
|
|
5397
5545
|
}
|
|
5398
5546
|
}();
|
|
5399
|
-
return Promise.resolve(
|
|
5547
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp8) : _temp8(_temp7));
|
|
5400
5548
|
} catch (e) {
|
|
5401
5549
|
return Promise.reject(e);
|
|
5402
5550
|
}
|
|
@@ -5415,8 +5563,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5415
5563
|
return _errorArray;
|
|
5416
5564
|
});
|
|
5417
5565
|
setErrorMsgs(function (prevState) {
|
|
5418
|
-
var
|
|
5419
|
-
return _extends({}, prevState, (
|
|
5566
|
+
var _extends20;
|
|
5567
|
+
return _extends({}, prevState, (_extends20 = {}, _extends20[_name] = _errorMsg, _extends20));
|
|
5420
5568
|
});
|
|
5421
5569
|
};
|
|
5422
5570
|
var dispatch = reactRedux.useDispatch();
|
|
@@ -5722,7 +5870,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5722
5870
|
}, [renderFields.expenseApprovers]);
|
|
5723
5871
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5724
5872
|
try {
|
|
5725
|
-
var
|
|
5873
|
+
var _temp10 = function _temp10() {
|
|
5726
5874
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5727
5875
|
dispatch(stopLoader());
|
|
5728
5876
|
return data;
|
|
@@ -5738,12 +5886,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5738
5886
|
userID: editUserId
|
|
5739
5887
|
});
|
|
5740
5888
|
});
|
|
5741
|
-
var
|
|
5889
|
+
var _temp9 = _forTo(docs, function (i) {
|
|
5742
5890
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5743
5891
|
data.push(res);
|
|
5744
5892
|
});
|
|
5745
5893
|
});
|
|
5746
|
-
return Promise.resolve(
|
|
5894
|
+
return Promise.resolve(_temp9 && _temp9.then ? _temp9.then(_temp10) : _temp10(_temp9));
|
|
5747
5895
|
} catch (e) {
|
|
5748
5896
|
return Promise.reject(e);
|
|
5749
5897
|
}
|
|
@@ -5899,27 +6047,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5899
6047
|
if (_isError) {
|
|
5900
6048
|
setErrorArray(_errorArray);
|
|
5901
6049
|
setErrorMsgs(_errorMsgs);
|
|
5902
|
-
|
|
6050
|
+
var _loop = function _loop() {
|
|
5903
6051
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
5904
6052
|
if (_errorMsgs[_key3]) {
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
}
|
|
5919
|
-
}();
|
|
5920
|
-
if (_ret === "break") break;
|
|
6053
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
6054
|
+
setAdditionalInfoFlag('open');
|
|
6055
|
+
}
|
|
6056
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
6057
|
+
if (el) {
|
|
6058
|
+
setTimeout(function () {
|
|
6059
|
+
el.scrollIntoView({
|
|
6060
|
+
behavior: 'smooth',
|
|
6061
|
+
block: 'center'
|
|
6062
|
+
});
|
|
6063
|
+
}, 500);
|
|
6064
|
+
return "break";
|
|
6065
|
+
}
|
|
5921
6066
|
}
|
|
5922
6067
|
}
|
|
6068
|
+
};
|
|
6069
|
+
for (var _key3 in _errorMsgs) {
|
|
6070
|
+
var _ret = _loop();
|
|
6071
|
+
if (_ret === "break") break;
|
|
5923
6072
|
}
|
|
5924
6073
|
return Promise.resolve();
|
|
5925
6074
|
}
|
|
@@ -5949,27 +6098,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5949
6098
|
}
|
|
5950
6099
|
setErrorArray(Object.keys(err));
|
|
5951
6100
|
setErrorMsgs(err);
|
|
5952
|
-
|
|
6101
|
+
var _loop2 = function _loop2() {
|
|
5953
6102
|
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
5954
6103
|
if (err[_key4]) {
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
5960
|
-
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5968
|
-
}
|
|
5969
|
-
}();
|
|
5970
|
-
if (_ret2 === "break") break;
|
|
6104
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6105
|
+
setAdditionalInfoFlag('open');
|
|
6106
|
+
}
|
|
6107
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6108
|
+
if (el) {
|
|
6109
|
+
setTimeout(function () {
|
|
6110
|
+
el.scrollIntoView({
|
|
6111
|
+
behavior: 'smooth',
|
|
6112
|
+
block: 'center'
|
|
6113
|
+
});
|
|
6114
|
+
}, 500);
|
|
6115
|
+
return "break";
|
|
6116
|
+
}
|
|
5971
6117
|
}
|
|
5972
6118
|
}
|
|
6119
|
+
};
|
|
6120
|
+
for (var _key4 in err) {
|
|
6121
|
+
var _ret2 = _loop2();
|
|
6122
|
+
if (_ret2 === "break") break;
|
|
5973
6123
|
}
|
|
5974
6124
|
} else if (typeof err === 'string') {
|
|
5975
6125
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -5998,27 +6148,28 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5998
6148
|
}
|
|
5999
6149
|
setErrorArray(Object.keys(err));
|
|
6000
6150
|
setErrorMsgs(err);
|
|
6001
|
-
|
|
6151
|
+
var _loop3 = function _loop3() {
|
|
6002
6152
|
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6003
6153
|
if (err[_key5]) {
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
}
|
|
6018
|
-
}();
|
|
6019
|
-
if (_ret3 === "break") break;
|
|
6154
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6155
|
+
setAdditionalInfoFlag('open');
|
|
6156
|
+
}
|
|
6157
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6158
|
+
if (el) {
|
|
6159
|
+
setTimeout(function () {
|
|
6160
|
+
el.scrollIntoView({
|
|
6161
|
+
behavior: 'smooth',
|
|
6162
|
+
block: 'center'
|
|
6163
|
+
});
|
|
6164
|
+
}, 500);
|
|
6165
|
+
return "break";
|
|
6166
|
+
}
|
|
6020
6167
|
}
|
|
6021
6168
|
}
|
|
6169
|
+
};
|
|
6170
|
+
for (var _key5 in err) {
|
|
6171
|
+
var _ret3 = _loop3();
|
|
6172
|
+
if (_ret3 === "break") break;
|
|
6022
6173
|
}
|
|
6023
6174
|
} else if (typeof err === 'string') {
|
|
6024
6175
|
IUIToastMessageService$4.warningNotify(err);
|
|
@@ -6742,7 +6893,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6742
6893
|
};
|
|
6743
6894
|
};
|
|
6744
6895
|
|
|
6745
|
-
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"};
|
|
6896
|
+
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"};
|
|
6746
6897
|
|
|
6747
6898
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6748
6899
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -6811,7 +6962,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6811
6962
|
file: doc
|
|
6812
6963
|
});
|
|
6813
6964
|
});
|
|
6814
|
-
var
|
|
6965
|
+
var _temp = _forTo(docs, function (i) {
|
|
6815
6966
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6816
6967
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6817
6968
|
if (validatedRes.data.status) {
|
|
@@ -6851,7 +7002,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6851
7002
|
})).then(function () {});
|
|
6852
7003
|
});
|
|
6853
7004
|
});
|
|
6854
|
-
return Promise.resolve(
|
|
7005
|
+
return Promise.resolve(_temp && _temp.then ? _temp.then(function () {}) : void 0);
|
|
6855
7006
|
} catch (e) {
|
|
6856
7007
|
return Promise.reject(e);
|
|
6857
7008
|
}
|
|
@@ -8228,9 +8379,9 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8228
8379
|
cell: function cell(row) {
|
|
8229
8380
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8230
8381
|
component: "div",
|
|
8231
|
-
width:
|
|
8382
|
+
width: 80
|
|
8232
8383
|
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8233
|
-
title: "This user hasn't logged
|
|
8384
|
+
title: "This user hasn't logged in to the platform yet",
|
|
8234
8385
|
arrow: true,
|
|
8235
8386
|
classes: {
|
|
8236
8387
|
arrow: classes.arrow,
|
|
@@ -8238,7 +8389,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8238
8389
|
},
|
|
8239
8390
|
placement: "top-start"
|
|
8240
8391
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8241
|
-
className: clsx(styles$5.
|
|
8392
|
+
className: clsx(styles$5.tooltipTextDiv)
|
|
8242
8393
|
}, "Invited")) : null);
|
|
8243
8394
|
}
|
|
8244
8395
|
}, {
|
|
@@ -8339,7 +8490,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8339
8490
|
options.push({
|
|
8340
8491
|
label: 'Resend invite',
|
|
8341
8492
|
handler: function handler() {
|
|
8342
|
-
return toggleInviteModal(row.id, 'single');
|
|
8493
|
+
return toggleInviteModal(row.id, 'single', row.first_name, row.last_name);
|
|
8343
8494
|
}
|
|
8344
8495
|
});
|
|
8345
8496
|
}
|
|
@@ -8511,6 +8662,42 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8511
8662
|
});
|
|
8512
8663
|
};
|
|
8513
8664
|
|
|
8665
|
+
function InfoYellowIcon(props) {
|
|
8666
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8667
|
+
width: props.width,
|
|
8668
|
+
height: props.height,
|
|
8669
|
+
viewBox: "0 0 20 20",
|
|
8670
|
+
fill: "none",
|
|
8671
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8672
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8673
|
+
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",
|
|
8674
|
+
fill: "#CA8A04"
|
|
8675
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8676
|
+
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",
|
|
8677
|
+
fill: "#CA8A04"
|
|
8678
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8679
|
+
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",
|
|
8680
|
+
fill: "#CA8A04"
|
|
8681
|
+
}));
|
|
8682
|
+
}
|
|
8683
|
+
|
|
8684
|
+
function RedWarningIcon(props) {
|
|
8685
|
+
var _props$color = props.color,
|
|
8686
|
+
color = _props$color === void 0 ? '#E11D48' : _props$color,
|
|
8687
|
+
_props$size = props.size,
|
|
8688
|
+
size = _props$size === void 0 ? '14' : _props$size;
|
|
8689
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8690
|
+
width: size,
|
|
8691
|
+
height: size,
|
|
8692
|
+
viewBox: "0 0 14 14",
|
|
8693
|
+
fill: color,
|
|
8694
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8695
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8696
|
+
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",
|
|
8697
|
+
fill: color
|
|
8698
|
+
}));
|
|
8699
|
+
}
|
|
8700
|
+
|
|
8514
8701
|
function InviteInfoIcon() {
|
|
8515
8702
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8516
8703
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -8528,7 +8715,8 @@ function InviteInfoIcon() {
|
|
|
8528
8715
|
}
|
|
8529
8716
|
|
|
8530
8717
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8531
|
-
var env$7 = utils.configs.env
|
|
8718
|
+
var env$7 = utils.configs.env,
|
|
8719
|
+
api$7 = utils.configs.api;
|
|
8532
8720
|
var UndoButton = function UndoButton(_ref) {
|
|
8533
8721
|
var onUndo = _ref.onUndo,
|
|
8534
8722
|
msg = _ref.msg;
|
|
@@ -8566,27 +8754,49 @@ var UserList = function UserList(_ref2) {
|
|
|
8566
8754
|
isDataFetching = _useSelector.isDataFetching,
|
|
8567
8755
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8568
8756
|
tabValue = _useSelector.tabValue;
|
|
8569
|
-
var
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8578
|
-
|
|
8579
|
-
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
searchValue = _useState2[0],
|
|
8586
|
-
setSearchValue = _useState2[1];
|
|
8757
|
+
var newSelecteds = userListInfo.results;
|
|
8758
|
+
var _React$useState = React__default.useState(''),
|
|
8759
|
+
deactivateUser = _React$useState[0],
|
|
8760
|
+
setDeactivateUser = _React$useState[1];
|
|
8761
|
+
var _React$useState2 = React__default.useState(null),
|
|
8762
|
+
defaultId = _React$useState2[0],
|
|
8763
|
+
setDefaultId = _React$useState2[1];
|
|
8764
|
+
var _React$useState3 = React__default.useState(1),
|
|
8765
|
+
page = _React$useState3[0],
|
|
8766
|
+
setPage = _React$useState3[1];
|
|
8767
|
+
var _useState = React.useState([]),
|
|
8768
|
+
selectedUsersNotApprover = _useState[0],
|
|
8769
|
+
setSelectedUsersNotApprover = _useState[1];
|
|
8770
|
+
var _useState2 = React.useState([]),
|
|
8771
|
+
selectedUsersApprover = _useState2[0],
|
|
8772
|
+
setSelectedUsersApprover = _useState2[1];
|
|
8587
8773
|
var _useState3 = React.useState(false),
|
|
8588
|
-
|
|
8589
|
-
|
|
8774
|
+
isBulkDeactivateModalOpen = _useState3[0],
|
|
8775
|
+
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8776
|
+
var _React$useState4 = React__default.useState(''),
|
|
8777
|
+
user = _React$useState4[0],
|
|
8778
|
+
setUser = _React$useState4[1];
|
|
8779
|
+
var _useState4 = React.useState(10),
|
|
8780
|
+
rowsPerPage = _useState4[0],
|
|
8781
|
+
setRowsPerPage = _useState4[1];
|
|
8782
|
+
var _React$useState5 = React__default.useState({}),
|
|
8783
|
+
selected = _React$useState5[0],
|
|
8784
|
+
setSelected = _React$useState5[1];
|
|
8785
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8786
|
+
order = _React$useState6[0],
|
|
8787
|
+
setOrder = _React$useState6[1];
|
|
8788
|
+
var _React$useState7 = React__default.useState(false),
|
|
8789
|
+
deactivateSingle = _React$useState7[0],
|
|
8790
|
+
setDeactivateSingle = _React$useState7[1];
|
|
8791
|
+
var _React$useState8 = React__default.useState('first_name'),
|
|
8792
|
+
orderBy = _React$useState8[0],
|
|
8793
|
+
setOrderBy = _React$useState8[1];
|
|
8794
|
+
var _useState5 = React.useState(''),
|
|
8795
|
+
searchValue = _useState5[0],
|
|
8796
|
+
setSearchValue = _useState5[1];
|
|
8797
|
+
var _useState6 = React.useState(false),
|
|
8798
|
+
isOpenDeActivateModal = _useState6[0],
|
|
8799
|
+
setOpenDeActivateModalFlag = _useState6[1];
|
|
8590
8800
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
8591
8801
|
return state.common;
|
|
8592
8802
|
}),
|
|
@@ -8594,36 +8804,54 @@ var UserList = function UserList(_ref2) {
|
|
|
8594
8804
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
8595
8805
|
isILadmin = _useSelector2.isILadmin,
|
|
8596
8806
|
companyName = _useSelector2.companyName;
|
|
8597
|
-
var _useState4 = React.useState(false),
|
|
8598
|
-
isOpenImportUsersModal = _useState4[0],
|
|
8599
|
-
setOpenImportUsersModal = _useState4[1];
|
|
8600
|
-
var _useState5 = React.useState(false),
|
|
8601
|
-
isFileDownloading = _useState5[0],
|
|
8602
|
-
setDownlStatus = _useState5[1];
|
|
8603
|
-
var _useState6 = React.useState(false),
|
|
8604
|
-
isSortingChange = _useState6[0],
|
|
8605
|
-
setSortingChange = _useState6[1];
|
|
8606
8807
|
var _useState7 = React.useState(false),
|
|
8607
|
-
|
|
8608
|
-
|
|
8808
|
+
isOpenImportUsersModal = _useState7[0],
|
|
8809
|
+
setOpenImportUsersModal = _useState7[1];
|
|
8609
8810
|
var _useState8 = React.useState(false),
|
|
8610
|
-
|
|
8611
|
-
|
|
8811
|
+
approveeStatus = _useState8[0],
|
|
8812
|
+
setApproveeStatus = _useState8[1];
|
|
8612
8813
|
var _useState9 = React.useState(false),
|
|
8613
|
-
|
|
8614
|
-
|
|
8814
|
+
isFileDownloading = _useState9[0],
|
|
8815
|
+
setDownlStatus = _useState9[1];
|
|
8615
8816
|
var _useState10 = React.useState(false),
|
|
8616
|
-
|
|
8617
|
-
|
|
8817
|
+
isSortingChange = _useState10[0],
|
|
8818
|
+
setSortingChange = _useState10[1];
|
|
8618
8819
|
var _useState11 = React.useState(false),
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
var _useState12 = React.useState(
|
|
8622
|
-
|
|
8623
|
-
|
|
8624
|
-
var
|
|
8625
|
-
|
|
8626
|
-
|
|
8820
|
+
isSearchingChange = _useState11[0],
|
|
8821
|
+
setSearchingChange = _useState11[1];
|
|
8822
|
+
var _useState12 = React.useState(false),
|
|
8823
|
+
isSortingChangeTemp = _useState12[0],
|
|
8824
|
+
setSortingChangeTemp = _useState12[1];
|
|
8825
|
+
var _useState13 = React.useState(false),
|
|
8826
|
+
isSearchingChangeTemp = _useState13[0],
|
|
8827
|
+
setSearchingChangeTemp = _useState13[1];
|
|
8828
|
+
var _useState14 = React.useState(false),
|
|
8829
|
+
isApiFetching = _useState14[0],
|
|
8830
|
+
setisApiFetching = _useState14[1];
|
|
8831
|
+
var _useState15 = React.useState({
|
|
8832
|
+
value: '',
|
|
8833
|
+
label: 'Select approver'
|
|
8834
|
+
}),
|
|
8835
|
+
approverRole = _useState15[0],
|
|
8836
|
+
setApproverRole = _useState15[1];
|
|
8837
|
+
var _useState16 = React.useState(false),
|
|
8838
|
+
showInviteModal = _useState16[0],
|
|
8839
|
+
setToggleInviteModal = _useState16[1];
|
|
8840
|
+
var _useState17 = React.useState(''),
|
|
8841
|
+
userIds = _useState17[0],
|
|
8842
|
+
setUserIds = _useState17[1];
|
|
8843
|
+
var _React$useState9 = React__default.useState(false),
|
|
8844
|
+
overlayMenu = _React$useState9[0],
|
|
8845
|
+
setOverlayMenu = _React$useState9[1];
|
|
8846
|
+
var _useState18 = React.useState(''),
|
|
8847
|
+
userFirstName = _useState18[0],
|
|
8848
|
+
setUserFirstName = _useState18[1];
|
|
8849
|
+
var _useState19 = React.useState(''),
|
|
8850
|
+
userLastName = _useState19[0],
|
|
8851
|
+
setUserLastName = _useState19[1];
|
|
8852
|
+
var _useState20 = React.useState(true),
|
|
8853
|
+
isDisabledSubmitBtn = _useState20[0],
|
|
8854
|
+
setIsDisabledSubmitBtn = _useState20[1];
|
|
8627
8855
|
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8628
8856
|
var prevPos = _ref3.prevPos,
|
|
8629
8857
|
currPos = _ref3.currPos;
|
|
@@ -8644,47 +8872,68 @@ var UserList = function UserList(_ref2) {
|
|
|
8644
8872
|
behavior: 'smooth'
|
|
8645
8873
|
});
|
|
8646
8874
|
};
|
|
8647
|
-
var _React$
|
|
8648
|
-
signup_page = _React$
|
|
8649
|
-
setSignUpPage = _React$
|
|
8650
|
-
var
|
|
8651
|
-
signup_rowsPerPage =
|
|
8652
|
-
setSignUpRowsPerPage =
|
|
8653
|
-
var _React$
|
|
8654
|
-
signup_order = _React$
|
|
8655
|
-
setSignUpOrder = _React$
|
|
8656
|
-
var _React$
|
|
8657
|
-
signup_orderBy = _React$
|
|
8658
|
-
setSignUpOrderBy = _React$
|
|
8659
|
-
var
|
|
8660
|
-
signup_searchValue =
|
|
8661
|
-
set_signup_SearchValue =
|
|
8662
|
-
var
|
|
8663
|
-
isSignUpSortingChange =
|
|
8664
|
-
setSignUpSortingChange =
|
|
8665
|
-
var
|
|
8666
|
-
isSignUpSearchingChange =
|
|
8667
|
-
setSignUpSearchingChange =
|
|
8668
|
-
var
|
|
8669
|
-
isSignUpSortingChangeTemp =
|
|
8670
|
-
setSignUpSortingChangeTemp =
|
|
8671
|
-
var
|
|
8672
|
-
isSignUpSearchingChangeTemp =
|
|
8673
|
-
setSignUpSearchingChangeTemp =
|
|
8875
|
+
var _React$useState10 = React__default.useState(1),
|
|
8876
|
+
signup_page = _React$useState10[0],
|
|
8877
|
+
setSignUpPage = _React$useState10[1];
|
|
8878
|
+
var _useState21 = React.useState(5),
|
|
8879
|
+
signup_rowsPerPage = _useState21[0],
|
|
8880
|
+
setSignUpRowsPerPage = _useState21[1];
|
|
8881
|
+
var _React$useState11 = React__default.useState('asc'),
|
|
8882
|
+
signup_order = _React$useState11[0],
|
|
8883
|
+
setSignUpOrder = _React$useState11[1];
|
|
8884
|
+
var _React$useState12 = React__default.useState('fname'),
|
|
8885
|
+
signup_orderBy = _React$useState12[0],
|
|
8886
|
+
setSignUpOrderBy = _React$useState12[1];
|
|
8887
|
+
var _useState22 = React.useState(''),
|
|
8888
|
+
signup_searchValue = _useState22[0],
|
|
8889
|
+
set_signup_SearchValue = _useState22[1];
|
|
8890
|
+
var _useState23 = React.useState(false),
|
|
8891
|
+
isSignUpSortingChange = _useState23[0],
|
|
8892
|
+
setSignUpSortingChange = _useState23[1];
|
|
8893
|
+
var _useState24 = React.useState(false),
|
|
8894
|
+
isSignUpSearchingChange = _useState24[0],
|
|
8895
|
+
setSignUpSearchingChange = _useState24[1];
|
|
8896
|
+
var _useState25 = React.useState(false),
|
|
8897
|
+
isSignUpSortingChangeTemp = _useState25[0],
|
|
8898
|
+
setSignUpSortingChangeTemp = _useState25[1];
|
|
8899
|
+
var _useState26 = React.useState(false),
|
|
8900
|
+
isSignUpSearchingChangeTemp = _useState26[0],
|
|
8901
|
+
setSignUpSearchingChangeTemp = _useState26[1];
|
|
8674
8902
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8675
8903
|
return state.userList;
|
|
8676
8904
|
}),
|
|
8677
8905
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8906
|
+
var redirectToNotifications = function redirectToNotifications() {
|
|
8907
|
+
history.push(config.routes.notification.path);
|
|
8908
|
+
};
|
|
8678
8909
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8679
8910
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8680
8911
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
8681
8912
|
return false;
|
|
8682
8913
|
}
|
|
8683
|
-
|
|
8914
|
+
if (selectedUsersApprover.length) {
|
|
8915
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8916
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8917
|
+
var _selected = Object.values(selected).flat();
|
|
8918
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8919
|
+
return _selected.includes(item.id.toString());
|
|
8920
|
+
});
|
|
8921
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8922
|
+
return _selected.includes(item.id.toString());
|
|
8923
|
+
});
|
|
8924
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8925
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8926
|
+
setIsBulkDeactivateModalOpen(true);
|
|
8927
|
+
} else {
|
|
8928
|
+
setOpenDeActivateModalFlag(true);
|
|
8929
|
+
}
|
|
8684
8930
|
};
|
|
8685
8931
|
var closeDeActivateModal = function closeDeActivateModal() {
|
|
8686
8932
|
setOpenDeActivateModalFlag(false);
|
|
8687
8933
|
};
|
|
8934
|
+
var closeDeActiveModal = function closeDeActiveModal() {
|
|
8935
|
+
setIsBulkDeactivateModalOpen(false);
|
|
8936
|
+
};
|
|
8688
8937
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
8689
8938
|
history.push(config.routes.users.add.path);
|
|
8690
8939
|
};
|
|
@@ -8732,12 +8981,25 @@ var UserList = function UserList(_ref2) {
|
|
|
8732
8981
|
};
|
|
8733
8982
|
var deselectingCheckboxHandler = function deselectingCheckboxHandler(page) {
|
|
8734
8983
|
var _extends2;
|
|
8735
|
-
var
|
|
8984
|
+
var selectedId = [];
|
|
8985
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8986
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8987
|
+
var _newSelecteds = newSelecteds.filter(function (n) {
|
|
8736
8988
|
return n.is_active;
|
|
8737
|
-
}).map(function (obj) {
|
|
8738
|
-
return obj.id.toString();
|
|
8739
8989
|
});
|
|
8740
|
-
|
|
8990
|
+
_newSelecteds.map(function (obj) {
|
|
8991
|
+
if (selected && !Object.values(selected).flat().includes(obj.id.toString())) {
|
|
8992
|
+
if (obj.roles.is_approver === true) {
|
|
8993
|
+
_selectedUsersApprover.push(obj);
|
|
8994
|
+
} else if (obj.roles.is_approver === false) {
|
|
8995
|
+
_selectedUsersNotApprover.push(obj);
|
|
8996
|
+
}
|
|
8997
|
+
}
|
|
8998
|
+
selectedId.push(obj.id.toString());
|
|
8999
|
+
});
|
|
9000
|
+
setSelected(_extends({}, selected, (_extends2 = {}, _extends2[page] = selectedId, _extends2)));
|
|
9001
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9002
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
8741
9003
|
};
|
|
8742
9004
|
var handleSelectAllClick = function handleSelectAllClick(event, page) {
|
|
8743
9005
|
var _extends3;
|
|
@@ -8764,49 +9026,145 @@ var UserList = function UserList(_ref2) {
|
|
|
8764
9026
|
setSignUpSearchingChange(true);
|
|
8765
9027
|
setSignUpSearchingChangeTemp(!isSignUpSearchingChangeTemp);
|
|
8766
9028
|
};
|
|
8767
|
-
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
|
|
9029
|
+
var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page, data) {
|
|
8768
9030
|
var _extends4;
|
|
8769
9031
|
var selectedTemp = _extends({}, selected);
|
|
8770
9032
|
if (!(page in selectedTemp)) {
|
|
8771
9033
|
selectedTemp[page] = [];
|
|
8772
9034
|
}
|
|
8773
9035
|
var selectedIndex = selectedTemp[page].indexOf(id);
|
|
8774
|
-
var
|
|
9036
|
+
var _newSelected = [];
|
|
8775
9037
|
if (selectedIndex === -1) {
|
|
8776
|
-
|
|
9038
|
+
_newSelected = _newSelected.concat(selectedTemp[page], id);
|
|
8777
9039
|
} else if (selectedIndex === 0) {
|
|
8778
|
-
|
|
9040
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(1));
|
|
8779
9041
|
} else if (selectedIndex === selectedTemp[page].length - 1) {
|
|
8780
|
-
|
|
9042
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, -1));
|
|
8781
9043
|
} else if (selectedIndex > 0) {
|
|
8782
|
-
|
|
9044
|
+
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9045
|
+
}
|
|
9046
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9047
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9048
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9049
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9050
|
+
return id !== item.id.toString();
|
|
9051
|
+
});
|
|
9052
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9053
|
+
return item.id.toString() !== id;
|
|
9054
|
+
});
|
|
9055
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9056
|
+
if (data.roles.is_approver === true) {
|
|
9057
|
+
_SelectedUsersApprover.push(data);
|
|
9058
|
+
} else if (data.roles.is_approver === false) {
|
|
9059
|
+
_SelectedUsersNotApprover.push(data);
|
|
9060
|
+
}
|
|
8783
9061
|
}
|
|
8784
|
-
|
|
9062
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9063
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9064
|
+
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
8785
9065
|
};
|
|
9066
|
+
React.useEffect(function () {
|
|
9067
|
+
setApproverRole({
|
|
9068
|
+
value: '',
|
|
9069
|
+
label: 'Select approver'
|
|
9070
|
+
});
|
|
9071
|
+
setDefaultId(null);
|
|
9072
|
+
setIsDisabledSubmitBtn(true);
|
|
9073
|
+
setApproveeStatus(false);
|
|
9074
|
+
if (deactivateSingle === true) {
|
|
9075
|
+
api$7.get(userAddEditUrl.transferAppover() + "user_id=" + user.id + "&page=1").then(function (response) {
|
|
9076
|
+
if (response.data["default"].id) {
|
|
9077
|
+
setDefaultId(response.data["default"].id);
|
|
9078
|
+
setApproverRole({
|
|
9079
|
+
value: '',
|
|
9080
|
+
label: response.data["default"].email
|
|
9081
|
+
});
|
|
9082
|
+
setIsDisabledSubmitBtn(false);
|
|
9083
|
+
setApproveeStatus(response.data["default"].approvee_status);
|
|
9084
|
+
}
|
|
9085
|
+
});
|
|
9086
|
+
}
|
|
9087
|
+
}, [deactivateSingle]);
|
|
8786
9088
|
var handleChangeRowsPerPage = function handleChangeRowsPerPage(event) {
|
|
8787
9089
|
setRowsPerPage(+event.target.value);
|
|
8788
9090
|
setPage(1);
|
|
8789
9091
|
setSelected({});
|
|
9092
|
+
setSelectedUsersNotApprover([]);
|
|
9093
|
+
setSelectedUsersApprover([]);
|
|
8790
9094
|
setSortingChange(true);
|
|
8791
9095
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8792
9096
|
};
|
|
8793
9097
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8794
9098
|
var isActive = e.target.checked;
|
|
8795
|
-
|
|
8796
|
-
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
9099
|
+
var _isApprover;
|
|
9100
|
+
newSelecteds.map(function (item) {
|
|
9101
|
+
if (item.id === id) {
|
|
9102
|
+
_isApprover = item.roles.is_approver;
|
|
9103
|
+
if (_isApprover === true && isActive === false) {
|
|
9104
|
+
setDeactivateSingle(true);
|
|
9105
|
+
setDeactivateUser(item.first_name + ' ' + item.last_name);
|
|
9106
|
+
setUser(item);
|
|
9107
|
+
} else {
|
|
9108
|
+
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id, _isApprover)).then(function () {
|
|
9109
|
+
if (!isActive) {
|
|
9110
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9111
|
+
var _extends5;
|
|
9112
|
+
var selectedTemp = _extends({}, selected);
|
|
9113
|
+
var _selectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9114
|
+
var _selectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9115
|
+
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
9116
|
+
_selectedUsersApprover = _selectedUsersApprover.filter(function (item) {
|
|
9117
|
+
return item.id != id;
|
|
9118
|
+
});
|
|
9119
|
+
_selectedUsersNotApprover = _selectedUsersNotApprover.filter(function (item) {
|
|
9120
|
+
return item.id != id;
|
|
9121
|
+
});
|
|
9122
|
+
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
9123
|
+
setSelectedUsersApprover(_selectedUsersApprover);
|
|
9124
|
+
setSelectedUsersNotApprover(_selectedUsersNotApprover);
|
|
9125
|
+
}
|
|
9126
|
+
}
|
|
9127
|
+
});
|
|
8802
9128
|
}
|
|
8803
9129
|
}
|
|
8804
9130
|
});
|
|
8805
9131
|
};
|
|
9132
|
+
var selectApprover = function selectApprover(_ref4) {
|
|
9133
|
+
var _value = _ref4._value;
|
|
9134
|
+
if (_value.data.approvee_status) {
|
|
9135
|
+
setApproveeStatus(true);
|
|
9136
|
+
} else {
|
|
9137
|
+
setApproveeStatus(false);
|
|
9138
|
+
}
|
|
9139
|
+
setDefaultId(_value.data.id);
|
|
9140
|
+
setApproverRole(_value);
|
|
9141
|
+
setIsDisabledSubmitBtn(false);
|
|
9142
|
+
};
|
|
9143
|
+
var handleDeactivateUser = function handleDeactivateUser() {
|
|
9144
|
+
dispatch(updateActiveStatus(0, user.id, user.roles.is_approver, defaultId));
|
|
9145
|
+
setOpenDeActivateModalFlag(false);
|
|
9146
|
+
setDeactivateSingle(false);
|
|
9147
|
+
setSelected({});
|
|
9148
|
+
setSelectedUsersNotApprover([]);
|
|
9149
|
+
setSelectedUsersApprover([]);
|
|
9150
|
+
};
|
|
8806
9151
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8807
9152
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
8808
9153
|
setOpenDeActivateModalFlag(false);
|
|
8809
9154
|
setSelected({});
|
|
9155
|
+
setSelectedUsersNotApprover([]);
|
|
9156
|
+
setSelectedUsersApprover([]);
|
|
9157
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9158
|
+
};
|
|
9159
|
+
var handleDeactivateSafeUsers = function handleDeactivateSafeUsers() {
|
|
9160
|
+
var _selectedUsersNotApprover = selectedUsersNotApprover.map(function (item) {
|
|
9161
|
+
return item.id;
|
|
9162
|
+
});
|
|
9163
|
+
dispatch(deActivateUsers(_selectedUsersNotApprover));
|
|
9164
|
+
setIsBulkDeactivateModalOpen(false);
|
|
9165
|
+
setSelected({});
|
|
9166
|
+
setSelectedUsersNotApprover([]);
|
|
9167
|
+
setSelectedUsersApprover([]);
|
|
8810
9168
|
};
|
|
8811
9169
|
var importUserHandler = function importUserHandler() {
|
|
8812
9170
|
setOpenImportUsersModal(true);
|
|
@@ -8823,13 +9181,19 @@ var UserList = function UserList(_ref2) {
|
|
|
8823
9181
|
email: email
|
|
8824
9182
|
}));
|
|
8825
9183
|
};
|
|
8826
|
-
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8827
|
-
|
|
8828
|
-
|
|
8829
|
-
|
|
8830
|
-
|
|
9184
|
+
var toggleInviteModal = function toggleInviteModal(ids, type, firstName, lastName) {
|
|
9185
|
+
if (type === undefined) {
|
|
9186
|
+
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
9187
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
9188
|
+
return false;
|
|
9189
|
+
}
|
|
8831
9190
|
}
|
|
8832
9191
|
setUserIds(ids);
|
|
9192
|
+
setUserFirstName(firstName);
|
|
9193
|
+
setUserLastName(lastName);
|
|
9194
|
+
setToggleInviteModal(!showInviteModal);
|
|
9195
|
+
};
|
|
9196
|
+
var toggleInviteModalClose = function toggleInviteModalClose() {
|
|
8833
9197
|
setToggleInviteModal(!showInviteModal);
|
|
8834
9198
|
};
|
|
8835
9199
|
var onResendInviteHandler = function onResendInviteHandler() {
|
|
@@ -8902,6 +9266,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8902
9266
|
userId: userId
|
|
8903
9267
|
}));
|
|
8904
9268
|
};
|
|
9269
|
+
var knowMore = function knowMore() {
|
|
9270
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9271
|
+
};
|
|
8905
9272
|
var dispatch = reactRedux.useDispatch();
|
|
8906
9273
|
React.useEffect(function () {
|
|
8907
9274
|
if (isTokenVerified === true) {
|
|
@@ -9153,7 +9520,10 @@ var UserList = function UserList(_ref2) {
|
|
|
9153
9520
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9154
9521
|
variant: "body2",
|
|
9155
9522
|
className: clsx(styles$5.description)
|
|
9156
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in
|
|
9523
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9524
|
+
onClick: config.routes.notification && redirectToNotifications,
|
|
9525
|
+
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9526
|
+
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9157
9527
|
data: signupRequestListInfo,
|
|
9158
9528
|
handleChangeRowsPerPage: function handleChangeRowsPerPage(event) {
|
|
9159
9529
|
setSignUpRowsPerPage(+event.target.value);
|
|
@@ -9185,6 +9555,54 @@ var UserList = function UserList(_ref2) {
|
|
|
9185
9555
|
}))
|
|
9186
9556
|
}]
|
|
9187
9557
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9558
|
+
isOpen: deactivateSingle,
|
|
9559
|
+
closeHandler: function closeHandler() {
|
|
9560
|
+
setDeactivateSingle(false);
|
|
9561
|
+
},
|
|
9562
|
+
cancelLabel: "Cancel",
|
|
9563
|
+
submitLabel: "Deactivate",
|
|
9564
|
+
submitHandler: handleDeactivateUser,
|
|
9565
|
+
headerText: "Deactivate this user?",
|
|
9566
|
+
width: "400px",
|
|
9567
|
+
subHanderText: "",
|
|
9568
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9569
|
+
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9570
|
+
modalClass: "deactivateSingleModal",
|
|
9571
|
+
modalBodyStyle: {
|
|
9572
|
+
overflowY: 'unset'
|
|
9573
|
+
}
|
|
9574
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9575
|
+
className: clsx(styles$5.deactivateSingle, 'iui__mb-16')
|
|
9576
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9577
|
+
className: styles$5.deactivateAlert
|
|
9578
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9579
|
+
width: "9",
|
|
9580
|
+
height: "9"
|
|
9581
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9582
|
+
variant: "body2"
|
|
9583
|
+
}, /*#__PURE__*/React__default.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9584
|
+
onClick: knowMore,
|
|
9585
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9586
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9587
|
+
className: "iui__mt-15"
|
|
9588
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9589
|
+
isMove: true,
|
|
9590
|
+
additional: {
|
|
9591
|
+
page: 1,
|
|
9592
|
+
product: 'travel',
|
|
9593
|
+
userId: user.id
|
|
9594
|
+
},
|
|
9595
|
+
label: "Transfer approver role to",
|
|
9596
|
+
value: approverRole,
|
|
9597
|
+
onValueChange: selectApprover,
|
|
9598
|
+
loadOption: transferRoleOptions,
|
|
9599
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9600
|
+
customLoadingText: "No results found"
|
|
9601
|
+
}), approveeStatus && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9602
|
+
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9603
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement(RedWarningIcon, null)), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9604
|
+
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9605
|
+
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9188
9606
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9189
9607
|
closeHandler: closeDeActivateModal,
|
|
9190
9608
|
cancelLabel: "Cancel",
|
|
@@ -9211,8 +9629,85 @@ var UserList = function UserList(_ref2) {
|
|
|
9211
9629
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9212
9630
|
className: styles$5.description
|
|
9213
9631
|
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9632
|
+
isOpen: isBulkDeactivateModalOpen,
|
|
9633
|
+
closeHandler: closeDeActiveModal,
|
|
9634
|
+
cancelLabel: "Cancel",
|
|
9635
|
+
submitLabel: "Deactivate safe users",
|
|
9636
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9637
|
+
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9638
|
+
customButtonLabel: "Deactivate all users",
|
|
9639
|
+
customButtonHandler: handleDeactivateUsers,
|
|
9640
|
+
submitHandler: handleDeactivateSafeUsers,
|
|
9641
|
+
width: "640px",
|
|
9642
|
+
customButtonClass: clsx(styles$5.deactivateCustomButtonClass),
|
|
9643
|
+
headerText: "Deactivate users?",
|
|
9644
|
+
modalBodyStyle: {
|
|
9645
|
+
maxHeight: 'calc(100vh - 50vh)'
|
|
9646
|
+
}
|
|
9647
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9648
|
+
className: clsx(styles$5.deactivateAlert, styles$5.warningSvg)
|
|
9649
|
+
}, /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9650
|
+
color: "#9A6700",
|
|
9651
|
+
size: "14"
|
|
9652
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9653
|
+
variant: "body2"
|
|
9654
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9655
|
+
onClick: knowMore,
|
|
9656
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9657
|
+
}, "Know more"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9658
|
+
className: "iui__my-15"
|
|
9659
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9660
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9661
|
+
}, "Users with roles"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9662
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9663
|
+
}, "Deactivating these users will affect the associated approval rules."), (selectedUsersApprover === null || selectedUsersApprover === void 0 ? void 0 : selectedUsersApprover.length) && selectedUsersApprover.map(function (item, index) {
|
|
9664
|
+
var _item$data;
|
|
9665
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9666
|
+
key: index,
|
|
9667
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9668
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9669
|
+
firstName: item.first_name,
|
|
9670
|
+
lastName: item.last_name,
|
|
9671
|
+
isLetterAvatar: "true",
|
|
9672
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9673
|
+
secondaryText: item.email,
|
|
9674
|
+
letterAvatarTextColor: "black",
|
|
9675
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9676
|
+
profilePath: (_item$data = item.data) === null || _item$data === void 0 ? void 0 : _item$data.profile_pic
|
|
9677
|
+
}), /*#__PURE__*/React__default.createElement(RedWarningIcon, {
|
|
9678
|
+
color: "#9A6700",
|
|
9679
|
+
size: "14"
|
|
9680
|
+
}));
|
|
9681
|
+
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, /*#__PURE__*/React__default.createElement("hr", {
|
|
9682
|
+
style: {
|
|
9683
|
+
borderColor: '#E5E9ED'
|
|
9684
|
+
}
|
|
9685
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9686
|
+
className: "iui__my-15"
|
|
9687
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9688
|
+
className: "iui__font--para-large iui__font--weight-medium"
|
|
9689
|
+
}, "Safe users"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9690
|
+
className: "iui__font--color-black500 iui__font--size-sm iui__mt-2"
|
|
9691
|
+
}, "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) {
|
|
9692
|
+
var _item$data2;
|
|
9693
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9694
|
+
key: index,
|
|
9695
|
+
className: "iui__d-flex iui__justify-content-spaceBetween iui__align-items-center iui__mt-10"
|
|
9696
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
9697
|
+
firstName: item.first_name,
|
|
9698
|
+
lastName: item.last_name,
|
|
9699
|
+
isLetterAvatar: "true",
|
|
9700
|
+
primaryText: item.first_name + ' ' + item.last_name,
|
|
9701
|
+
secondaryText: item.email,
|
|
9702
|
+
letterAvatarTextColor: "black",
|
|
9703
|
+
letterAvatarBackgroundColor: "#d3d3d3",
|
|
9704
|
+
profilePath: (_item$data2 = item.data) === null || _item$data2 === void 0 ? void 0 : _item$data2.profile_pic
|
|
9705
|
+
}));
|
|
9706
|
+
}))) : null), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9214
9707
|
isOpen: showInviteModal,
|
|
9215
|
-
closeHandler:
|
|
9708
|
+
closeHandler: function closeHandler() {
|
|
9709
|
+
return toggleInviteModalClose();
|
|
9710
|
+
},
|
|
9216
9711
|
cancelLabel: "Cancel",
|
|
9217
9712
|
headerText: "Resend Invites?",
|
|
9218
9713
|
submitLabel: "Send",
|
|
@@ -9244,7 +9739,13 @@ var UserList = function UserList(_ref2) {
|
|
|
9244
9739
|
fontSize: '14px',
|
|
9245
9740
|
color: '#374151'
|
|
9246
9741
|
}
|
|
9247
|
-
}, "This invitation will be sent to
|
|
9742
|
+
}, "This invitation will be sent to", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9743
|
+
style: {
|
|
9744
|
+
fontSize: '14px',
|
|
9745
|
+
color: '#374151',
|
|
9746
|
+
fontWeight: 'bold'
|
|
9747
|
+
}
|
|
9748
|
+
}, userFirstName != null ? userFirstName + " " + userLastName : 'selected users'), ", who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9248
9749
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9249
9750
|
closeImportUsersModal: closeImportUsersModal,
|
|
9250
9751
|
closeImportModal: closeImportModal
|
|
@@ -9253,8 +9754,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9253
9754
|
errMsg: hasVerificationError
|
|
9254
9755
|
}));
|
|
9255
9756
|
};
|
|
9256
|
-
var TabLabelCount = function TabLabelCount(
|
|
9257
|
-
var count =
|
|
9757
|
+
var TabLabelCount = function TabLabelCount(_ref5) {
|
|
9758
|
+
var count = _ref5.count;
|
|
9258
9759
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9259
9760
|
className: styles$5.TabLabelCount
|
|
9260
9761
|
}, " ", count, " ");
|
|
@@ -9329,11 +9830,12 @@ function Header(props) {
|
|
|
9329
9830
|
})));
|
|
9330
9831
|
}
|
|
9331
9832
|
|
|
9332
|
-
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"};
|
|
9833
|
+
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"};
|
|
9333
9834
|
|
|
9334
9835
|
function Listview(_ref) {
|
|
9335
9836
|
var data = _ref.data,
|
|
9336
9837
|
name = _ref.name,
|
|
9838
|
+
tableName = _ref.tableName,
|
|
9337
9839
|
handleEditDialog = _ref.handleEditDialog,
|
|
9338
9840
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9339
9841
|
orderBy = _ref.orderBy,
|
|
@@ -9346,16 +9848,82 @@ function Listview(_ref) {
|
|
|
9346
9848
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9347
9849
|
page = _ref.page,
|
|
9348
9850
|
rowsPerPage = _ref.rowsPerPage;
|
|
9851
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9852
|
+
var _data$dept_head_detai;
|
|
9853
|
+
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) {
|
|
9854
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9855
|
+
}
|
|
9856
|
+
};
|
|
9349
9857
|
var columns = [{
|
|
9350
9858
|
id: 'name',
|
|
9351
9859
|
label: name,
|
|
9352
|
-
width: '
|
|
9860
|
+
width: '40%',
|
|
9861
|
+
sortable: true,
|
|
9862
|
+
cell: function cell(row) {
|
|
9863
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9864
|
+
component: "div"
|
|
9865
|
+
}, row.name);
|
|
9866
|
+
}
|
|
9867
|
+
}, {
|
|
9868
|
+
id: 'no_of_users',
|
|
9869
|
+
label: 'Number of users',
|
|
9870
|
+
width: '40%',
|
|
9871
|
+
sortable: true,
|
|
9872
|
+
cell: function cell(row) {
|
|
9873
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9874
|
+
component: "div"
|
|
9875
|
+
}, row.no_of_users);
|
|
9876
|
+
}
|
|
9877
|
+
}, {
|
|
9878
|
+
id: 'actions',
|
|
9879
|
+
label: 'Actions',
|
|
9880
|
+
width: '20%',
|
|
9881
|
+
cell: function cell(row) {
|
|
9882
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9883
|
+
display: "flex"
|
|
9884
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9885
|
+
buttonText: "Edit",
|
|
9886
|
+
className: styles$7.buttonWidth,
|
|
9887
|
+
onClick: function onClick() {
|
|
9888
|
+
return handleEditDialog(row);
|
|
9889
|
+
}
|
|
9890
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9891
|
+
buttonText: "Delete",
|
|
9892
|
+
className: styles$7.buttonWidth,
|
|
9893
|
+
onClick: function onClick() {
|
|
9894
|
+
return handleDeleteDialog(row, true);
|
|
9895
|
+
}
|
|
9896
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9897
|
+
buttonText: "Delete",
|
|
9898
|
+
className: styles$7.buttonWidth,
|
|
9899
|
+
onClick: function onClick() {
|
|
9900
|
+
return handleDeleteDialog(row, false);
|
|
9901
|
+
}
|
|
9902
|
+
}));
|
|
9903
|
+
}
|
|
9904
|
+
}];
|
|
9905
|
+
var departmentColumns = [{
|
|
9906
|
+
id: 'name',
|
|
9907
|
+
label: name,
|
|
9908
|
+
width: '30%',
|
|
9353
9909
|
sortable: true,
|
|
9354
9910
|
cell: function cell(row) {
|
|
9355
9911
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9356
9912
|
component: "div"
|
|
9357
9913
|
}, row.name);
|
|
9358
9914
|
}
|
|
9915
|
+
}, {
|
|
9916
|
+
id: 'department_head',
|
|
9917
|
+
label: 'Department head',
|
|
9918
|
+
width: '30%',
|
|
9919
|
+
sortable: true,
|
|
9920
|
+
cell: function cell(row) {
|
|
9921
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9922
|
+
component: "div"
|
|
9923
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9924
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9925
|
+
}, "Assigned by default"));
|
|
9926
|
+
}
|
|
9359
9927
|
}, {
|
|
9360
9928
|
id: 'no_of_users',
|
|
9361
9929
|
label: 'Number of users',
|
|
@@ -9369,7 +9937,7 @@ function Listview(_ref) {
|
|
|
9369
9937
|
}, {
|
|
9370
9938
|
id: 'actions',
|
|
9371
9939
|
label: 'Actions',
|
|
9372
|
-
width: '
|
|
9940
|
+
width: '15%',
|
|
9373
9941
|
cell: function cell(row) {
|
|
9374
9942
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9375
9943
|
display: "flex"
|
|
@@ -9402,7 +9970,7 @@ function Listview(_ref) {
|
|
|
9402
9970
|
hasFilter: true,
|
|
9403
9971
|
isCheckboxTable: false,
|
|
9404
9972
|
count: data.count,
|
|
9405
|
-
columns: columns,
|
|
9973
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9406
9974
|
rows: data.results,
|
|
9407
9975
|
page: page,
|
|
9408
9976
|
handleChangePage: handleChangePage,
|
|
@@ -9459,15 +10027,44 @@ function EditPanelDialog(_ref) {
|
|
|
9459
10027
|
var isOpen = _ref.isOpen,
|
|
9460
10028
|
closeHandler = _ref.closeHandler,
|
|
9461
10029
|
onValueChange = _ref.onValueChange,
|
|
9462
|
-
|
|
10030
|
+
_submitHandler = _ref.submitHandler,
|
|
9463
10031
|
isError = _ref.isError,
|
|
9464
10032
|
name = _ref.name,
|
|
9465
10033
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9466
|
-
validation = _ref.validation
|
|
10034
|
+
validation = _ref.validation,
|
|
10035
|
+
rowData = _ref.rowData,
|
|
10036
|
+
tableName = _ref.tableName,
|
|
10037
|
+
config = _ref.config;
|
|
9467
10038
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9468
10039
|
return state.userPanel;
|
|
9469
10040
|
}),
|
|
9470
10041
|
dialogData = _useSelector.dialogData;
|
|
10042
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
10043
|
+
var _data$dept_head_detai;
|
|
10044
|
+
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) {
|
|
10045
|
+
setHead({
|
|
10046
|
+
value: data.dept_head_details[0].id,
|
|
10047
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
10048
|
+
});
|
|
10049
|
+
}
|
|
10050
|
+
};
|
|
10051
|
+
var _useState = React.useState({
|
|
10052
|
+
value: '',
|
|
10053
|
+
label: 'Select'
|
|
10054
|
+
}),
|
|
10055
|
+
head = _useState[0],
|
|
10056
|
+
setHead = _useState[1];
|
|
10057
|
+
React.useEffect(function () {
|
|
10058
|
+
deptHeadDetails(rowData);
|
|
10059
|
+
}, [rowData]);
|
|
10060
|
+
var history = reactRouterDom.useHistory();
|
|
10061
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10062
|
+
console.log(rowData);
|
|
10063
|
+
history.push({
|
|
10064
|
+
pathname: config.routes.users.add.path,
|
|
10065
|
+
state: rowData
|
|
10066
|
+
});
|
|
10067
|
+
};
|
|
9471
10068
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9472
10069
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9473
10070
|
isOpen: isOpen,
|
|
@@ -9475,25 +10072,59 @@ function EditPanelDialog(_ref) {
|
|
|
9475
10072
|
headerText: "Edit " + name.toLowerCase(),
|
|
9476
10073
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9477
10074
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9478
|
-
submitHandler: submitHandler
|
|
9479
|
-
|
|
10075
|
+
submitHandler: function submitHandler() {
|
|
10076
|
+
return _submitHandler(head);
|
|
10077
|
+
},
|
|
10078
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9480
10079
|
hideCloseIcon: false,
|
|
9481
10080
|
modalBodyStyle: {
|
|
9482
|
-
|
|
9483
|
-
overflow: 'auto',
|
|
9484
|
-
margin: '0px'
|
|
10081
|
+
overflowY: 'visible'
|
|
9485
10082
|
},
|
|
9486
10083
|
footerStyle: {
|
|
9487
10084
|
justifyContent: 'end'
|
|
9488
10085
|
}
|
|
10086
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10087
|
+
display: "flex",
|
|
10088
|
+
justifyContent: "center",
|
|
10089
|
+
alignItems: "center",
|
|
10090
|
+
flexDirection: "column",
|
|
10091
|
+
style: {
|
|
10092
|
+
marginBottom: '30px'
|
|
10093
|
+
}
|
|
9489
10094
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9490
|
-
component: "div",
|
|
9491
10095
|
display: "flex",
|
|
9492
10096
|
justifyContent: "center",
|
|
9493
10097
|
alignItems: "center",
|
|
9494
10098
|
flexDirection: "column",
|
|
9495
|
-
|
|
9496
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
10099
|
+
className: styles$7.baseAlert
|
|
10100
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10101
|
+
className: styles$7.alertDescContainer
|
|
10102
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10103
|
+
className: styles$7.iconLayout,
|
|
10104
|
+
style: {
|
|
10105
|
+
paddingTop: '4px'
|
|
10106
|
+
}
|
|
10107
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
10108
|
+
color: "#CA8A04",
|
|
10109
|
+
width: "25",
|
|
10110
|
+
height: "20",
|
|
10111
|
+
className: styles$7.iconStyle
|
|
10112
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
10113
|
+
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.",
|
|
10114
|
+
style: {
|
|
10115
|
+
fontWeight: 'normal'
|
|
10116
|
+
}
|
|
10117
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
10118
|
+
buttonText: "Add user",
|
|
10119
|
+
type: "text",
|
|
10120
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
10121
|
+
width: "9",
|
|
10122
|
+
height: "9",
|
|
10123
|
+
color: "#EC5D25"
|
|
10124
|
+
}),
|
|
10125
|
+
onClick: handleAddPageNavigation,
|
|
10126
|
+
className: styles$7.addUserButton
|
|
10127
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9497
10128
|
label: name + " name",
|
|
9498
10129
|
name: "name",
|
|
9499
10130
|
defaultValue: dialogData.data.name,
|
|
@@ -9502,7 +10133,49 @@ function EditPanelDialog(_ref) {
|
|
|
9502
10133
|
isError: isError,
|
|
9503
10134
|
validation: validation,
|
|
9504
10135
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9505
|
-
required: true
|
|
10136
|
+
required: true,
|
|
10137
|
+
style: tableName === 'department' && {
|
|
10138
|
+
width: '350px'
|
|
10139
|
+
}
|
|
10140
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10141
|
+
className: "iui__mt-15",
|
|
10142
|
+
style: {
|
|
10143
|
+
width: '100%'
|
|
10144
|
+
}
|
|
10145
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
10146
|
+
label: "Department head",
|
|
10147
|
+
name: "name",
|
|
10148
|
+
defaultValue: head.label,
|
|
10149
|
+
placeholder: "",
|
|
10150
|
+
readOnly: true,
|
|
10151
|
+
style: {
|
|
10152
|
+
width: '350px'
|
|
10153
|
+
}
|
|
10154
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
10155
|
+
className: "iui__mt-15",
|
|
10156
|
+
style: {
|
|
10157
|
+
width: '100%'
|
|
10158
|
+
}
|
|
10159
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
10160
|
+
noResultsText: true,
|
|
10161
|
+
isMove: true,
|
|
10162
|
+
additional: {
|
|
10163
|
+
page: 1,
|
|
10164
|
+
departmentId: rowData.id
|
|
10165
|
+
},
|
|
10166
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
10167
|
+
label: "Department head",
|
|
10168
|
+
value: head,
|
|
10169
|
+
onValueChange: function onValueChange(_ref2) {
|
|
10170
|
+
var _value = _ref2._value;
|
|
10171
|
+
return setHead(_value);
|
|
10172
|
+
},
|
|
10173
|
+
loadOption: departmentHeadOptions,
|
|
10174
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
10175
|
+
customLoadingText: "No users found in this department",
|
|
10176
|
+
customLoadingTextStyle: {
|
|
10177
|
+
color: '#374151'
|
|
10178
|
+
}
|
|
9506
10179
|
})));
|
|
9507
10180
|
}
|
|
9508
10181
|
|
|
@@ -9681,12 +10354,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9681
10354
|
var _useState13 = React.useState(false),
|
|
9682
10355
|
isSortingChangeTemp = _useState13[0],
|
|
9683
10356
|
setSortingChangeTemp = _useState13[1];
|
|
9684
|
-
var _useState14 = React.useState(
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
var _useState15 = React.useState(
|
|
9688
|
-
|
|
9689
|
-
|
|
10357
|
+
var _useState14 = React.useState([]),
|
|
10358
|
+
rowData = _useState14[0],
|
|
10359
|
+
setRowData = _useState14[1];
|
|
10360
|
+
var _useState15 = React.useState(1),
|
|
10361
|
+
page = _useState15[0],
|
|
10362
|
+
setPage = _useState15[1];
|
|
10363
|
+
var _useState16 = React.useState(5),
|
|
10364
|
+
rowsPerPage = _useState16[0],
|
|
10365
|
+
setRowsPerPage = _useState16[1];
|
|
9690
10366
|
var orderingParam = orderBy;
|
|
9691
10367
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9692
10368
|
return state.userPanel;
|
|
@@ -9782,6 +10458,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9782
10458
|
submitLabel: 'Save'
|
|
9783
10459
|
}, '', data));
|
|
9784
10460
|
setDataList(data.name);
|
|
10461
|
+
setRowData(data);
|
|
9785
10462
|
setEditModal(true);
|
|
9786
10463
|
};
|
|
9787
10464
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9796,6 +10473,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9796
10473
|
var payload = {
|
|
9797
10474
|
names: [dataList]
|
|
9798
10475
|
};
|
|
10476
|
+
if (tableName === 'department') {
|
|
10477
|
+
payload = {
|
|
10478
|
+
name: dataList,
|
|
10479
|
+
department_head_id: null
|
|
10480
|
+
};
|
|
10481
|
+
}
|
|
9799
10482
|
var message = title + " added successfully.";
|
|
9800
10483
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9801
10484
|
} else {
|
|
@@ -9809,9 +10492,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9809
10492
|
var message = title + " deleted successfully.";
|
|
9810
10493
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9811
10494
|
};
|
|
9812
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10495
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10496
|
+
if (optionalParams === void 0) {
|
|
10497
|
+
optionalParams = null;
|
|
10498
|
+
}
|
|
9813
10499
|
dispatch(userPanelShowLoader());
|
|
9814
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10500
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9815
10501
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9816
10502
|
dispatch(userPanelStopLoader());
|
|
9817
10503
|
if (type === 'delete') {
|
|
@@ -9853,8 +10539,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9853
10539
|
name: dataList
|
|
9854
10540
|
}]
|
|
9855
10541
|
};
|
|
10542
|
+
if (tableName === 'department') {
|
|
10543
|
+
payload = {
|
|
10544
|
+
name: dataList,
|
|
10545
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10546
|
+
};
|
|
10547
|
+
}
|
|
9856
10548
|
var message = title + " updated successfully.";
|
|
9857
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10549
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9858
10550
|
setErrorEdit(false);
|
|
9859
10551
|
} else {
|
|
9860
10552
|
setErrorEdit(true);
|
|
@@ -9961,7 +10653,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9961
10653
|
submitHandler: handleEditPanel,
|
|
9962
10654
|
isError: errorEdit,
|
|
9963
10655
|
isDisabledSubmitBtn: loading,
|
|
9964
|
-
validation: validation
|
|
10656
|
+
validation: validation,
|
|
10657
|
+
rowData: rowData,
|
|
10658
|
+
tableName: tableName,
|
|
10659
|
+
config: config
|
|
9965
10660
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9966
10661
|
config: config
|
|
9967
10662
|
}));
|