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
Fix: Wrap value of multi variable in array when coming from URL #16992
Conversation
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.
Looks great!
expect(setValueMock).toHaveBeenCalledWith({ text: 'none', value: 'none' }); | ||
}); | ||
|
||
it('sets text and value even if it does not match any option and it is array', async () => { |
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.
@torkelo Sorry realised there was one more case that was kinda broken after you reviewed. This makes behaviour more consistent for custom values in URL as for single value it worked fine but for multiple custom values the text
would be empty.
* grafana/master: chore: remove x character in explore Dashboard: show refresh button in kiosk mode (grafana#17032) Devenv: Updated gauge test dashboard Chore: reintroduce gosec (grafana#17021) Gauge: tweaks to background color and height usage (grafana#17019) Feature: provide multildap server configuration (grafana#16914) (feat/explore): Support for new LogQL filtering syntax (grafana#16674) fix(explore): Prevent double querying for Prometheus and Loki (grafana#17004) Chore: No implict any fixes (grafana#17020) move log package to /infra (grafana#17023) Chore: Lowered implicit anys limit to 5386 Chore: Updated snapshot Select: Fixed isOpen issue Chore: Typescript no-implicit any fixes progress (grafana#17018) GraphPanel: show results for all SeriesData (grafana#16966) Fix: Wrap value of multi variable in array when coming from URL (grafana#16992)
* grafana/master: chore: remove x character in explore Dashboard: show refresh button in kiosk mode (grafana#17032) Devenv: Updated gauge test dashboard Chore: reintroduce gosec (grafana#17021) Gauge: tweaks to background color and height usage (grafana#17019) Feature: provide multildap server configuration (grafana#16914) (feat/explore): Support for new LogQL filtering syntax (grafana#16674) fix(explore): Prevent double querying for Prometheus and Loki (grafana#17004) Chore: No implict any fixes (grafana#17020) move log package to /infra (grafana#17023) Chore: Lowered implicit anys limit to 5386 Chore: Updated snapshot Select: Fixed isOpen issue Chore: Typescript no-implicit any fixes progress (grafana#17018) GraphPanel: show results for all SeriesData (grafana#16966) Fix: Wrap value of multi variable in array when coming from URL (grafana#16992)
* grafana/master: (30 commits) chore: remove x character in explore Dashboard: show refresh button in kiosk mode (grafana#17032) Devenv: Updated gauge test dashboard Chore: reintroduce gosec (grafana#17021) Gauge: tweaks to background color and height usage (grafana#17019) Feature: provide multildap server configuration (grafana#16914) (feat/explore): Support for new LogQL filtering syntax (grafana#16674) fix(explore): Prevent double querying for Prometheus and Loki (grafana#17004) Chore: No implict any fixes (grafana#17020) move log package to /infra (grafana#17023) Chore: Lowered implicit anys limit to 5386 Chore: Updated snapshot Select: Fixed isOpen issue Chore: Typescript no-implicit any fixes progress (grafana#17018) GraphPanel: show results for all SeriesData (grafana#16966) Fix: Wrap value of multi variable in array when coming from URL (grafana#16992) GettingStarted: add key and remove ng-class (grafana#17007) explore: add some extra time for angular query editors to update query (grafana#16955) Explore: Align Explore with Dashboards and Panels (grafana#16823) Explore: Fix empty result from datasource should render logs container (grafana#16999) ...
Closes: #15942
When multiple choice option is selected it is wrapped in array even if only one option is selected. When refreshed and taken from URL though it is set as single string instead. This wraps the value in array for those cases to normalize the behaviour.