Commit graph

4,971 commits

Author SHA1 Message Date
cristhianzl
b68d3c57dc (tests): update test selectors to use test IDs for model selection
 (tests): add waitForTimeout to ensure stability in end-to-end tests
2024-06-26 16:23:27 -03:00
cristhianzl
8153c863e6 (tests): add model selection step in end-to-end tests
Add steps to select "gpt-4o" model in various end-to-end tests to ensure
consistency and accuracy in test execution.
2024-06-26 16:11:37 -03:00
cristhianzl
ca62f1a31f (index.tsx): add data-testid attribute to shared button for testing
 (store.spec.ts): update test selector to use new data-testid attribute
♻️ (textInputOutput.spec.ts): refactor element selection and interaction logic for clarity and maintainability
2024-06-26 15:27:58 -03:00
cristhianzl
2ede00b668 (basicExamples.spec.ts): comment out end-to-end test steps for Vector Store RAG 2024-06-26 14:56:17 -03:00
cristhianzl
dad0aa282f Merge branch 'dev' into cz/fixTestsCI 2024-06-26 12:06:00 -03:00
cristhianzl
326353cb6d (playwright.config.ts): update retries and workers configuration for CI
💡 (textAreaWrapper): add data-testid attribute for better test targeting
 (actionsMainPage.spec.ts): add waitForSelector for better test stability
 (basicExamples.spec.ts): replace waitForTimeout with waitForSelector
 (basicExamples.spec.ts): use data-testid for chat input for consistency
 (memoryChatbot.spec.ts): replace waitForTimeout with waitForSelector
 (memoryChatbot.spec.ts): use data-testid for chat input for consistency
 (documentQA.spec.ts): replace waitForTimeout with waitForSelector
 (documentQA.spec.ts): use data-testid for chat input for consistency
 (vectorStoreRAG.spec.ts): replace waitForTimeout with waitForSelector
 (vectorStoreRAG.spec.ts): use data-testid for chat input for consistency

 (tests): add waitForSelector to ensure elements are loaded before interaction

 (tests): add waitForSelector for 'fit view' button in end-to-end tests
2024-06-26 11:47:48 -03:00
cristhianzl
b49e8dac9a ♻️ (playwright.config.ts): increase workers from 1 to 3 to improve test parallelism
 (basicExamples.spec.ts): add waitForSelector for 'fit view' to ensure element is loaded

 (basicExamples.spec.ts): add waitForSelector for 'built successfully' to ensure element is loaded

 (chatInputOutput.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (codeAreaModalComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (dropdownComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (fileUploadComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (filterEdge.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (filterEdge.spec.ts): update test expectations for 'disclosure-agents' to be visible

 (floatComponent.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (flowPage.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (folders.spec.ts): add waitForSelector for 'icon-ChevronLeft' to ensure element is loaded

 (folders.spec.ts): update folder name input and visibility check to improve reliability

 (generalBugs.spec.ts): add waitForSelector for 'extended-disclosure' to ensure element is loaded

 (tests): replace waitForTimeout with waitForSelector in end-to-end tests

Replace `waitForTimeout` with `waitForSelector` to improve test reliability and reduce flakiness.
2024-06-25 22:14:17 -03:00
cristhianzl
a0117f5794 💡 (hooks): add TypeScript types to hook parameters for better type safety
💡 (use-dropdown-options.tsx): add TypeScript types to function parameters

💡 (use-api-keys.tsx): add TypeScript types to function parameters

💡 (use-handle-delete-key.tsx): add TypeScript types to function parameters

💡 (use-preload-images.tsx): add TypeScript types to function parameters

💡 (use-patch-password.tsx): add TypeScript types to function parameters

💡 (use-patch-profile-picture.tsx): add TypeScript types to function parameters

💡 (use-save-key.tsx): add TypeScript types to function parameters

💡 (use-scroll-to-element.tsx): add TypeScript types to function parameters

💡 (use-messages-table.tsx): add TypeScript types to function parameters

💡 (use-remove-messages.tsx): add TypeScript types to function parameters

💡 (use-updateMessage.tsx): add type annotations to setSuccessData and setErrorData for better type safety and code clarity
2024-06-25 20:02:23 -03:00
cristhianzl
b7ff822ae2 💡 (hooks): add TypeScript types to hook parameters for better type safety
💡 (index.tsx): add non-null assertion operator to playground variable
♻️ (use-on-file-drop.tsx): add type annotations for folderId and folderChangeCallback
♻️ (use-auto-resize-text-area.tsx): add type annotations for value and inputRef
♻️ (use-drag-and-drop.tsx): add type annotations for setIsDragging, setFiles, currentFlowId, and setErrorData
♻️ (use-focus-unlock.tsx): add type annotations for lockChat and inputRef
♻️ (use-upload.tsx): add type annotations for uploadFile, currentFlowId, setFiles, and lockChat
♻️ (use-column-defs.tsx): add type annotation for myData
♻️ (use-row-data.tsx): add type annotations for myData and open
♻️ (index.tsx): remove commented-out code
♻️ (use-filtered-flows.tsx): add type annotations for flowsFromFolder, searchFlowsComponents, and setAllFlows
💡 (index.tsx): add non-null assertion operator to flowsFromFolder variable
2024-06-25 20:02:15 -03:00
cristhianzl
3db91f890b (hooks): add custom hooks for card component
- Add `useDataEffect` to handle data-related side effects
- Add `useInstallComponent` to manage component installation logic
- Add `useLikeComponent` to handle like functionality
- Add `useDragStart` to manage drag start events
- Add `usePlaygroundEffect` to handle playground-related side effects

 (cardComponent): add custom hooks for data, install, like, drag start, and playground effects
♻️ (cardComponent): rename state variables for consistency and readability
 (MainPage): add CollectionCard component to handle card rendering and interactions

 (index.tsx): add CollectionCard component to ComponentsComponent
♻️ (index.tsx): refactor to use CollectionCard instead of inline code
2024-06-25 20:01:52 -03:00
Gabriel Luiz Freitas Almeida
2ed4d54f99
Add check-format script and update lint-js.yml (#2357)
* chore: Add check-format script to package.json for code formatting consistency

* chore: Update lint-js.yml to use npm run check-format instead of npm run format
2024-06-25 14:46:51 -07:00
Gabriel Luiz Freitas Almeida
0f8cd9e572 chore: Update authContext imports and remove duplicate imports 2024-06-25 15:31:29 -03:00
Cristhian Zanforlin Lousa
4077135ba7 Updating Tests and Fixing Related Bugs (#2319)
* 🐛 (tableNodeCellRender): fix templateValue check to use Object.keys
 (textAreaComponent): add Case component for conditional rendering
♻️ (editNodeModal): remove commented-out useEffect code
 (basicExamples.spec): update test selectors and increase timeout values

 (filterEdge.spec.ts): update test IDs to match new naming conventions

 (inputListComponent.spec.ts, intComponent.spec.ts): update test IDs and streamline test steps for consistency and clarity

 (keyPairListComponent.spec.ts): update test ID for model element
 (keyPairListComponent.spec.ts): add steps to test editing model options and saving changes

*  (tests): update end-to-end tests for chat input/output and modal components

- Update test selectors for better accuracy
- Add keyboard interaction in chatInputOutputUser.spec.ts
- Improve file handling in chat image upload test
- Refine prompt modal component tests for better validation
- Enhance twoEdges.spec.ts with additional view controls

* ♻️ (tests): refactor repeated click actions into reusable function in e2e tests

*  (tests): replace waitForTimeout with waitForSelector in end-to-end tests

*  (typescript_test.yml): add --debug flag to Playwright test command for better debugging

*  (typescript_test.yml): enable trace option in Playwright tests for better debugging

*  (typescript_test.yml): reduce Playwright test workers from 2 to 1 to improve stability
 (textInputOutput.spec.ts): add waitFor visibility checks to ensure elements are visible before interaction

*  (tests): update paths for test assets to correct locations
 (tests): add waitForSelector to ensure elements are loaded before interaction

*  (typescript_test.yml): increase Playwright workers from 1 to 2 to speed up tests
 (chatInputOutputUser.spec.ts): increase timeout for AI response to 100000ms
 (chatInputOutputUser.spec.ts): correct file path for image upload test
 (deleteComponentFlows.spec.ts): change waitFor to target last checkbox-component
 (store.spec.ts): increase timeout for share button to 100000ms

* 🐛 (flows.py): ensure flow names are unique by appending a number if necessary

* Apply Ruff formatting

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Cristhianzl <Cristhianzl@users.noreply.github.com>
2024-06-25 10:21:38 -07:00
Cristhian Zanforlin Lousa
2fe2024a58 Fix lint error version of tailwind css plugin (#2323)
⬆️ (package.json): update prettier-plugin-tailwindcss to version 0.6.5
♻️ (package.json): reorder @types/lodash dependency for consistency

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-06-25 10:21:38 -07:00
anovazzi1
f954295731 format code 2024-06-25 10:21:38 -07:00
anovazzi1
c8d37c38b4 fix fetch data to work even with autologin true 2024-06-25 10:21:38 -07:00
Gabriel Luiz Freitas Almeida
fff4537b1e
Fixes CLI and server (#2342)
* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* Refactor "created_at" column type for consistency and fix cancel middleware (#2316)

* chore: update linting workflows to include dev branch in merge_group

* Update README.md

Add 1.0 banner

* Update README.md

* chore: update package versions in pyproject.toml files

* refactor: update "created_at" column type to use the "sa" module for consistency

* Update README.md

Add 1.0 banner

* chore: Remove unused import in ToolCallingAgent.py

* fix: adapt RequestCancelledMiddleware to handle cancelled requests

* chore: Remove unused import in test_helper_components.py

* refactor: Declare queue variable with explicit type in RequestCancelledMiddleware

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>

* chore: Update AstraDB.py imports and method signature for search_documents

* chore: Update package versions in pyproject.toml files

* chore: Update run-name in release.yml for Langflow Release

* fix: add call to _add_documents_to_vector_store in AstraDB component

* chore: Fix missing parentheses in RequestCancelledMiddleware

* chore: Update pydantic-settings and tenacity versions

The commit updates the versions of the `pydantic-settings` and `tenacity` packages in the `poetry.lock` file. The `pydantic-settings` version is updated from 2.3.3 to 2.3.4, and the `tenacity` version is updated from 8.4.1 to 8.4.2.

* Update README.md

Add 1.0 banner

* fix fetch data to work even with autologin true

* format code

* deactivate stop button until we have a better solution (#2337)

* consistent auth error status code

* [Fix] unhandled http errors in background tasks (#2326)

* handle exceptions for background task

* revert changes that is not related to this HTTP handler exception

* Refactor model GoogleGenerativeAIModel (#2251)

* refactor model GoogleGenerativeAIModel

* adds model options

---------

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

* Fix .env values not being honored in CLI (#2336)

* chore: Update launch.json to include environment file

The launch.json file was updated to include the environment file path for the "run" command in the "Python: Flask" configuration. This change ensures that the necessary environment variables are loaded when running the backend base of Langflow frontend. The previous configuration had the environment variables set in the "env" field, but it has been removed as it is redundant with the new environment file inclusion.

* chore: Update dotenv import and environment variable handling

This commit updates the import statement for the `dotenv` module in the `__main__.py` file. It adds the `dotenv_values` function to the import statement to enable loading environment variables from a file. Additionally, it introduces a new section of code that maps environment variables to their corresponding variables and types, allowing for more flexible and dynamic configuration. The commit also updates the `run` function to update variables based on environment variables, if they are present. This change improves the handling of environment variables and enhances the configurability of the application.

* deactivate stop button until we have a better solution (#2337)

* consistent auth error status code

* [Fix] unhandled http errors in background tasks (#2326)

* handle exceptions for background task

* revert changes that is not related to this HTTP handler exception

* Refactor model GoogleGenerativeAIModel (#2251)

* refactor model GoogleGenerativeAIModel

* adds model options

---------

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

---------

Co-authored-by: ming luo <itestmycode@gmail.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>

* Update GitHub Actions workflows and dependencies (#2341)

* chore: Add GitHub Actions workflow for testing documentation build

* Fix server start command in GitHub Actions workflows

* chore: Bump langflow and langflow-base versions

* chore: Update GitHub Actions workflow for docs_test

* chore: Update typing import in __main__.py

* Fix user authentication and authorization issues (#2343)

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: ming luo <itestmycode@gmail.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
2024-06-25 09:20:55 -07:00
Gabriel Luiz Freitas Almeida
39320ae31e refactor: Update nodeColors and nodeNames in styleUtils.ts for consistency 2024-06-24 05:59:32 -07:00
Gabriel Luiz Freitas Almeida
7f94f5f5dd Update project documentation URLs to use the new domain 2024-06-24 05:43:40 -07:00
Gabriel Luiz Freitas Almeida
ef1e70d151 style: run prettier 2024-06-24 05:05:35 -07:00
ogabrielluiz
321ef411e5 Apply Prettier formatting 2024-06-24 04:38:39 -07:00
Lucas Oliveira
3f22a78c5a Fixed beta 2024-06-24 04:38:39 -07:00
anovazzi1
e71a63432d added beta foreground soft color 2024-06-24 04:38:39 -07:00
anovazzi1
4bd09b925e Apply Prettier formatting 2024-06-24 04:38:39 -07:00
anovazzi1
6ceb19b9dd feat: Add beta label to Experimental parent disclosure title 2024-06-24 04:38:39 -07:00
anovazzi1
b8581581ea Apply Prettier formatting 2024-06-24 04:28:48 -07:00
anovazzi1
07de1d6674 add warning to components with old codes 2024-06-24 04:28:48 -07:00
Nicolò Boschi
8f31291d97 fixes and refactory 2024-06-24 04:04:36 -07:00
anovazzi1
f6cc61053a Apply Prettier formatting 2024-06-23 18:40:09 -07:00
anovazzi1
6201035891 update getHealth function to work with stop button 2024-06-23 18:40:09 -07:00
cristhianzl
870193d595 🐛 (sideBarFolderButtons): prevent unnecessary folder name updates on blur 2024-06-23 18:39:51 -07:00
Gabriel Luiz Freitas Almeida
13d53a8533 refactor: Update GenericNode and related hooks to handle component type
This commit updates the GenericNode component and its related hooks to handle the component type. The code changes in the index.tsx file of the GenericNode directory include modifying the updateNodeCode function to accept an additional "type" parameter. The handleNodeClass function in the use-handle-node-class.tsx file has also been updated to handle the "type" parameter. These changes ensure that the GenericNode component can correctly handle different types of components and update the node code accordingly.
2024-06-23 15:25:13 -07:00
lucaseduoli
d07c2a6128 Apply Prettier formatting 2024-06-23 15:24:25 -07:00
Lucas Oliveira
b42d340787 Changed naming of some projects 2024-06-23 15:24:25 -07:00
lucaseduoli
1e1652280c Apply Prettier formatting 2024-06-23 15:24:25 -07:00
Lucas Oliveira
a8c474588c Removed markdown to not cause problems 2024-06-23 15:24:25 -07:00
cristhianzl
d4080b81f9 💄 (paginatorComponent): update button styles to include fixed height and width
 (paginatorComponent): add size prop to buttons for consistent styling
2024-06-23 15:21:26 -07:00
cristhianzl
4dd64e486b 💄 (paginatorComponent): remove fixed height and width from paginator buttons for better responsiveness 2024-06-23 15:21:26 -07:00
Gabriel Luiz Freitas Almeida
c06227e7d0 refactor: Simplify getJsApiCode utility function
Simplify the getJsApiCode utility function in the get-js-api-code.tsx file. The unnecessary replacement of JavaScript boolean literals has been removed, improving code readability and maintainability.
2024-06-23 12:00:48 -07:00
Gabriel Luiz Freitas Almeida
590ab5135e refactor: Update CodeTabsComponent to handle additional tabs
This commit updates the CodeTabsComponent to handle an additional tab in the code tabs display. The previous implementation had a condition that checked if the active tab index was less than 4, but it has been updated to check if the active tab index is less than 5. This change ensures that the component can handle the new tab and display the corresponding content correctly. The code has been modified in the index.tsx file of the CodeTabsComponent directory.
2024-06-23 12:00:48 -07:00
Gabriel Luiz Freitas Almeida
cdbf1a62df refactor: Add getJsApiCode utility function for generating JavaScript code
This commit adds a new utility function called getJsApiCode to the apiModal/utils/get-js-api-code.tsx file. The function generates JavaScript code for interfacing with an API using the LangflowClient class. It takes several parameters including the flowId, isAuth, tweaksBuildedObject, and endpointName. The function constructs a LangflowClient instance and defines methods for making API requests, handling streams, and running flows. It also includes a main function that demonstrates how to use the LangflowClient to initiate a session and handle stream updates. This utility function improves code organization and reusability.
2024-06-23 12:00:48 -07:00
ogabrielluiz
86f8b3e945 Apply Prettier formatting 2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
8f2232575d refactor: Handle error updating Component code in GenericNode
When updating the Component code in GenericNode, handle any errors that occur. If an error occurs, display an error message with instructions to report the issue on Discord or GitHub. This improves the error handling and user experience when updating the Component code.
2024-06-22 17:39:37 -07:00
Gabriel Luiz Freitas Almeida
f4517b250e refactor: remove Prompt from ignored components list 2024-06-22 17:39:37 -07:00
ogabrielluiz
0f615e0b32 Apply Prettier formatting 2024-06-22 12:25:28 -07:00
anovazzi1
8e0b6cdf68 Apply Prettier formatting 2024-06-22 12:25:28 -07:00
anovazzi1
73c43ee529 refactor: Update editable prop in MessagesPage component 2024-06-22 12:25:28 -07:00
anovazzi1
cd02755f7d refactor: Update TextModal to use TextEditorArea for text input 2024-06-22 12:25:28 -07:00
anovazzi1
370f2dff6b refactor: Update TextModal to use TextEditorArea for text input 2024-06-22 12:25:28 -07:00
anovazzi1
eebaea3788 fix refresh on App 2024-06-22 12:25:28 -07:00