Skip to content
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 template variables multi-select #855

Merged
merged 7 commits into from
May 30, 2024
Merged

Conversation

aangelisc
Copy link
Contributor

@aangelisc aangelisc commented Apr 11, 2024

Allow multi-select of template variables in the builder editor.

The problem here was that we were quoting the template variable values. I've tested this with multiple filters/group bys and the quoting doesn't seem necessary so I've removed it.

Let me know if you find any cases where this may not be the case!

Updated the docs to reflect that these variables will now work in the builder.

Also, a minor change to ensure there is a table selected in the query editor before we display the error asserting that there is no table schema.

Fixes #823

@aangelisc aangelisc added the enhancement New feature or request label Apr 11, 2024
@aangelisc aangelisc self-assigned this Apr 11, 2024
@aangelisc aangelisc requested a review from a team as a code owner April 11, 2024 17:16
Copy link

github-actions bot commented Apr 11, 2024

Use the following command to run this PR with Docker at http://localhost:3000:

docker run --rm -p 3000:3000 grafana/plugin-builds:a973fdd319a3656ca4a634702c8a8d006c4f4609pre

Copy link
Contributor

@bossinc bossinc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to work when I create constants without quotes, but I don't think we should be modifying template variable values in components. That should be done in applyTemplateVars function in datasource

adamyeats
adamyeats previously approved these changes Apr 18, 2024
@adamyeats adamyeats self-requested a review April 18, 2024 16:54
@aangelisc
Copy link
Contributor Author

This doesn't seem to work when I create constants without quotes, but I don't think we should be modifying template variable values in components. That should be done in applyTemplateVars function in datasource

Good callout @bossinc, I'll take a look at just implementing this in applyTemplateVariables (and how to handle quoted values).

@javisst
Copy link

javisst commented May 23, 2024

@aangelisc Do you have an update on this?

@aangelisc
Copy link
Contributor Author

Hi @javisst, not yet - I'm hoping to get to this next week.

bossinc
bossinc previously approved these changes May 30, 2024
@aangelisc aangelisc dismissed stale reviews from bossinc and adamyeats via f290b06 May 30, 2024 16:42
@aangelisc aangelisc requested a review from bossinc May 30, 2024 16:45
bossinc
bossinc previously approved these changes May 30, 2024
@aangelisc aangelisc merged commit 1656c05 into main May 30, 2024
8 checks passed
@aangelisc aangelisc deleted the andreas/fix-multi-select branch May 30, 2024 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Template variables in Builder
4 participants