feat: Update SwitchOutputView component to handle array result type
This commit is contained in:
parent
46313155b3
commit
88f1e6602b
2 changed files with 14 additions and 8 deletions
|
|
@ -48,13 +48,19 @@ export default function SwitchOutputView(nodeId): JSX.Element {
|
||||||
columnMode="union"
|
columnMode="union"
|
||||||
/>
|
/>
|
||||||
</Case>
|
</Case>
|
||||||
<Case condition={resultType === "array"}>
|
{Array.isArray(resultMessage) && (
|
||||||
<RecordsOutputComponent
|
<Case condition={resultType === "array"}>
|
||||||
rows={resultMessage}
|
<RecordsOutputComponent
|
||||||
pagination={true}
|
rows={
|
||||||
columnMode="union"
|
(resultMessage as Array<any>).every((item) => item.data)
|
||||||
/>
|
? (resultMessage as Array<any>).map((item) => item.data)
|
||||||
</Case>
|
: resultMessage
|
||||||
|
}
|
||||||
|
pagination={true}
|
||||||
|
columnMode="union"
|
||||||
|
/>
|
||||||
|
</Case>
|
||||||
|
)}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -161,7 +161,7 @@ export type VertexBuildTypeAPI = {
|
||||||
// it has results, artifacts, timedelta, duration
|
// it has results, artifacts, timedelta, duration
|
||||||
export type VertexDataTypeAPI = {
|
export type VertexDataTypeAPI = {
|
||||||
results: { [key: string]: string };
|
results: { [key: string]: string };
|
||||||
logs: { message: string; type: string }[];
|
logs: any[];
|
||||||
messages: ChatOutputType[] | chatInputType[];
|
messages: ChatOutputType[] | chatInputType[];
|
||||||
inactive?: boolean;
|
inactive?: boolean;
|
||||||
timedelta?: number;
|
timedelta?: number;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue