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
Bug 1840543: fix bug where quota gauge chart does not appear #5622
Conversation
@rhamilto: This pull request references Bugzilla bug 1840543, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold for 4.6 |
@rhamilto: This pull request references Bugzilla bug 1840543, which is invalid:
Comment In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold cancel |
/bugzilla refresh |
@spadgett: This pull request references Bugzilla bug 1840543, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhamilto, spadgett The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
I feel like using a static size here just addresses one manifestation of the larger issue with the useRefWidth
hook. We should probably either open a follow on bug to track the issue with that hook, or figure out a solution here.
@kyoto pointed out that the issue with the useRefWidth
hook started when it was updated in #4841. The only thing that changed there is that we default to 0 when ref?.current?.clientWidth
is undefined. What I think is happening is that having an explicit 0
is probably changing the way the underlying PF chart component is handling it. In other words, the PF chart component was providing a default width/height when the corresponding props were undefined, but now that we explicitly set them to 0, we don't get that fallback. So, I think that we either need to allow useRefWidth
to return an undefined
width, or add our own mechanism for providing a default width other than 0 when ref?.current?.clientWidth === undefined
.
This sounds likely, cc @rawagner |
@rhamilto: All pull requests linked via external trackers have merged: openshift/console#5622. Bugzilla bug 1840543 has been moved to the MODIFIED state. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1840543
It appears
useRefWidth
requires a second render of the component utilizing it in order to work correctly [1]. In the case of this bug, a second render may not occur (the bug is easily reproduced when creating a new quota resource). Since the size of<GaugeChart>
does not change with the layout, the simplest fix is to simply remove the use ofuseRefWidth
and hard code the size of the chart.After:
[1] We probably want to explore fixing this issue as it has caused other bugs (see #5515).