It's for variables with custom all value, when we interpolate a datalink with ${varName} we do not use the URL state for all value ($__all) as we do not really know if the link is targeting Grafana or an external system, so that will always interpolate to the real value, so if the value is All then it would be all values or if a custom value is defined (say .*) the URL value will be .* .
This new code (condition) will translate the URL value back to our meta All value ($__all) when it matches the custom all value.
📦 Published PR as canary version: 4.23.0--canary.738.9107827139.0
:sparkles: Test out this PR locally via:
```bash
npm install @grafana/scenes@4.23.0--canary.738.9107827139.0
# or
yarn add @grafana/scenes@4.23.0--canary.738.9107827139.0
```
Ran across this if statement in the old variable system a few weeks ago, https://github.com/grafana/grafana/blob/main/public/app/features/variables/state/actions.ts#L423 , I have had it on my todo to fix this in the new variable system.
The condition fixes this issue https://github.com/grafana/grafana/issues/28635
It's for variables with custom all value, when we interpolate a datalink with
${varName}
we do not use the URL state for all value ($__all
) as we do not really know if the link is targeting Grafana or an external system, so that will always interpolate to the real value, so if the value isAll
then it would be all values or if a custom value is defined (say.*
) the URL value will be.*
.This new code (condition) will translate the URL value back to our meta All value (
$__all
) when it matches the custom all value.📦 Published PR as canary version:
4.23.0--canary.738.9107827139.0
:sparkles: Test out this PR locally via: ```bash npm install @grafana/scenes@4.23.0--canary.738.9107827139.0 # or yarn add @grafana/scenes@4.23.0--canary.738.9107827139.0 ```