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>
<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>
)}
</> </>
); );
} }

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;