Commit graph

2,427 commits

Author SHA1 Message Date
anovazzi1
a41cc95abb added security check to avoid errors on building empty flows 2023-06-12 20:26:56 -03:00
anovazzi1
62b0b28b7f start websocket from chat only after build 2023-06-12 20:23:52 -03:00
Lucas Oliveira
83e592d4d7 fixed routing, working perfectly 2023-06-12 20:15:07 -03:00
anovazzi1
f9cece1ece lock click on loading state of button 2023-06-12 20:10:40 -03:00
Lucas Oliveira
b45966051a fixed header to new logic 2023-06-12 19:23:34 -03:00
Lucas Oliveira
9408442191 Fixed logic to simplify transition to routes 2023-06-12 19:21:48 -03:00
Cristhian Zanforlin Lousa
7dfffd33e7 dark mode dropdown 2023-06-12 19:12:24 -03:00
Cristhian Zanforlin Lousa
a5d7683442 changing width dropdown 2023-06-12 19:04:59 -03:00
Cristhian Zanforlin Lousa
78ce80098d adjust dark mode and dropdown 2023-06-12 18:55:00 -03:00
anovazzi1
1fdf03c925 validating nodes before sending it to the backend 2023-06-12 18:30:53 -03:00
anovazzi1
72dea88f14 moved validateNodes function to utils 2023-06-12 18:20:52 -03:00
Lucas Oliveira
ceb9b1d155 Added flow id and routes logic 2023-06-12 18:19:05 -03:00
Gabriel Luiz Freitas Almeida
312e0c4834 🐛 fix(GenericNode): set validationStatus to null when relevantData is null
This change fixes a bug where the validationStatus state was not being set to null when relevantData was null. This caused the validationStatus to retain its previous value, which could lead to incorrect validation results being displayed.
2023-06-12 17:05:05 -03:00
Gabriel Luiz Freitas Almeida
de7b2c9f31 🔥 chore(chatComponent): remove unused imports and API call
The import for the postBuild function was removed as it was not being used in the BuildTrigger component. This improves the code's readability and maintainability.

🚀 feat(chatComponent): add useEffect hook to fetch build status and update state
An async function was added to fetch the build status of the flow and update the state of the isBuilt variable. This allows the component to display the correct state of the build trigger button.

👌 refactor(chatComponent): refactor useEffect hook to update isBuilt state when nodes change
The useEffect hook was refactored to update the isBuilt state when the nodes change. This ensures that the build trigger button is disabled when the nodes change, as the flow needs to be rebuilt before it can be triggered again.

🔥 chore(intComponent): remove console.log statement
The console.log statement was removed from the onKeyDown event listener in the IntComponent component. This improves the code's cleanliness and readability.
2023-06-12 17:04:19 -03:00
Gabriel Luiz Freitas Almeida
d381228b83 🚀 feat(API): add BuildStatusTypeAPI to API types and implement getBuildStatus function
The BuildStatusTypeAPI was added to the API types to support the new getBuildStatus function. The getBuildStatus function retrieves the build status of a flow by making a GET request to the server. This function is useful for updating the UI with the current status of a flow.
2023-06-12 17:03:54 -03:00
Gabriel Luiz Freitas Almeida
68e17384c8 🔧 chore(chatModal): extract getWebSocketUrl function to improve readability and maintainability
The getWebSocketUrl function was extracted to improve the readability and maintainability of the code. It takes the chatId and isDevelopment flag as parameters and returns the WebSocket URL based on the current environment. The function uses the window.location object to determine the protocol and host, and the chatEndpoint to construct the URL.
2023-06-12 17:03:36 -03:00
Gabriel Luiz Freitas Almeida
bc499b285d 🚀 feat(api): add BuildStatusTypeAPI to represent the status of a build
The BuildStatusTypeAPI is added to represent the status of a build. It contains a boolean value indicating whether the build was successful or not.
2023-06-12 17:03:22 -03:00
Cristhian Zanforlin Lousa
0dc8ca8682 bugfixes: darkmode and not saving file/text 2023-06-12 13:57:56 -03:00
Gabriel Luiz Freitas Almeida
64397d2830 🔨 refactor(buildTrigger): change allNodesValid to validationResults array and add finished variable to improve readability
🚀 feat(buildTrigger): add waiting for stream to finish and return validation results for each node
The allNodesValid variable has been changed to a validationResults array to store the validation results for each node. A finished variable has been added to improve readability and to wait for the stream to finish. The function now returns an array of validation results for each node.
2023-06-12 13:05:02 -03:00
Gabriel Luiz Freitas Almeida
806d815a10 feat(index.tsx): add support for streaming build process using EventSource
The commented out code for the /build/{client_id} endpoint has been removed as it is no longer needed. The new implementation uses the /build/init endpoint to initiate the build process and then establishes an SSE connection using EventSource to stream the build process. This allows for a more efficient and responsive build process as the client can receive updates in real-time.
🔥 chore(chat.py, index.tsx): remove commented out code for /build/{client_id} endpoint
2023-06-12 11:49:59 -03:00
Gabriel Luiz Freitas Almeida
4f4a0ff4c7 🔨 refactor(chatComponent): refactor handleBuild function to use async/await and extract constants to improve readability
🐛 fix(chatComponent): fix issue with progressEvent not being properly destructured
🚀 feat(chatComponent): add minimum loading time to improve user experience
The handleBuild function was refactored to use async/await and constants were extracted to improve readability. The issue with progressEvent not being properly destructured was fixed. A minimum loading time was added to improve user experience by ensuring that the loading spinner is displayed for at least a certain amount of time.
2023-06-12 09:44:12 -03:00
Gabriel Luiz Freitas Almeida
25f22ae88c 🔇 chore(frontend): comment out console.log statements
The console.log statements were commented out in the tabsContext.tsx, EditNodeModal/index.tsx, NodeToolbarComponent/index.tsx, and FlowPage/index.tsx files to remove unnecessary logging in the console.
2023-06-12 09:33:03 -03:00
Gabriel Luiz Freitas Almeida
68288be80e feat (GenericNode): replace validation with SSE validation 2023-06-12 09:31:43 -03:00
Gabriel Luiz Freitas Almeida
eaae1dda27 feat(chatComponent): add SSE context to update data in real-time
The handleBuild function has been refactored to process data in chunks instead of waiting for the entire response to be received. This improves the performance of the function and allows for real-time updates. The SSE context has been added to update the data in real-time as it is received.
🔨 refactor(chatComponent): refactor handleBuild function to process data in chunks
2023-06-12 09:31:01 -03:00
Gabriel Luiz Freitas Almeida
42d5a501bb 🚀 feat(App.tsx): add SSEProvider to App component
🎉 feat(SSEContext.tsx): add SSEContext and SSEProvider components to handle server-sent events
The SSEProvider component was added to the App component to provide the SSEContext to the TabsManagerComponent. The SSEContext component was also added to handle server-sent events. The SSEContext component provides a way to update the sseData state and to access the sseData state from any component that uses the useSSE hook.
2023-06-12 09:30:47 -03:00
Gabriel Luiz Freitas Almeida
5fe4ac6ffa 🔇 chore(frontend): comment out console.log statements
The console.log statements were commented out in the following files:
- src/frontend/src/components/intComponent/index.tsx
- src/frontend/src/contexts/tabsContext.tsx
- src/frontend/src/modals/EditNodeModal/index.tsx
- src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx
- src/frontend/src/pages/FlowPage/index.tsx

The console.log statements were not necessary and were removed to reduce noise in the console.
2023-06-12 07:05:00 -03:00
Gabriel Luiz Freitas Almeida
a65a88ca45 🐛 fix(vite.config.ts): update validate route to use regex pattern
The validate route was updated to use a regex pattern instead of a string pattern to match all routes that start with "/api/v1/validate/". This change ensures that all routes that match the pattern are correctly routed to the validate endpoint.
2023-06-12 07:03:16 -03:00
Gabriel Luiz Freitas Almeida
f88b14f33d 🚀 feat(chatComponent): add build trigger component to allow users to build a flow
 feat(chatComponent): add loading animation to build trigger component
The BuildTrigger component is added to the chatComponent to allow users to build a flow. The component is triggered by clicking on a button and sends a POST request to the server to build the flow. A loading animation is added to the component to indicate that the flow is being built. The postBuild function is added to the API controller to handle the POST request.
2023-06-11 18:09:17 -03:00
Gabriel Luiz Freitas Almeida
2c0a9aee95 🚸 chore(chatTrigger): add error message when chat is triggered before flow is built
 feat(chatComponent): add BuildTrigger component to check if flow is built before showing ChatTrigger component
The ChatTrigger component now checks if the flow is built before allowing the user to open the chat. If the flow is not built, an error message is displayed instead. The BuildTrigger component is added to check if the flow is built before showing the ChatTrigger component. This improves the user experience by preventing the user from opening the chat before the flow is built.
2023-06-11 18:08:52 -03:00
Gabriel Luiz Freitas Almeida
395af24101 🚀 chore(vite.config.ts): add build route to apiRoutes array
The build route was added to the apiRoutes array to allow the frontend to access the build files.
2023-06-11 18:08:35 -03:00
Gabriel Luiz Freitas Almeida
10fce79bc3 🐛 fix(App.tsx): replace fetch call with getVersion function call to retrieve app version
 feat(App.tsx): add getVersion function to retrieve app version from API
The fetch call to retrieve the app version has been replaced with a call to the getVersion function. This function retrieves the app version from the API. This change improves the code's readability and reduces the amount of code needed to retrieve the app version.

🐛 fix(GenericNode/index.tsx): replace fetch call with postValidateNode function call to validate node
 feat(GenericNode/index.tsx): add postValidateNode function to validate node via API
The fetch call to validate the node has been replaced with a call to the postValidateNode function. This function validates the node via the API. This change improves the code's readability and reduces the amount of code needed to validate the node.

🐛 fix(codeAreaModal/index.tsx): replace checkCode function call with postValidateCode function call to validate code
 feat(codeAreaModal/index.tsx): add postValidateCode function to validate code via API
The checkCode function call to validate the code has been replaced with a call to the postValidateCode function. This function validates the code via the API. This change improves the code's readability and reduces the amount of code needed to validate the code.
2023-06-11 12:17:16 -03:00
Gabriel Luiz Freitas Almeida
21440578a7 🔧 chore(API): add /api/v1/ prefix to API routes
 feat(API): add getVersion function to retrieve the version of the API
The API routes have been updated to include the /api/v1/ prefix to improve semantics and avoid conflicts with other routes. The getVersion function has been added to retrieve the version of the API.
2023-06-11 12:17:00 -03:00
Gabriel Luiz Freitas Almeida
09bd1093dd 🎨 style(constants.tsx): refactor getPythonApiCode, getCurlCode, and getPythonCode to separate functions
 feat(ApiModal): use getPythonApiCode and getCurlCode functions to generate python and curl code
 feat(cardComponent): add RenameLabel component to allow renaming of flow name and description
🐛 fix(cardComponent): fix CardDescription height to prevent overflow
The getPythonApiCode, getCurlCode, and getPythonCode functions were refactored into separate functions to improve code readability and maintainability. The ApiModal component now uses the getPythonApiCode and getCurlCode functions to generate the python and curl code. The CardComponent now has a RenameLabel component that allows renaming of the flow name and description. The CardDescription height was also fixed to prevent overflow.
2023-06-11 10:58:10 -03:00
Cristhian Zanforlin Lousa
74b8cbb224 dropdown float, placeholders and inputlist bug fix 2023-06-11 10:48:42 -03:00
Gabriel Luiz Freitas Almeida
445f4013c1 🎨 style(MainPage): add whitespace to button className
The whitespace was added to the button className to improve readability and consistency with the rest of the code.
2023-06-10 16:52:55 -03:00
Gabriel Luiz Freitas Almeida
a95d7d7f6a 🎨 style(cardComponent): update color of card background and icons
💄 style(cardComponent): update layout of card footer and remove unused code
The background color of the card component has been updated to a lighter shade of blue. The icons used for editing and deleting a flow have been updated to use the Lucide icon library. The layout of the card footer has been updated to align the content to the right and remove unused code.
2023-06-10 16:52:30 -03:00
Gabriel Luiz Freitas Almeida
181df91500 🎨 style(menuBar): replace heroicons with lucide-react icons and refactor code to improve readability
 feat(menuBar): add support for custom emoji and color for each flow
This commit replaces the heroicons with lucide-react icons to improve the consistency of the icon set used in the application. The code has also been refactored to improve readability. Additionally, support for custom emoji and color for each flow has been added to improve the user experience.
2023-06-10 16:52:09 -03:00
Gabriel Luiz Freitas Almeida
99be4b5470 💄 style(ApiModal): add cURL code snippet to API modal
The flowName prop has been changed to a flow object to improve semantics and make the code more readable. The cURL code snippet has been added to the API modal to provide an alternative way to interact with the API.
🔨 refactor(ApiModal): change flowName prop to flow object to improve semantics
2023-06-10 16:50:23 -03:00
Gabriel Luiz Freitas Almeida
2f73fd9ca5 feat(tabsContext.tsx): add try-catch blocks to handle errors when processing flow data and add saveFlowToDatabase function to save new flows to the database
The tabs trigger border radius has been changed from rounded-sm to rounded-lg to improve the appearance of the tabs. Try-catch blocks have been added to handle errors when processing flow data to prevent the application from breaking. A new function, saveFlowToDatabase, has been added to save new flows to the database. This function is called when a new flow is created, and the ID counter is incremented after the flow is saved. The new flow is then added to the list of flows, and the tab index is set to the new flow.
🎨 style(ui/tabs.tsx): change tabs trigger border radius from rounded-sm to rounded-lg
2023-06-10 16:49:43 -03:00
Gabriel Luiz Freitas Almeida
c76ee24a78 🔨 refactor(API): replace axios with fetch for getVersion and getHealth functions
🔨 refactor(MainPage): remove handleSaveFlow prop from MenuBar component
🔨 refactor(MainPage): export MenuBar component as named export
The axios library is replaced with the fetch API for the getVersion and getHealth functions to reduce the bundle size and improve performance. The handleSaveFlow prop is removed from the MenuBar component as it is not used. The MenuBar component is now exported as a named export to improve code readability and maintainability.
2023-06-09 17:59:29 -03:00
Gabriel Luiz Freitas Almeida
61207db4da 🐛 fix(App.tsx): change fetch URL to relative path to fix incorrect API call
The fetch URL was incorrect and was calling the API with an absolute path instead of a relative path. This caused the API call to fail. The URL has been changed to a relative path to fix the issue.
2023-06-09 17:17:55 -03:00
Cristhian Zanforlin Lousa
ef1b19a6d3 Removing unnecessary prop 2023-06-09 16:43:10 -03:00
Cristhian Zanforlin Lousa
244fe5c123 Adjusted state of toggle buttons and inputComp 2023-06-09 16:41:34 -03:00
Gabriel Luiz Freitas Almeida
c30bc4f2e0 🔥 chore(frontend): remove @radix-ui/react-slot dependency
The @radix-ui/react-slot dependency was removed from the package.json file.
2023-06-09 15:52:48 -03:00
Gabriel Luiz Freitas Almeida
5c6c39eb49 🚀 feat(menuBar): create a new component to handle the menu bar in the MainPage
The new component MenuBar was created to handle the menu bar in the MainPage. It contains all the logic and UI elements related to the menu bar. The component receives props such as activeTab, setRename, rename, flows, tabIndex, and handleSaveFlow. The handleSaveFlow function was moved from the MainPage component to the MenuBar component. The code related to the menu bar was removed from the MainPage component and replaced by the MenuBar component.
2023-06-09 15:45:08 -03:00
Gabriel Luiz Freitas Almeida
80de5b19ea 🚀 feat(App.tsx): add getVersion function to fetch API version
🚀 feat(API/index.ts): add getVersion function to fetch API version
🚀 feat(cardComponent/index.tsx): add CardComponent to display flow data
🚀 feat(types/flow/index.ts): add FlowStyleType to represent flow styles
The getVersion function was added to fetch the version of the API. The CardComponent was added to display flow data. The FlowStyleType was added to represent flow styles.
2023-06-09 15:44:49 -03:00
Gabriel Luiz Freitas Almeida
79d258d7fa Merge remote-tracking branch 'origin/dev' into db 2023-06-09 14:51:18 -03:00
Gabriel Luiz Freitas Almeida
51ecc05563 🐛 fix(vite.config.ts): remove /api/v1 prefix from proxy target URL
 feat(vite.config.ts): add rewrite function to proxy configuration to add /api/v1 prefix to requests
The /api/v1 prefix was removed from the proxy target URL as it was already being added by the rewrite function. The rewrite function was added to the proxy configuration to add the /api/v1 prefix to requests, which is required by the backend API.

Fixes #458
2023-06-09 14:31:09 -03:00
Gabriel Luiz Freitas Almeida
b53b349c6b 🎨 style(cardComponent): add support for styling the flow card with an emoji and a color
 feat(MainPage): add error handling for adding and updating flows
🔨 refactor(MainPage): extract handleAddFlow and handleSave functions to improve readability
The FlowType now has an optional style property that can be used to style the flow card with an emoji and a color. The CardComponent now supports this feature. The MainPage now has error handling for adding and updating flows. The handleAddFlow and handleSave functions were extracted to improve readability.
2023-06-09 14:00:52 -03:00
Gabriel Luiz Freitas Almeida
9c71d99852 🚀 chore(vite.config.ts): add new routes to apiRoutes array
The new routes added to the apiRoutes array are "/flows_styles", "/flows_styles/" and "/flows_styles/*". These routes were added to allow the frontend to fetch the styles for the flows.
2023-06-09 13:59:02 -03:00