From 036f77fde2e61b8cd78ef20f539c431fdf742396 Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 19 Jun 2024 17:32:52 -0300 Subject: [PATCH 1/2] Fix issue with file validation in Message class --- src/frontend/src/utils/buildUtils.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/utils/buildUtils.ts b/src/frontend/src/utils/buildUtils.ts index b9b8c453d..62184c645 100644 --- a/src/frontend/src/utils/buildUtils.ts +++ b/src/frontend/src/utils/buildUtils.ts @@ -294,8 +294,14 @@ async function buildVertex({ verticesIds.map((id) => ({ id })), ); stopBuild(); + onBuildUpdate(buildData, BuildStatus.ERROR); + + } + else + { + + onBuildUpdate(buildData, BuildStatus.BUILT); } - onBuildUpdate(buildData, BuildStatus.BUILT); } buildResults.push(buildData.valid); } catch (error) { From acd2e4daed9a85b7821a20b95a3392e42a7bb989 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Wed, 19 Jun 2024 17:37:34 -0300 Subject: [PATCH 2/2] Fixed content not being colored on genericModal --- .../src/modals/genericModal/index.tsx | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/frontend/src/modals/genericModal/index.tsx b/src/frontend/src/modals/genericModal/index.tsx index 3ed4379bc..78b00e16e 100644 --- a/src/frontend/src/modals/genericModal/index.tsx +++ b/src/frontend/src/modals/genericModal/index.tsx @@ -90,23 +90,7 @@ export default function GenericModal({ setWordsHighlight(filteredWordsHighlight); } - useEffect(() => { - if (type === TypeModal.PROMPT && inputValue && inputValue != "") { - checkVariables(inputValue); - } - }, [inputValue, type]); - - useEffect(() => { - if (typeof value === "string") setInputValue(value); - }, [value, modalOpen]); - let coloredContent = inputValue || ""; - // Check if coloredContent is a string - // calling toString on undefined will throw an error - // so we need to check if it is a string first - if (typeof coloredContent !== "string") { - coloredContent = ""; - } - coloredContent + const coloredContent = (typeof inputValue === "string" ? inputValue : "") .replace(//g, ">") .replace(regexHighlight, (match, p1, p2) => { @@ -123,6 +107,17 @@ export default function GenericModal({ return match; }) .replace(/\n/g, "
"); + + useEffect(() => { + if (type === TypeModal.PROMPT && inputValue && inputValue != "") { + checkVariables(inputValue); + } + }, [inputValue, type]); + + useEffect(() => { + if (typeof value === "string") setInputValue(value); + }, [value, modalOpen]); + function getClassByNumberLength(): string { let sumOfCaracteres: number = 0; wordsHighlight.forEach((element) => { @@ -188,7 +183,9 @@ export default function GenericModal({ open={modalOpen} setOpen={setModalOpen} > - {children} + + {children} + { switch (myModalTitle) {