Commit graph

13,616 commits

Author SHA1 Message Date
Lucas Oliveira
f7ad36b211
fix: ctrl a not working on edit node table (#2992)
* removed console log and fixed nulland

* Fixed ag grid version mismatch

* Fixed unused import

* Fixed ctrl+a not working on edit node and tweaks

* Fixed styling on editnode

* Made it work on mac

*  (generalBugs-shard-7.spec.ts): add end-to-end test for selecting all with ctrl + A on advanced modal to ensure functionality works as expected

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-07-26 19:21:17 +00:00
Cristhian Zanforlin Lousa
ac77cee699
bugfix: fix missing condition to open disconnect modal when backend is down (#2993)
🐛 (App.tsx): Fix logic to correctly display error modal when health data is missing or not "ok"
🔧 (use-get-health.ts): Disable retry option in useGetHealthQuery to prevent unnecessary refetching of health data
2024-07-26 16:06:49 -03:00
Nadir J
1935d38bc4
fix: log messages (#2995) 2024-07-26 11:58:34 -07:00
Lucas Oliveira
a857868b7e
feat: dropdown combobox option (#2991)
* Removed default variable as true

* added combobox to dropdown

* Fixed types on strRenderComponents

* Added type of combobox

* Created combobox option on backend

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-26 17:50:01 +00:00
Lucas Oliveira
a9863a050e
refactor: parameter component, edit node modal and api modal (#2928)
* changed column defs to receive handleOnNewValue and use it to change Advanced variable

* Exported function isTargetHandleConnected

* Refactored types of setNodeClass

* Exported type of handleOnNewValue

* Refactored useHandleNodeClass to only handle changes to node data

* Refactored toggleCellRender to handle advanced values by itself with the handleOnNewValue

* changed setNodeClass types and disabled hook

* changed handleNodeClass on parametercomponent

* changed handleNodeClass on the two components that used it

* refactor: Update handleNodeClass to accept newNodeClass and type only

* Refactor EditNodeModal component to use new handleNodeClass and columnDefs

* Changed columnDefs to receive new handleNodeClass and not receive useless parameters

* changed cellTypeStr to strRender

* Refactored inputFileComponent to use the new handleOnNewValue

* Refactored keypairList to convert values on the fly

* added parameterRenderComponent that renders all parameters in one place

* Exported parameterRenderComponent

* Changed tableNodeCellRender to use ParameterRenderComponent

* changed parameterredercomponent to receive name

* changed strrendercomponent to receive name

* changed nodecellrender to pass name and to check if value is undefined before assigning on templateData

* chore: Refactor use-handle-new-value to handle undefined values in changes

* Used ParameterRenderComponent at parameterComponent

* Refactored parameterRenderComponent to include refresh button

* Created refresh parameter component

* Added nodeId to parameterrendercomponent call

* Removed unused variable

* Refactored refreshButton

* Fixed parameters not showing when they dont have a value

* Created a tweakComplnent that renders the tweak individually, with the same table as the EditNode

* Created tweaks component, that renders all tweaks

* Changed tableNodeCellRender to pass setNode as well

* changed handleOnNewValue to use custom setNode if specified

* added editNodeComponent that handles the table and rowData and columnDefs

* changed editNodeModal to use editNodeComponent instead of table

* changed columndefs type to handle setNode and hideVisibility optional parameters

* changed useRowData to not use myData, and just use nodeClass

* Changed codeTabsPropsType tweaks property to include only the ncessary

* changed codeTabsComponent to use TweaksComponent and handle an internal nodes state

* changed apiModal to handle the tweaks build by finding the differences between old and current node

* fix bug on API modal that refresh tweaks table all the time

* Created new tweaks store type

* Added tweaks store with all of the logic needed to get the tweaks on the API page

* refactored TweakComponent to hold an temporary state to prevent the table from rerendering

* Added TweakComponent into TweaksComponent

* Removed external state on tableAdvancedToggle, making every state come from the Stores

* Removed external state from TableNodeCellRender and added isTweaks to choose which store to use

* Added SetNode type on HandleOnNewValue

* Added custom setNode to handleNodeClass

* Removed unused logic from apiModal

* removed unused old code

* Changed type of getChangesTypes

* Transformed string into object on get codes

* Changed getNodesWithDefaultValue to return nodes that will appear on Tweaks, as well as just the allowed parameters

* added hasTweaks to tabs

* added check of template keys to update the local nodeClass state, allowing the table to be updated just when the number of parameters changes

* passed isTweaks to columnDefs

* removed unused state and passed isTweaks to value getters

* Removed unused state

* updated tabsArrayType with hasTweaks and removed unused types

* Added local nodes tweaks state to the codetabscomponent and refactored conditions of display

* removed unused console.log

* changed advanced toggle to use parameterid given by the value

* changed nodecellrender to use parameter id given by the value

* passed parameter id by value to the renderers

* removed nodeClass from columnDefs definition

* Fixed isTargetHandleConnected returning error if field is undefined

* Fix performance issues on edit node modal

* Fixed scroll overflow issues on tweaksComponent

* Revert "Revert "refactor: update template api, handleonnewvalue and handlenodeclass hooks (#2628)""

This reverts commit 236ae82cabba2fa1128f498d781099facd222b57.

* 📝 (tweaksTest.spec.ts): remove redundant code and improve readability by simplifying the interaction with elements in the test case

* added custom id for tests

*  (frontend): Add unique id prop to input components for better testability and accessibility.

 (Hierarchical Tasks Agent.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (Memory Chatbot.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (Sequential Tasks Agent.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (chatInputOutputUser-shard-0.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (chatInputOutputUser-shard-1.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (chatInputOutputUser-shard-2.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (decisionFlow.spec.ts): Update input list element IDs to improve clarity and consistency
 (decisionFlow.spec.ts): Update prompt area element IDs to improve clarity and consistency
 (decisionFlow.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (freeze-path.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (generalBugs-shard-0.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (generalBugs-shard-1.spec.ts): Update dropdown element IDs to improve clarity and consistency
 (generalBugs-shard-3.spec.ts): Update dropdown element IDs to improve clarity and consistency

🔧 (logs.spec.ts, textInputOutput.spec.ts): update dropdown test selectors to match changes in the frontend codebase

* Fixed prompt not holding the value when validating

* Fixed range spec on int component

* Fixed OpenAI Model max tokens range spec

*  (dropdownComponent.spec.ts): Update dropdown test cases to use more descriptive test IDs for better clarity and maintainability
📝 (fileUploadComponent.spec.ts): Add explicit wait for "Run Flow" button to ensure it is loaded before clicking
📝 (folders.spec.ts): Update file path in readFileSync function to use an absolute path for better reliability
📝 (freeze-path.spec.ts): Refactor test code to remove commented out code and improve readability by using more descriptive test IDs and removing unnecessary code snippets

 (inputListComponent.spec.ts): Update test file to use consistent naming convention for input elements in the InputListComponent
📝 (intComponent.spec.ts): Refactor test file to use consistent naming convention for input elements in the IntComponent

 (nestedComponent.spec.ts): Update test steps and interactions for nestedComponent to improve test coverage and accuracy.

📝 (promptModalComponent.spec.ts): Update test selectors for prompt modal component to improve consistency and readability
📝 (textAreaModalComponent.spec.ts): Update test selectors for text area modal component to improve consistency and readability
📝 (toggleComponent.spec.ts): Update test selectors for toggle component to improve consistency and readability

* 🐛 (intComponent.spec.ts): fix incorrect value comparison in test for IntComponent
🐛 (intComponent.spec.ts): fix missing test step for clicking on a specific element in IntComponent test

* 📝 (Vector Store.spec.ts): increase timeout for waiting for "built successfully" text to improve test reliability and prevent false negatives

* Fixed folders test

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-07-26 18:32:24 +02:00
Lucas Oliveira
83910866e9
fix: memories not visible when sending from outside io modal (#2987)
* Fixed names and unused params

* Added refetch of memories
2024-07-26 15:07:40 +00:00
Nicolò Boschi
9ac861da2f
feat: migrate transactions to sql database (#2915)
* feat: migrate transactions to sql database

* feat: migrate transactions to sql database

* feat: migrate transactions to sql database

* feat: migrate transactions to sql database

* feat: migrate transactions to sql database

* feat: migrate transactions to sql database

* [autofix.ci] apply automated fixes

* remove useless

* remove useless

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-26 14:57:38 +00:00
Ítalo Johnny
169664cf1b
fix: environment variable initialization issue (#2971)
* feat: apply singleton pattern to class

* fix: remove code that overrides environment vars

* feat: remove unused imports
2024-07-26 13:39:23 +00:00
Nicolò Boschi
53084bcf92
feat: expose main_version on /version endpoint (#2944) 2024-07-26 13:56:18 +02:00
YAMON.IO
cba0ae4b86
docs: update korean readme (#2970) 2024-07-26 05:56:15 -03:00
Lucas Oliveira
b2e40ec92f
fix: videos not showing on docs (#2967)
Fixed videos not showing on docs
2024-07-25 22:11:40 +00:00
Cristhian Zanforlin Lousa
b6774cf3d8
bugfix: langflow application losing store api-key on refresh page/backend (#2960)
* changing api key journey

* refactor(api_key.py): remove unnecessary code related to config_dir and secret_key_path
refactor(login.py): refactor setting api_key cookie to use user's store_api_key
refactor(variable/service.py): re-encrypt stored value if secret_key changes to ensure validity

* 📝 (api_key.py): Remove unused imports and clean up code for better readability
📝 (login.py): Remove unused imports and clean up code for better readability
📝 (auth/utils.py): Remove unused imports and clean up code for better readability
📝 (store/service.py): Remove unused imports and clean up code for better readability

* 🔧 (utils.py): replace hashing logic with random key generation for key length less than 32 bytes to ensure key length is always 32 bytes
📝 (utils.py): update comments for clarity and accuracy regarding key generation and encryption process

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-25 22:05:38 +00:00
Jordan Frazier
55693c920d
ref: adds multi threading to the AI/ML embeddings component (#2959)
* Use http client for requests and split texts naively

* update models list

* prints

* multithread requests to aiml embeddings

* remove comment

* [autofix.ci] apply automated fixes

* style(AIMLEmbeddingsImpl.py): improve code formatting and add type hinting for better code clarit

---------

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-07-25 14:50:23 -07:00
Lucas Oliveira
6a482f36c4
feat: add custom value on dropown ui (#2961)
* Added fuzzy search and custom value on search on Dropdown Component

* added allowCustom prop to allow custom values on dropdownComponent

* changed type of allowCustom

* added custom to custom field on dropdown

* Fixed empty search not showing all of the options

* Added Text on the left of the label
2024-07-25 21:37:59 +00:00
Gabriel Luiz Freitas Almeida
02a879f330
ci: add labeler job to automatically add 'lgtm' label when pull request review is approved (#2963)
* feat(ci.yml): add labeler job to automatically add 'lgtm' label when pull request review is approved

* ci(ci.yml): add dependency on labeler job to ensure it runs before the ci job

* chore(ci.yml): remove unnecessary condition for labeler job in CI workflow

* refactor(ci.yml): remove unnecessary condition for labeler job in CI workflow

* refactor(ci.yml): update CI workflow to include labeled pull requests in the trigger conditions
2024-07-25 20:12:18 +00:00
Gabriel Luiz Freitas Almeida
d33e4981e0
refactor: update StateVertex to function like a normal component unless specified not to (#2950)
* refactor: update StateVertex class to inherit from ComponentVertex

The StateVertex class in types.py has been updated to inherit from the ComponentVertex class instead of the Vertex class. This change ensures that the StateVertex class has access to the methods and attributes of the ComponentVertex class, improving code organization and maintainability.

* feat: add _successors_ids attribute to Vertex class

The Vertex class in base.py has been updated to include a new attribute `_successors_ids`. This attribute will store the IDs of the successors of the vertex. This change improves the functionality and flexibility of the Vertex class.

* feat: add _set_successors_ids method to NotifyComponent

This commit adds a new method `_set_successors_ids` to the `NotifyComponent` class in `Notify.py`. This method retrieves the successors of the vertex and sets the `successors_ids` attribute accordingly. This change improves the functionality and flexibility of the `NotifyComponent` class.

* refactor: add _set_successors_ids method to ListenComponent

This commit adds a new method `_set_successors_ids` to the `ListenComponent` class in `Listen.py`. This method retrieves the successors of the vertex and sets the `successors_ids` attribute accordingly. This change improves the functionality and flexibility of the `ListenComponent` class.

* refactor: update StateVertex class to not be a state

This commit updates the StateVertex class in types.py to no longer be considered a state. The `is_state` attribute is set to False, ensuring that the vertex is not treated as a state. This change improves code clarity and aligns with the intended functionality of the class.

* refactor: set is_state attribute to True in ListenComponent

This commit sets the `is_state` attribute to True in the `ListenComponent` class in `Listen.py`. This change ensures that the `ListenComponent` is treated as a state and improves the functionality of the component.

* refactor: set is_state attribute to True in NotifyComponent

* refactor: remove base_type argument from StateVertex constructor

This commit removes the `base_type` argument from the constructor of the `StateVertex` class in `types.py`. The `base_type` argument was not being used and was unnecessary for the functionality of the class. This change improves code clarity and removes unnecessary code.

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-25 19:33:32 +00:00
github-actions[bot]
d6c7352345
docs: update docs from notion (#2951)
Update docs from Notion

Co-authored-by: lucaseduoli <lucaseduoli@users.noreply.github.com>
2024-07-25 19:30:28 +00:00
Gabriel Luiz Freitas Almeida
9ce12c8598
chore: bump langflow and langflow-base versions to 1.0.13 and 0.0.89 respectively (#2956)
* feat(Makefile): add 'patch' target to bump the version in langflow and langflow-base

* chore: bump langflow and langflow-base versions to 1.0.13 and 0.0.89 respectively
2024-07-25 17:18:02 +00:00
Gabriel Luiz Freitas Almeida
dea322b024
feat: add InputTypesMap and _instantiate_input function (#2955)
* refactor: add _input_type attribute to dump in BaseInputMixin

* feat: add InputTypesMap and _instantiate_input function

The commit adds the `InputTypesMap` dictionary and `_instantiate_input` function to the `inputs.py` file. The `InputTypesMap` is a dictionary that maps input types to their corresponding classes, and the `_instantiate_input` function is used to instantiate an input object based on its type. This change improves the flexibility and extensibility of the codebase.
2024-07-25 17:09:12 +00:00
Gabriel Luiz Freitas Almeida
ca98103af4
ci: add debug info (#2957)
* ci: add debug info

* fix: change echo commands
2024-07-25 16:51:57 +00:00
Gabriel Luiz Freitas Almeida
e0a0242d7a
refactor: update TelemetryService and change Service teardown methods to be async (#2937)
* refactor: convert teardown_services function to async

The `teardown_services` function in `utils.py` has been converted to an asynchronous function to ensure proper handling of asynchronous operations during service teardown. This change improves the overall reliability and performance of the codebase.

* refactor: convert teardown method to async

Convert the `teardown` method in the `Service` class to an asynchronous function to handle asynchronous operations during service teardown. This change improves the reliability and performance of the codebase.

* refactor: convert teardown methods to async in services

* feat: add teardown method in TelemetryService

Convert the `teardown` method in the `TelemetryService` class to an asynchronous function to handle asynchronous operations during service teardown. This change improves the reliability and performance of the codebase.

* refactor: update TelemetryService to use optimized payload in get request

The `TelemetryService` class in `service.py` has been updated to use an optimized payload dictionary in the `get` request. This change improves the efficiency and performance of the codebase.

* refactor: convert teardown method to async in utils.py
2024-07-25 12:49:43 +00:00
Gabriel Luiz Freitas Almeida
51b85dbc8e
fix: update path filter condition in ci.yml (#2947)
Update the path filter condition in ci.yml to use strict comparison for the 'should-run-ci' output value. This ensures that the CI job is only executed when the output value is 'true'.
2024-07-25 12:45:30 +00:00
Cristhian Zanforlin Lousa
44ffe8e6cd
refactor: change downloadFolders requests to use useQuery hook (#2920)
*  (sidebarComponent): Add support for downloading folders in the sidebar component to allow users to download folder data as JSON files
🔧 (sidebarComponent): Remove unused import and function related to downloading folders to clean up the codebase
📝 (use-get-download-folders): Add a new function to handle downloading folders from the API in a separate file for better code organization
♻️ (MainPage/services): Remove unused functions related to downloading and uploading flows from folders to simplify the services file and improve maintainability
🔧 (foldersStore): Remove unused import and function related to uploading flows from folders to clean up the codebase

* 📝 (sideBarFolderButtons/index.tsx): add error handling logic to display error message when downloading folder fails

* update error message

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-25 01:25:27 +00:00
Gabriel Luiz Freitas Almeida
7d5ccb324a
fix: validate params assignment in custom_component_update endpoint (#2931)
* feat(RunFlow.py): update input and output definitions for RunFlowComponent

* refactor: update params assignment in custom_component_update endpoint

Simplify the params assignment in the custom_component_update endpoint by using a dictionary comprehension. This improves code readability and reduces the number of lines.

* feat(custom_component.py, flow.py): add support for specifying output type in run_flow method to filter outputs based on type
2024-07-25 00:33:05 +00:00
Gabriel Luiz Freitas Almeida
a22b76534b
fix: update button role in end-to-end test (#2936)
refactor: update button role in end-to-end test

Update the button role in the end-to-end test to use "Check & Save" instead of "Save".
2024-07-24 17:16:08 -07:00
Sai Kolasani
23b54a63c1
fix: Ollama model component parameter (#2935)
change params from model to model_name"

Co-authored-by: Sai Kolasani <sai.kolasani@datastax.com>
2024-07-24 23:50:58 +00:00
Injae Ryou
23e06fe882
docs: add Korean README (#2883) 2024-07-24 23:27:39 +00:00
Gabriel Luiz Freitas Almeida
459a80c983
ci: fix set-ci-condition job (#2934)
* chore(ci.yml): refactor CI workflow to include a new job 'set-ci-condition' to determine if CI should run based on conditions such as pull request labels and event type

* refactor: include new job 'set-ci-condition' in CI workflow to determine if CI should run based on conditions
2024-07-24 14:40:33 -07:00
Gabriel Luiz Freitas Almeida
950aac1cce
ci: update CI workflow to include new job 'set-ci-condition' (#2933)
chore(ci.yml): refactor CI workflow to include a new job 'set-ci-condition' to determine if CI should run based on conditions such as pull request labels and event type

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-24 14:33:29 -07:00
github-actions[bot]
384f622f48
docs: update docs from notion (#2922)
Update docs from Notion

Co-authored-by: lucaseduoli <lucaseduoli@users.noreply.github.com>
2024-07-24 21:22:39 +00:00
Lucas Oliveira
00df8f8405
fix: python code with null and undefined (#2932)
Updated pythonCode to include None as replacement to null and undefined
2024-07-24 21:09:55 +00:00
Lucas Oliveira
ce7418a688
bug: starter rag example didnt contain connection from rag to template (#2930)
* Changed starter example Vector Store RAG

* Formatted example
2024-07-24 17:52:32 -03:00
Cristhian Zanforlin Lousa
6c5b487e47
refactor: change post/patch folders requests to use UseQuery (#2917)
*  (sidebarComponent): Add usePostFolders hook to handle adding new folders in the sidebar
📝 (folders): Add use-post-folders and use-patch-folders hooks for handling post and patch requests for folders
🔧 (BundleModal): Remove useFolderSubmit hook and directly use usePostFolders hook for adding and updating folders in the modal

*  (sidebarComponent): Add usePatchFolders hook to handle updating folders in the sidebar component
🔧 (use-patch-folders): Refactor IPatchAddFolders interface to IPatchPatchFolders for better naming consistency
🔧 (use-patch-folders): Refactor addFoldersFn to patchFoldersFn for better function naming
🔧 (use-patch-folders): Update patchFoldersFn to send patch request to specific folder endpoint
🔧 (use-patch-folders): Update patchFoldersFn to handle updating folders and return updated data
🔧 (use-patch-folders): Update usePatchFolders hook to use patchFoldersFn for mutation
🔧 (use-post-folders): Remove unnecessary call to getFoldersApi after posting folders
🔧 (BundleModal): Remove BundleModal component and entities as they are no longer needed

🔧 (BundleModal/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/component/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/entities/index.ts): Remove unused zod schema and clean up code
🔧 (foldersModal/hooks/submit-folder.tsx): Remove unused imports and clean up code

 (foldersModal/index.tsx): Remove unused FoldersModal component from modalsComponent to optimize code and improve maintainability.

* 📝 (index.tsx): Remove unused openFolderModal and setOpenFolderModal props from ModalsComponent
♻️ (services/index.ts): Remove addFolder, updateFolder, and deleteFolder functions as they are not used in the application
♻️ (foldersStore.tsx): Remove unused import statements for uploadFlowsFromFolders from services and related functions

* 📝 (index.tsx): replace async/await with synchronous function call to refresh folders after successful operation
2024-07-24 18:57:31 +00:00
dependabot[bot]
8f678de217
chore(deps): bump langchain-community from 0.2.7 to 0.2.9 (#2925)
Bumps [langchain-community](https://github.com/langchain-ai/langchain) from 0.2.7 to 0.2.9.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.2.7...langchain-community==0.2.9)

---
updated-dependencies:
- dependency-name: langchain-community
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 18:32:56 +00:00
Ítalo Johnny
e318694366
refactor: vertex instantiation (#2703)
* style: handle whitespaces around colons

* refactor: split a func into two

* refactor: update code to use newly created funcs

* refactor: merge code of one func into another

* refactor: rename func

* refactor: extract code segment to parent func

* refactor: extract code segment to parent func

* refactor: rename func

* refactor: rename object

* refactor: extract code segment into a new func

* feat: add condition to determine how the vertex is built

* fix: modify component initialization call
2024-07-24 18:28:53 +00:00
Carlos Coelho
0ac67a9e89
chore(template): adjust bug report template to include screenshot and WIP sections (#2899)
* Update bug-report.yaml

* Update bug-report.yaml

* Update feature-request.yaml

* Create work-in-progress.yaml
2024-07-24 11:13:22 -07:00
Cristhian Zanforlin Lousa
544e763c2d
test: improve test to allow any errors checks (#2926)
🐛 (generalBugs-shard-6.spec.ts): fix test assertion to check for error message length greater than 20 instead of 50 for improved accuracy
2024-07-24 18:13:01 +00:00
anovazzi1
4c3ec04dcb
enhancement: Add function to check broken edges (#2882)
* chore: create new function to check broken edges

* enhancement: add edges check when a new flow is added

* [autofix.ci] apply automated fixes

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

* refactor: update BROKEN_EDGES_WARNING message to use "connections" instead of "edges"

* [autofix.ci] apply automated fixes

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

* update function name

* refactor: improve error handling in detectBrokenEdgesEdges function

* remove console.log

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

---------

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-07-24 17:02:48 +00:00
Cezar Vasconcelos
7ca1d84596
feat: add method and refresh button to fetch Groq models (#2902)
* feat: add method and refresh button to fetch Groq models

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-24 08:56:20 -07:00
anovazzi1
007c38afed
feat: add new node Input type for data in table format (#2635)
* feat: add Table component and related functionality

This commit adds the Table component and related functionality to the codebase. The Table component is used to display tabular data and includes features such as pagination, row deletion, row duplication, and adding new rows. The TableOptions component is also added to provide options for resetting the grid and adding new rows. Additionally, the necessary types and interfaces are updated to support the Table component. This feature enhances the user experience by allowing them to interact with tabular data in a more intuitive way.

* feat: add Edit Data trigger to TableNodeComponent

* [autofix.ci] apply automated fixes

* feat: add TableSchema class for defining table structure

* feat: add TableMixin class for table-related functionality

* feat: add TableInput class for table-related functionality

* feat: add TableInput to io module

* feat: update Column model in table schema

This commit updates the `Column` model in the table schema to include the `display_name` and `name` fields instead of `header` and `field`. It also adds validation for the `formatter` field to accept either a `FormatterType` enum value or a string. This change improves the clarity and flexibility of the table schema.

* feat: add displayEmptyAlert prop to TableComponent

This commit adds the `displayEmptyAlert` prop to the `TableComponent` in order to control whether an alert is displayed when the table has no data. By default, the alert will be shown, but it can be disabled by setting `displayEmptyAlert` to `false`. This feature enhances the flexibility of the table component by allowing users to customize the behavior when there are no rows in the table.

* This commit improves the TableAutoCellRender component by adding support for a custom formatter. The formatter can be specified as a prop and allows for rendering the cell value in different formats, such as JSON. This enhancement enhances the flexibility and customization options of the TableAutoCellRender component.

* feat: add FormatColumns function to utils.ts

This commit adds the `FormatColumns` function to `utils.ts` file. The function takes an array of `ColumnField` objects and returns an array of `ColDef` objects. It maps each `ColumnField` to a `ColDef` with properties like `headerName`, `field`, `sortable`, and `filter`. If a `ColumnField` has a `formatter` property, it sets the `cellDataType` or `cellRendererParams` accordingly. This function enhances the flexibility and customization options for formatting columns in the table.

* feat: enhance TableNodeComponent with FormatColumns function

This commit enhances the TableNodeComponent by utilizing the FormatColumns function from utils.ts. The FormatColumns function takes an array of ColumnField objects and returns an array of ColDef objects, allowing for flexible and customizable column formatting in the table. By integrating this function, the TableNodeComponent now has improved column handling capabilities.

* chore: Update TableNodeComponent and TableComponent

This commit updates the TableNodeComponent and TableComponent to improve column handling and customization options. The TableNodeComponent now utilizes the FormatColumns function from utils.ts, allowing for flexible and customizable column formatting in the table. The TableComponent now has a new prop, displayEmptyAlert, which controls whether an alert is displayed when the table has no data. These enhancements enhance the flexibility and customization options of the table components.

* [autofix.ci] apply automated fixes

* feat: Update TableNodeComponent and TableComponent

This commit updates the TableNodeComponent and TableComponent to improve column handling and customization options. It utilizes the FormatColumns function from utils.ts for flexible and customizable column formatting in the table. The TableComponent now has a new prop, displayEmptyAlert, to control the display of an alert when the table has no data. These enhancements enhance the flexibility and customization options of the table components.

* feat: initialize table field values as DataFrame

* feat: Enhance TableNodeComponent with duplicateRow function

This commit enhances the TableNodeComponent by adding the duplicateRow function. This function allows users to duplicate selected rows in the table. When called, it clones the selected nodes and adds the duplicated rows to the table. This feature enhances the flexibility and customization options of the TableNodeComponent.

* [autofix.ci] apply automated fixes

* feat: Remove "text" from basic_types in FormatColumns function

This commit removes the "text" value from the basic_types set in the FormatColumns function in utils.ts. The basic_types set is used to determine the column type for formatting in the table. By removing "text", we ensure that only "date" and "number" types are considered as basic types. This change improves the accuracy and consistency of column formatting in the table.

* fix: alingment bug on AgGrid cell

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Styled the Open Table button on TableNodeComponent

* Fixed type of ref on tableComponent

* Creaed a TableModal component, that receives the props that are passed to the Table, as well as a title, and creates a modal

* Used the TableModal on the TableNodeComponent

* Fixed looks of TableModal

* Added description set on tableModal

* Add description field to TableNodeComponent

* Fixed text of description if info is not provided

* Added TableComponent in tableNodeCellRenderer

* Added styling based on editNode

* Added Auto Size to table modal

* refactor: update TableOptions component styling and behavior

- Update TableOptions component to dynamically apply text color based on selection
- Remove unnecessary console.log statement
- Improve hover behavior for the Trash2 icon

* chore: Remove unnecessary imports and initialize empty columns array in TableNodeComponent

* feat: Add default values for sortable and filterable in Column model

The code changes in `table.py` modify the `Column` model in the `langflow.schema` module. The `sortable` and `filterable` attributes of the `Column` model now have default values of `True`. This change ensures that new instances of the `Column` model will have these attributes set to `True` by default.

Based on the recent user commits and repository commits, the commit message follows the established convention of using a prefix to indicate the type of change (`feat` for a new feature) and provides a clear and concise description of the changes made.

* feat(utils.ts): add check for empty columns array in FormatColumns function to prevent errors

* feat: Add validation for TableInput value in inputs.py

The code changes in `inputs.py` add a validation function for the `value` attribute of the `TableInput` class. The function checks if the value is a list of dictionaries and raises a `ValueError` if it is not. This ensures that the `TableInput` instances have a valid value that is a list of dictionaries.

Based on the recent user commits and repository commits, the commit message follows the established convention of using a prefix to indicate the type of change (`feat` for a new feature) and provides a clear and concise description of the changes made.

* [autofix.ci] apply automated fixes

* feat: extend editable field to json field

* [autofix.ci] apply automated fixes

* feat: Add validation for TableInput value in inputs.py

* feat(validate.py): add exception handling to catch and re-raise ValidationError with a more informative error message

* chore: Refactor error message in build_custom_component_template function

* fix(validate.py): improve error message formatting in create_class function

Refactor the error message formatting in the `create_class` function in `validate.py` to improve readability and clarity. Instead of using a list comprehension to extract the error messages, the code now uses a nested list comprehension to split the error messages and extract the relevant information. This change ensures that the error message is properly formatted and provides more informative details about the validation errors.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* feat: Update TableMixin to support TableSchema or list of Columns

The TableMixin class in input_mixin.py has been updated to support either a TableSchema object or a list of Columns for the table_schema attribute. This change allows for more flexibility in defining the table schema for input validation.

* feat: Update TableNodeComponent to generate backend columns from value

Refactor the TableNodeComponent to generate backend columns from the value when the columns prop is not provided. This change ensures that the component can handle dynamic column generation based on the value, improving flexibility and usability.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* Refactor extractColumnsFromRows function to return only ColDef objects

The extractColumnsFromRows function in utils.ts has been refactored to return only ColDef objects instead of a combination of ColDef and ColGroupDef objects. This change simplifies the function's return type and improves consistency in the codebase.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* [autofix.ci] apply automated fixes

* refactor: Generate backend columns from value in TableNodeComponent

Refactor the TableNodeComponent to generate backend columns from the value when the columns prop is not provided. This change ensures that the component can handle dynamic column generation based on the value, improving flexibility and usability.

* feat: Update TableNodeComponent to handle number and date properly

* fix bug that delete all rows on modal close

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-07-24 06:20:58 -07:00
Cristhian Zanforlin Lousa
18dfd9a3d6
refactor: add useQuery to delete folder api requests (#2901)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

*  (editFlowSettingsComponent): Add padding top class to improve styling of the component

📝 (folders/index.tsx): Add use-delete-folders query to handle deletion of folders

📝 (folders/use-delete-folders.ts): Create useDeleteFolders hook to handle deletion of folders

📝 (mainPage/index.tsx): Import useDeleteFolders hook and implement handleDeleteFolder function to delete folders and show success/error messages

* 🔧 (use-delete-folder.tsx): Remove unused file use-delete-folder.tsx
🔧 (mainPage/index.tsx): Remove import of use-delete-folder hook as it is no longer used
2024-07-23 19:28:03 -03:00
anovazzi1
ae5f8714b2
chore: Update langflow-embedded-chat to v1.0.4 (#2900)
chore: update langflow-embedded-chat to v1.0.4 in getWidgetCode.tsx
2024-07-23 18:57:22 +00:00
Cristhian Zanforlin Lousa
c83006e066
bugfix: add returning promises on interceptor errors + tests (#2896)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* 📝 (API/api.tsx): return error in promise rejection to handle errors properly
📝 (codeAreaModal/index.tsx): add data-testid attribute to title element for testing purposes
 (generalBugs-shard-6.spec.ts): add end-to-end test for error handling in Code Modal

* 📝 (generalBugs-shard-6.spec.ts): update test description for better clarity and grammar
2024-07-23 15:33:48 -03:00
Cristhian Zanforlin Lousa
7ffcdd2b68
bugfix: filter flows on folder to ensure is displaying only for the logged user (#2897)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* 🐛 (folders.py): fix issue where all flows were being returned instead of only flows from the current user in the specified folder
2024-07-23 14:06:16 -03:00
anovazzi1
b7bc36d32a
refactor: authentication logic and move isAdmin to zustand store (#2888)
* refactor: remove isAuthenticated from context and move it to zustand store

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-23 14:59:13 +00:00
Cristhian Zanforlin Lousa
61265cc327
feat: change download flows to download as .zip file (#2870)
* 📝 (flows.py): Add endpoint to download multiple flows as a zip file
📝 (constants.ts): Add FLOWS constant for API endpoint
📝 (index.ts): Add use-post-download-multiple-flows query function
📝 (use-post-download-multiple-flows.ts): Implement function to download multiple flows as a zip file
📝 (index.tsx): Import usePostDownloadMultipleFlows in componentsComponent
📝 (index.tsx): Implement handleExport function to download multiple flows as a zip file
📝 (index.tsx): Update handleExport function to handle downloading and saving the zip file
📝 (headerComponent.tsx): Add shouldSelectAll state and setShouldSelectAll function to manage select all functionality

* formatting file

* 📝 (flows.py): Remove download_file endpoint and refactor download_multiple_file to support downloading multiple flows as a zip file
📝 (index.tsx): Refactor export functionality to handle exporting multiple flows as a zip file or a single flow as a JSON file
🔧 (use-post-download-multiple-flows.ts): Update API endpoint for downloading flows
🔧 (index.tsx): Remove unused imports and functions related to exporting flows
🔧 (reactflowUtils.ts): Remove unused downloadFlows function and related imports

* [autofix.ci] apply automated fixes

* 📝 (flows.py): remove unnecessary whitespace and improve code readability by aligning function parameters in download_multiple_file function

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-23 14:41:55 +00:00
dependabot[bot]
2db87e89bf
chore(deps): bump ag-grid-community from 31.3.2 to 32.0.0 in /src/frontend (#2650)
chore(deps): bump ag-grid-community in /src/frontend

Bumps [ag-grid-community](https://github.com/ag-grid/ag-grid) from 31.3.2 to 32.0.0.
- [Release notes](https://github.com/ag-grid/ag-grid/releases)
- [Commits](https://github.com/ag-grid/ag-grid/compare/v31.3.2...v32.0.0)

---
updated-dependencies:
- dependency-name: ag-grid-community
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 06:53:03 -07:00
Nicolò Boschi
8145d91f7d
fix: frontend image should forward /health_check to backend (#2887) 2024-07-23 15:08:43 +02:00
Cristhian Zanforlin Lousa
65acbd50a3
feat: Refactor Upload Folders to Use Mutations for HTTP Request Management (#2810)
*  (frontend): Add new API queries for user authentication and messages handling
📝 (frontend): Update API queries for user authentication to include new functionalities like logout, reset password, update user, add user, login user, and refresh access token
📝 (frontend): Update API queries for messages to change the update messages functionality to use PUT method instead of PATCH

*  (sideBarFolderButtons/index.tsx): Add usePostUploadFolders query to handle uploading folders and files
🔧 (constants.ts): Add FOLDERS constant to API URLs for folder-related endpoints
🔧 (folders/index.tsx): Add use-post-upload-folders query to handle uploading folders and files

🔧 (use-update-messages.ts): Remove unused file use-update-messages.ts to clean up the project
🔧 (foldersStore.tsx): Remove unused uploadFolder function to improve code maintainability and reduce complexity
🔧 (folders/index.ts): Remove unused uploadFolder function to simplify the codebase and improve readability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-23 09:16:42 -03:00
anovazzi1
90508b25e5
refactor: move isAuthenticated from context to zustand store" (#2845)
* remove isAuthenticated from context and move it to zustand store

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* refactor: fix authentication logic in authStore.ts

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-22 22:28:51 +00:00