From 26689d8578beb2b0666b047019c44754cd61c9e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mose=20M=C3=BCller?= Date: Tue, 27 Feb 2024 16:07:54 +0100 Subject: [PATCH] updates AsyncMethodComponent to work with backend --- .../src/components/AsyncMethodComponent.tsx | 27 +++---------------- 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/frontend/src/components/AsyncMethodComponent.tsx b/frontend/src/components/AsyncMethodComponent.tsx index 472b6b0..18eaf42 100644 --- a/frontend/src/components/AsyncMethodComponent.tsx +++ b/frontend/src/components/AsyncMethodComponent.tsx @@ -7,7 +7,7 @@ import { LevelName } from './NotificationsComponent'; type AsyncMethodProps = { name: string; parentPath: string; - value: Record; + value: 'RUNNING' | null; docString?: string; hideOutput?: boolean; addNotification: (message: string, levelname?: LevelName) => void; @@ -38,33 +38,12 @@ export const AsyncMethodComponent = React.memo((props: AsyncMethodProps) => { useEffect(() => { renderCount.current++; - - // updates the value of each form control that has a matching name in the - // runningTask object - if (runningTask) { - const formElement = formRef.current; - if (formElement) { - Object.entries(runningTask).forEach(([name, value]) => { - const inputElement = formElement.elements.namedItem(name); - if (inputElement) { - inputElement.value = value; - } - }); - } - } - }, [runningTask]); - - useEffect(() => { let message: string; if (runningTask === null) { message = `${fullAccessPath} task was stopped.`; } else { - const runningTaskEntries = Object.entries(runningTask) - .map(([key, value]) => `${key}: "${value}"`) - .join(', '); - - message = `${fullAccessPath} was started with parameters { ${runningTaskEntries} }.`; + message = `${fullAccessPath} was started.`; } addNotification(message); }, [props.value]); @@ -94,7 +73,7 @@ export const AsyncMethodComponent = React.memo((props: AsyncMethodProps) => {