Change the color on str output, change X icon on Notification tab, change the icon on nodeToolbar (Code) (#1473)

* 🐛 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
This commit is contained in:
Cristhian Zanforlin Lousa 2024-02-28 10:29:52 -03:00 committed by GitHub
commit c348b4204a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 17 deletions

View file

@ -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);
}}
>
<IconComponent name="Trash2" className="h-[1.1rem] w-[1.1rem]" />
<IconComponent name="Trash2" className="h-4 w-4" />
</button>
<button
className="text-foreground hover:text-status-red"
className="text-foreground opacity-70 hover:opacity-100"
onClick={() => {
setOpen(false);
}}
>
<IconComponent name="X" className="h-5 w-5" />
<Cross2Icon className="h-4 w-4" />
</button>
</div>
</div>

View file

@ -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}
/>
</div>
<IconComponent name="Code" className="h-4 w-4" />
<IconComponent name="TerminalSquare" className="h-4 w-4" />
</button>
</ShadTooltip>
) : (
@ -371,13 +373,11 @@ export default function NodeToolbarComponent({
className="relative top-0.5 mr-2 h-4 w-4 "
/>{" "}
<span className="">Copy</span>{" "}
<IconComponent
name="Command"
className="absolute right-[1.15rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
></IconComponent>
<span className="absolute right-2 top-[0.5em]">C</span>
<IconComponent
name="Command"
className="absolute right-[1.15rem] top-[0.65em] h-3.5 w-3.5 stroke-2"
></IconComponent>
<span className="absolute right-2 top-[0.5em]">C</span>
</div>
</SelectItem>
{hasStore && (
@ -450,7 +450,7 @@ export default function NodeToolbarComponent({
<span>
<IconComponent
name="Delete"
className="absolute right-2 top-2 h-4 w-4 text-red-400 stroke-2"
className="absolute right-2 top-2 h-4 w-4 stroke-2 text-red-400"
></IconComponent>
</span>
</div>

View file

@ -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",