Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global variables implementation #1548

Merged
merged 91 commits into from Mar 27, 2024
Merged

Conversation

lucaseduoli
Copy link
Collaborator

This PR is related to the Global Variables functionality.

image
When clicking the Globe, it's possible to use global variables in any InputComponent.
When hovering an item, it's possible to delete it.
When clicking on Add New Variable, it's possible to add a new global variable.

igorrCarvalho and others added 30 commits February 5, 2024 11:42
…to fix missing import error

feat(App.tsx): add support for fetching global variables and setting them in the global variables store
feat(App.tsx): add useGlobalVariablesStore hook to access and set global variables in the component
feat(addNewVariableButton.tsx): create a new component for adding a new variable
feat(GlobalVariablesPage.tsx): create GlobalVariablesPage component to display and manage global variables
feat(routes.tsx): add route for GlobalVariablesPage component
feat(globalVariables.ts): update globalVariables store to include globalVariablesEntries array and modify setGlobalVariables function to set both globalVariables and globalVariablesEntries
feat(index.ts): add types for globalVariables store
… new global variables

feat(globalVariables.ts): add functions to add and remove global variables in the store
feat(globalVariables/index.ts): add types for the new functions in the global variables store
…er input field

This commit adds support for global variables in the parameter input field of the ParameterComponent. It imports the useGlobalVariablesStore hook from the globalVariables store and uses it to access the globalVariablesEntries state. It also imports the setNoticeData function from the alert store to display a notice when a global variable is used as a parameter value.

In the onChange event handler of the input field, the commit checks if the entered value is a global variable by comparing it with the globalVariablesEntries array. If it is a global variable, the commit sets the notice data to inform the user that the real value will be updated during runtime. Additionally, the commit marks the parameter as a global variable by setting the load_from_db property of the template object to true in the setNode function.
…splay global variables in dropdown

feat(codeTabsComponent): add support for global variables in InputComponent and DictComponent
feat(inputComponent): remove dependency on globalVariablesStore and use options prop instead
feat(editNodeModal): add support for global variables in InputComponent
…in template object

fix(codeTabsComponent): fix logic for setting load_from_db property in template object
fix(EditNodeModal): fix logic for setting load_from_db property in template object
fix(globalVariablesPage): fix logic for deleting global variable by id
feat(globalVariables): add getVariableId function to retrieve variable id by key
feat(types): add getVariableId function to GlobalVariablesStore type
…ctions and files, and add version module (#1570)

* Update function signature and import statements

* Refactor code and fix bugs

* Add new langflow helper functions and remove base model component

* Add new files and modify existing files

* Add version module and update imports

* Update packages include path in pyproject.toml

* Update Poetry version to 1.8.2
Copy link
Contributor

@anovazzi1 anovazzi1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lucaseduoli lucaseduoli merged commit 54fb1ba into zustand/io/migration Mar 27, 2024
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer python Pull requests that update Python code size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants