update to new backend format

This commit is contained in:
anovazzi1 2024-06-05 16:38:38 -03:00
commit c2bf5ff927
2 changed files with 27 additions and 4 deletions

View file

@ -8,14 +8,12 @@ function RecordsOutputComponent({
pagination, pagination,
rows, rows,
columnMode = "union", columnMode = "union",
columnDefsRow,
}: { }: {
pagination: boolean; pagination: boolean;
rows: any; rows: any;
columnMode?: "intersection" | "union"; columnMode?: "intersection" | "union";
columnDefsRow?: Array<Object>;
}) { }) {
const columns = extractColumnsFromRows(columnDefsRow ?? rows, columnMode); const columns = extractColumnsFromRows(rows, columnMode);
const columnDefs = columns.map((col, idx) => ({ const columnDefs = columns.map((col, idx) => ({
...col, ...col,

View file

@ -1,4 +1,10 @@
import ForwardedIconComponent from "../../../../../../components/genericIconComponent";
import RecordsOutputComponent from "../../../../../../components/recordsOutputComponent"; import RecordsOutputComponent from "../../../../../../components/recordsOutputComponent";
import {
Alert,
AlertDescription,
AlertTitle,
} from "../../../../../../components/ui/alert";
import { Case } from "../../../../../../shared/components/caseComponent"; import { Case } from "../../../../../../shared/components/caseComponent";
import TextOutputView from "../../../../../../shared/components/textOutputView"; import TextOutputView from "../../../../../../shared/components/textOutputView";
import useFlowStore from "../../../../../../stores/flowStore"; import useFlowStore from "../../../../../../stores/flowStore";
@ -17,7 +23,10 @@ export default function SwitchOutputView(nodeId): JSX.Element {
const results = flowPoolNode?.data?.logs[0] ?? ""; const results = flowPoolNode?.data?.logs[0] ?? "";
const resultType = results?.type; const resultType = results?.type;
const resultMessage = results?.message; let resultMessage = results?.message;
if (resultMessage.raw) {
resultMessage = resultMessage.raw;
}
console.log("resultType", results); console.log("resultType", results);
return ( return (
<> <>
@ -60,6 +69,22 @@ export default function SwitchOutputView(nodeId): JSX.Element {
/> />
</Case> </Case>
)} )}
<Case condition={resultType === "stream"}>
<div className="flex h-full w-full items-center justify-center align-middle">
<Alert variant={"default"} className="w-fit">
<ForwardedIconComponent
name="AlertCircle"
className="h-5 w-5 text-primary"
/>
<AlertTitle>{"Streaming is not supported"}</AlertTitle>
<AlertDescription>
{
"Use the playground to interact with components that stream data"
}
</AlertDescription>
</Alert>
</div>
</Case>
</> </>
); );
} }