diff --git a/public/locales/de/translation.json b/public/locales/de/translation.json index 273eb1e..67b0c35 100644 --- a/public/locales/de/translation.json +++ b/public/locales/de/translation.json @@ -141,7 +141,8 @@ "popover": { "groupTaskId.title": "Gruppenaufgabe", "groupTaskStep.title": "Gruppenaufgabe Schritt", - "role.title": "Rolle" + "role.title": "Rolle", + "groupId.title": "Gruppen ID" }, "card": { "checkbox.info": "INFO", "checkbox.error": "FEHLER" }, "tooltip": { @@ -164,33 +165,31 @@ "action": { "title": "Maßnahme", "roleChange": { - "popconfirm.title": "Rolle ändern in", - "roleChange.popconfirm.okText": "Ändern" + "popconfirm": { + "title": "Rolle ändern in", + "okText": "Ändern" + } }, "changeRole": "Rolle ändern", "delete": { "link": "Löschen", - "popconfirm": { "okText": "User löschen" }, - "delete": { - "popconfirm": { - "title": "Sind Sie sicher, dass Sie den Benutzer löschen wollen?" - } + "popconfirm": { + "title": "Sind Sie sicher, dass Sie den Benutzer löschen wollen?", + "okText": "User löschen" } }, "deactivate": { "link": "Deaktivieren", "popconfirm": { - "okText": "Benutzer deaktivieren", - "title": "Sind Sie sicher, dass Sie den Benutzer deaktivieren wollen?" + "title": "Sind Sie sicher, dass Sie den Benutzer deaktivieren wollen?", + "okText": "Benutzer deaktivieren" } }, "activate": { "link": "Aktivieren", - "popconfirm": { "okText": "Benutzer aktivieren" }, - "activate": { - "popconfirm": { - "title": "Sind Sie sicher, dass Sie den Benutzer aktivieren wollen?" - } + "popconfirm": { + "title": "Sind Sie sicher, dass Sie den Benutzer aktivieren wollen?", + "okText": "Benutzer aktivieren" } } } diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 5ac586a..da77b8c 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -141,7 +141,8 @@ "popover": { "groupTaskId.title": "Group Task", "groupTaskStep.title": "Group Task Step", - "role.title": "Role" + "role.title": "Role", + "groupId.title": "Group ID" }, "card": { "checkbox.info": "INFO", "checkbox.error": "ERROR" }, "tooltip": { @@ -164,33 +165,31 @@ "action": { "title": "Action", "roleChange": { - "popconfirm.title": "Change role to", - "roleChange.popconfirm.okText": "Change" + "popconfirm": { + "title": "Change role to", + "okText": "Change" + } }, "changeRole": "Change Role", "delete": { "link": "Delete", - "popconfirm": { "okText": "Delete User" }, - "delete": { - "popconfirm": { - "title": "Are you sure you want to delete the user?" - } + "popconfirm": { + "title": "Are you sure you want to delete the user?", + "okText": "Delete User" } }, "deactivate": { "link": "Deactivate", "popconfirm": { - "okText": "Deactivate User", - "title": "Are you sure you want to deactivate the user?" + "title": "Are you sure you want to deactivate the user?", + "okText": "Deactivate User" } }, "activate": { "link": "Activate", - "popconfirm": { "okText": "Activate User" }, - "activate": { - "popconfirm": { - "title": "Are you sure you want to activate the user?" - } + "popconfirm": { + "title": "Are you sure you want to activate the user?", + "okText": "Activate User" } } } diff --git a/src/Components/LogCard/index.js b/src/Components/LogCard/index.js index 2a321d3..aa92bd8 100644 --- a/src/Components/LogCard/index.js +++ b/src/Components/LogCard/index.js @@ -297,6 +297,61 @@ export default function LogCard({ type }) { /> ); } + } else if (splittedMessage[s] === "%groupId%") { + const foundDataCategory = data.Logs[i].LogData.find( + (data) => data.Type === "category" + ); + + const foundDataGroupId = data.Logs[i].LogData.find( + (data) => data.Type === "groupId" + ); + + if ( + foundDataCategory !== undefined && + foundDataGroupId !== undefined + ) { + const foundGroup = webSocketContext.CategoryGroups.find( + (categoryGroup) => + categoryGroup.category === foundDataCategory.Value + ).groups.find( + (group) => group.id === foundDataGroupId.Value + ); + + items.push( + + ID: + {foundDataGroupId.Value} + + } + title={t("logCard.popover.groupId.title")} + trigger="click" + > + {" "} + + {foundGroup !== undefined + ? foundGroup.name + : foundDataGroupId.Value} + + + } + /> + ); + } else { + items.push( + + ); + } } else { items.push( } style={{ - height: "97vh", + height: "90vh", overflow: "hidden", overflowWrap: "break-word", width: "100%", }} > {!loadingSpinner ? ( -
+
{logData.Logs.filter((log) => { return ( (log.Type === 0 && checkboxInfoChecked) || diff --git a/src/Pages/GroupTasks/Overview/GroupTasksTableList.js b/src/Pages/GroupTasks/Overview/GroupTasksTableList.js index 19f1ba6..fa61169 100644 --- a/src/Pages/GroupTasks/Overview/GroupTasksTableList.js +++ b/src/Pages/GroupTasks/Overview/GroupTasksTableList.js @@ -1,12 +1,9 @@ -import { - DownloadOutlined, - PlusOutlined, - ReloadOutlined, -} from "@ant-design/icons"; +import { DownOutlined, PlusOutlined, ReloadOutlined } from "@ant-design/icons"; import { Badge, Button, Divider, + Dropdown, Popconfirm, Popover, Space, @@ -196,12 +193,34 @@ export default function GroupTaskTableList({ return items; }; - const handleOnConfirm = (category) => { + const handleOnReloadGroupTasksConfirm = (category) => { webSocketContext.SendSocketMessage(SentMessagesCommands.ReloadGroupTasks, { category: category, }); }; + const handleOnInstallPythonDependenciesConfirm = (category, groupId) => { + webSocketContext.SendSocketMessage( + SentMessagesCommands.GroupTasksInstallPythonDependencies, + { + category: category, + groupId: groupId, + } + ); + }; + + const dropDownItems = + categoryGroup.groups !== undefined + ? categoryGroup.groups.map((group, index) => { + return { + key: index, + label: group.name, + category: group.category, + groupid: group.id, + }; + }) + : []; + return ( <> {categoryGroup.category} @@ -246,21 +265,27 @@ export default function GroupTaskTableList({ .XYInstallPythonDependencies, categoryGroup.category ) && ( - handleOnConfirm(categoryGroup.category)} + + handleOnInstallPythonDependenciesConfirm( + dropDownItems[key].category, + dropDownItems[key].groupid + ), + }} + arrow + trigger="click" > - - + )} {hasXYPermission( @@ -273,7 +298,9 @@ export default function GroupTaskTableList({ title={t("groupTasks.groupTasksTableList.popover.reload.title")} cancelText={t("common.button.cancel")} okText={t("common.button.confirm")} - onConfirm={() => handleOnConfirm(categoryGroup.category)} + onConfirm={() => + handleOnReloadGroupTasksConfirm(categoryGroup.category) + } > + +*/ diff --git a/src/utils.js b/src/utils.js index 11650bf..11c9015 100644 --- a/src/utils.js +++ b/src/utils.js @@ -212,6 +212,9 @@ const ReceivedMessagesCommands = { NewUserApiKeyCreated: 30, DeletedUserApiKey: 31, NewApiKeyUsageCount: 32, + InstallingPythonDependencies: 33, + InstallingPythonDependenciesFailed: 34, + InstallingPythonDependenciesFinished: 35, }; // commands sent to the backend server @@ -236,6 +239,7 @@ export const SentMessagesCommands = { HandleUserActionTaskStep: 18, CreateNewUserApiKey: 19, DeleteUserApiKey: 20, + GroupTasksInstallPythonDependencies: 21, }; export function WebSocketProvider({ @@ -1011,8 +1015,25 @@ export function WebSocketProvider({ return updatedUser; }); break; - - default: + case ReceivedMessagesCommands.InstallingPythonDependencies: + notificationApi["info"]({ + message: `Installing python dependencies for ${body.GroupId} of ${body.Category}`, + description: `This may take a while`, + }); + break; + case ReceivedMessagesCommands.InstallingPythonDependenciesFailed: + notificationApi["error"]({ + message: `Installing python dependencies for ${body.GroupId} of ${body.Category} failed`, + description: `Please check the logs`, + }); + break; + case ReceivedMessagesCommands.InstallingPythonDependenciesFinished: + notificationApi["success"]({ + message: `Installing python dependencies for ${body.GroupId} of ${body.Category} finished`, + description: `You can now start the group task`, + }); + break; + case ReceivedMessagesCommands.default: console.error("unknown command", cmd); break; }