From db02ef5666efaeffce406be1a37c59fbe837a7e9 Mon Sep 17 00:00:00 2001 From: Eugene Jahn Date: Thu, 26 May 2022 12:39:08 -0700 Subject: [PATCH] feat: fix test coverage Signed-off-by: Eugene Jahn --- .../ExecutionDetailsActions.tsx | 10 +++---- .../Tables/NodeExecutionActions.tsx | 26 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx index 2f69277dc..e5251378f 100644 --- a/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx +++ b/packages/zapp/console/src/components/Executions/ExecutionDetails/ExecutionDetailsActions.tsx @@ -28,18 +28,18 @@ export const ExecutionDetailsActions = (props: ExecutionDetailsActionsProps): JS const id = details.taskTemplate?.id as ResourceIdentifier | undefined; - if (!id) { - return <>; - } - React.useEffect(() => { const fetchTask = async () => { const task = await getTask(id as Identifier); setTaskInputsTypes(task.closure.compiledTask.template?.interface?.inputs?.variables); }; - fetchTask(); + if (id) fetchTask(); }, [id]); + if (!id) { + return <>; + } + const literals = executionData.value.fullInputs?.literals; const initialParameters: TaskInitialLaunchParameters = { diff --git a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx index bcaf53058..62ef88c35 100644 --- a/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx +++ b/packages/zapp/console/src/components/Executions/Tables/NodeExecutionActions.tsx @@ -35,19 +35,6 @@ export const NodeExecutionActions = (props: NodeExecutionActionsProps): JSX.Elem const literals = executionData.value.fullInputs?.literals; const id = nodeExecutionDetails?.taskTemplate?.id as ResourceIdentifier; - // open the side panel for selected execution's detail - const inputsAndOutputsIconOnClick = (e: React.MouseEvent) => { - // prevent the parent row body onClick event trigger - e.stopPropagation(); - // use null in case if there is no execution provided - when it is null will close panel - state.setSelectedExecution(execution?.id ?? null); - }; - - const rerunIconOnClick = (e: React.MouseEvent) => { - e.stopPropagation(); - setShowLaunchForm(true); - }; - React.useEffect(() => { detailsContext.getNodeExecutionDetails(execution).then((res) => { setNodeExecutionDetails(res); @@ -62,6 +49,19 @@ export const NodeExecutionActions = (props: NodeExecutionActionsProps): JSX.Elem if (id) fetchTask(); }, [id]); + // open the side panel for selected execution's detail + const inputsAndOutputsIconOnClick = (e: React.MouseEvent) => { + // prevent the parent row body onClick event trigger + e.stopPropagation(); + // use null in case if there is no execution provided - when it is null will close panel + state.setSelectedExecution(execution?.id ?? null); + }; + + const rerunIconOnClick = (e: React.MouseEvent) => { + e.stopPropagation(); + setShowLaunchForm(true); + }; + const renderRerunAction = () => { if (!id) { return <>;