@itilite/iui-user-management 0.4.503 → 0.4.505
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.js +57 -38
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +57 -38
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -6045,12 +6045,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6045
6045
|
setErrorArray(_errorArray);
|
|
6046
6046
|
setErrorMsgs(_errorMsgs);
|
|
6047
6047
|
var _loop = function _loop() {
|
|
6048
|
-
if (Object.hasOwnProperty.call(_errorMsgs,
|
|
6049
|
-
if (_errorMsgs[
|
|
6050
|
-
if (
|
|
6048
|
+
if (Object.hasOwnProperty.call(_errorMsgs, key)) {
|
|
6049
|
+
if (_errorMsgs[key]) {
|
|
6050
|
+
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
6051
6051
|
setAdditionalInfoFlag('open');
|
|
6052
6052
|
}
|
|
6053
|
-
var el = document.getElementById(
|
|
6053
|
+
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
6054
6054
|
if (el) {
|
|
6055
6055
|
setTimeout(function () {
|
|
6056
6056
|
el.scrollIntoView({
|
|
@@ -6096,12 +6096,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6096
6096
|
setErrorArray(Object.keys(err));
|
|
6097
6097
|
setErrorMsgs(err);
|
|
6098
6098
|
var _loop2 = function _loop2() {
|
|
6099
|
-
if (Object.hasOwnProperty.call(err,
|
|
6100
|
-
if (err[
|
|
6101
|
-
if (
|
|
6099
|
+
if (Object.hasOwnProperty.call(err, key)) {
|
|
6100
|
+
if (err[key]) {
|
|
6101
|
+
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
6102
6102
|
setAdditionalInfoFlag('open');
|
|
6103
6103
|
}
|
|
6104
|
-
var el = document.getElementById(
|
|
6104
|
+
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
6105
6105
|
if (el) {
|
|
6106
6106
|
setTimeout(function () {
|
|
6107
6107
|
el.scrollIntoView({
|
|
@@ -6146,12 +6146,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6146
6146
|
setErrorArray(Object.keys(err));
|
|
6147
6147
|
setErrorMsgs(err);
|
|
6148
6148
|
var _loop3 = function _loop3() {
|
|
6149
|
-
if (Object.hasOwnProperty.call(err,
|
|
6150
|
-
if (err[
|
|
6151
|
-
if (
|
|
6149
|
+
if (Object.hasOwnProperty.call(err, key)) {
|
|
6150
|
+
if (err[key]) {
|
|
6151
|
+
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
6152
6152
|
setAdditionalInfoFlag('open');
|
|
6153
6153
|
}
|
|
6154
|
-
var el = document.getElementById(
|
|
6154
|
+
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
6155
6155
|
if (el) {
|
|
6156
6156
|
setTimeout(function () {
|
|
6157
6157
|
el.scrollIntoView({
|
|
@@ -8909,6 +8909,17 @@ var UserList = function UserList(_ref2) {
|
|
|
8909
8909
|
return false;
|
|
8910
8910
|
}
|
|
8911
8911
|
if (selectedUsersApprover.length) {
|
|
8912
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8913
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8914
|
+
var _selected = Object.values(selected).flat();
|
|
8915
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8916
|
+
return _selected.includes(item.id.toString());
|
|
8917
|
+
});
|
|
8918
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8919
|
+
return _selected.includes(item.id.toString());
|
|
8920
|
+
});
|
|
8921
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8922
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8912
8923
|
setIsBulkDeactivateModalOpen(true);
|
|
8913
8924
|
} else {
|
|
8914
8925
|
setOpenDeActivateModalFlag(true);
|
|
@@ -8994,8 +9005,6 @@ var UserList = function UserList(_ref2) {
|
|
|
8994
9005
|
return;
|
|
8995
9006
|
}
|
|
8996
9007
|
setSelected(_extends({}, selected, (_extends3 = {}, _extends3[page] = [], _extends3)));
|
|
8997
|
-
setSelectedUsersNotApprover([]);
|
|
8998
|
-
setSelectedUsersApprover([]);
|
|
8999
9008
|
};
|
|
9000
9009
|
var onRequestSort = function onRequestSort(event, property) {
|
|
9001
9010
|
var isAsc = orderBy === property && order === 'asc';
|
|
@@ -9031,26 +9040,24 @@ var UserList = function UserList(_ref2) {
|
|
|
9031
9040
|
} else if (selectedIndex > 0) {
|
|
9032
9041
|
_newSelected = _newSelected.concat(selectedTemp[page].slice(0, selectedIndex), selectedTemp[page].slice(selectedIndex + 1));
|
|
9033
9042
|
}
|
|
9034
|
-
|
|
9035
|
-
|
|
9036
|
-
|
|
9037
|
-
|
|
9038
|
-
|
|
9039
|
-
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
_SelectedUsersNotApprover.push(data);
|
|
9049
|
-
}
|
|
9043
|
+
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
9044
|
+
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
9045
|
+
if (Object.values(selected).flat().includes(id.toString())) {
|
|
9046
|
+
_SelectedUsersNotApprover = selectedUsersNotApprover.filter(function (item) {
|
|
9047
|
+
return id !== item.id.toString();
|
|
9048
|
+
});
|
|
9049
|
+
_SelectedUsersApprover = selectedUsersApprover.filter(function (item) {
|
|
9050
|
+
return item.id.toString() !== id;
|
|
9051
|
+
});
|
|
9052
|
+
} else if (data !== null && data !== void 0 && data.roles) {
|
|
9053
|
+
if (data.roles.is_approver === true) {
|
|
9054
|
+
_SelectedUsersApprover.push(data);
|
|
9055
|
+
} else if (data.roles.is_approver === false) {
|
|
9056
|
+
_SelectedUsersNotApprover.push(data);
|
|
9050
9057
|
}
|
|
9051
|
-
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9052
|
-
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9053
9058
|
}
|
|
9059
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
9060
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
9054
9061
|
setSelected(_extends({}, selected, (_extends4 = {}, _extends4[page] = _newSelected, _extends4)));
|
|
9055
9062
|
};
|
|
9056
9063
|
useEffect(function () {
|
|
@@ -9256,6 +9263,9 @@ var UserList = function UserList(_ref2) {
|
|
|
9256
9263
|
userId: userId
|
|
9257
9264
|
}));
|
|
9258
9265
|
};
|
|
9266
|
+
var knowMore = function knowMore() {
|
|
9267
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9268
|
+
};
|
|
9259
9269
|
var dispatch = useDispatch();
|
|
9260
9270
|
useEffect(function () {
|
|
9261
9271
|
if (isTokenVerified === true) {
|
|
@@ -9507,8 +9517,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9507
9517
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9508
9518
|
variant: "body2",
|
|
9509
9519
|
className: clsx(styles$5.description)
|
|
9510
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement(
|
|
9511
|
-
variant: "span",
|
|
9520
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9512
9521
|
onClick: config.routes.notification && redirectToNotifications,
|
|
9513
9522
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9514
9523
|
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
@@ -9566,7 +9575,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9566
9575
|
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9567
9576
|
width: "9",
|
|
9568
9577
|
height: "9"
|
|
9569
|
-
}), /*#__PURE__*/React.createElement(IUITypography,
|
|
9578
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9579
|
+
variant: "body2"
|
|
9580
|
+
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9581
|
+
onClick: knowMore,
|
|
9582
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9583
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9570
9584
|
className: "iui__mt-15"
|
|
9571
9585
|
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9572
9586
|
isMove: true,
|
|
@@ -9575,7 +9589,6 @@ var UserList = function UserList(_ref2) {
|
|
|
9575
9589
|
product: 'travel',
|
|
9576
9590
|
userId: user.id
|
|
9577
9591
|
},
|
|
9578
|
-
placeHolderCheck: approverRole !== undefined && approverRole.value === '',
|
|
9579
9592
|
label: "Transfer approver role to",
|
|
9580
9593
|
value: approverRole,
|
|
9581
9594
|
onValueChange: selectApprover,
|
|
@@ -9586,7 +9599,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9586
9599
|
className: "iui__d-flex iui__align-items-baseline iui__mr-5"
|
|
9587
9600
|
}, /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement(RedWarningIcon, null)), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9588
9601
|
className: "iui__font--para-normal iui__font--color-black500 iui__mt-5 iui__ml-5"
|
|
9589
|
-
}, "The user
|
|
9602
|
+
}, "The user you're deactivating is the approver of the user you're transferring the role to. If you continue, this user will become a self-approver"))))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9590
9603
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9591
9604
|
closeHandler: closeDeActivateModal,
|
|
9592
9605
|
cancelLabel: "Cancel",
|
|
@@ -9617,6 +9630,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9617
9630
|
closeHandler: closeDeActiveModal,
|
|
9618
9631
|
cancelLabel: "Cancel",
|
|
9619
9632
|
submitLabel: "Deactivate safe users",
|
|
9633
|
+
isDisabledSubmitBtn: !((selectedUsersNotApprover === null || selectedUsersNotApprover === void 0 ? void 0 : selectedUsersNotApprover.length) > 0),
|
|
9620
9634
|
submitBtnClass: clsx(styles$5.deactivateSubmitBtn),
|
|
9621
9635
|
customButtonLabel: "Deactivate all users",
|
|
9622
9636
|
customButtonHandler: handleDeactivateUsers,
|
|
@@ -9632,7 +9646,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9632
9646
|
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9633
9647
|
color: "#9A6700",
|
|
9634
9648
|
size: "14"
|
|
9635
|
-
}), /*#__PURE__*/React.createElement(IUITypography,
|
|
9649
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9650
|
+
variant: "body2"
|
|
9651
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9652
|
+
onClick: knowMore,
|
|
9653
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9654
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9636
9655
|
className: "iui__my-15"
|
|
9637
9656
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9638
9657
|
className: "iui__font--para-large iui__font--weight-medium"
|