From 3489bdf0a4d07160d260302d2f3077bf28b0be4a Mon Sep 17 00:00:00 2001 From: Cahllagerfeld <43843195+Cahllagerfeld@users.noreply.github.com> Date: Fri, 29 Nov 2024 14:37:54 +0100 Subject: [PATCH] fix: dict and array params (#705) --- src/components/NestedCollapsible.tsx | 2 +- .../steps/step-sheet/ConfigurationTab.tsx | 48 ++----------------- 2 files changed, 6 insertions(+), 44 deletions(-) diff --git a/src/components/NestedCollapsible.tsx b/src/components/NestedCollapsible.tsx index d5ad0028..ce7618f3 100644 --- a/src/components/NestedCollapsible.tsx +++ b/src/components/NestedCollapsible.tsx @@ -114,7 +114,7 @@ function RenderArray({ title, value }: { title: string; value: unknown[] }) { const simpleValues: unknown[] = value.filter( (val) => (!isArray(val) && !isObject(val)) || val === null ); - const nestedValues: unknown[] = value.filter((val) => isArray(val) || isObject); + const nestedValues: unknown[] = value.filter((val) => isArray(val) || isObject(val)); return ( <> diff --git a/src/components/steps/step-sheet/ConfigurationTab.tsx b/src/components/steps/step-sheet/ConfigurationTab.tsx index 762d1e7f..438989df 100644 --- a/src/components/steps/step-sheet/ConfigurationTab.tsx +++ b/src/components/steps/step-sheet/ConfigurationTab.tsx @@ -1,20 +1,12 @@ import { DockerImageCollapsible } from "@/app/runs/[id]/_Tabs/Configuration/DockerImageCollapsible"; import { Codesnippet } from "@/components/CodeSnippet"; import { CollapsibleCard } from "@/components/CollapsibleCard"; -import { KeyValue } from "@/components/KeyValue"; import { usePipelineBuild } from "@/data/pipeline-builds/all-pipeline-builds-query"; import { usePipelineRun } from "@/data/pipeline-runs/pipeline-run-detail-query"; import { useStepDetail } from "@/data/steps/step-detail-query"; -import { renderAnyToString } from "@/lib/strings"; import { AnyDict } from "@/types/common"; import { BuildItemMap } from "@/types/pipeline-builds"; import { Skeleton } from "@zenml-io/react-component-library"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger -} from "@zenml-io/react-component-library/components/client"; import { useParams } from "react-router-dom"; import { ErrorFallback } from "../../Error"; import { NestedCollapsible } from "../../NestedCollapsible"; @@ -78,7 +70,11 @@ export function StepConfigTab({ stepId }: Props) { return (
- + {dataImage ? : null} 0; - - if (!hasData) - return ( - -

No data available

-
- ); - return ( - -
- {Object.entries(data).map( - ([key, value]) => - typeof value !== "object" && ( - - - {key} - {key} - - - } - value={
{renderAnyToString(value)}
} - /> - ) - )} -
-
- ); -} - function CodeSnippetCard({ id }: { id: string }) { function returnConfigSchema(id: string) { return `from zenml.client import Client