grafana/public/app
yenalsnavaj f830d8772a
Variables: Adds named capture groups to variable regex (#28625)
* Dashboard: Add named capture groups to variable query regex

Variable query regex are able to use 'text' and 'value' named capture
groups to allow for separate display text to be extracted from the
query result. e.g.

Using a regex of /foo="(?<text>[^"]+)|bar="(?<value>[^"]+)/g on a query
result of metric{foo="FOO", bar="BAR"} would result in the variable
value being set to 'BAR' but display text being set to 'FOO'

Resolves #21076

* Improve regex capture group documentation

* Update docs/sources/variables/filter-variables-with-regex.md

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>

* Use text capture if value capture does not match

This is to keep the behaviour consistent with the current behavior. See
discussion https://github.com/grafana/grafana/pull/28625/files#r516490942

* Improve regex field placeholder and tooltip message

To make the feature more discoverable to users the place holder example
now includes the named capture groups. The tool tip message also
includes a reference and link to the documentation.

Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
2020-11-04 09:31:38 +01:00
..
core Events: Remove unused or unnecessary events (#28783) 2020-11-03 15:29:43 +01:00
features Variables: Adds named capture groups to variable regex (#28625) 2020-11-04 09:31:38 +01:00
partials Migrate: Error page (404) (#26010) 2020-07-03 08:53:54 +02:00
plugins Graph: Fixes event emit function error (#28795) 2020-11-03 21:43:32 +01:00
routes Events: Remove unused or unnecessary events (#28783) 2020-11-03 15:29:43 +01:00
store Redux: Added config to redux development middlewares that checks for mutations and serializability (#23492) 2020-04-10 10:08:42 +02:00
types Events: Remove unused or unnecessary events (#28783) 2020-11-03 15:29:43 +01:00
app.ts Events: Remove unused or unnecessary events (#28783) 2020-11-03 15:29:43 +01:00
dev.ts React: Add why-did-you-render dev extension to better see what components re-render and why (in console) (#23455) 2020-04-09 19:44:05 +02:00
index.ts Echo: mechanism for collecting custom events lazily (#20365) 2019-12-05 08:30:39 +01:00