From dfcb3a5b04d36c5e52635bdd85d816de80f98902 Mon Sep 17 00:00:00 2001 From: Cristhian Zanforlin Lousa Date: Wed, 11 Dec 2024 14:48:12 -0300 Subject: [PATCH] fix: Resolve DOM validation & React lifecycle warnings (#5205) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 📝 (frontend): Update AlertDropdown component to use 'asChild' prop for PopoverTrigger 📝 (frontend): Refactor ShadTooltip component to use forwardRef and add displayName 📝 (frontend): Update AppHeaderComponent to remove unnecessary aria-hidden attribute 📝 (frontend): Refactor SelectOptions component to improve code structure and readability 📝 (frontend): Update SideBarFoldersButtonsComponent to add getRandomKeyByssmm function and improve code structure 📝 (AWS.jsx): Update fill color condition to use stringToBool function for props.isdark 📝 (index.tsx): Convert isdark value to string before passing it to SvgAWS component 📝 (AstraDB.jsx): Update fill color condition to use stringToBool function for props.isdark ✨ (icons): Convert 'isdark' variable to string to ensure consistent type ♻️ (icons): Refactor 'fill-rule' and 'clip-rule' attributes to 'fillRule' and 'clipRule' for consistency ♻️ (nvidia): Refactor 'enable-background' attribute to 'enableBackground' for consistency ♻️ (nvidia): Refactor 'fill' attribute to use 'stringToBool' function for consistent boolean conversion 📝 (utils): Add 'stringToBool' function to convert string to boolean for reusability --- .../src/alerts/alertDropDown/index.tsx | 2 +- .../common/shadTooltipComponent/index.tsx | 84 +- .../core/appHeaderComponent/index.tsx | 2 - .../components/select-options.tsx | 92 +- .../components/sideBarFolderButtons/index.tsx | 87 +- src/frontend/src/icons/AWS/AWS.jsx | 4 +- src/frontend/src/icons/AWS/index.tsx | 2 +- src/frontend/src/icons/AstraDB/AstraDB.jsx | 6 +- src/frontend/src/icons/AstraDB/index.tsx | 2 +- .../src/icons/Cassandra/Cassandra.jsx | 4 +- src/frontend/src/icons/CrewAI/CrewAiIcon.jsx | 4 +- src/frontend/src/icons/Glean/Glean.jsx | 3004 ++++++++--------- .../icons/GoogleGenerativeAI/GoogleGemini.jsx | 6 +- src/frontend/src/icons/HCD/HCD.jsx | 6 +- src/frontend/src/icons/HCD/index.tsx | 2 +- .../src/icons/Langwatch/langwatch.jsx | 720 ++-- src/frontend/src/icons/Mem0/SvgMem.jsx | 4 +- src/frontend/src/icons/Mem0/index.tsx | 2 +- src/frontend/src/icons/Nvidia/index.tsx | 2 +- src/frontend/src/icons/Nvidia/nvidia.jsx | 8 +- src/frontend/src/icons/Python/Python.jsx | 210 +- src/frontend/src/icons/Youtube/youtube.jsx | 1608 ++++----- .../src/icons/ZepMemory/ZepMemory.jsx | 96 +- src/frontend/src/utils/utils.ts | 2 + 24 files changed, 2991 insertions(+), 2968 deletions(-) diff --git a/src/frontend/src/alerts/alertDropDown/index.tsx b/src/frontend/src/alerts/alertDropDown/index.tsx index 12fb8beee..5a2e54e67 100644 --- a/src/frontend/src/alerts/alertDropDown/index.tsx +++ b/src/frontend/src/alerts/alertDropDown/index.tsx @@ -46,7 +46,7 @@ export default function AlertDropdown({ } }} > - {children} + {children} = ({ - content, - side, - asChild = true, - children, - styleClasses, - delayDuration = 500, - open, - align, - setOpen, - avoidCollisions = false, -}) => { - if (!content) { - return <>{children}; - } +const ShadTooltip = forwardRef( + ( + { + content, + side, + asChild = true, + children, + styleClasses, + delayDuration = 500, + open, + align, + setOpen, + avoidCollisions = false, + }, + ref, + ) => { + if (!content) { + return <>{children}; + } - return ( - - {children} - - {content} - - - ); -}; + {children} + + {content} + + + ); + }, +); + +ShadTooltip.displayName = "ShadTooltip"; export default ShadTooltip; diff --git a/src/frontend/src/components/core/appHeaderComponent/index.tsx b/src/frontend/src/components/core/appHeaderComponent/index.tsx index c95496799..5150527bb 100644 --- a/src/frontend/src/components/core/appHeaderComponent/index.tsx +++ b/src/frontend/src/components/core/appHeaderComponent/index.tsx @@ -121,7 +121,6 @@ export default function AppHeader(): JSX.Element {