-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
feat: add new input type - SliderComponent + tests #4144
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
…rt slider input type in parameter rendering 🔧 (parameterRenderComponent/index.tsx): import SliderComponent and add logic to render slider input type based on template data type
…ider functionality in the frontend, including support for dark mode, customizable labels, icons, and button options.
…he frontend to enhance user experience and interactivity.
… number values in addition to strings for better flexibility and type safety 📝 (index.ts): add new optional properties minLabel, maxLabel, minLabelIcon, maxLabelIcon, sliderButtons, and sliderButtonsOptions to FloatComponentType for enhanced customization options
…de readability and add support for different slider input configurations.
…th value, disabled state, onChange function, and range specification. Add sliderInput flag to FloatComponentType to indicate the presence of a slider input.
…ionality to ensure users can interact with the slider input and perform various actions on the page.
…e input classes ✨ (inputs/input_mixin.py): Introduce SliderMixin class to handle slider input type in the application
…h slider functionality in language flow inputs.
…io module for handling slider input fields.
…gent string for better browser compatibility handling 📝 (sliderComponent.spec.ts): Add additional functionality to handle slider input based on user agent OS information 📝 (sliderComponent.spec.ts): Update code to replace FloatInput with SliderInput and add additional input options for slider customization 📝 (sliderComponent.spec.ts): Add new test cases and functions for mutual validation and slider movement in the UI
…alue to ensure value falls within specified min and max range
…or max value based on input value, min, and max to improve code readability and maintainability ♻️ (sliderComponent/index.tsx): Refactor code to use the new utility function to calculate valueAsNumber based on input value, min, and max instead of directly converting the value to a number and setting step afterwards. This improves code clarity and maintainability.
…ist of strings instead of a list of dictionaries to simplify the data structure and improve readability
…LOR_BACKGROUND, DARK_COLOR_TEXT, LIGHT_COLOR_BACKGROUND, and LIGHT_COLOR_TEXT for better readability and maintainability 🐛 (sliderComponent/index.tsx): fix sliderButtons default value to be true instead of false for consistency and expected behavior ♻️ (sliderComponent/index.tsx): refactor code to use the newly added constants for dark and light colors instead of hardcoding values
…orted types in LANGFLOW_SUPPORTED_TYPES for frontend functionality.
…erRenderComponent and SliderComponent 📝 (frontend): update SliderComponent to use default slider buttons options if none provided 📝 (frontend): update SliderComponentType to use 'id' instead of 'value' for slider buttons options
…n_label_icon, and max_label_icon in SliderMixin class 🔧 (index.tsx): refactor SliderComponent to use constants for default labels and icons, and ensure sliderButtonsOptions is properly set when sliderButtons is true
dosubot
bot
added
size:XL
This PR changes 500-999 lines, ignoring generated files.
enhancement
New feature or request
labels
Oct 14, 2024
Cristhianzl
changed the title
feat: add new input type - SliderComponent
feat: add new input type - SliderComponent + TESTS
Oct 14, 2024
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Oct 14, 2024
anovazzi1
previously requested changes
Oct 15, 2024
…ther string[] or number[] for better type safety and clarity
… into cz/slider-component
lucaseduoli
approved these changes
Oct 15, 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.
Looks good!
ogabrielluiz
changed the title
feat: add new input type - SliderComponent + TESTS
feat: add new input type - SliderComponent + tests
Oct 16, 2024
github-actions
bot
added
enhancement
New feature or request
and removed
enhancement
New feature or request
labels
Oct 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
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 introduces a new input type, SliderComponent, designed to provide a more interactive way for users to input numerical values by sliding a handle along a defined range.
Changes: