fix: probe filtering behaviour and reset button #1066
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
We had a bug where you couldn't filter most probes correctly on the check list page. We were made aware of it in this escalation: https://github.com/grafana/support-escalations/issues/14671
We had unit and integration tests covering this problem but none that were comprehensive enough to catch the bug.
Whilst fixing this bug I discovered the reset button also wasn't working so put in a quick fix.
Solution
I've added the
displayName
property to our hard-coded probe meta data list. Upon reflection this is the safer way to handle this problem as it no longer transforms private probe names, which would likely want to restrict their display to the user-inputted name.Regardless, I've updated
camelCaseToSentence
topascalCaseToSentence
. It ensures that if the first letter is a capital it doesn't get prepended with a space and for values which already have a space it no longer double pads them.I've also changed the
reset
button so it directly alters the URL, which the state then passes down to the filters to update themselves accordingly. This isn't an ideal fix but as we have re-doing the check list page on the horizon I don't want to invest an unnecessary amount of time for something that is likely to change in some capacity in the future.