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

AdHocFilter: Correctly show the label for a matching default key #645

Merged
merged 2 commits into from
Mar 15, 2024

Conversation

ashharrison90
Copy link
Contributor

Addresses grafana/grafana#83157 (comment)

in AdHocFilterRenderer the selected value for that select is constructed from the filter key here. this uses the toOption method which just takes the value and applies it as both the label and value

this changes the behaviour when defaultKeys are present to find the matching option from the list of defaultKeys, then uses toSelectableValue to convert it. that way both the label and internal value are preserved correctly

@ashharrison90 ashharrison90 added type/bug Something isn't working patch Increment the patch version when merged labels Mar 15, 2024
@ashharrison90 ashharrison90 self-assigned this Mar 15, 2024
@ashharrison90 ashharrison90 merged commit 41007b8 into main Mar 15, 2024
3 checks passed
@ashharrison90 ashharrison90 deleted the ash/adhoc-filter-default-key branch March 15, 2024 13:01
@ashharrison90 ashharrison90 added the release Create a release when this pr is merged label Mar 15, 2024
@grafanabot
Copy link
Contributor

🚀 PR was released in v3.13.3 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released type/bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants