feat: improving tool mode metadata updates and tables refresh (#6935)
* updates to tool mode * Update src/backend/base/langflow/custom/custom_component/component.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * [autofix.ci] apply automated fixes * fix the update real time table refresh issues. * [autofix.ci] apply automated fixes * Update component.py * Update component.py * format errors * [autofix.ci] apply automated fixes * Update index.tsx * [autofix.ci] apply automated fixes * lint error fix * [autofix.ci] apply automated fixes * fix format issue * [autofix.ci] apply automated fixes * fix typing.override does not exist in your Python version --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
94140ccf2e
commit
a8f4090888
4 changed files with 98 additions and 50 deletions
|
|
@ -4,7 +4,7 @@ import { FormatColumns, generateBackendColumnsFromValue } from "@/utils/utils";
|
|||
import { DataTypeDefinition, SelectionChangedEvent } from "ag-grid-community";
|
||||
import { AgGridReact } from "ag-grid-react";
|
||||
import { cloneDeep } from "lodash";
|
||||
import { useMemo, useRef, useState } from "react";
|
||||
import { useEffect, useMemo, useRef, useState } from "react";
|
||||
import { ForwardedIconComponent } from "../../../../common/genericIconComponent";
|
||||
import { Button } from "../../../../ui/button";
|
||||
import { InputProps, TableComponentType } from "../../types";
|
||||
|
|
@ -68,6 +68,11 @@ export default function TableNodeComponent({
|
|||
const [tempValue, setTempValue] = useState<any[]>(cloneDeep(value));
|
||||
const [isModalOpen, setIsModalOpen] = useState(false);
|
||||
const agGrid = useRef<AgGridReact>(null);
|
||||
// Add useEffect to sync with incoming value changes
|
||||
useEffect(() => {
|
||||
setTempValue(cloneDeep(value));
|
||||
}, [value]);
|
||||
|
||||
const componentColumns = columns
|
||||
? columns
|
||||
: generateBackendColumnsFromValue(tempValue ?? [], table_options);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue