From c348b4204afebaac814d2430d8222cfde544f00a Mon Sep 17 00:00:00 2001
From: Cristhian Zanforlin Lousa
<72977554+Cristhianzl@users.noreply.github.com>
Date: Wed, 28 Feb 2024 10:29:52 -0300
Subject: [PATCH] Change the color on str output, change X icon on Notification
tab, change the icon on nodeToolbar (Code) (#1473)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* 🐛 fix(GenericNode): simplify return statement for build status classes to improve code readability
🔥 chore(GenericNode): remove console.log statement used for debugging
🔥 chore(alertDropDown): remove unused import
🔥 chore(nodeToolbarComponent): remove unused import
🔥 chore(styleUtils): remove unused color definition
* 🎨 style(styleUtils.ts): update color for 'str' key in nodeColors object to match the color used in other keys
* 🔥 refactor(GenericNode/index.tsx): remove unnecessary console.log statement for data.node?.template
---
.../src/alerts/alertDropDown/index.tsx | 7 ++---
.../components/nodeToolbarComponent/index.tsx | 26 +++++++++----------
src/frontend/src/utils/styleUtils.ts | 2 +-
3 files changed, 18 insertions(+), 17 deletions(-)
diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx
index cf3fa13dc..f1eab4c60 100644
--- a/src/frontend/src/alerts/alertDropDown/index.tsx
+++ b/src/frontend/src/alerts/alertDropDown/index.tsx
@@ -1,3 +1,4 @@
+import { Cross2Icon } from "@radix-ui/react-icons";
import { useState } from "react";
import IconComponent from "../../components/genericIconComponent";
import {
@@ -46,15 +47,15 @@ export default function AlertDropdown({
setTimeout(clearNotificationList, 100);
}}
>
-
+
diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
index a0136ba85..f7ee2eba4 100644
--- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
+++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
@@ -1,5 +1,6 @@
import _, { cloneDeep } from "lodash";
import { useEffect, useState } from "react";
+import { useUpdateNodeInternals } from "reactflow";
import ShadTooltip from "../../../../components/ShadTooltipComponent";
import CodeAreaComponent from "../../../../components/codeAreaComponent";
import IconComponent from "../../../../components/genericIconComponent";
@@ -26,7 +27,6 @@ import {
updateFlowPosition,
} from "../../../../utils/reactflowUtils";
import { classNames, cn } from "../../../../utils/utils";
-import { useUpdateNodeInternals } from "reactflow";
export default function NodeToolbarComponent({
data,
@@ -89,7 +89,9 @@ export default function NodeToolbarComponent({
}, [showModalAdvanced]);
const updateNodeInternals = useUpdateNodeInternals();
- const setLastCopiedSelection = useFlowStore(state => state.setLastCopiedSelection);
+ const setLastCopiedSelection = useFlowStore(
+ (state) => state.setLastCopiedSelection
+ );
useEffect(() => {
setFlowComponent(createFlowComponent(cloneDeep(data), version));
}, [
@@ -144,8 +146,8 @@ export default function NodeToolbarComponent({
deleteNode(data.id);
break;
case "copy":
- const node = nodes.filter(node => node.id === data.id)
- setLastCopiedSelection({ nodes: _.cloneDeep(node), edges: [] })
+ const node = nodes.filter((node) => node.id === data.id);
+ setLastCopiedSelection({ nodes: _.cloneDeep(node), edges: [] });
}
};
@@ -233,7 +235,7 @@ export default function NodeToolbarComponent({
id={"code-input-node-toolbar-" + name}
/>
-
+
) : (
@@ -371,13 +373,11 @@ export default function NodeToolbarComponent({
className="relative top-0.5 mr-2 h-4 w-4 "
/>{" "}
Copy{" "}
-
-
- C
-
+
+ C
{hasStore && (
@@ -450,7 +450,7 @@ export default function NodeToolbarComponent({
diff --git a/src/frontend/src/utils/styleUtils.ts b/src/frontend/src/utils/styleUtils.ts
index 62e1c6ec7..4abcecdaf 100644
--- a/src/frontend/src/utils/styleUtils.ts
+++ b/src/frontend/src/utils/styleUtils.ts
@@ -219,7 +219,7 @@ export const nodeColors: { [char: string]: string } = {
wrappers: "#E6277A",
utilities: "#31A3CC",
output_parsers: "#E6A627",
- str: "#049524",
+ str: "#31a3cc",
retrievers: "#e6b25a",
unknown: "#9CA3AF",
custom_components: "#ab11ab",