-
Notifications
You must be signed in to change notification settings - Fork 47
MultiValueVariable: Fixes issue when value is all value but all value is not enabled #757
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
Conversation
ivanortegaalba
left a comment
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.
💯 Thanks Torkel for the quick fix
|
I tested locally, and the issue was solved 👍 |
| w: 12, | ||
| h: 8, | ||
| x: 0, | ||
| y: 2, | ||
| i: 'a', | ||
| w: 12, | ||
| h: 8, | ||
| x: 0, | ||
| y: 2, | ||
| i: 'a', | ||
| }, | ||
| { | ||
| w: 24, | ||
| h: 1, | ||
| x: 0, | ||
| y: 0, | ||
| i: 'row-a', | ||
| w: 24, | ||
| h: 1, | ||
| x: 0, | ||
| y: 0, | ||
| i: 'row-a', | ||
| }, | ||
| { | ||
| w: 12, | ||
| h: 8, | ||
| x: 0, | ||
| y: 10, | ||
| i: 'b', | ||
| } | ||
| ], | ||
| w: 12, | ||
| h: 8, | ||
| x: 0, | ||
| y: 10, | ||
| i: 'b', | ||
| }, | ||
| ], |
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.
@ivanortegaalba what version of prettier are you on?
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.
Using the one from node_modules 😅 it only happens to me with this file. Does the format for you differently? I assumed this file was unformatted
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.
What worries me is why this is not formatted with the pre-commit hook?
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.
If I run prettier over the whole project I get some files formatted:
modified: packages/scenes-app/.config/.eslintrc
modified: packages/scenes-app/.eslintrc
modified: packages/scenes-app/package.json
modified: packages/scenes-app/src/demos/verticalControlsLayoutDemo.tsx
modified: packages/scenes/src/components/layout/grid/SceneGridLayout.test.tsx
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.
So, I think it is an issue with only this file that was unformatted. You didn't touch it in your PR, I removed a console log from there that I saw when reviewing your tests
|
🚀 PR was released in |
# v4.24.4 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) #### Authors: 1 - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- # v4.24.3 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- # v4.24.2 (Wed May 29 2024) #### 🐛 Bug Fix - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- # v4.24.1 (Tue May 28 2024) #### 🐛 Bug Fix - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) #### Authors: 3 - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- # v4.24.0 (Mon May 27 2024) #### 🚀 Enhancement - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) #### Authors: 1 - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) ---
- `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) --- (cherry picked from commit c5ae0bb)
# v4.24.4 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [grafana#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) #### Authors: 1 - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- # v4.24.3 (Thu May 30 2024) #### 🐛 Bug Fix - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [grafana#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [grafana#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- # v4.24.2 (Wed May 29 2024) #### 🐛 Bug Fix - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [grafana#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) #### Authors: 2 - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- # v4.24.1 (Tue May 28 2024) #### 🐛 Bug Fix - Plugin.json: update schema reference URL in scenes-app [grafana#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [grafana#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [grafana#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) #### Authors: 3 - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- # v4.24.0 (Mon May 27 2024) #### 🚀 Enhancement - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [grafana#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) #### Authors: 1 - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) ---
Scenes: Update to latest 4.23.1 -> 4.24.4 (#88485) - `@grafana/scenes` - VizPanelRenderer: Emit SetPanelAttention event [#716](grafana/scenes#716) ([@tskarhed](https://github.com/tskarhed)) - Tobias Skarhed ([@tskarhed](https://github.com/tskarhed)) --- - `@grafana/scenes` - Macros: Resolve browser timezone for `$__timezone` [#759](grafana/scenes#759) ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Variables: Prioritize showing adhoc variable key and operator [#750](grafana/scenes#750) ([@oscarkilhed](https://github.com/oscarkilhed)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Oscar Kilhed ([@oscarkilhed](https://github.com/oscarkilhed)) --- - `@grafana/scenes` - MultiValueVariable: Fixes issue when value is all value but all value is not enabled [#757](grafana/scenes#757) ([@torkelo](https://github.com/torkelo) [@ivanortegaalba](https://github.com/ivanortegaalba)) - Ivan Ortega Alba ([@ivanortegaalba](https://github.com/ivanortegaalba)) - Torkel Ödegaard ([@torkelo](https://github.com/torkelo)) --- - Plugin.json: update schema reference URL in scenes-app [#754](grafana/scenes#754) ([@leventebalogh](https://github.com/leventebalogh)) - `@grafana/scenes` - Allow drag and dropping rows in valid states [#756](grafana/scenes#756) ([@mdvictor](https://github.com/mdvictor)) - fix: undefined check on RefreshPicker.autoOption [#751](grafana/scenes#751) ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Darren Janeczek ([@darrenjaneczek](https://github.com/darrenjaneczek)) - Levente Balogh ([@leventebalogh](https://github.com/leventebalogh)) - Victor Marin ([@mdvictor](https://github.com/mdvictor)) --- - `@grafana/scenes` - SceneFlexLayout: Min width/height option was ignored [#749](grafana/scenes#749) ([@edvard-falkskar](https://github.com/edvard-falkskar)) - Edvard Falkskär ([@edvard-falkskar](https://github.com/edvard-falkskar)) --- (cherry picked from commit c5ae0bb)
Adds logic for a special case when current value is the ALL_VALUE but the variable has not enabled all value, in this case we should just pick the first option.
Refactored the validation function a bit so we can simplify the long nested if/else statements and leverage early return pattern instead.
Fixes grafana/grafana#88391
📦 Published PR as canary version:
4.24.2--canary.757.9283024412.0✨ Test out this PR locally via: