From b06cb9507f0511d682d184916dead4110ad9f0ba Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Tue, 12 Sep 2023 14:25:04 -0300 Subject: [PATCH] Feat: Add minimize icon and conditional render --- .../src/CustomNodes/GenericNode/index.tsx | 151 ++++++++++-------- src/frontend/src/style/applies.css | 2 +- src/frontend/src/utils/styleUtils.ts | 2 + 3 files changed, 84 insertions(+), 71 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 30dda4034..8d8d4aefd 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -14,6 +14,7 @@ import { cleanEdges } from "../../utils/reactflowUtils"; import { nodeColors, nodeIconsLucide } from "../../utils/styleUtils"; import { classNames, toTitleCase } from "../../utils/utils"; import ParameterComponent from "./components/parameterComponent"; +import { Button } from "@mui/material"; export default function GenericNode({ data: olddata, @@ -29,6 +30,7 @@ export default function GenericNode({ const name = nodeIconsLucide[data.type] ? data.type : types[data.type]; const [validationStatus, setValidationStatus] = useState(null); + const [showNode, setShowNode] = useState(true); // State for outline color const { sseData, isBuilding } = useSSE(); useEffect(() => { @@ -84,76 +86,84 @@ export default function GenericNode({
BETA
)} -
-
- -
- -
- {data.node?.display_name} -
-
-
+
+
+
-
-
- Building... - ) : !validationStatus ? ( - - Build{" "} - {" "} - flow to validate status. - - ) : ( -
- {typeof validationStatus.params === "string" - ? validationStatus.params - .split("\n") - .map((line: string, index: number) => ( -
{line}
- )) - : ""} -
- ) - } - > -
-
-
-
-
-
+
+
+ +
+ +
+ {data.node?.display_name} +
+
+
+
+
+
+ Building... + ) : !validationStatus ? ( + + Build{" "} + {" "} + flow to validate status. + + ) : ( +
+ {typeof validationStatus.params === "string" + ? validationStatus.params + .split("\n") + .map((line: string, index: number) => ( +
{line}
+ )) + : ""} +
+ ) + } + > +
+
+
+
+
+
+
@@ -167,7 +177,8 @@ export default function GenericNode({ .map((templateField: string, idx) => (
{data.node!.template[templateField].show && - !data.node!.template[templateField].advanced ? ( + !data.node!.template[templateField].advanced && + showNode ? (