From fa627eea037b522a0248669a5ab36da6ab04299c Mon Sep 17 00:00:00 2001 From: igorrCarvalho Date: Mon, 27 Nov 2023 21:28:33 -0300 Subject: [PATCH] Fix: bug on disabled share when there is no api key --- .../src/CustomNodes/GenericNode/index.tsx | 45 +++++++------- .../extraSidebarComponent/index.tsx | 60 ++++++++++++++----- .../components/nodeToolbarComponent/index.tsx | 10 ++-- src/frontend/src/pages/StorePage/index.tsx | 14 ++++- .../end-to-end/promptModalComponent.spec.ts | 4 +- 5 files changed, 89 insertions(+), 44 deletions(-) diff --git a/src/frontend/src/CustomNodes/GenericNode/index.tsx b/src/frontend/src/CustomNodes/GenericNode/index.tsx index a86207063..2ceacf654 100644 --- a/src/frontend/src/CustomNodes/GenericNode/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/index.tsx @@ -198,14 +198,19 @@ export default function GenericNode({ ) : ( -
setInputName(true)}> -
+
setInputName(true)} + > +
{data.node?.display_name}
- {data.node?.flow&& } + {data.node?.flow && ( + + )}
)} @@ -235,10 +240,10 @@ export default function GenericNode({ setData={setData} color={ nodeColors[ - types[data.node?.template[templateField].type!] + types[data.node?.template[templateField].type!] ] ?? nodeColors[ - data.node?.template[templateField].type! + data.node?.template[templateField].type! ] ?? nodeColors.unknown } @@ -285,7 +290,7 @@ export default function GenericNode({ color={nodeColors[types[data.type]] ?? nodeColors.unknown} title={ data.node?.output_types && - data.node.output_types.length > 0 + data.node.output_types.length > 0 ? data.node.output_types.join("|") : data.type } @@ -323,10 +328,10 @@ export default function GenericNode({
{typeof validationStatus.params === "string" ? validationStatus.params - .split("\n") - .map((line: string, index: number) => ( -
{line}
- )) + .split("\n") + .map((line: string, index: number) => ( +
{line}
+ )) : ""}
) @@ -370,14 +375,14 @@ export default function GenericNode({ className={ showNode ? "generic-node-desc " + - (data.node?.description !== "" ? "py-5" : "pb-5") + (data.node?.description !== "" ? "py-5" : "pb-5") : "" } > {data.node?.description !== "" && - showNode && - data.node?.flow && - inputDescription ? ( + showNode && + data.node?.flow && + inputDescription ? (