-
Notifications
You must be signed in to change notification settings - Fork 35
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
Correct alias to displayName #21
Conversation
src/DataSource.ts
Outdated
@@ -73,7 +76,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> { | |||
payload = payload.replace(/\$timeFrom/g, range.from.valueOf().toString()); | |||
payload = payload.replace(/\$timeTo/g, range.to.valueOf().toString()); | |||
} | |||
payload = getTemplateSrv().replace(payload, scopedVars); | |||
payload = this.templateSrv.replace(payload, scopedVars); |
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.
getTemplateSrv()
is the new, documented way to access the current templateSrv
for variable interpolation... https://grafana.com/docs/grafana/latest/developers/plugins/add-support-for-variables/#interpolate-variables-in-data-source-plugins
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 to complete that thought, if you encountered an error trying to import that from @grafana/runtime
you probably don't have the latest version installed.
My demo site is running Grafana 7.0.3 and the v1.1.1-grafana7 release, which is the last commit on the grafana-7.0 branch.
One could certainly make that argument, but I'm lazy. :)
Yes, there's still some issue with release builds, that I haven't had more time to dig into. |
Oh, I realized I didn't have the runtime package installed, so a simple So now the main thing that this changes is the Also, if you do end up merging this, I recommend a squash merge, since we don't need both these commits in the history. |
nice @retrodaredevil - I was able to use this on What I can't quite work out, is that if you run In any case, very cool! title did change to displayname, but the dependency need to be bumped like it is here to show that. |
I did note that the new API docs list
Yep I have #17 open for that. Seems nobody else has run into that issue, so it must be something simple. Any help would be appreciated! |
thanks @retzkek will take a look at the prod build issue too when I can. |
I made a few changes so that running 'yarn dev' now works for me and I've confirmed this works on Grafana 7. Before these changes, running 'yarn dev' failed.
Personally, I couldn't get the current grafana-7.0 branch to work on my Grafana 7.0.3 install, so I made these changes.
Also, is there a reason that all the "devDependencies" in package.json all have "next"? Shouldn't those be replaced with 7.0.3?
Running 'yarn dev' is still how you're supposed to compile this, right?