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

Process variables in data field #26

Merged
merged 3 commits into from
Feb 19, 2019
Merged

Process variables in data field #26

merged 3 commits into from
Feb 19, 2019

Conversation

simPod
Copy link
Owner

@simPod simPod commented Feb 12, 2019

Resolves #11

@simPod simPod added the enhancement New feature or request label Feb 12, 2019
@simPod simPod self-assigned this Feb 12, 2019
@simPod simPod requested a review from andig February 12, 2019 22:53
@simPod simPod force-pushed the process-vars-in-data branch 2 times, most recently from a5f5ac2 to 7f0765c Compare February 12, 2019 23:04
src/datasource.ts Outdated Show resolved Hide resolved
dist/README.md Outdated Show resolved Hide resolved
@simPod simPod merged commit 83e624a into next Feb 19, 2019
@simPod simPod deleted the process-vars-in-data branch February 19, 2019 12:22
@zak-b2c2
Copy link

🎆

@andig
Copy link
Collaborator

andig commented Feb 19, 2019

Do we need to do a release? Could look into it on the weekend...

@simPod
Copy link
Owner Author

simPod commented Feb 19, 2019

We can do it, will patch version be ok?

@andig
Copy link
Collaborator

andig commented Feb 19, 2019

Yes- we need to up version here and then pr in the plugin repo.

@simPod
Copy link
Owner Author

simPod commented Feb 20, 2019

Bumped version 008125d

@simPod
Copy link
Owner Author

simPod commented Feb 20, 2019

@zak-b2c2
Copy link

zak-b2c2 commented Mar 1, 2019

Out of interest, how would it work?
Assume I have drop-down list of aggregates "sum, avg, min, max" called aggr as the scoped variable
Would the below work?

 {"field": "${aggr}.column" }

@andig
Copy link
Collaborator

andig commented Mar 1, 2019

imho yes- but I really haven't tried it

@simPod
Copy link
Owner Author

simPod commented Mar 6, 2019

@zak-b2c2 this is now supported

image

without quotes

@simPod
Copy link
Owner Author

simPod commented Mar 6, 2019

However, I'm thinking that the quotes should be supported. The dashboard definition json is invalid this way.

@simPod
Copy link
Owner Author

simPod commented Mar 6, 2019

What do you think about this aaf76ed @andig @zak-b2c2 ?

It detects variables as strings "$variable", tries to replace it and if it succeeds, it strips trailing quotes from the replaced value and puts it back into data var.

Works for my usecase very well.

@andig
Copy link
Collaborator

andig commented Mar 6, 2019

LGTM! Its still a hack though as it will fail e.g. on "foo\"bar". I really wonder how the template services are really meant to be user (or if there is any proper documentation)...

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.

None yet

3 participants