refactor: add flow and upload flow functionality (#3200)

* Removed unused function and fixed tags initial value

* Added post save flow

* Added update flow patch

* removed unused import

* created useAddFlow hook to substitute AddFlow function on flowsManager store

* fixed post save flow to handle endpoint name as undefined

* Fixed add flow hook to use post save flow mutation

* removed unused  line

* changed addFlow to use hook in all components that use addFlow

* Removed unused code

* removed addFlow of useDuplicateFlows call

* made newProject default as true

* removed unused variables from addFlow

* fixed url of requests of flows

* passed functions directly

* fix app to display loading on top of the router

* fixed promise of addFlow

* Added upload flow hook with a lot of modularity

* Fixed addFlow naming

* Added helper functions for file uploading

* Changed upload flow to use helper functions

* removed refresh on post

* changed paste function to handle when chatinput node exists on paste

* Used helper function to create input on FileInput

* Used helper function to create input on InputFileComponent

* Used helper function to create input on folder upload, and used uploadFlow hook

* used uploadFlow hook on dropdown options

* used addFlow instead of addComponent on node toolbar

* changed upload flow on headerComponent to use hook

* Changed pageComponent to use uploadFlow hook

* removed useFileDrop dependency

* Fixed onFileDrop to use uploadFlow

* removed useDropdown dependency

* removed unused add and upload functions from flowsManagerStore

* Clean flows and refetch when flow change, added loader when is fetching

* Changed loading to the useQuery isPending

* changed post to add flow

* fixed error when uploading other thing that is not a JSON not appearing

* changed useAddFlow to handle empty params too

* Fixed loading every time we switch tabs

* Fixed unnecessary list and !

* Fixed reference bug

* Inserted cloneDeep to prevent reference bugs

* Fixed tests of drag and drop

* Fixed flows not being refreshed when uploading

* [autofix.ci] apply automated fixes

* fixed folders test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Lucas Oliveira 2024-08-06 18:52:47 -03:00 • committed by GitHub
commit 4d66bf351d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 543 additions and 569 deletions

View file

@ -43,7 +43,7 @@ test.describe("drag and drop test", () => {
// Now dispatch
await page.dispatchEvent(
'//*[@id="root"]/div/div[1]/div[2]/div[3]/div/div',
'//*[@id="root"]/div/div[2]/div[2]/div[3]/div',
"drop",
{
dataTransfer,

View file

@ -77,7 +77,7 @@ test("add folder by drag and drop", async ({ page }) => {
// Wait for the target element to be available before evaluation
await page.waitForSelector(
'//*[@id="root"]/div/div[1]/div[2]/div[3]/aside/nav/div/div[2]',
'//*[@id="root"]/div/div[2]/div[2]/div[3]/aside/nav/div/div[2]',
);
// Create the DataTransfer and File
@ -93,7 +93,7 @@ test("add folder by drag and drop", async ({ page }) => {
// Now dispatch
await page.dispatchEvent(
'//*[@id="root"]/div/div[1]/div[2]/div[3]/aside/nav/div/div[2]',
'//*[@id="root"]/div/div[2]/div[2]/div[3]/aside/nav/div/div[2]',
"drop",
{
dataTransfer,