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"
|
||||
/>
|
||||
</Case>
|
||||
<Case condition={resultType === "array"}>
|
||||
<RecordsOutputComponent
|
||||
rows={resultMessage}
|
||||
pagination={true}
|
||||
columnMode="union"
|
||||
/>
|
||||
</Case>
|
||||
{Array.isArray(resultMessage) && (
|
||||
<Case condition={resultType === "array"}>
|
||||
<RecordsOutputComponent
|
||||
rows={
|
||||
(resultMessage as Array<any>).every((item) => item.data)
|
||||
? (resultMessage as Array<any>).map((item) => item.data)
|
||||
: resultMessage
|
||||
}
|
||||
pagination={true}
|
||||
columnMode="union"
|
||||
/>
|
||||
</Case>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ export type VertexBuildTypeAPI = {
|
|||
// it has results, artifacts, timedelta, duration
|
||||
export type VertexDataTypeAPI = {
|
||||
results: { [key: string]: string };
|
||||
logs: { message: string; type: string }[];
|
||||
logs: any[];
|
||||
messages: ChatOutputType[] | chatInputType[];
|
||||
inactive?: boolean;
|
||||
timedelta?: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue