Commit graph

5,382 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
9b83f44611
feat: add stop button on Playground Chat (#3704)
* 📝 (buttonSendWrapper/index.tsx): refactor button styling logic to use constants for better readability and maintainability
🐛 (buttonSendWrapper/index.tsx): fix logic to disable button when chat is locked and not building
🐛 (buttonSendWrapper/index.tsx): fix conditional rendering of icons based on button state

*  (stop-button-playground.spec.ts): Add end-to-end test for stopping building from inside Playground.

* 🔧 (buttonSendWrapper/index.tsx): refactor conditional logic to correctly prioritize showStopButton condition and improve code readability

*  (stop-button-playground.spec.ts): add assertion to check if "build stopped" text is visible after clicking on the stop button
2024-09-06 20:19:00 +00:00
Cristhian Zanforlin Lousa
f72e009406
feat: Add x-large size option to baseModal and various modals resizes (#3710)
* feat: Add x-large size option to baseModal

The code changes introduce a new size option "x-large" to the baseModal component. This size option sets the minimum width to "min-w-[95vw]" and the height to "h-[95vh]". This change allows for a larger modal size when needed.

* feat: Add x-large size option to baseModal

* chore: Update CodeAreaModal to use x-large size option

* feat: Update EditNodeModal to use x-large size option

* feat: Update FlowLogsModal to use x-large size option

* chore: Update modal components to use x-large size option

* 🔧 (applies.css): Rearrange CSS classes properties for better readability and maintainability. Fix the order of properties in CSS classes to follow a consistent pattern.
2024-09-06 18:30:48 +00:00
Cristhian Zanforlin Lousa
40798c5b5a
refactor: improve readability of several components (#3714)
* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

*  (Simple Agent.spec.ts): update expected count of python words to 2 for accurate test results
📝 (auto-login-off.spec.ts): add a 1-second timeout before checking visibility of a text element to ensure proper rendering and improve test reliability

* 📝 (cardComponent/index.tsx): Extract handlePlaygroundClick function to improve code readability and maintainability
📝 (codeAreaComponent/index.tsx): Refactor code to use consistent naming conventions and improve code structure
📝 (rename-label.tsx): Refactor code to use consistent naming conventions and improve code structure
📝 (dictAreaModal/index.tsx): Refactor code to use consistent naming conventions and improve code structure

* 🔧 (rename-label.tsx): Refactor RenameLabel component to improve readability and maintainability by restructuring the component logic into separate functions for handling blur, change, and double click events. Split the component rendering logic into separate functions for input and span elements.

* update type

* [autofix.ci] apply automated fixes

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-06 18:30:20 +00:00
Cristhian Zanforlin Lousa
835559a05d
feat: add a better scroll behave on playground's chat (#3680)
* feat: Add useUtilityStore hook to IOModal for setting playground scroll behavior

* feat: Add useUtilityStore hook to IOModal for setting playground scroll behavior

* feat: Add setPlaygroundScrollBehaves function to useUtilityStore hook

* feat: Update codeTabsPropsType to allow undefined for the 'open' property

* feat: Add `playgroundScrollBehaves` and `setPlaygroundScrollBehaves` to `UtilityStoreType`

The `UtilityStoreType` now includes the `playgroundScrollBehaves` property of type `ScrollBehavior` and the `setPlaygroundScrollBehaves` function to update it. This allows for managing the scroll behavior of the playground in the application.

* refactor: Remove unused 'open' prop from CodeTabsComponent
2024-09-06 14:49:50 -03:00
Cristhian Zanforlin Lousa
1e334335d1
tests: fix decision flow tests - conditional router component (#3702)
 (decisionFlow.spec.ts): Remove unnecessary code related to connection 4 and improve flow by adding a new connection for prompt input user message
📝 (decisionFlow.spec.ts): Update test to fill in a different message in the chat playground and verify a different emoji response
2024-09-05 18:26:17 -03:00
Lucas Oliveira
3bc9cc9686
fix: update saving behavior when exiting flow (#3673)
* Updated save flow to only execute when the flow has unsaved changes

* Made flowPage call saveFlow immediatly when trying to exit page

* Changed save changes modal to automatically exit when saved on autoSave

* Changed flowPage to save and exit when autoSave

* Remove confirmation button if it does not exist and remove footer if confirmation and cancel does not exist

* Changed saveChangesModal to not show buttons when autoSave is on and to set loading as true when autoSave is off and the user saves

* Add timer to close modal, so, if saving takes less than 1 second, it waits

* Changed type of confirmationModal

* Added handling for when it's building and there is unsaved changes

* Added success toast when flow finishes saving

* refactored confirmationModal

* check autoLogin !== undefined before calling things

* Fix use save flow to compare the passed flow instead of the current one

* Changed style of save changes modal

* deleted build in progress modal

* Removed build in progress modal, just stopping the build

* Fix condition on api

* Changed condition to be autoLogin !== undefined
2024-09-05 21:10:15 +00:00
Lucas Oliveira
c31005a84f
fix: remove saving on flow pan and add fit view to reactflow (#3696)
* Remove save on pan flow and added fit view

* Removed viewport setting on resetFlow and setReactflowInstance

* Made last saved appear on header

* Made it only fit on set react flow instance

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-09-05 19:17:21 +00:00
Lucas Oliveira
414bfe799e
fix: set refetch on window focus to false for all queries on flow page (#3699)
Add refetchOnWindowFocus as false on every query that is run on the flow
2024-09-05 18:03:40 +00:00
Lucas Oliveira
a4dc5381b2
feat: add build in progress modal when trying to exit (#3695)
* Changed store to stop the isBuilding state as well

* Create Build In Progress modal

* Use blocker to stop if its building as well
2024-09-05 13:50:12 +00:00
anovazzi1
533d5afdc6
fix: Delete folder from cache after successful deletion (#3686)
* feat: Delete folder from cache after successful deletion

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-04 18:19:46 -03:00
anovazzi1
addadeb5cb
fix: remove edges glitch (#3689)
fix: Update transition property in App.css

The transition property in App.css has been updated to only transition the color property instead of all properties. This change improves performance by reducing unnecessary transitions.
2024-09-04 21:05:36 +00:00
anovazzi1
5ad48b4212
chore: update TextInput and TextOutput components to use MultilineInput (#3664)
chore: Update TextInput and TextOutput components to use MultilineInput instead of MessageTextInput
2024-09-04 19:12:19 +00:00
Cristhian Zanforlin Lousa
a670a7cb0b
fix: getall is being called unnecessarily every time the user accesses the My Collection page (#3681)
*  (use-get-folders.ts): Update useGetFoldersQuery to check if types are empty before calling getTypes to avoid unnecessary API calls
♻️ (typesStore.ts): Remove unnecessary useAlertStore setState call to improve code readability and maintainability

* feat: Update getTypes function to always force refresh

The `getTypes` function in `typesStore.ts` has been updated to always force a refresh of the types data. This change ensures that the latest data is fetched from the API, avoiding unnecessary API calls.

* Changed types check in other pages

---------

Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-09-04 16:48:09 +00:00
Marcelo Nunes Alves
d93c90760a
feat: add component clickhouse for vector database (#3657)
* fix: Problem in the description field when using the MariaDB or MySQL database.

* fix: Problem in the description field when using the MariaDB or MySQL database.

* fix: Add the migration script to update description columns type.

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/alembic/versions/1d90f8a0efe1_update_description_columns_type.py

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* feat: add component clickhouse for vector database

* feat: add component clickhouse for vector database - conflicts resolved

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* feat: add component clickhouse for vector database - conflicts resolved

* feat: add component clickhouse for vector database - update poetry

* feat: add component clickhouse for vector database - conflicts resolved

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-04 05:33:30 -07:00
Rodrigo Nader
978bdf5fec
add text embedder component (#3663)
* add text embedder component

* [autofix.ci] apply automated fixes

* add embedding similarity component

* [autofix.ci] apply automated fixes

* change text embedder output type to data

*  (similarity.spec.ts): Add end-to-end test for checking similarity between embedding texts in the frontend application.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-03 20:11:18 +00:00
Lucas Oliveira
61e5bbb482
fix: folders call when saving flow (#3658)
* Removed refetching of get folder on save

* Made component appear if its loading

* Rebaned query key to not refetch folders

* Changed isLoading to isFetching for the component to be unclickable while refetching
2024-09-03 17:41:53 +00:00
Lucas Oliveira
27ad129049
fix: iomodal and folders api calls (#3661)
* Fixed IOModal calling getMessages again

* Fixed folders API being called twice

* removed unused imports

* Re-added query of get messages and changed to enable query when open

* Fix auto login off test
2024-09-03 17:29:35 +00:00
Lucas Oliveira
be3cb833dd
fix: selected node and edge color and width (#3667)
* Fix border node color to use ring in order to not shrink component and to use selected edge color

* Updated selected edge width to match selected node width

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-09-03 14:45:51 +00:00
Lucas Oliveira
f2abb944f6
fix: console reported issues (#3660)
* Added key to sidebar buttons

* Added key directrly to sidebar category

* Removed key definition on sidebar category

* Fix error of nested buttons on secretKeyModal

* Fix nested buttons on output modal

* Fix clip-path warning on components

* Fix components cannot be given refs on nodeOutputField

* Removed unused console.log

* Added key on profile pictures map

* Fixed hideOverlay being called when the table is destroyed

* Fixed valueFormatter error on Apply To Fields field on GlobalVariables page

* Updated headers on config page to ensure consistent design
2024-09-02 21:48:05 +00:00
Cristhian Zanforlin Lousa
70af48cfe4
fix: success dialog popping wrong (#3659)
* 🐛 (sideBarFolderButtons/index.tsx): fix success message not being set when files array is empty

* 🐛 (index.tsx): fix issue where success message was not being displayed when uploading files successfully
2024-09-02 14:10:47 -07:00
anovazzi1
076f4f0772
fix: update BUNDLES_SIDEBAR_FOLDER_NAMES constant to include "Notion" (#3651)
* chore: update BUNDLES_SIDEBAR_FOLDER_NAMES constant to include "Notion"

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 17:18:47 +00:00
Lucas Oliveira
882c35ef6b
fix: stop building with abort controller (#3634)
* Added buildController and stopBuilding controllers

* Used stop building in header Stop button

* Set the build controller in API performstreamingrequest

* added setbuildcontroller to types
2024-09-02 06:36:51 -07:00
anovazzi1
4ee25359a5
feature: add flow notes (#3460)
* feat: Add NoteDraggableComponent to extraSidebarComponent

This commit adds the NoteDraggableComponent to the extraSidebarComponent in the FlowPage. The NoteDraggableComponent allows users to drag and drop sticky note icons onto the page. When a note is dragged, its data is set as "note" in the dataTransfer object. The note has a default text value of null and a noteColor of "yellow". This component enhances the user experience by providing a convenient way to add notes to the page.

* feat: Add NoteNode component for displaying and editing notes

This commit adds the NoteNode component, which is responsible for displaying and editing notes in the FlowPage. The NoteNode component includes functionality for resizing, selecting, and editing the note text. It enhances the user experience by providing a convenient way to add and manage notes on the page.

* feat: Add NoteNode and NoteDraggableComponent for managing notes in FlowPage

This commit adds the NoteNode component, responsible for displaying and editing notes in the FlowPage. It also introduces the NoteDraggableComponent, allowing users to drag and drop sticky note icons onto the page. These components enhance the user experience by providing a convenient way to add and manage notes on the page.

* feat: Add DRAG_EVENTS_CUSTOM_TYPESS constant for custom drag event types

This commit adds the DRAG_EVENTS_CUSTOM_TYPESS constant to the constants file. It defines custom drag event types for the generic node and note node components. This constant enhances the code by providing a centralized place to manage and reference the custom drag event types.

* feat: Add support functions for custom drag event types

* feat: Add support for custom drag event types in PageComponent

This commit adds support for custom drag event types in the PageComponent of the FlowPage. It imports the necessary functions from the utils file and uses them to check if the dragged data has supported node types. This enhancement improves the drag and drop functionality by allowing only supported node types to be dropped on the page.

* feat: Add NoteDataType for managing note data in FlowPage

* refactor: create new types for noteNode

* feat: Update NoteNode component to use new NoteDataType

The NoteNode component in the NoteNode/index.tsx file has been updated to use the new NoteDataType for managing note data in the FlowPage. This change ensures consistency and improves the codebase.

* node with title and description

* feat: Add "note" alias for StickyNote in nodeIconsLucide

This commit adds the "note" alias for the StickyNote icon in the nodeIconsLucide object in the styleUtils.ts file. This alias allows for more intuitive usage of the StickyNote icon by providing an alternative name. It improves code readability and maintainability.

* refactor: Update NodeDescription component to use emptyPlaceholder prop

The NodeDescription component in the GenericNode/components/NodeDescription/index.tsx file has been updated to use the emptyPlaceholder prop. This change allows for more flexibility in customizing the placeholder text when the description is empty. It improves code reusability and enhances the user experience.

* refactor: Remove unused Textarea import in NoteNode component

* add initial resize to note component

* [autofix.ci] apply automated fixes

* refactor: add code validation functionality on tanstack mutation (#3469)

* Added Validate endpoint

* Added API Code Validate type

* Added post validate code hook

* Used mutation instead of API call to validate code

* Removed validate code api call

* refactor: Update NodeName component to use full width in GenericNode

The NodeName component in the GenericNode module has been updated to use the full width of the parent container. This change ensures that the input field or tooltip for the node name occupies the entire available space, improving the visual consistency and user experience.

* refactor: Update NodeDescription component to use full height in GenericNode

The NodeDescription component in the GenericNode module has been updated to use the full height of the parent container. This change ensures that the description text area occupies the entire available space, improving the visual consistency and user experience.

* refactor: Update NodeDescription component to use full height in GenericNode

* refactor: Update NodeDescription component to use full height in GenericNode

* increase size control on note node

* refactor: Update NoteNode component to use constants for min and max dimensions

The NoteNode component in the CustomNodes module has been updated to use the constants for the minimum and maximum dimensions. This change improves code readability and maintainability by centralizing the values in the constants file. The component now uses the NOTE_NODE_MIN_WIDTH, NOTE_NODE_MIN_HEIGHT, NOTE_NODE_MAX_HEIGHT, and NOTE_NODE_MAX_WIDTH constants for setting the dimensions of the NodeResizer and the inline styles. This ensures consistency across the application and makes it easier to adjust the dimensions in the future.

* fix overflow issue

* refactor: update NoteDraggableComponent

The NoteDraggableComponent in the extraSidebarComponent module has been updated to remove unused code and improve functionality. The code for adding a note has been removed as it is no longer needed. Additionally, the component has been updated to use a new design and layout for better user experience. This refactor improves the overall code cleanliness and removes unnecessary clutter.

* refactor: Update NoteNode component to use constants for min and max dimensions

* update component to accept multiple colors

* update note colors

* update min width

* refactor: Update NodeDescription component to accept additional styling options

The NodeDescription component in the GenericNode module has been updated to accept additional styling options. The component now includes the inputClassName, mdClassName, and style props, allowing for more customization of the input and markdown elements. This refactor improves the flexibility and extensibility of the component, making it easier to adapt to different design requirements.

* fix bug on description size

* [autofix.ci] apply automated fixes

* feat: skip note nodes when building vertices"

add check to skip nodes of type NoteNode when building vertices in the graph
this prevents unnecessary processing of note nodes which are not part of the actual graph logic

* fix: update serialization and improve error handling (#3516)

* feat(utils): add support for V1BaseModel in serialize_field

Add support for V1BaseModel instances in the serialize_field function by
checking for a "to_json" method. If the method is not present, return the
attribute values as a dictionary.

* refactor: Update field serializer function and error handling in build_flow function

* fix: no module named 'psycopg2' (#3526)

* fix: add dependecy to Dockerfile

* fix: revert quick fix

* fix: update poetry.lock

* feat: add compression support to frontend and backend (#3484)

* Added compression lib to frontend

* Added compression handling to backend

* Added compression to body requests on frontend

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* refactor: add code validation functionality on tanstack mutation (#3469)

* Added Validate endpoint

* Added API Code Validate type

* Added post validate code hook

* Used mutation instead of API call to validate code

* Removed validate code api call

* refactor: Update NodeName component to use full width in GenericNode

The NodeName component in the GenericNode module has been updated to use the full width of the parent container. This change ensures that the input field or tooltip for the node name occupies the entire available space, improving the visual consistency and user experience.

* fix imports

* refactor: remove unused import in styleUtils.ts

* refactor: update checkOldNodesOutput to include only generic nodes

The checkOldNodesOutput function in reactflowUtils.ts has been updated to include only generic nodes when checking for nodes without outputs. This change ensures that only nodes of type "genericNode" are considered, improving the accuracy of the check and preventing false positives.

* refactor: improve checkOldNodesOutput to include only generic nodes

* [autofix.ci] apply automated fixes

* 📝 (frontend): Add data-testid attribute to elements for testing purposes in NodeDescription, NoteToolbarComponent, NoteNode, and Textarea components
 (frontend): Create end-to-end test for interacting with sticky notes including creating, editing, duplicating, and deleting notes

*  (stop-building.spec.ts): Add a 1-second delay after clicking the stop building button to improve user experience
 (sticky-notes.spec.ts): Add a new end-to-end test for interacting with sticky notes on the main page to ensure functionality and user interaction with sticky notes.

* refactor: update NodeName and GenericNode components to improve UI and code readability

* [autofix.ci] apply automated fixes

* chore: Update NodeDescription component to use dark mode placeholder color

* chore: Update sidebar note component icon to use StickyNote instead of SquarePen

* refactor(main.py): remove unused imports and middleware related to GZip to simplify code and improve readability
feat(main.py): add middleware for configuring logger to improve logging functionality and centralize logging configuration

* add center postion in the flow

* chore: Update NoteNode icon to use SquarePen instead of StickyNote

* [autofix.ci] apply automated fixes

* chore: Update API base URL

* [autofix.ci] apply automated fixes

* chore:  add feature flag for MVPs

* code format

*  (NoteNode/index.tsx): Wrap IconComponent in a div with data-testid "note_icon" for better accessibility and testing
 (PageComponent/index.tsx): Add data-testid "add_note" to ControlButton for easier testing and identification
🔧 (sticky-notes.spec.ts): Update test selectors to use new data-testid "note_icon" and "add_note" for improved test reliability

* chore: Update types-markdown to version 3.7.0.20240822

* feat: Add lazy loading for images in sticky-notes.spec.ts

* [autofix.ci] apply automated fixes

* update poetry lock

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Refactor feature flag import for ENABLE_MVPS across components and tests

* Add skip marker to unimplemented test in test_graph_state_model.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-02 11:53:47 +00:00
Lucas Oliveira
c9cf9d8304
refactor: update docs link to be modular (#3637)
changed docs link to be modular
2024-08-30 21:51:05 +00:00
Lucas Oliveira
47a9bf3890
fix: add unstructured icon (#3631)
Added Unstructured icon

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-08-30 21:41:25 +00:00
Cristhian Zanforlin Lousa
70ac19740a
tests: add new tests to tableComponent (#3627)
* refactor: modularized categories and fixed Discover More not appearing

* refactor: modularized categories and fixed Discover More not appearing

* refactor: modularized categories and fixed Discover More not appearing

* refactor: add end-to-end test for interacting with table input component

* refactor: Remove duplicate ID in filterSidebar.spec.ts and remove commented code in tableInputComponent.spec.ts
2024-08-30 21:35:51 +00:00
Lucas Oliveira
27b5f55ef9
refactor: health check endpoint (#3635)
* Changed health check to use /health_check and to be modularized

* Added default value

* Added health constant to default export

* check cors before inserting custom headers

* Added get global variables check on init

* Updated global variables to start with undefined

* Fixed redirect when showGeneralSettings is disabled

* Added isOpen props to custom api generator
2024-08-30 20:40:16 +00:00
Lucas Oliveira
a71375c6f9
fix: auto login and logout functionality (#3629)
* Made auto login not call refresh

* Fixed mutation query

* Removed navigation to login on logout function

* Made refresh token set cookie for docker

* Added return to login with custom navigate and added check for refreshing only if its authenticated

* Minor refactor

* Navigate after logout on get autologin

* Removed unused console.log
2024-08-30 18:19:32 +00:00
Lucas Oliveira
3bef9aa633
refactor: custom post loading and add AppAuthenticatedPage (#3632)
* Added post loading hook to appInitPage

* Removed custom post loading

* Changed custom post loading to cusotm post auth

* Adds AppAuthenticatedPage

* Uses AppAuthenticatedPage inside protected route
2024-08-30 17:53:11 +00:00
Gabriel Luiz Freitas Almeida
f596cc4ad3
feat!: replace Agent starter projects with simpler ones (#3612)
* Add initial setup for "Simple Agent" starter project

- Introduced a new JSON configuration for the "Simple Agent" starter project.
- The flow includes nodes for Chat Input, Chat Output, OpenAI Model, Tool Calling Agent, Calculator Tool, and Python REPL Tool.
- Configured edges to connect these nodes, enabling interaction between different components.
- Added detailed descriptions and configurations for each node to facilitate easy setup and usage.

* Add Travel Planning Agents starter project JSON file

- Introduced a new JSON file for Travel Planning Agents in the starter projects directory.
- The JSON file includes configurations for various nodes such as ChatInput, ChatOutput, OpenAIModel, ToolCallingAgent, SearchAPI, URL Content Fetcher, and CalculatorTool.
- Defined connections between nodes to create a multi-agent system for planning trips.
- Added detailed prompts and configurations for each node to facilitate travel itinerary creation and information retrieval.

* Update example names in newFlowModal to match updated project terminology

* Update agent names in undrawCards component for consistency

* Rename "Complex Agent" to "Dynamic Agent" across frontend and backend components

* format project

*  (Dynamic Agent.spec.ts): Add end-to-end test for Dynamic Agent functionality
 (Simple Agent.spec.ts): Add end-to-end test for Simple Agent functionality
 (Travel Planning Agent.spec.ts): Add end-to-end test for Travel Planning Agent functionality

*  (Travel Planning Agent.spec.ts): Update end-to-end test for Travel Planning Agent to include new interactions and connections for improved test coverage and functionality.

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-08-29 20:38:11 +00:00
Lucas Oliveira
59b6d8acc0
refactor: health check and error handling (#3620)
* Refactored getHealth to get if any value of health check is not ok

* Added custom health check

* Created generic error component to display error popups

* added useHealthCheck hook

* Updated wrapper page to use health check hook

* Removed custom error

* Added custom loading page for when custom primary loading is not done

* Changed health check to be disabled when flow is building or any request is pending

* Changed text of ttimeout error
2024-08-29 19:40:21 +00:00
Lucas Oliveira
9102c6272f
refactor: added analytics track and custom parameter support (#3617)
* Added analytics track

* Changed post add user to just use the function

* Added tracking in various components

* Added custom parameter support

* Added centered footer
2024-08-29 19:35:17 +00:00
Lucas Oliveira
32d51b69e8
refactor: custom api code generator and fix chat locking when saving (#3618)
* Removed saveLoading from the chat

* Fixed initialSetup that couldnt be null

* Added types for get codes type

* Added new types for getCodes and initialSetup on Tweaks store

* Created a use custom api code to return all code

* Passed the getCodes from the custom hook into initialSetup

* Updated tabs array to receive object

* Update every code to get correct props

* Update tweaks store to handle refactored getCodes and createTabsArray

* Added custom api generator component on top of the codetabscomponent
2024-08-29 19:31:03 +00:00
Lucas Oliveira
06ea6c408b
refactor: modular navigation and custom api calls (#3613)
* Added customization files

* Added custom API headers and changed logout mutation

* Changed mutationLogout on authGuard

* Renamed feature flags

* Changed auto login to run after primary loading

* Removed unused code

* Added undefined on mutationfunctiontype to have options

* Changed logout to mutationLogout

* Return data on getConfig

* Added custom wrapper

* changed hasStore to be the constant by default

* Added custom header

* Added customParam feature flag

* Fix routes and custom link and navigate to consider absolute and relative paths

* Fixed regex on  tabs search component

* Added CustomNavigate

* Added basename and ports and URLs config

* [autofix.ci] apply automated fixes

* Update config-constants.ts

* Update index.tsx

* Fixed path comparations

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-29 15:05:23 +00:00
Lucas Oliveira
cb1a2f24b3
refactor: modularized categories (#3615)
Modularized category and fixed Discover More not appearing
2024-08-29 11:42:41 -03:00
Lucas Oliveira
af052285ec
refactor: queries loading order and wrapper order (#3603)
* Added loading page

* Removed unused loadings and changed loading to LoadingPage

* Refactored ComponentsComponent to receive info from parent

* refactored headerTabsComponent to receive loading from parent

* Added loading of folders into MyCollectionComponent

* removed unused loading and folderSelected

* updated get config api call to update everything

* Make app wait for autoLogin to be set to execute everything else

* changed API type to not contain params if its undefined

* Updated get autologin to do all logic regarding autologin

* Updated other queries with the new useQueryFunctionType type

* Updated App.tsx with new gets and configurations and added a loader before loading the router

* Made ProtectedRoute refresh on authentication change

* Fixed order of wrappers in order for Auth and  API context to have access to router

* Made loading only exist in one place

* 📝 (folders.spec.ts): remove unused test for adding folder by drag and drop to improve test suite cleanliness and maintainability.

* Fixed flow dropping to another folder

*  (folders.spec.ts): add test for adding folder by drag and drop functionality
🔧 (auto-save-off.spec.ts): add click event for "Save And Exit" button
🔧 (dragAndDrop.spec.ts): change dispatchEvent to getByTestId and add assertions for specific text visibility
🔧 (store-shard-3.spec.ts): increase timeout for page.waitForTimeout to improve test reliability

*  (folders.spec.ts): update test description to be more descriptive and accurate

* test: improve timeout for page.waitForSelector in auto-save-off.spec.ts

* feat: add replace button functionality to main page

The code changes include adding the functionality for the replace button on the main page. This allows users to replace a flow or a component. The replace button is now visible on the page, and clicking on it triggers the appropriate action.

Recent user commits:
- test: improve timeout for page.waitForSelector in auto-save-off.spec.ts
-  (folders.spec.ts): update test description to be more descriptive and accurate
-  (folders.spec.ts): add test for adding folder by drag and drop functionality
- 🔧 (auto-save-off.spec.ts): add click event for "Save And Exit" button
- 🔧 (dragAndDrop.spec.ts): change dispatchEvent to getByTestId and add assertions for specific text visibility
- 🔧 (store-shard-3.spec.ts): increase timeout for page.waitForTimeout to improve test reliability

Recent repository commits:
- test: improve timeout for page.waitForSelector in auto-save-off.spec.ts
-  (folders.spec.ts): update test description to be more descriptive and accurate
-  (folders.spec.ts): add test for adding folder by drag and drop functionality
- 🔧 (auto-save-off.spec.ts): add click event for "Save And Exit" button
- 🔧 (dragAndDrop.spec.ts): change dispatchEvent to getByTestId and add assertions for specific text visibility
- 🔧 (store-shard-3.spec.ts): increase timeout for page.waitForTimeout to improve test reliability
- Fixed flow dropping to another folder
- 📝 (folders.spec.ts): remove unused test for adding folder by drag and drop to improve test suite cleanliness and maintainability.
- Made loading only exist in one place
- Fixed order of wrappers in order for Auth and API context to have access to router
- Made ProtectedRoute refresh on authentication change
- Updated App.tsx with new gets and configurations and added a loader before loading the router
- Updated other queries with the new useQueryFunctionType type

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-08-29 12:10:26 +00:00
Cristhian Zanforlin Lousa
7641e81ca3
fix: add retriever input_type on RetrieverToolComponent + tests (#3601)
*  (RetrieverTool.py): add "input_types" field to the configuration of the RetrieverToolComponent class

*  (generalBugs-shard-12.spec.ts): add end-to-end test for connecting RetrieverTool to other components in the application.
2024-08-28 12:02:42 -07:00
Cristhian Zanforlin Lousa
9ae4e29815
tests: improve delete rows from table message test (#3598)
🐛 (generalBugs-shard-1.spec.ts): Fix timing issues in end-to-end test by adding explicit waits for elements to be visible before interacting with them
2024-08-28 11:38:23 -07:00
Cristhian Zanforlin Lousa
b1f79a5511
tests: Add Integration with starter-projects Endpoint and Vector Store Test (#3599)
*  (App.tsx): Add useGetStarterProjectsQuery hook to fetch starter projects data
📝 (constants.ts): Add STARTER_PROJECTS constant to define the endpoint for starter projects API
📝 (use-get-starter-projects.ts): Create useGetStarterProjectsQuery hook to fetch starter projects data
📝 (index.tsx): Add AppWrapperPage test for drag and drop functionality with starter projects data
📝 (starter-projects.spec.ts): Add end-to-end test for drag and drop functionality with starter projects data

*  (starter-projects.spec.ts): update test description to be more descriptive and specific about the test scenario

* ♻️ (App.tsx): remove unused useGetStarterProjectsQuery hook to clean up code and improve readability

* 🔧 (App.tsx): remove unused import useGetStarterProjectsQuery to clean up code and improve readability
2024-08-28 11:37:50 -07:00
Lucas Oliveira
d6537b724e
refactor: routes and back button (#3600)
* Changed ProtectedRoute to handle refresh token

* Created DashboardWrapperPage to insert header into elements

* Changed routes to be contained by only one ProtectedRoute

* Removed refresh and get version query of App.tsx

* Added loading if user not authenticated in ProtectedAdminRoute

* Changed page layout to not contain header

* Changed AdminPage and FlowPage to not have headers

* Removed unused variables

* Refactored redirectToLastLocation of headerComponent

* Removed unused track last visited path

* changed viewPage to not set onFlowPage since it's used only on header

* Added flow fetching into Playground page

* Fixed back button not working between flows

* Changed duplicate requests to show which request failed

* Refactored useGetBuilds to remove duplicated request

* Re-added get version query and config query

* [autofix.ci] apply automated fixes

* Fix tests that rely on autosave delay

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-28 16:52:11 +00:00
Cristhian Zanforlin Lousa
ffff5720d8
fix: Ensure Correct Focus on Playground Chat Input (#3582)
 (textAreaWrapper/index.tsx): add useEffect hook to focus on input when conditions are met
♻️ (AppWrapperPage/index.tsx): remove unnecessary console.log statement
2024-08-28 05:50:48 -07:00
anovazzi1
03e95d4522
feat: add notion integration components (#3579) 2024-08-27 22:01:43 -03:00
Gabriel Luiz Freitas Almeida
63cf0cff29
fix: surround a tag with feature flag for ENABLE_BRANDING (#3581) 2024-08-27 22:01:19 -03:00
Edwin Jose
46a9789028
fix(ollama): resolve model list loading issue and add Pytest for component testing (#3575)
* Commit to solve Model not loading issue

The issue was that the url of the models: api/tags was not parsed correctly.
It was having a // hence used urlencode to parse it properly.

Th e correct apporach works only if the base_url is correct,i.e a valid ollama URL:
for DS LF this must be a public ollama Server URL.

* updated the component Ollama Component

changed the get model to take in base url and the function will make the expected url for the model names. This makes the function better, than providing the model url as paramter.

Added Pytest, 7 tests, 1 test excluded for future implememtstion: test_build_model_failure

Make lint and Make format had touched multiple files

* removed unwanted print statements

removed unwanted print statements.

make format, formatted a lot of .tsx files also

* removed skipped tests

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-27 19:21:06 -04:00
Nicolò Boschi
8e9ba9cca1
fix: building vertices not working on Safari and improve stop button (#3569)
* fix: building vertices not working on Safari

* fix: building vertices not working on Safari

* fix: stop build button seems to not work

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-27 05:19:26 -07:00
anovazzi1
df16cfdb93
fix: update border class for selected node status (#3556)
Update the border class for the selected node status in the NodeStatus component to "border-2 border-node-selected hover:shadow-node". This change improves the visual representation of the selected node status.
2024-08-26 22:10:00 +00:00
Cristhian Zanforlin Lousa
a763f57af5
feat: add timeout handler on FE (#3537)
*  (frontend): Add TimeoutErrorComponent to handle timeout errors in API requests
🔧 (frontend): Add healthCheckTimeout state and setHealthCheckTimeout function to utilityStore for managing timeout errors in API requests

* 📝 (constants.ts): add constants for server health check intervals to improve code readability and maintainability
🐛 (use-get-health.ts): fix refetch interval value to use the newly added constant REFETCH_SERVER_HEALTH_INTERVAL for consistency and easier maintenance

* 📝 (api.tsx): Add utilityStore import to improve code organization
📝 (api.tsx): Add createNewError503 function to handle custom 503 errors
📝 (api.tsx): Add AxiosError import for type checking
📝 (api.tsx): Refactor error handling logic for authentication errors
📝 (use-get-health.ts): Add createNewError503 import for custom 503 errors
📝 (use-get-health.ts): Add AxiosError import for type checking
📝 (use-get-health.ts): Refactor error handling logic for server busy status
📝 (index.tsx): Add AxiosError import for type checking
📝 (index.tsx): Add useEffect and useState imports for state management
📝 (index.tsx): Refactor error handling logic for server status and retries
📝 (utilityStore.ts): Add retriesApiRequest state and setRetriesApiRequest function
📝 (axios-error-503.ts): Create function to generate custom 503 error responses
📝 (index.ts): Add retriesApiRequest state and setRetriesApiRequest function to UtilityStoreType

* 🔧 (utilityStore.ts): remove unused retriesApiRequest and setRetriesApiRequest functions to clean up code and improve maintainability
🔧 (index.ts): remove unused retriesApiRequest and setRetriesApiRequest types to keep type definitions consistent and up to date

*  (nginx.conf): add new health endpoint to proxy_pass requests to the backend server for health checks

*  (langflow): Add support for configuring the number of retries for the health check feature. This change introduces a new option `health_check_max_retries` that can be set via environment variable or command line argument to control the maximum number of retries for the health check process.

* check if value is none
2024-08-26 14:21:05 -07:00
Lucas Oliveira
f4e96b113e
revert: add compression support to frontend and backend (#3549)
Revert "feat: add compression support to frontend and backend (#3484)"

This reverts commit b63916e3c6.
2024-08-26 13:24:02 -03:00
Cristhian Zanforlin Lousa
7fdfe10098
fix: user not been able to add new user on langflow docker (#3538)
🐛 (use-post-add-user.ts): fix API endpoint URL to include trailing slash for consistency and to ensure correct routing
2024-08-26 12:56:38 +00:00
Cristhian Zanforlin Lousa
0818d88075
fix: remove depth loop calls on folder's useEffect (#3535)
🐛 (index.tsx): Fix issue where setEditFolderName was being called with undefined or empty folders array, causing a crash. Added a check to ensure folders array is not empty before setting edit folder names.
2024-08-23 20:02:42 +00:00