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

feat(Progress): use max parameter to scale value of progress bar #950

Merged
merged 4 commits into from
Nov 28, 2018

Conversation

kmcfaul
Copy link
Contributor

@kmcfaul kmcfaul commented Nov 21, 2018

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:

  • use floor of scaled value to prevent false 100% reports
  • change internal variable name to better represent behavior
  • update snapshot of Progress tests to reflect new behavior of max

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://950-pr-patternfly-react-patternfly.surge.sh

@coveralls
Copy link

coveralls commented Nov 21, 2018

Pull Request Test Coverage Report for Build 3389

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 81.726%

Totals Coverage Status
Change from base Build 3382: -0.02%
Covered Lines: 3965
Relevant Lines: 4581

💛 - Coveralls

Copy link
Contributor

@tlabaj tlabaj left a 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
Copy link
Collaborator

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

@kmcfaul kmcfaul force-pushed the progress-bar-improvements branch from 2a64486 to ff7760e Compare November 27, 2018 14:26
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.
@kmcfaul kmcfaul force-pushed the progress-bar-improvements branch from ff7760e to 66f0a70 Compare November 28, 2018 16:35
Copy link
Collaborator

@jschuler jschuler left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@tlabaj tlabaj left a 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
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants