Skip to content

Commit

Permalink
feat: fix test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Eugene Jahn <[email protected]>
  • Loading branch information
eugenejahn committed May 26, 2022
1 parent d86e0d1 commit db02ef5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<HTMLElement>) => {
// 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<HTMLElement>) => {
e.stopPropagation();
setShowLaunchForm(true);
};

React.useEffect(() => {
detailsContext.getNodeExecutionDetails(execution).then((res) => {
setNodeExecutionDetails(res);
Expand All @@ -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<HTMLElement>) => {
// 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<HTMLElement>) => {
e.stopPropagation();
setShowLaunchForm(true);
};

const renderRerunAction = () => {
if (!id) {
return <></>;
Expand Down

0 comments on commit db02ef5

Please sign in to comment.