feat: Update SwitchOutputView component to handle array result type

This commit is contained in:
anovazzi1 2024-06-04 16:57:56 -03:00
commit 88f1e6602b
2 changed files with 14 additions and 8 deletions

View file

@ -48,13 +48,19 @@ export default function SwitchOutputView(nodeId): JSX.Element {
columnMode="union" columnMode="union"
/> />
</Case> </Case>
{Array.isArray(resultMessage) && (
<Case condition={resultType === "array"}> <Case condition={resultType === "array"}>
<RecordsOutputComponent <RecordsOutputComponent
rows={resultMessage} rows={
(resultMessage as Array<any>).every((item) => item.data)
? (resultMessage as Array<any>).map((item) => item.data)
: resultMessage
}
pagination={true} pagination={true}
columnMode="union" columnMode="union"
/> />
</Case> </Case>
)}
</> </>
); );
} }

View file

@ -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;