From 07276523a350878b91ff009d0187addb4804c9e4 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 7 Jul 2023 11:35:50 -0300 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=90=9B=20fix(chatMessage/index.tsx):?= =?UTF-8?q?=20remove=20unnecessary=20div=20wrapper=20around=20matched=20te?= =?UTF-8?q?xt=20in=20AccordionContent=20=F0=9F=94=A8=20refactor(chatMessag?= =?UTF-8?q?e/index.tsx):=20simplify=20rendering=20of=20matched=20text=20in?= =?UTF-8?q?=20AccordionContent=20by=20using=20a=20span=20instead=20of=20a?= =?UTF-8?q?=20div=20=F0=9F=94=A8=20refactor(chatMessage/index.tsx):=20remo?= =?UTF-8?q?ve=20unnecessary=20div=20wrapper=20around=20chat.message[chat.c?= =?UTF-8?q?hatKey]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modals/formModal/chatMessage/index.tsx | 36 ++++++++----------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/frontend/src/modals/formModal/chatMessage/index.tsx b/src/frontend/src/modals/formModal/chatMessage/index.tsx index 722365e0c..499a7bee1 100644 --- a/src/frontend/src/modals/formModal/chatMessage/index.tsx +++ b/src/frontend/src/modals/formModal/chatMessage/index.tsx @@ -138,15 +138,15 @@ export default function ChatMessage({
- + - + Initial Prompt - + { // Make all the variables that are inside curly braces bold template.split("\n").map((line, index) => { @@ -160,24 +160,14 @@ export default function ChatMessage({ parts.push(line.substring(lastIndex, match.index)); } // Push div with matched text - parts.push( -
-
- - - {match[1]} - - {chat.message[match[1]] ? ( - -   {chat.message[match[1]]} - - ) : ( - "" - )} - -
-
- ); + if (chat.message[match[1]]) { + parts.push( + + {chat.message[match[1]]} + + ); + } + // Update last index lastIndex = regex.lastIndex; } @@ -191,7 +181,9 @@ export default function ChatMessage({
- {chat.message[chat.chatKey]} + + {chat.message[chat.chatKey]} +
From 3842b9090796e6e62df4e4f79312eebac9030158 Mon Sep 17 00:00:00 2001 From: Lucas Oliveira Date: Fri, 7 Jul 2023 11:36:34 -0300 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=90=9B=20fix(GenericNode):=20improve?= =?UTF-8?q?=20readability=20of=20tooltip=20title=20by=20formatting=20the?= =?UTF-8?q?=20JSX=20code=20=F0=9F=90=9B=20fix(inputFileComponent):=20fix?= =?UTF-8?q?=20class=20order=20in=20className=20to=20ensure=20proper=20styl?= =?UTF-8?q?ing=20=F0=9F=90=9B=20fix(textAreaComponent):=20fix=20class=20or?= =?UTF-8?q?der=20in=20className=20to=20ensure=20proper=20styling=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(API):=20remove=20trailing=20whitespace=20at?= =?UTF-8?q?=20the=20end=20of=20the=20file=20=F0=9F=90=9B=20fix(ApiModal):?= =?UTF-8?q?=20add=20missing=20space=20before=20if=20statement=20condition?= =?UTF-8?q?=20=F0=9F=90=9B=20fix(genericModal):=20remove=20unnecessary=20w?= =?UTF-8?q?hitespace=20and=20fix=20class=20order=20in=20className=20?= =?UTF-8?q?=F0=9F=90=9B=20fix(utils):=20add=20missing=20comma=20in=20INVAL?= =?UTF-8?q?ID=5FCHARACTERS=20array=20=F0=9F=90=9B=20fix(tailwind.config.js?= =?UTF-8?q?):=20add=20missing=20comma=20in=20custom-scroll=20CSS=20rule?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/CustomNodes/GenericNode/index.tsx | 10 +++++-- .../components/inputFileComponent/index.tsx | 2 +- .../components/textAreaComponent/index.tsx | 27 +++++++++---------- src/frontend/src/controllers/API/index.ts | 2 +- src/frontend/src/modals/ApiModal/index.tsx | 2 +- .../src/modals/genericModal/index.tsx | 27 +++++++++---------- src/frontend/src/utils.ts | 2 +- src/frontend/tailwind.config.js | 2 +- 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index 56d574920..0567580e3 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -118,8 +118,14 @@ export default function GenericNode({ Build flow to validate status. - + + Build{" "} + {" "} + flow to validate status. + ) : (
{validationStatus.params diff --git a/src/frontend/src/components/inputFileComponent/index.tsx b/src/frontend/src/components/inputFileComponent/index.tsx index 99f066aff..f1919f220 100644 --- a/src/frontend/src/components/inputFileComponent/index.tsx +++ b/src/frontend/src/components/inputFileComponent/index.tsx @@ -112,7 +112,7 @@ export default function InputFileComponent({ {!editNode && !loading && ( )} {!editNode && loading && ( diff --git a/src/frontend/src/components/textAreaComponent/index.tsx b/src/frontend/src/components/textAreaComponent/index.tsx index dc6f92cd2..c7c7f5e80 100644 --- a/src/frontend/src/components/textAreaComponent/index.tsx +++ b/src/frontend/src/components/textAreaComponent/index.tsx @@ -30,24 +30,23 @@ export default function TextAreaComponent({
- { - setMyValue(e.target.value); - onChange(e.target.value); - }} - /> + value={myValue} + className={ + editNode + ? "input-edit-node" + : "input-primary" + (disabled ? " input-disable " : "") + } + placeholder={"Type something..."} + onChange={(e) => { + setMyValue(e.target.value); + onChange(e.target.value); + }} + />