-
Notifications
You must be signed in to change notification settings - Fork 356
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(Progress): use max parameter to scale value of progress bar #950
Conversation
PatternFly-React preview: https://950-pr-patternfly-react-patternfly.surge.sh |
Pull Request Test Coverage Report for Build 3389
💛 - Coveralls |
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 Katie. Could you update the "Progress Failure Without Measure" example while you are in the code. It does not match what is in core.
limitedValue = value < min ? min : value; | ||
limitedValue = limitedValue > max ? max : limitedValue; | ||
const scaledValue = | ||
max === 100 |
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.
can you put this in a function and add some test cases?
i tried out with value = 50, min = 50, max = 100 and got result 50 when I expected 0
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.
The min param still behaves as a minimum value for progress rather than a scaling factor as how max was changed. Should I also be changing how min works?
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.
Changing min parameter based on slack discussion.
2a64486
to
ff7760e
Compare
Previously, the max parameter acted as a hard limit to the progress value.
… core Changed logic to always show status icon if present regardless if label/value should be displayed. This matches behavior in pf-next.
Change scaling logic to account for both max and min, instead of only max.
ff7760e
to
66f0a70
Compare
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!
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
What: Change max parameter to control scaling of progress bar. Previously, it acted as a limit for the progress value.
Addresses issue: #945
Other notes: