Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/PipelineRun/RunDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const RunDetails = () => {
/>
)}

<PipelineIO readOnly />
<PipelineIO taskArguments={details.task_spec.arguments} />
</BlockStack>
);
};
29 changes: 26 additions & 3 deletions src/components/shared/Execution/PipelineIO.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { type ReactNode } from "react";

import type { TaskSpecOutput } from "@/api/types.gen";
import { Attribute } from "@/components/shared/ContextPanel/Blocks/Attribute";
import { ContentBlock } from "@/components/shared/ContextPanel/Blocks/ContentBlock";
import { typeSpecToString } from "@/components/shared/ReactFlow/FlowCanvas/TaskNode/ArgumentsEditor/utils";
Expand All @@ -15,10 +16,16 @@ import { InputValueEditor } from "../../Editor/IOEditor/InputValueEditor";
import { OutputNameEditor } from "../../Editor/IOEditor/OutputNameEditor";
import { getOutputConnectedDetails } from "../../Editor/utils/getOutputConnectedDetails";

const PipelineIO = ({ readOnly }: { readOnly?: boolean }) => {
const PipelineIO = ({
taskArguments,
}: {
taskArguments?: TaskSpecOutput["arguments"] | null;
}) => {
const { setContent } = useContextPanel();
const { componentSpec, graphSpec } = useComponentSpec();

const readOnly = !!taskArguments;

const handleInputEdit = (input: InputSpec) => {
setContent(<InputValueEditor key={input.name} input={input} />);
};
Expand Down Expand Up @@ -57,13 +64,18 @@ const PipelineIO = ({ readOnly }: { readOnly?: boolean }) => {

return (
<BlockStack gap="4">
<ContentBlock title="Inputs">
<ContentBlock title={taskArguments ? "Arguments" : "Inputs"}>
{componentSpec.inputs && componentSpec.inputs.length > 0 ? (
<BlockStack>
{componentSpec.inputs.map((input) => (
<IORow
key={input.name}
value={input.value || input.default || "—"}
value={
getArgumentValue(taskArguments, input.name) ||
input.value ||
input.default ||
"—"
}
type={typeSpecToString(input?.type)}
spec={input}
actions={inputActions}
Expand Down Expand Up @@ -162,3 +174,14 @@ function IORow({ spec, value, type, actions }: IORowProps) {
</InlineStack>
);
}

function getArgumentValue(
taskArguments: TaskSpecOutput["arguments"] | undefined,
inputName: string,
) {
const argument = taskArguments?.[inputName];
if (typeof argument === "string") {
return argument;
}
return undefined;
}