Commit graph

5,333 commits

Author SHA1 Message Date
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
Lucas Oliveira
b63916e3c6
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>
2024-08-23 12:07:07 -07:00
Lucas Oliveira
f5ddc3ed52
fix: appearance of update button on title (#3503)
Fixed update button appearing on the bottom of the title
2024-08-22 17:31:53 +00:00
Cristhian Zanforlin Lousa
b5116e6f68
tests: fix dropdown components test (#3504)
*  (dropdownComponent.spec.ts): add missing test case for dropdownComponent to improve test coverage and ensure functionality
🔧 (dropdownComponent.spec.ts): update test case to include additional interactions with the page to simulate user behavior and improve test robustness

*  (dropdownComponent.spec.ts): update mouse wheel scroll distance to 800 to improve test reliability
📝 (dropdownComponent.spec.ts): add additional wait time to ensure stability in test execution

* 🔧 (dropdownComponent.spec.ts): remove unnecessary code related to hovering and scrolling in the dropdown component test to improve test readability and maintainability
2024-08-22 07:10:31 -07:00
Yuqi Tang
dde0fa4566
Fix: API JS generated code (#3461)
* update js code

* fix langflowid

* fix code change
2024-08-21 18:04:38 -07:00
Cristhian Zanforlin Lousa
1db1e3af3d
feat: add LANGFLOW_AUTO_SAVING_INTERVAL .env variable for flow auto-saving debounce (#3478)
* 📝 (langflow): Add support for configuring auto saving interval for Langflow
📝 (langflow): Update ConfigResponse and Settings to include auto_saving_interval
📝 (frontend): Update useGetConfigQuery and useSaveConfig to handle auto_saving_interval
📝 (frontend): Update useAutoSaveFlow and flowsManagerStore to handle auto saving interval

* 📝 (util.py): add support for setting auto_saving_interval in update_settings function to allow customization of auto-saving interval
2024-08-21 12:02:26 -07:00
Cristhian Zanforlin Lousa
8dd85d98b6
fix: auto_login=off error on login and editing a user + FE tests (#3471)
* 🐛 (users.py): Fix issue where user password was not being updated correctly
📝 (constants.ts, authContext.tsx, index.tsx): Add LANGFLOW_REFRESH_TOKEN constant and update related code to support refresh token functionality
📝 (userManagementModal/index.tsx): Update form reset logic and handle input values correctly
📝 (LoginPage/index.tsx, LoginAdminPage/index.tsx): Update login function to include refresh token parameter
📝 (components/index.ts, auth.ts): Update inputHandlerEventType to support boolean values

 (auto-login-off.spec.ts): Add end-to-end test for user login functionality with auto_login set to false, CRUD operations for users, and verification of user flows visibility based on permissions.

*  (auto-login-off.spec.ts): improve test description for better clarity and understanding
📝 (auto-login-off.spec.ts): add comments to clarify the purpose of intercepting requests and performing CRUD operations

* 🐛 (users.py): fix comparison of password to check for None using 'is not None' instead of '!= None' for better accuracy
2024-08-21 15:55:47 +00:00
Lucas Oliveira
3a408c8141
refactor: add useGetRefreshFlows mutation and update code to use it (#3475)
* Added refresh flows mutation

* Changed places that used refreshFlows to use the mutation

* removed old refreshFlows

* removed readFlowsFromDatabase api call

* Removed unused API calls from API.ts

* Removed getFlowFromDatabase call
2024-08-21 15:21:19 +00:00
Lucas Oliveira
0586d1e1d5
refactor: prompt validation functionality (#3473)
* Added post validate prompt mutation

* Updated prompt modal to use mutation to validate prompt

* Removed post validate prompt from API.ts
2024-08-21 15:12:45 +00:00
Lucas Oliveira
a5e366c03d
fix: auto login hooks order bug (#3472)
Fix auto login hooks order bug
2024-08-21 12:12:17 -03:00
Lucas Oliveira
1d46bee0f9
refactor: component code validation (#3470)
* removed post custom component update

* Added post validade component code mutation

* Used post validade code mutation on component code

* removed unused console log

* used validate component code on generic node code validation
2024-08-21 14:47:11 +00:00
anovazzi1
767a1a68b0
refactor: Add NodeIcon component for displaying icons in GenericNode (#3459)
* feat: Add NodeIcon component for displaying icons in GenericNode

This commit adds a new component called NodeIcon to the GenericNode module. The NodeIcon component is responsible for displaying icons based on the data type of the node. It uses the nodeIconsLucide object from the styleUtils module to map the data type to the corresponding icon name. The component also handles the display of emojis as icons by checking if the icon is an emoji using the emoji-regex library. The icon color is determined based on the data type using the nodeColors object from the styleUtils module. The NodeIcon component is used in the GenericNode component to render the icon of the node.

* [autofix.ci] apply automated fixes

* feat: Remove useIconNodeRender hook from CustomNodes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-21 11:29:57 -03:00
Lucas Oliveira
f328179d82
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
2024-08-21 13:24:54 +00:00
anovazzi1
29c3325036
fix: move css class for improve of the UI/UX (#3457)
* move css class for improve of the UI/UX

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-20 18:06:17 -03:00
anovazzi1
c267cd60c1
Fix node size in nodeComponent (#3450)
* fix: set nide size directly in the nodeComponent

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-20 14:37:08 +00:00
dependabot[bot]
4bcc560f01
build(deps): bump axios from 1.7.2 to 1.7.4 in /src/frontend (#3342)
Bumps [axios](https://github.com/axios/axios) from 1.7.2 to 1.7.4.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.2...v1.7.4)

---
updated-dependencies:
- dependency-name: axios
  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-08-20 11:06:50 +00:00
anovazzi1
d4a1111974
fix: remove autosize on textArea inside nodes (#3436)
refactor: Update rows prop in TextAreaComponent to always be 1
2024-08-19 21:43:49 +00:00
Cristhian Zanforlin Lousa
4c496496e5
tests: improve tests removing unnecessary timeouts and decreasing some (#3437)
* feat: Add data-testid attribute to main page title

The code changes add a `data-testid` attribute to the main page title in the `PageLayout` component. This attribute can be used for testing purposes.

* refactor: Update page load timeout in end-to-end test

Reduce the page load timeout in the end-to-end test for Basic Prompting to improve test efficiency. The timeout is decreased from 2000ms to 1000ms.

* refactor: Decrease page load timeout in end-to-end test

Reduce the page load timeout in the end-to-end test for Basic Prompting to improve test efficiency. The timeout is decreased from 2000ms to 1000ms.

* refactor: Decrease page load timeout in end-to-end test

* refactor: Update page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

* refactor: Decrease page load timeout in end-to-end test

Reduce the page load timeout in the end-to-end test for Basic Prompting to improve test efficiency. The timeout is decreased from 2000ms to 1000ms.

* improve tests decreasing and removing time outs
2024-08-19 18:33:40 -03:00
Sai Kolasani
a2406fac72
feat: Add Perplexity Models Component (#3351) 2024-08-19 21:28:28 +00:00
Cristhian Zanforlin Lousa
feb3c18ef2
tests: Reduce Timeout on Tests for Basic Examples Modal (#3429)
* reducing timeout on tests basic examples modal

* reducing timeout on tests basic examples modal

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-08-19 17:11:33 -03:00
Cristhian Zanforlin Lousa
595746e797
fix: Fix api_key missing error when adding a flow in ComposIO + tests (#3432)
* 🐛 (ComposioAPI.py): Fix issue where build_config was not being updated correctly when api_key is not empty

* 🐛 (GenericNode/index.tsx): Fix potential null pointer exception by adding non-null assertion operator to info property access
 (generalBugs-shard-11.spec.ts): Add end-to-end tests to ensure users can use ComposIO without api_key error and connect tools successfully
2024-08-19 19:45:09 +00:00
Cristhian Zanforlin Lousa
886a8c6bed
fix: Remove unnecessary error return when all components are erased from a flow (#3433)
🔧 (use-save-flow.ts): remove unnecessary error data setting when saving an empty flow to improve code readability and maintainability
2024-08-19 19:39:48 +00:00
Cristhian Zanforlin Lousa
66110f24e2
tests: Add Tests for New Auto-Saving Feature (#3428)
*  (index.tsx): Add data-testid attribute to the save button for testing purposes
 (auto-save-off.spec.ts): Add end-to-end test for manually saving a flow when auto_save is off

* ⬆️ (auto-save-off.spec.ts): decrease wait time from 5000ms to 3000ms for improved test efficiency

* moving auto-save-off test to scheduled folder
2024-08-19 16:17:03 -03:00
Cristhian Zanforlin Lousa
08d2d89e4f
tests: add freeze component feature test (#3365)
 (freeze.spec.ts): Add end-to-end test for freezing a component to ensure the functionality works as expected.
2024-08-19 14:15:06 +00:00
anovazzi1
0f2729da8d
refactor: add use-download-files hook for downloading files on chat (#3399)
* feat: add useGetDownloadFileMutation hook for downloading files

This commit adds a new hook called useGetDownloadFileMutation to handle the downloading of files in the frontend. The hook takes in the path and filename as parameters and uses the fetch API to download the file. It then creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.

* feat: add use-download-files hook for downloading files on chat

This commit adds a new hook called use-download-files to handle the downloading of files in the frontend. The hook takes in the path and filename as parameters and uses the fetch API to download the file. It then creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.

* [autofix.ci] apply automated fixes

* feat: refactor file download handling in chat view

Refactor the file download handling in the chat view by introducing a new hook called `use-download-files`. This hook takes in the path and filename as parameters and uses the fetch API to download the file. It creates a URL object for the downloaded file and sets it as the href of a dynamically created anchor element. Finally, it triggers a click event on the anchor element to initiate the file download. The URL object is revoked after the download is complete.

* remove console.log

---------

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-08-19 13:06:40 +00:00
anovazzi1
2a27b083f6
refactor: Update lazy loading imports in routes.tsx (#3353)
* refactor: Update lazy loading imports in routes.tsx

The code changes in `routes.tsx` refactor the lazy loading imports by removing unnecessary code duplication and reorganizing the import statements. This improves the readability and maintainability of the code.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-19 10:00:58 -03:00
Cristhian Zanforlin Lousa
c03677c4fb
tests: add test to stop building feature (#3364)
*  (use-icons-status.tsx): Add data-testid attribute to Loading component for testing purposes
 (index.tsx): Add data-testid attribute to stop building button for testing purposes
 (stop-building.spec.ts): Add end-to-end test to ensure user can stop a building process

*  (stop-building.spec.ts): Add additional tests to ensure the user can stop a building process successfully and verify the button functionality.

* test(stop-building.spec.ts): Comment out wait timeouts

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-08-19 09:22:32 -03:00
Cristhian Zanforlin Lousa
a5cdab68bb
tests: Categorize Tests into CI and Scheduled Groups (#3391)
* categoring tests

*  (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecting and deleting items, searching flows, and searching components on the main page to ensure proper functionality and user experience.

* 📝 (frontend/tsconfig.json): update file paths in include section to match the correct directory structure for scheduled-end-to-end tests.

* 🔧 (typescript_test.yml): update path in the command to change directory to run end-to-end tests in the frontend folder
📝 (typescript_test.yml): improve comments for better readability and understanding of the workflow logic

* add yml configuration to choose folder to run CI

* 🔧 (ci.yml): Fix formatting issues and add support for running tests in a specific folder
📝 (ci.yml): Update job dependencies to improve readability and maintainability of the workflow configuration

* ♻️ (typescript_test.yml): refactor matrix values for shardIndex and shardTotal to reduce redundancy and improve readability

* categoring tests

*  (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecting and deleting items, searching flows, and searching components on the main page to ensure proper functionality and user experience.

* 📝 (frontend/tsconfig.json): update file paths in include section to match the correct directory structure for scheduled-end-to-end tests.

* 🔧 (typescript_test.yml): update path in the command to change directory to run end-to-end tests in the frontend folder
📝 (typescript_test.yml): improve comments for better readability and understanding of the workflow logic

* add yml configuration to choose folder to run CI

* 🔧 (ci.yml): Fix formatting issues and add support for running tests in a specific folder
📝 (ci.yml): Update job dependencies to improve readability and maintainability of the workflow configuration

* ♻️ (typescript_test.yml): refactor matrix values for shardIndex and shardTotal to reduce redundancy and improve readability

* 🐛 (fileUploadComponent.spec.ts): fix file path for file upload to correctly locate the test file in the assets folder

* changing test_folder

*  (fileUploadComponent.spec.ts): update file path for file upload test to match new file location in the project structure

* fix input on playwright command
2024-08-16 18:13:47 -03:00
Lucas Oliveira
0d60fbf3e7
fix: auto saving config (#3395)
* remove env definition from vite

* add get config query

* add save config hook to add info to autosaving and axios

* Use save config hook to get info

* Create autoSaving variable on flowsManagerStore

* Adds autoSaving from store into every place that used the env variables

* fix wrong url

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-08-16 17:23:11 -03:00
Lucas Oliveira
00d2cffe46
fix: auto save ui and env var (#3384)
* Added new confirmation modal for saving

* Fixed save button

* fixed header classes

* updated docs link

* Added different message to auto saving

* Changed tooltip to appear in saved text, not in button

* Changed tooltip back to previous when auto saving is enabled

* changed auto_save to auto_saving

* Fixed build not appearing and icons

* Changed modal when autosave is enabled

* 🐛 (menuBar/index.tsx): fix condition for disabling save button to include isBuilding flag to prevent saving during build process

* fix current flow not being updated on set nodes and edges and fix modal not letting user leave when flow is empty

* Removed console log

* Fix add flow not adding the flow that comes from the backend

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-08-16 18:17:42 +00:00
anovazzi1
26bc6bc645
fix: Add TableNodeComponent and set default formatter type (#3382)
* feat: Add TableNodeComponent for rendering table data in ParameterRenderComponent

* refactor: Set default formatter type for columns in FormatColumns function

* [autofix.ci] apply automated fixes

* refactor: Improve object rendering in ObjectRender component

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-16 14:47:44 +00:00
Anand Dev Singh
6f001c64be
fix: Corrected Changed the data type of number field from string to number (#3363)
* Changed the data type of number field from string to number

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-15 21:15:12 +00:00
anovazzi1
981f314a73
refactor: improve store and collection card components (#3350)
* refactor: add card store component

* refactor: use StoreCardComponent for displaying store cards

* refactor: Remove unused code

* refactor: Update Collection card to fit only to the my collection case

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 19:02:46 -03:00
anovazzi1
642df45bf6
enhancement: update widget code to use latest version of langflow-embedded-chat (#3347)
refactor: Update widget code to use latest version of langflow-embedded-chat
2024-08-14 21:26:32 +00:00
anovazzi1
e5ee0ba946
refactor: Add ComponentTextModal and Prompt modal for displaying and editing text areas and components (#3346)
* add separated component for prompt modal

* refactor: rename promptAreaModal to promptModal and update type import

* refactor: update promptComponent to use PromptModal instead of GenericModal

* refactor: update textarea-primary class in applies.css

* refactor: add ComponentTextModal for displaying and editing text areas

Add a new component, ComponentTextModal, for displaying and editing text areas. This component includes a textarea input, a title, and an icon. It also supports password visibility toggling. The ComponentTextModal is used within a BaseModal component and includes a save button for finishing the editing process. This commit refactors the code to add the ComponentTextModal and its related functionality.

* refactor: Add ComponentTextModal for displaying and editing text areas

* delete genericModal component and their references

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 15:08:59 -03:00
Lucas Oliveira
765895432e
refactor: folder fetching, folder sidebar and fix various issues (#3344)
* Removed unused code

* Separated folder sidebar from common sidebar

* Removed useOnFileDrop from common sidebar

* Added folderSidebarComponent that fetches the folders

* Added useOnFileDrop and SIdebarFoldersButton

* Make auth context not get folders

* Make delete folder refetch get folders

* Make folder mutations refetch the getFolder

* Create getFolder query

* Removed unused functions from useFolderStore

* Make isLoading from application depend only on flows

* Make main page not refetch folders

* Change types of folders store

* removed getFolders refetch on duplicateFolders

* Added loading from query into ComponentsComponent

* Made the flow page get the flows and types if they're not available

* Made the loading be the isLoading only

* Removed unused function

* Make cards appear even if it didnt load

* Removed setLoading of various pages

* Fixed loading happening every time the flow changes

* Added skeleton instead of loading on folders

* Added routing to contain folderId on both flows and initial page

* remove redirect of useFileDrop

* remove folderid getting from state

* removed setAllFlows

* chore: Remove unused variables and functions in useDuplicateFlows hook

* Added refetch of folders when the flow is deleted or added

* Changed redirectToLastLocation to redirect to last folder also

* Added upload flow to folder tanstack and refetched folders on upload

* Added loading of current folder on display of empty component

* Removed refetching folder on file drop

* Removed unused code

* Fixed add new flow from header not redirecting correctly

* Fixed unused code

* Added undefined on setting current flow as empty

* Added disable top bar and make it be displayed on the top of an empty folder

* Fixed select all checked when deleting all flows
2024-08-14 14:40:18 -03:00
anovazzi1
0e2f27736c
refactor: update keyboard shortcuts display (#3316)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

* refactor: remove unused code and handle count in GenericNodeToolbar component

* refactor: Add useShortcuts hook for handling keyboard shortcuts in nodeToolbarComponent

* refactor: Add keyboard shortcuts handling to nodeToolbarComponent need to test

* refactor: Update FreezeAllVertices function in NodeToolbarComponent

* feat: Add getNodeLength function to calculate the length of a node's template fields

* refactor: Update RenderIcons component to use navigator.platform for detecting macOS

* refactor: Add ShortcutDisplay component to nodeToolbarComponent

* refactor: Update nodeToolbarComponent to remove RenderIcons and add ShortcutDisplay

* refactor: Improve keyboard shortcuts handling in nodeToolbarComponent

* [autofix.ci] apply automated fixes

* refactor: Add OptionIcon to nodeIconsLucide

* feat: Add SHORTCUT_KEYS constant

* feat: Add SHORTCUT_KEYS constant

* refactor: Add RenderKey component for rendering keyboard shortcuts

* refactor: Update RenderIcons component to use RenderKey for rendering keyboard shortcuts

* update shortcut page to use shortcut icons

* [autofix.ci] apply automated fixes

* Update Astra link in README.md (#3314)

* Update link in README.md

* Update README.md

* Update getting-started-installation.md

* Update README.KR.md

* Update README.ja.md

* refactor: Simplify NodeToolbarComponent's save flow logic

* [autofix.ci] apply automated fixes

* feat: Google Drive Search Component (#3319)

* feat: Google Drive Search Component

feat: Google Drive Search Component
Ability to search Google Drive and get back the relevant Doc id or Doc urls

* Updated Google Drive Search.py

* feat: Add support for metadata filtering and namespaces for the Upstash Vector component (#3254)

* feat: add metadata filtering and namespace support for the upstash vector component

* docs: add upstash vector to the vectorstores doc

* [autofix.ci] apply automated fixes

---------

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

* ci: Update pytest configuration and add pytest-flakefinder. (#3330)

* chore: Refactor NodeToolbarComponent to simplify code structure

* [autofix.ci] apply automated fixes

* refactor: Simplify NodeToolbarComponent's save flow logic

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Leventer <3254549+alexleventer@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: ytkimirti <yusuftaha9@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-14 12:28:46 -03:00
anovazzi1
7fe6c53b37
refactor: improve node toolbar code (#3311)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

* refactor: remove unused code and handle count in GenericNodeToolbar component

* refactor: Add useShortcuts hook for handling keyboard shortcuts in nodeToolbarComponent

* refactor: Add keyboard shortcuts handling to nodeToolbarComponent need to test

* refactor: Update FreezeAllVertices function in NodeToolbarComponent

* feat: Add getNodeLength function to calculate the length of a node's template fields

* refactor: Update RenderIcons component to use navigator.platform for detecting macOS

* refactor: Add ShortcutDisplay component to nodeToolbarComponent

* refactor: Update nodeToolbarComponent to remove RenderIcons and add ShortcutDisplay

* refactor: Improve keyboard shortcuts handling in nodeToolbarComponent

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 15:04:25 +00:00
Ítalo Johnny
493b73f9d8
fix: add double quotes to curl command generation (#3337) 2024-08-14 14:36:00 +00:00
Lucas Oliveira
c19a031b9c
fix: dark mode and header text display issues (#3315)
* Fix dark mode not starting with the browser saved variable

* Added the Last saved at text on the header too

* Fixed css
2024-08-13 20:01:46 -03:00
anovazzi1
62b1b88644
refactor: improve NodeOutputField and NodeInputField components (#3235)
* remove refhtml and create new component

* refactor: refactor NodeOutputField component in GenericNode

* refactor: refactor NodeOutputField component in GenericNode

* refactor: refactor NodeInputField component in GenericNode

* refactor: remove output shortcut

* [autofix.ci] apply automated fixes

* refactor: remove console.log statements in NodeOutputField component

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-13 16:52:26 -03:00
anovazzi1
64aecddeca
refactor: add components for node name, description, and status (#3248)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-13 14:37:33 -03:00
anovazzi1
665842680e
enhancement: prevent esc on codeAreaModal (#3232)
* add onEscapeKeyDown

* refactor: Add ConfirmationModal to CodeAreaModal for better user experience

* refactor: Update CodeAreaModal to use ReactAce for code editing

* fix closing o x modal

* refactor: Update CodeAreaModal to use ReactAce for code editing

* [autofix.ci] apply automated fixes

* decompose object

---------

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-08-13 12:35:02 +00:00
Lucas Oliveira
7264028e41
refactor: optimize flow saving functionality and implement manual saving (#3283)
* fixed patch update flow

* fixed update flow patch to receive id by payload

* created save flow hook with auto save and manual save functions

* fix poetry lock

* added auto save check with environment variable

* removed unused user

* separated autosave and put the flow as a creation with nodes and edges

* removed set nodes that skipped saving

* implemented auto save hook

* removed autosave from setNodes and setEdges

* added auto save hook and saved on viewport move and added useEffect to save on nodes and edges changed

* changed type of setNodes

* removed unused var

* removed deletion of empty flow

* Added saving of flow on button when autoSave is disabled

* disable saving when the nodes are empty

* removed save loading as false when the access token is renewed

* implemented useDebounce

* added save loading to save flow hook

* removed setting nodes and edges on fetching, since they are set when the current flow is updated

* removed unused var

* use debounce hook to save flow

* set nodes and edges on current flow id change

* removed useplaygroundeffect

* removed unused import

* put set save loading before the If

* removed flow cleaning and inputs setting, since the inputs and outputs are set on the ResetFlow function

* updated to use ResetFlow function to update everything regarding flow

* removed flow pool get on resetFlow, for it to be fetched only if the user is inside the flow

* updated packagelock

* Changed router to outlet on app.tsx to use createRouter

* Created authSettingsGuard to guard the general settings

* Fixed routes to use createBrowserRouter to allow the use of useBlocker

* Changed index.tsx to use RouterProvider and the router just created

* Changed flowStore to have a local flow state

* Implemented setting the current flow state when saving the flow

* Added the update of current flow when auto saving

* changed current flow to use the current flow from Flow Store instead of Flows Manager Store

* Changed codeTabsComponent Tweaks check to show if its checked

* Removed unused variables

* Removed browser router from context wrapper

* Removed unused console.log

* Changed initialSetup to just run when opening the modal

* changed confirmationModal to have destructiveCancel and to only call onCancel if the other buttons were not pressed

* Created a SaveChangesModal that confirms if the user wants to save their changes

* Get folder by id when folder id changes too

* Changed reset flow calls to store whole flow

* Added check if user is exiting page to prevent him when there are unsaved changes

* Added new types on ConfirmationModalType

* Implement save on clicking the save button on the header

* added save component shortcut to use save shortcut as save flow

* added save component shortcut on shortcutsStore type

* changed save shortcut to save component on node toolbar

* added save shortcut to header menubar

* changed shortcuts name to be compatible with existing ones

* changed shortcuts to be backwards compatible

* changed save to changes to maintain retrocompatibility

* changed save_component to save to maintain retrocompatibility

* Changed time difference to unsaved changes

* changed the toolbar select item to get the right save shortcut

* Changed save flow to use current flow from useFlowStore instead of the previous saved flow

* changed changesNotSaved to include flow name and metadata

* Added way of saving the flow settings just locally instead of directly to database

* Changed shareModal to save flow with hook

* removed old auto saving on connect

* Removed save functions from flowsManagerStore

* refactor: Remove unused imports and state variables in EditFlowSettings component

* use current flow not saved one and refactored page to not receive flow

* added check of isFlowPage to display the menubar

* Added checks to render playground if API key is valid and if Flows exists

* Added check to not display X on chat on playground page

* Updated flows variable to be undefined by start to prevent things from loading before flows initialize

* Implemented log builds parameter to not allow the builds to be logged if user not on flowPage
2024-08-12 22:21:52 +00:00
neeraj gupta
1789e2da63
fix: correct issue with The "No suitable component" error is appearing on the OpenAI component and other components due to a missing check (#3279) 2024-08-11 08:22:45 -03:00
Mike Manh
583bc74019
fix(get-python-api-code):fixing errors in a file uploading flow, as in issue #2799 (#2815)
fixing errors in a file uploading flow, as in issue #2799

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-09 22:53:39 +00:00
Gabriel Luiz Freitas Almeida
d0484ba412
fix: enhance error handling in build_flow and add error handling for Flow build (#3259)
* feat: add error handling for Flow build

The code changes in `buildUtils.ts` add error handling for the Flow build process. It includes a new case for handling errors in the switch statement, which displays the error message and triggers the `onBuildError` function. This change ensures that errors during the Flow build are properly handled and the build process is stopped.

* feat: enhance error handling in build_flow to capture and report HTTP exceptions in the flow building process
2024-08-09 14:15:35 +00:00
William Espegren
7a36cc9ebf
feat: add Spider Web Scraper & Crawler (#2439)
* spider files

* rebuild required

* add spider-client here

* Feat: Spider Web Crawler & Scraper

* Feat: spider integration

* new input not working

* [autofix.ci] apply automated fixes

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

* fix: add outputs and configure build method

* style: run ruff

* Refactor SpiderTool to use 'crawl' instead of 'build' for generating Markdown content

* chore: add type ignore

* chore: new lock

* chore: Update mem0ai dependency to version 0.0.5

---------

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-08-08 05:53:05 -07:00
Gabriel Luiz Freitas Almeida
0ac7845a9a
feat: improve layout options and make sure nodes and flow have position data (#3231)
* feat: Export needsLayout function for layout handling in reactflowUtils, enhancing node position verification

* feat(layoutUtils): Enhance ELK layout options for improved graph rendering and add debug logs for layout verification

* feat: Update PageComponent to fit view when viewport is at (0,0)

The PageComponent in the FlowPage now fits the view when the viewport is at (0,0). This improves the initial display of the page and enhances the user experience.

* feat(uploadFlow): Integrate processDataFromFlow to handle flows during upload, improving data processing efficiency

* feat(constants): Update NODE_WIDTH from 384 to 400 for improved component layout and consistency in the user interface

* refactor(layoutUtils): Remove debug console logs from getLayoutedNodes
2024-08-07 13:27:56 -07:00
Gabriel Luiz Freitas Almeida
811816c8b1
fix: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics (#3228)
* fix: add 'nowheel' class to Textarea component for enhanced user experience in textarea interactions

* refactor: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics

* refactor: Update TextAreaComponent to dynamically adjust the number of rows based on the content length for improved user experience

* [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-08-07 11:21:26 -07:00