diff --git a/src/frontend/src/components/codeAreaComponent/index.tsx b/src/frontend/src/components/codeAreaComponent/index.tsx index f5f2947b5..af599e1d8 100644 --- a/src/frontend/src/components/codeAreaComponent/index.tsx +++ b/src/frontend/src/components/codeAreaComponent/index.tsx @@ -14,7 +14,8 @@ export default function CodeAreaComponent({ setNodeClass, id = "", readonly = false, - openModal, + open, + setOpen, }: CodeAreaComponentType) { const [myValue, setMyValue] = useState( typeof value == "string" ? value : JSON.stringify(value) @@ -33,7 +34,8 @@ export default function CodeAreaComponent({ return (
state.dark); const unselectAll = useFlowStore((state) => state.unselectAll); @@ -56,10 +58,6 @@ export default function CodeAreaModal({ } }, []); - useEffect(() => { - if (openModal) setOpen(true); - }, [openModal]); - function processNonDynamicField() { postValidateCode(code) .then((apiReturn) => { @@ -143,8 +141,6 @@ export default function CodeAreaModal({ }; }, [error, setHeight]); - const [open, setOpen] = useState(false); - useEffect(() => { setCode(value); }, [value, open]); diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 72ea03be9..789de30a0 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -219,23 +219,6 @@ export default function NodeToolbarComponent({ }} data-testid="code-button-modal" > -
- -
@@ -492,6 +475,26 @@ export default function NodeToolbarComponent({ is_component={true} component={flowComponent!} /> + {hasCode && ( +
+ +
+ )}
diff --git a/src/frontend/src/types/components/index.ts b/src/frontend/src/types/components/index.ts index 7b19bc871..cd23ae31b 100644 --- a/src/frontend/src/types/components/index.ts +++ b/src/frontend/src/types/components/index.ts @@ -113,7 +113,8 @@ export type CodeAreaComponentType = { dynamic?: boolean; id?: string; readonly?: boolean; - openModal?: boolean; + open?: boolean; + setOpen?: (open: boolean) => void; }; export type FileComponentType = { @@ -519,7 +520,8 @@ export type codeAreaModalPropsType = { children: ReactNode; dynamic?: boolean; readonly?: boolean; - openModal?: boolean; + open?: boolean; + setOpen?: (open: boolean) => void; }; export type chatMessagePropsType = {