-
Notifications
You must be signed in to change notification settings - Fork 14
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
Line Filter: Add regex option to line filter #958
Line Filter: Add regex option to line filter #958
Conversation
…sitive-localstorage' into gtk-grafana/issues/952/line-filter-ui-updates__regex-option
super({ | ||
lineFilter: state?.lineFilter || '', | ||
caseSensitive: getLineFilterCase(false), | ||
caseSensitive, | ||
regex: getLineFilterRegex(false), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One issue with regex
is that we're setting it based on the stored preference and not the filter contents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's almost there. There is an issue to resolve when you share or reuse a URL, because the regex
state doesn't depend on the filter contents. Also it seems that even with regex turned out we're producing and interpreting regexes (the URL I open in incognito with the regex correctly produces log results).
Demo.mov
After seeing #956 and this PR, I think we should change the approach:
So we either produce regular expression queries (case sensitive or not), or plain text line filters. |
…sitive-localstorage' into gtk-grafana/issues/952/line-filter-ui-updates__regex-option
…2/line-filter-ui-updates__regex-option
Well **** if the filter is case sensitive && no regex, it has So we need to store the sensitive, regex options in the URL so shared URLs can be parsed appropriately. I disagree that making the options mutually exclusive is the solution (undesirable UX), but I agree that the options that are set should be pulled from the URL. The values stored in local storage should only set the default. We'll need to make sure that when we change the options we don't overwrite the users default for other queries (i.e. only when the user clicks on a button). Also when options change we'll need to convert and escape the value appropriately. Potential solutions:
I think the next step is a PoC with the ad-hoc solution. But yeah I guess that we should find out in the PoC: can we use the existing variables and renderers for line filters with case,regex options (and what provides best support for more options in the future, e.g. ip function, word wrap, other global regex options etc). |
Part of: #952
Parent branch: #956
Search for IPs:
case insensitive regex
case sensitive regex