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: omit tenant selector in Metrics when only one exists #119882

Merged
merged 1 commit into from
Mar 8, 2024

Conversation

dhartunian
Copy link
Collaborator

The "Virtual Cluster" selector on the Metrics page should only be present when we have more than one tenant on the cluster. Previously, the code that decided this did not account for the fact that an additional "All" option was always present in the dropdown and mistook it for a tenant when counting.

Resolves: #114168
Epic: None

Release note: None

@dhartunian dhartunian requested review from a team and xinhaoz and removed request for a team March 4, 2024 19:54
@cockroach-teamcity
Copy link
Member

This change is Reviewable

tenantOptions: DropdownOption[],
): boolean => {
return (
tenantOptions.filter(
Copy link
Member

Choose a reason for hiding this comment

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

nit: You can also accomplish this with tenantOptions.some( t => t.label !== SYSTEM_TENANT_NAME && t.label !== ALL_TENANTS_OPTION.label) which won't have to operate on the entire array / create a new one.

Feel free to ignore though as this array is likely always quite small anyway.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thx! Done.

@dhartunian dhartunian force-pushed the tenant-dropdown-bugs branch from f1adf50 to 881f2d1 Compare March 6, 2024 18:58
The "Virtual Cluster" selector on the Metrics page should only be
present when we have more than one tenant on the cluster. Previously,
the code that decided this did not account for the fact that an
additional "All" option was always present in the dropdown and mistook
it for a tenant when counting.

Resolves: cockroachdb#114168
Epic: None

Release note: None
@dhartunian dhartunian force-pushed the tenant-dropdown-bugs branch from 881f2d1 to 4b97017 Compare March 8, 2024 15:20
@dhartunian
Copy link
Collaborator Author

TFTR

bors r=xinhaoz

@craig
Copy link
Contributor

craig bot commented Mar 8, 2024

Build succeeded:

@craig craig bot merged commit a4f061d into cockroachdb:master Mar 8, 2024
18 of 19 checks passed
@dhartunian
Copy link
Collaborator Author

blathers backport 23.2

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.

multitenant: Remove dropdown from DB Console when on a non-UA cluster
3 participants