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

ui: fix db page Node/Regions column rendering #105765

Merged
merged 1 commit into from
Jun 29, 2023

Conversation

xinhaoz
Copy link
Member

@xinhaoz xinhaoz commented Jun 28, 2023

Previously, the db page was not updating its columns if the
showNodeRegionsColumn prop changed. The db details page was
also not filtering out the regions column when desired.

Epic: none

Release note (bug fix): node/regions columns in db and db details
page should properly render. This column is hidden for tenants and
otherwise is shown for clusters with > 1 node.

@xinhaoz xinhaoz requested a review from a team June 28, 2023 21:23
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@xinhaoz xinhaoz requested a review from a team June 28, 2023 21:23
@xinhaoz xinhaoz added the backport-23.1.x Flags PRs that need to be backported to 23.1 label Jun 28, 2023
@xinhaoz xinhaoz marked this pull request as draft June 28, 2023 21:51
Previously, the db page was not updating its columns if the
`showNodeRegionsColumn` prop changed. The db details page was
also not filtering out the regions column when desired.

Epic: none

Release note (bug fix): node/regions columns in db and db details
page should properly render. This column is hidden for tenants and
otherwise is shown for clusters with > 1 node.
@xinhaoz xinhaoz changed the title ui: render Node/Regions column in db page based on region count ui: fix db page Node/Regions column rendering Jun 28, 2023
@xinhaoz xinhaoz marked this pull request as ready for review June 28, 2023 22:09
Copy link

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

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

:lgtm:

left a small note/question

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)


pkg/ui/workspaces/cluster-ui/src/databasesPage/databasesPage.tsx line 289 at r1 (raw file):

      prevProps.indexRecommendationsEnabled !==
        this.props.indexRecommendationsEnabled ||
      prevProps.showNodeRegionsColumn !== this.props.showNodeRegionsColumn

In principle, the change here is saying we should render this column if the # of nodes or regions changes to >1. Was this the case that was causing the cypress test to fail?

Copy link

@THardy98 THardy98 left a comment

Choose a reason for hiding this comment

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

oops meant to approve

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @xinhaoz)

@xinhaoz
Copy link
Member Author

xinhaoz commented Jun 29, 2023

In principle, the change here is saying we should render this column if the # of nodes or regions changes to >1. Was this the case that was causing the cypress test to fail?

This bit was the part causing tests to fail, yes, but the prop was always based on if we had more than 1 node. The issue here was that we weren't recomputing the columns when this prop changed -- in the cypress testing it just so happens that this is the first page we request the nodes info, so the prop flips when the request returns.

@xinhaoz
Copy link
Member Author

xinhaoz commented Jun 29, 2023

TFTR! Test failure unrelated to UI.
bors r+

@craig craig bot merged commit 2b66f95 into cockroachdb:master Jun 29, 2023
@craig
Copy link
Contributor

craig bot commented Jun 29, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants