Commit graph

5,891 commits

Author SHA1 Message Date
cristhianzl
90853dda96 fix(modals): hardcode API key in StoreApiKeyModal to a specific value for testing purposes
refactor(pages): simplify conditional rendering logic in StorePage by removing unnecessary variables and error message display
2023-10-23 22:05:44 -03:00
anovazzi1
9f7fe0545c fix(StorePage/index.tsx): fix typo in import statement for getStoreComponents function
feat(StorePage/index.tsx): add support for saving flow store and searching for a component in API controller
feat(StorePage/index.tsx): add support for cloning a flow with parent and saving it to flow store
feat(StorePage/index.tsx): add support for adding a cloned flow to tabs context
feat(StorePage/index.tsx): add test button to test cloning and saving flow
feat(types/flow/index.ts): add parent property to FlowType to track parent flow
feat(utils/storeUtils.ts): add utility function to clone a flow with parent
2023-10-23 21:54:09 -03:00
Gabriel Luiz Freitas Almeida
88203b9178 🐛 fix(store.py): change method name from get to download in store_service to improve clarity and consistency 2023-10-23 21:29:53 -03:00
Gabriel Luiz Freitas Almeida
464ba02de8 🔄 refactor(schema.py): rename 'user_created' field to 'user_name' for better clarity and consistency 2023-10-23 21:25:20 -03:00
Gabriel Luiz Freitas Almeida
c695a4fd61 🔧 chore(store.py): add "user_created.name" and "is_component" fields to the list of fields returned by list_components() function
🔒 refactor(store.py): refactor the logic to handle the case when store_api_Key is not provided
2023-10-23 21:19:28 -03:00
Gabriel Luiz Freitas Almeida
6e8a98d6e3 🔧 chore(schema.py): add 'is_component' field to StoreComponentCreate schema for better data modeling and flexibility 2023-10-23 20:43:13 -03:00
Gabriel Luiz Freitas Almeida
b968fae19e 🔥 refactor(store.py): remove unused code and endpoint 'fork_component' to improve code readability and maintainability 2023-10-23 20:42:45 -03:00
cristhianzl
1033369795 Merge branch 'feature/store' of github.com:logspace-ai/langflow into feature/store 2023-10-23 20:17:32 -03:00
cristhianzl
6577d9c52c fix(authContext.tsx): remove unused hasApiKey state and function to improve code readability
feat(authContext.tsx): add storeApiKey function to store API key in cookies and update apiKey state
fix(StoreApiKeyModal/index.tsx): update usage of setApiKey to storeApiKey from AuthContext
feat(StorePage/index.tsx): add error handling for missing or invalid API key and display appropriate error message
2023-10-23 20:17:26 -03:00
cristhianzl
df267c065a feat(authContext.tsx): add support for storing and retrieving API key in the auth context
fix(StoreApiKeyModal/index.tsx): set API key in the auth context when it is saved
fix(StorePage/index.tsx): display a message to add an API key if it is not present in the auth context
fix(StorePage/index.tsx): display a loading message while fetching data if API key is present in the auth context
2023-10-23 20:17:10 -03:00
cristhianzl
0e9ce93f49 fix(extraSidebarComponent): add useMemo hook to improve performance by memoizing components
feat(extraSidebarComponent): add support for exporting flow and sharing flow functionalities
fix(StorePage): remove unnecessary useContext dependencies to improve performance
fix(StorePage): fix error message title
2023-10-23 19:47:27 -03:00
anovazzi1
b5c3892cf4 fix(ConfirmationModal/index.tsx): add missing dependencies to useEffect hook to prevent unnecessary re-renders
feat(ConfirmationModal/index.tsx): add support for open and onClose props to control modal visibility
fix(nodeToolbarComponent/index.tsx): import set function from lodash to fix missing set function error
feat(nodeToolbarComponent/index.tsx): add confirmation modal for sharing component functionality
fix(types/components/index.ts): add optional open and onClose props to ConfirmationModalType

The changes were made to improve the functionality and user experience of the ConfirmationModal and NodeToolbarComponent components.

In ConfirmationModal/index.tsx, the missing dependencies were added to the useEffect hook to prevent unnecessary re-renders. Additionally, support for the open and onClose props was added to control the visibility of the modal.

In NodeToolbarComponent/index.tsx, the set function was imported from lodash to fix the missing set function error. A confirmation modal was also added for the "Share" functionality, allowing users to share a component. The handleShareComponent function was implemented to handle the sharing logic.

In types/components/index.ts, the open and onClose props were added as optional to the ConfirmationModalType to reflect the changes made in the ConfirmationModal component.
2023-10-23 19:22:17 -03:00
anovazzi1
d8a460c610 fix(tabsContext.tsx): remove unnecessary id parameter from saveComponent function
fix(nodeToolbarComponent/index.tsx): remove unused imports and variables, update saveComponent logic to handle authentication and error handling
fix(types/tabs/index.ts): remove unnecessary id parameter from saveComponent function
2023-10-23 17:46:28 -03:00
anovazzi1
550e1ef8ef feat(extraSidebarComponent): add FlowType to saveFlow object to improve type safety and include flow name, id, and description in the saved flow data 2023-10-23 17:37:08 -03:00
anovazzi1
833d8ec30c fix(API/index.ts): update API endpoint from ${BASE_URL_API}store/ to ${BASE_URL_API}store/components/ to match backend API endpoint 2023-10-23 17:25:47 -03:00
Gabriel Luiz Freitas Almeida
ee0c11b4a6 🐛 fix(store.py): add missing import for FlowCreate and FlowRead models
 feat(store.py): add support for fetching specific fields when listing components
 feat(store.py): add support for forking components from the store
 feat(store.py): add support for searching components with various filters and sorting options
🐛 fix(schema.py): add missing parent field to ComponentResponse and StoreComponentCreate models
2023-10-23 17:15:19 -03:00
anovazzi1
25227db9f7 fix(tabsContext.tsx): remove unnecessary line that sets official property to false on component.node
fix(nodeToolbarComponent/index.tsx): fix downloadNode function call to pass a deep clone of data instead of the original data object
fix(reactflowUtils.ts): remove unnecessary line that sets official property to false on nodeData.node
2023-10-23 17:10:12 -03:00
anovazzi1
9ec4784afb fix(tabsContext.tsx): rename processDBData function to processFlows to improve semantics
fix(tabsContext.tsx): add skipUpdate parameter to processFlows function to control whether to update state or not
fix(tabsContext.tsx): remove setErrorData call in processFlows function to prevent unnecessary error logging
fix(tabsContext.tsx): remove unused error handling in processFlows function
fix(tabsContext.tsx): remove unused saveFlowToDatabase and addFlowToLocalState calls in deleteFlowFromDatabase function
fix(tabsContext.tsx): remove unused saveComponent function and addFlowToLocalState call in deleteComponent function
fix(tabsContext.tsx): remove unused increment variable in saveComponent function
fix(tabsContext.tsx): remove unused res parameter in saveComponent function
fix(tabsContext.tsx): remove unused console.error call in saveComponent function
feat(tabsContext.tsx): add support for skipping node update in processFlows function
feat(tabsContext.tsx): add support for removing component from data when deleting a flow if it is a custom component
feat(tabsContext.tsx): add support for adding new flow to local state and processing it in addFlowToLocalState function
feat(tabsContext.tsx): set component node official property to false in saveComponent function before saving to database
feat(tabsContext.tsx): remove addFlowToLocalState call and addFlow function call in saveComponent function
2023-10-23 17:03:27 -03:00
anovazzi1
433890504e fix(cardComponent): remove unused useContext import to improve code cleanliness
fix(tabsContext): remove commented out code for getting locally saved tabs data to improve code readability
fix(tabsContext): make removeFlow function asynchronous to ensure proper flow deletion from the database
fix(tabsContext): await the deleteFlowFromDatabase function before updating the flows state to prevent race conditions
fix(tabsContext): handle errors when saving flow to the database and log them to the console
fix(tabsContext): handle errors when deleting a component flow and log them to the console
fix(MainPage): remove unused removeFlow function import to improve code cleanliness
2023-10-23 15:53:55 -03:00
anovazzi1
3bc708fd61 feat(tabsContext.tsx): add 'is_component' property to the flow object in the TabsProvider component to indicate whether the flow is a component or not 2023-10-23 15:06:13 -03:00
anovazzi1
e5626cb247 fix(MainPage): fix filter condition in ComponentsComponent to correctly filter component flows 2023-10-23 14:31:05 -03:00
anovazzi1
863cc853c3 feat(routes.tsx): add redirect from root to /flows to improve user experience
In this commit, a redirect from the root path ("/") to the "/flows" path was added in the routes.tsx file. This change was made to improve the user experience by automatically redirecting users to the "/flows" page when they visit the root URL. The redirect is implemented using the useNavigate hook from the react-router-dom library.
2023-10-23 14:28:20 -03:00
Gabriel Luiz Freitas Almeida
f060155fe6 🔧 chore(utils.py): refactor setup_superuser and teardown_superuser functions to improve readability and remove unnecessary code duplication
🔧 chore(utils.py): update teardown_superuser function to only remove default superuser if AUTO_LOGIN is set to False
2023-10-20 18:25:42 -03:00
Lucas Oliveira
34c624ad82 Fixed problem on CommunityExamples 2023-10-20 18:08:44 -03:00
Lucas Oliveira
4f45bf8203 Added border on sidebar 2023-10-20 18:07:57 -03:00
Lucas Oliveira
bcfeaa6725 Added components screen at My Collection 2023-10-20 18:06:56 -03:00
anovazzi1
5ff4b8189d fix(extraSidebarComponent): add missing useRef import to fix compilation error
refactor(extraSidebarComponent): simplify handleSearchInput dependency array to only include 'data' variable
refactor(extraSidebarComponent): simplify official property condition in JSX element
2023-10-20 17:30:28 -03:00
anovazzi1
e91e24ee99 fix(tabsContext.tsx): remove unused imports and variables to improve code cleanliness
feat(tabsContext.tsx): add saveComponent and deleteComponent functions to TabsContext to handle saving and deleting custom components
fix(typesContext.tsx): remove saveComponent and deleteComponent functions from typesContext as they are now handled in TabsContext
fix(sideBarDraggableComponent/index.tsx): remove unused imports and variables to improve code cleanliness
feat(sideBarDraggableComponent/index.tsx): add deleteComponent function from TabsContext to handle deleting custom components
fix(nodeToolbarComponent/index.tsx): remove unused imports and variables to improve code cleanliness
feat(nodeToolbarComponent/index.tsx): add saveComponent function from TabsContext to handle saving custom components
fix(types/index.ts): import NodeDataType from flow to fix type error in TabsContextType
2023-10-20 16:37:28 -03:00
anovazzi1
40ee81144f refactor(typesContext.tsx): remove commented out code and unused variables to improve code readability and maintainability 2023-10-20 16:21:57 -03:00
anovazzi1
a41032def7 fix(tabsContext.tsx): fix issue with missing return statement causing incorrect data processing
fix(tabsContext.tsx): move setData function call outside of try-catch block to ensure it always executes
fix(MainPage/index.tsx): filter out component flows from the list of flows to be rendered
2023-10-20 12:36:48 -03:00
cristhianzl
315fe42e0b chore(API/index.ts): remove debugger statement for cleaner code 2023-10-20 11:32:25 -03:00
cristhianzl
551615f19e Merge branch 'feature/store' of github.com:logspace-ai/langflow into feature/store 2023-10-20 11:32:19 -03:00
cristhianzl
1a0d7bd3d4 feat(API): add new functions to interact with store components
- Added new functions `getStoreComponents`, `postStoreComponents`, `getComponent`, and `searchComponent` to the `API` controller module.
- `getStoreComponents` function retrieves a list of store components from the API.
- `postStoreComponents` function posts a new store component to the API.
- `getComponent` function retrieves a specific store component by its ID from the API.
- `searchComponent` function searches for store components based on various parameters such as query, page, limit, status, and tags.

fix(AdminPage): remove unnecessary line

- Removed an unnecessary line of code in the `AdminPage` component.

feat(StorePage): add functionality to get and search store components

- Added functionality to the `StorePage` component to get store components and perform a search.
- Added a new import statement for the `getStoreComponents` and `searchComponent` functions from the `API` controller module.
- Added a new state variable `searchData` to store the search results.
- Added a new state variable `inputText` to store the search input text.
- Added a new function `handleGetComponents` to fetch store components from the API.
- Added a new function `handleSearch` to perform a search based on the input text.
- Modified the `onChange` event handler of the search input to update the `inputText` state and trigger the search.
- Added a call to `handleGetComponents` in the `StoreApiKeyModal` component's `onCloseModal` event handler to refresh the store components after closing the modal.
2023-10-20 11:32:00 -03:00
Gabriel Luiz Freitas Almeida
09d4ee43cf 🔧 fix(store.py): remove duplicate list_components endpoint to avoid conflicts and improve code organization
 feat(store.py): add new list_components endpoint to retrieve a paginated list of components from the store
2023-10-20 11:26:08 -03:00
Gabriel Luiz Freitas Almeida
4c8550579d 🐛 fix(service.py): remove unnecessary try-except block and improve error handling in GET request 2023-10-20 11:08:38 -03:00
Gabriel Luiz Freitas Almeida
3b14cdbe9f 🐛 fix(service.py): catch all exceptions when raising ValueError in the search method to provide more informative error message 2023-10-20 11:06:16 -03:00
Gabriel Luiz Freitas Almeida
b7aa3274f8 🐛 fix(service.py): improve error handling in StoreService search method
 feat(service.py): change default sort parameter in StoreService search method to sort by likes in descending order
2023-10-20 11:02:38 -03:00
Gabriel Luiz Freitas Almeida
5667dd4540 🐛 fix(service.py): remove redundant assignment to params variable to fix incorrect behavior 2023-10-20 07:54:19 -03:00
Gabriel Luiz Freitas Almeida
51929df2b0 🐛 fix(service.py): remove redundant assignment to params variable
The redundant assignment to the params variable was removed to prevent overwriting the initial assignment.
2023-10-20 07:53:11 -03:00
Gabriel Luiz Freitas Almeida
4c6dc748a0 updates to colliding endpoints and search 2023-10-19 22:52:38 -03:00
Gabriel Luiz Freitas Almeida
09a1e332a5 update download method 2023-10-19 22:15:44 -03:00
Gabriel Luiz Freitas Almeida
54c2535b95 update schema for store endpoints 2023-10-19 22:14:45 -03:00
Gabriel Luiz Freitas Almeida
717334841f add guard in case api key is a str 2023-10-19 22:14:11 -03:00
Gabriel Luiz Freitas Almeida
062a709151 fix fields and likes count 2023-10-19 22:13:39 -03:00
Gabriel Luiz Freitas Almeida
a3bede0187 Add store schema 2023-10-19 22:12:49 -03:00
cristhianzl
405f74bef9 adding confirmation modal and save flow integratio 2023-10-19 21:27:29 -03:00
anovazzi1
79cdcaf19a fix(typesContext.tsx): update component type key to match newKey value for consistency and clarity 2023-10-19 20:09:14 -03:00
Gabriel Luiz Freitas Almeida
5aed852bb0 🔧 chore(service.py): add aggregation parameter to store service API call to retrieve count of likes for each component 2023-10-19 18:14:56 -03:00
Gabriel Luiz Freitas Almeida
242f741567 🔧 refactor(store.py): remove unused imports and variables to improve code readability and maintainability
🔒 chore(store.py): add dependency injection for store API key retrieval to improve code modularity and testability
🔒 chore(store.py): add error handling for missing store API key to provide better user feedback
🔒 chore(store.py): refactor create_component, read_component, and list_components to use store API key from dependency injection instead of user object
2023-10-19 18:14:56 -03:00
cristhianzl
91d0da573d Merge branch 'saveComponent' into feature/store 2023-10-19 18:08:52 -03:00