From c8ba001c5428de92aceb2f74f0172ee7af808669 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Mon, 10 Jun 2024 15:59:59 -0300 Subject: [PATCH] Removed pagination when its on the left side, fixed bug on opening parameter if the record is not a list --- .../src/components/tableComponent/index.tsx | 29 ++++++++++--------- .../IOModal/components/IOFieldView/index.tsx | 8 +++-- src/frontend/src/modals/IOModal/index.tsx | 2 +- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/frontend/src/components/tableComponent/index.tsx b/src/frontend/src/components/tableComponent/index.tsx index 84d4a6bba..917919f51 100644 --- a/src/frontend/src/components/tableComponent/index.tsx +++ b/src/frontend/src/components/tableComponent/index.tsx @@ -12,7 +12,6 @@ import { cn, toTitleCase } from "../../utils/utils"; import ForwardedIconComponent from "../genericIconComponent"; import { Alert, AlertDescription, AlertTitle } from "../ui/alert"; import TableOptions from "./components/TableOptions"; -import { useParams } from "react-router-dom"; import resetGrid from "./utils/reset-grid-columns"; interface TableComponentProps extends AgGridReactProps { @@ -21,6 +20,7 @@ interface TableComponentProps extends AgGridReactProps { alertTitle?: string; alertDescription?: string; editable?: boolean | string[]; + pagination?: boolean; onDelete?: () => void; onDuplicate?: () => void; } @@ -134,7 +134,6 @@ const TableComponent = forwardRef< }} columnDefs={colDef} ref={realRef} - pagination={true} onGridReady={onGridReady} onColumnMoved={onColumnMoved} onStateUpdated={(e) => { @@ -143,18 +142,20 @@ const TableComponent = forwardRef< } }} /> - 0} - duplicateRow={props.onDuplicate ? props.onDuplicate : undefined} - deleteRow={props.onDelete ? props.onDelete : undefined} - resetGrid={() => { - resetGrid(realRef, initialColumnDefs); - setTimeout(() => { - setColumnStateChange(false); - }, 100); - }} - /> + {props.pagination && ( + 0} + duplicateRow={props.onDuplicate ? props.onDuplicate : undefined} + deleteRow={props.onDelete ? props.onDelete : undefined} + resetGrid={() => { + resetGrid(realRef, initialColumnDefs); + setTimeout(() => { + setColumnStateChange(false); + }, 100); + }} + /> + )} ); }, diff --git a/src/frontend/src/modals/IOModal/components/IOFieldView/index.tsx b/src/frontend/src/modals/IOModal/components/IOFieldView/index.tsx index 0bf856aef..20bae05c6 100644 --- a/src/frontend/src/modals/IOModal/components/IOFieldView/index.tsx +++ b/src/frontend/src/modals/IOModal/components/IOFieldView/index.tsx @@ -255,9 +255,11 @@ export default function IOFieldView({ artifact.data - ) ?? [] + Array.isArray(flowPoolNode?.data?.artifacts) + ? flowPoolNode?.data?.artifacts?.map( + (artifact) => artifact.data, + ) ?? [] + : [flowPoolNode?.data?.artifacts] } columnMode="union" /> diff --git a/src/frontend/src/modals/IOModal/index.tsx b/src/frontend/src/modals/IOModal/index.tsx index 74b15ccd8..903455d5a 100644 --- a/src/frontend/src/modals/IOModal/index.tsx +++ b/src/frontend/src/modals/IOModal/index.tsx @@ -288,7 +288,7 @@ export default function IOModal({ const textOutputValue = (flowPool[node!.id] ?? [])[ (flowPool[node!.id]?.length ?? 1) - 1 - ]?.data.results.result ?? ""; + ]?.data?.artifacts ?? ""; const disabled = textOutputValue === "" || JSON.stringify(textOutputValue) === "{}";