Closed lucaseduoli closed 3 days ago
https://github.com/langflow-ai/langflow/pull/4761 -> new PR related to only updating single components https://github.com/langflow-ai/langflow/pull/4762 -> refactor get all to be fetched at the start https://github.com/langflow-ai/langflow/pull/4763 -> add updating of all components at once
Modularized PR into three
This pull request includes multiple changes to the
src/frontend/src/CustomNodes/GenericNode
components and related files to improve the handling of outdated nodes and streamline the codebase. The most important changes include modifying theNodeStatus
andGenericNode
components, adding a new hook for updating all nodes, and updating the flow and type management logic.Improvements to
NodeStatus
andGenericNode
components:src/frontend/src/CustomNodes/GenericNode/components/NodeStatus/index.tsx
: Removed unused propertieshandleUpdateCode
andloadingUpdate
, and added logic to update the class based onisOutdated
andisUserEdited
properties. [1] [2] [3] [4] [5]src/frontend/src/CustomNodes/GenericNode/index.tsx
: Added a warning banner for outdated nodes and removed the old update button logic fromNodeStatus
. [1] [2] [3] [4] [5]New hook for updating all nodes:
src/frontend/src/CustomNodes/hooks/use-update-all-nodes.tsx
: Introduced a new hookuseUpdateAllNodes
to handle updating multiple nodes at once, leveragingcloneDeep
fromlodash
anduseCallback
for performance.Flow and type management updates:
src/frontend/src/controllers/API/queries/flows/use-get-types.ts
: Added a new query functionuseGetTypes
to fetch and manage component types, replacing the oldgetTypes
method.src/frontend/src/pages/AppInitPage/index.tsx
: Updated the initialization logic to fetch types before other data, ensuring types are loaded before proceeding. [1] [2]Additional changes:
src/frontend/src/components/ui/button.tsx
: Added a newwarning
variant to the button component for consistent styling of warning messages.src/frontend/src/components/appHeaderComponent/components/FlowMenu/index.tsx
: Replaced the oldgetTypes
method with the newuseGetTypes
query.