removed category group button
parent
60de2fd47a
commit
2837ec71c7
|
@ -144,12 +144,6 @@
|
|||
"popover": {
|
||||
"title": "Sind Sie sicher, dass Sie die globalen Python Bibliotheken installieren wollen?"
|
||||
}
|
||||
},
|
||||
"checkingForCategoryGroupChanges": {
|
||||
"check": "Prüfung auf Änderungen der Kategoriegruppen",
|
||||
"popover": {
|
||||
"title": "Sind Sie sicher, dass Sie die Kategoriegruppen prüfen wollen? (Während der Prüfung schaut der Server nach neuen Kategoriegruppen und löscht ggf. nicht mehr vorhandene)"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -144,12 +144,6 @@
|
|||
"popover": {
|
||||
"title": "Are you sure you want to install the global Python libraries?"
|
||||
}
|
||||
},
|
||||
"checkingForCategoryGroupChanges": {
|
||||
"check": "Checking for Category Group Changes",
|
||||
"popover": {
|
||||
"title": "Are you sure you want to check category groups? (During the check, the server looks for new category groups and deletes those that are no longer available)"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -30,7 +30,6 @@ export const ReceivedMessagesCommands = {
|
|||
AllUsersNewUserCreated: 26,
|
||||
AllUsersUserDeleted: 27,
|
||||
AllUsersUserDeactivation: 28,
|
||||
GroupTasksCategoryGroupChanges: 29,
|
||||
NewUserApiKeyCreated: 30,
|
||||
DeletedUserApiKey: 31,
|
||||
NewApiKeyUsageCount: 32,
|
||||
|
@ -66,7 +65,6 @@ export const SentMessagesCommands = {
|
|||
AllUsersUserDeactivation: 14,
|
||||
ScannersUseScanners: 15,
|
||||
ScannersDisconnectScanner: 16,
|
||||
GroupTasksCheckingForCategoryGroupChanges: 17,
|
||||
HandleUserActionTaskStep: 18,
|
||||
CreateNewUserApiKey: 19,
|
||||
DeleteUserApiKey: 20,
|
||||
|
@ -716,113 +714,6 @@ export function handleWebSocketMessage(
|
|||
return newArr;
|
||||
});
|
||||
break;
|
||||
case ReceivedMessagesCommands.GroupTasksCategoryGroupChanges:
|
||||
if (
|
||||
body["AddedPermissions"] !== undefined ||
|
||||
body["RemovedPermissions"] !== undefined
|
||||
) {
|
||||
appContext.setUserPermissions((arr) => {
|
||||
let newArr = [...arr];
|
||||
|
||||
if (body["AddedPermissions"] !== undefined) {
|
||||
newArr = newArr.concat(body.AddedPermissions);
|
||||
}
|
||||
|
||||
if (body["RemovedPermissions"] !== undefined) {
|
||||
newArr = newArr.filter(
|
||||
(permission) => !body.RemovedPermissions.includes(permission)
|
||||
);
|
||||
}
|
||||
|
||||
return newArr;
|
||||
});
|
||||
|
||||
/*setUser((user) => {
|
||||
const updatedUser = { ...user };
|
||||
|
||||
if (
|
||||
body.AddedPermissions !== undefined &&
|
||||
updatedUser.RoleId === body.MasterRoleId
|
||||
) {
|
||||
updatedUser.Permissions = updatedUser.Permissions.concat(
|
||||
body.AddedPermissions
|
||||
);
|
||||
}
|
||||
|
||||
if (body.RemovedPermissions !== undefined) {
|
||||
updatedUser.Permissions = updatedUser.Permissions.filter(
|
||||
(permission) => !body.RemovedPermissions.includes(permission)
|
||||
);
|
||||
}
|
||||
|
||||
return updatedUser;
|
||||
});*/
|
||||
|
||||
adminAreaRolesContext.setRolesPermissions((arr) => {
|
||||
let newArr = [...arr];
|
||||
|
||||
const roleIndex = arr.findIndex(
|
||||
(item) => item.RoleId === body.MasterRoleId
|
||||
);
|
||||
|
||||
if (roleIndex !== -1) {
|
||||
if (body.AddedPermissions !== undefined) {
|
||||
newArr[roleIndex].Permissions = newArr[
|
||||
roleIndex
|
||||
].Permissions.concat(body.AddedPermissions);
|
||||
}
|
||||
|
||||
if (body.RemovedPermissions !== undefined) {
|
||||
newArr[roleIndex].Permissions = newArr[
|
||||
roleIndex
|
||||
].Permissions.filter(
|
||||
(permission) => !body.RemovedPermissions.includes(permission)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return newArr;
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
TODO: handle this
|
||||
if (
|
||||
body["AddedCategoryGroups"] !== undefined ||
|
||||
body["RemovedCategoryGroups"] !== undefined
|
||||
) {
|
||||
groupTasksContext.setCategoryGroup((arr) => {
|
||||
let newArr = [...arr];
|
||||
|
||||
if (body["RemovedCategoryGroups"] !== undefined) {
|
||||
newArr = newArr.filter(
|
||||
(c) => !body.RemovedCategoryGroups.includes(c.category)
|
||||
);
|
||||
}
|
||||
|
||||
if (body["AddedCategoryGroups"] !== undefined) {
|
||||
newArr = newArr.concat(body.AddedCategoryGroups);
|
||||
}
|
||||
|
||||
newArr = newArr.sort((a, b) => {
|
||||
if (a.category < b.category) {
|
||||
return -1; // a below b
|
||||
} else if (a.category > b.category) {
|
||||
return 1; // a above b
|
||||
} else {
|
||||
return 0; // keep the order
|
||||
}
|
||||
});
|
||||
|
||||
return newArr;
|
||||
});
|
||||
} */
|
||||
|
||||
notificationApi["success"]({
|
||||
message: `Category group changes reloaded`,
|
||||
description: `You can now continue with the work`,
|
||||
});
|
||||
break;
|
||||
case ReceivedMessagesCommands.NewUserApiKeyCreated:
|
||||
/*userProfileContext.setUserProfile((user) => ({
|
||||
...user,
|
||||
|
|
|
@ -32,13 +32,6 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
|||
setCurrentSelectedModalGroupType(null);
|
||||
};
|
||||
|
||||
const onCheckingForCategoryGroupChanges = () => {
|
||||
webSocketContext.SendSocketMessage(
|
||||
SentMessagesCommands.GroupTasksCheckingForCategoryGroupChanges,
|
||||
{}
|
||||
);
|
||||
};
|
||||
|
||||
const onInstallGlobalPythonPackages = () => {
|
||||
webSocketContext.SendSocketMessage(
|
||||
SentMessagesCommands.GroupTasksInstallGlobalPythonPackages,
|
||||
|
@ -136,40 +129,6 @@ export default function GroupTasks({ isGroupTasksViewModalOpen }) {
|
|||
setPaginationPage={(page) => onPaginationChange(page)}
|
||||
totalPages={groupTasksContext.totalPages}
|
||||
/>
|
||||
|
||||
{hasPermission(
|
||||
appContext.userPermissions,
|
||||
Constants.PERMISSIONS.GROUP_TASKS
|
||||
.CHECKING_FOR_CATEGORY_GROUP_CHANGES
|
||||
) && (
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
marginTop: AppStyle.app.margin,
|
||||
}}
|
||||
>
|
||||
<Popconfirm
|
||||
placement="top"
|
||||
okText={t("common.button.confirm")}
|
||||
cancelText={t("common.button.cancel")}
|
||||
title={t(
|
||||
"groupTasks.button.checkingForCategoryGroupChanges.popover.title"
|
||||
)}
|
||||
onConfirm={() => onCheckingForCategoryGroupChanges()}
|
||||
>
|
||||
<Button
|
||||
shape="round"
|
||||
icon={<ReloadOutlined />}
|
||||
size="large"
|
||||
>
|
||||
{t(
|
||||
"groupTasks.button.checkingForCategoryGroupChanges.check"
|
||||
)}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
|
|
|
@ -109,8 +109,6 @@ export const Constants = {
|
|||
HISTORY: "group_tasks.history",
|
||||
INSTALL_GLOBAL_PYTHON_PACKAGES:
|
||||
"group_tasks.install_global_python_packages",
|
||||
CHECKING_FOR_CATEGORY_GROUP_CHANGES:
|
||||
"group_tasks.checking_for_category_group_changes",
|
||||
},
|
||||
ALL_USERS: {
|
||||
CREATE_NEW_USER: "all_users.create_new_user",
|
||||
|
|
Loading…
Reference in New Issue