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

Bug 1840543: fix bug where quota gauge chart does not appear #5622

Merged
merged 1 commit into from Jun 1, 2020

Conversation

rhamilto
Copy link
Member

@rhamilto rhamilto commented May 28, 2020

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 of useRefWidth and hard code the size of the chart.

After:
Or9VSipZKB

[1] We probably want to explore fixing this issue as it has caused other bugs (see #5515).

@rhamilto rhamilto added this to the v4.6 milestone May 28, 2020
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels May 28, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1840543, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.6.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1840543: fix bug where quota gauge chart does not appear

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.

@rhamilto
Copy link
Member Author

/hold for 4.6

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 28, 2020
@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2020
@openshift-ci-robot
Copy link
Contributor

@rhamilto: This pull request references Bugzilla bug 1840543, which is invalid:

  • expected the bug to target the "4.5.0" release, but it targets "4.6.0" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

Bug 1840543: fix bug where quota gauge chart does not appear

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.

@spadgett
Copy link
Member

spadgett commented Jun 1, 2020

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 1, 2020
@spadgett
Copy link
Member

spadgett commented Jun 1, 2020

/bugzilla refresh

@openshift-ci-robot openshift-ci-robot added bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. and removed bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. labels Jun 1, 2020
@openshift-ci-robot
Copy link
Contributor

@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
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

/bugzilla refresh

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.

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 1, 2020
@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Member

@TheRealJon TheRealJon left a 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.

@spadgett
Copy link
Member

spadgett commented Jun 1, 2020

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

@openshift-merge-robot openshift-merge-robot merged commit 169bf18 into openshift:master Jun 1, 2020
@openshift-ci-robot
Copy link
Contributor

@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:

Bug 1840543: fix bug where quota gauge chart does not appear

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.

rawagner added a commit to rawagner/console that referenced this pull request Jun 1, 2020
This reverts commit 169bf18, reversing
changes made to 18b7916.
@rhamilto rhamilto deleted the bz1840543 branch June 8, 2020 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants