diff --git a/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx index 579233ccecb9..304ddb6cb8c3 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx @@ -11,7 +11,6 @@ import { STATUS_BUILD, STATUS_BUILDING, STATUS_INACTIVE, - TOOLTIP_OUTDATED_NODE, } from "@/constants/constants"; import { BuildStatus } from "@/constants/enums"; import { track } from "@/customization/utils/analytics"; @@ -39,8 +38,6 @@ export default function NodeStatus({ buildStatus, isOutdated, isUserEdited, - handleUpdateCode, - loadingUpdate, getValidationStatus, }: { nodeId: string; @@ -53,8 +50,6 @@ export default function NodeStatus({ buildStatus: BuildStatus; isOutdated: boolean; isUserEdited: boolean; - handleUpdateCode: () => void; - loadingUpdate: boolean; getValidationStatus: (data) => VertexBuildTypeAPI | null; }) { const nodeId_ = data.node?.flow?.data @@ -102,7 +97,9 @@ export default function NodeStatus({ ? " border ring-[0.75px] ring-muted-foreground border-muted-foreground hover:shadow-node" : "border ring-[0.5px] hover:shadow-node ring-border"; let frozenClass = selected ? "border-ring-frozen" : "border-frozen"; - return frozen ? frozenClass : className; + let updateClass = + isOutdated && !isUserEdited ? "border-warning ring-2 ring-warning" : ""; + return cn(frozen ? frozenClass : className, updateClass); }; const getNodeBorderClassName = ( selected: boolean, @@ -125,7 +122,15 @@ export default function NodeStatus({ setBorderColor( getNodeBorderClassName(selected, showNode, buildStatus, validationStatus), ); - }, [selected, showNode, buildStatus, validationStatus, frozen]); + }, [ + selected, + showNode, + buildStatus, + validationStatus, + isOutdated, + isUserEdited, + frozen, + ]); useEffect(() => { if (buildStatus === BuildStatus.BUILT && !isBuilding) { @@ -188,22 +193,6 @@ export default function NodeStatus({ return ( <>
- {isOutdated && !isUserEdited && ( - - - - )} -
)}
-
field.tool_mode); return ( - <> +
{memoizedNodeToolbarComponent} + {isOutdated && !isUserEdited && ( +
+ + + Update Ready + + +
+ )}
)} @@ -432,7 +451,6 @@ export default function GenericNode({
)}
- {showNode && (
{/* increase height!! */} @@ -509,6 +527,6 @@ export default function GenericNode({
)}
- +
); } diff --git a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx index 95a0b8124afc..e70f7e470dcc 100644 --- a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx @@ -1,7 +1,6 @@ import { componentsToIgnoreUpdate } from "@/constants/constants"; import { useEffect } from "react"; import { NodeDataType } from "../../types/flow"; -import { nodeNames } from "../../utils/styleUtils"; const useCheckCodeValidity = ( data: NodeDataType, diff --git a/src/frontend/src/components/ui/button.tsx b/src/frontend/src/components/ui/button.tsx index a4328af41730..0e190a42ea68 100644 --- a/src/frontend/src/components/ui/button.tsx +++ b/src/frontend/src/components/ui/button.tsx @@ -15,7 +15,9 @@ const buttonVariants = cva( outline: "border border-input hover:bg-input hover:text-accent-foreground ", primary: - "border bg-background text-secondary-foreground hover:bg-muted dark:hover:bg-muted hover:shadow-sm", + "border bg-background text-secondary-foreground hover:bg-muted hover:shadow-sm", + warning: + "bg-warning-foreground text-warning-text hover:bg-warning-foreground/90 hover:shadow-sm", secondary: "border border-muted bg-muted text-secondary-foreground hover:bg-secondary-foreground/5", ghost: diff --git a/src/frontend/src/style/index.css b/src/frontend/src/style/index.css index 27dda94f5705..58c46731cf0e 100644 --- a/src/frontend/src/style/index.css +++ b/src/frontend/src/style/index.css @@ -96,6 +96,10 @@ --note-blue: 213.3 96.9% 87.3%; /* hsl(213.3, 96.9%, 87.3%) */ --note-lime: 80.9 88.5% 79.6%; /* hsl(80.9, 88.5%, 79.6%) */ + --warning: 48 96.6% 76.7%; /* hsl(48, 96.6%, 76.7%) */ + --warning-foreground: 240 6% 10%; /* hsl(240, 6%, 10%) */ + --warning-text: 0 0% 100%; /* hsl(0, 0%, 100%) */ + --error-red: 0, 86%, 97%; /*hsla(0, 86%, 97%)*/ --error-red-border: 0, 96%, 89%; /*hsla(0,96%,89%)*/ @@ -204,6 +208,10 @@ --note-blue: 211.7 96.4% 78.4%; /* hsl(211.7, 96.4%, 78.4%) */ --note-lime: 82 84.5% 67.1%; /* hsl(82, 84.5%, 67.1%) */ + --warning: 45.9 96.7% 64.5%; /* hsl(45.9, 96.7%, 64.5%) */ + --warning-foreground: 240 6% 10%; /* hsl(240, 6%, 10%) */ + --warning-text: 0 0% 100%; /* hsl(0, 0%, 100%) */ + --node-selected: 234 89% 74%; --ice: #60a5fa; diff --git a/src/frontend/tailwind.config.mjs b/src/frontend/tailwind.config.mjs index d920e4ac0dc8..3455040f0768 100644 --- a/src/frontend/tailwind.config.mjs +++ b/src/frontend/tailwind.config.mjs @@ -108,6 +108,11 @@ const config = { "status-red": "var(--status-red)", "status-yellow": "var(--status-yellow)", "status-gray": "var(--status-gray)", + warning: { + DEFAULT: "hsl(var(--warning))", + foreground: "hsl(var(--warning-foreground))", + text: "hsl(var(--warning-text))", + }, "success-background": "var(--success-background)", "success-foreground": "var(--success-foreground)", "accent-pink": "hsl(var(--accent-pink))",