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

AdHoc Filters: Allow custom value #670

Merged
merged 2 commits into from
Apr 3, 2024
Merged

Conversation

ashharrison90
Copy link
Contributor

@ashharrison90 ashharrison90 commented Apr 3, 2024

  • allow specifying a custom value as the adhoc filter value
  • adds a unit test to ensure we preserve this behaviour

image

Fixes grafana/grafana#85070

📦 Published PR as canary version: 4.3.0--canary.670.8538200720.0

✨ Test out this PR locally via:

npm install @grafana/scenes@4.3.0--canary.670.8538200720.0
# or 
yarn add @grafana/scenes@4.3.0--canary.670.8538200720.0

@ashharrison90 ashharrison90 added minor Increment the minor version when merged release Create a release when this pr is merged labels Apr 3, 2024
@ashharrison90 ashharrison90 self-assigned this Apr 3, 2024
@dprokop
Copy link
Member

dprokop commented Apr 3, 2024

Looks good. Question is if reloading the page with the custom value in URL will allow the value to be preserved? I think it's essential to make sure the custom value is persisted across reloads.

@ashharrison90
Copy link
Contributor Author

Looks good. Question is if reloading the page with the custom value in URL will allow the value to be preserved? I think it's essential to make sure the custom value is persisted across reloads.

yep, reloading the page correctly restores the custom value 👍

Copy link
Member

@dprokop dprokop left a comment

Choose a reason for hiding this comment

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

Works well for Prometheus :)

image image

I wonder - is there any way in the Select that would allow us to edit the manually entered filter value? I think it would be very helpful for scenarios when one makes a type.

@ashharrison90
Copy link
Contributor Author

@dprokop i don't think there's a prop on the component that would let us do that. i know exactly what you mean, that could get annoying. i'm sure we were discussing this in frontend platform the other day. i'll do some searching

@ashharrison90 ashharrison90 merged commit d3800ca into main Apr 3, 2024
3 checks passed
@ashharrison90 ashharrison90 deleted the ash/adhoc-filter-custom-value branch April 3, 2024 16:18
@grafanabot
Copy link
Contributor

🚀 PR was released in v4.3.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Increment the minor version when merged release Create a release when this pr is merged released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AdHocFilters: Allow providing a free text value
3 participants