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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
…pe hint for custom_component
…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
anovazzi1
approved these changes
Mar 27, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is related to the Global Variables functionality.
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.