-
Notifications
You must be signed in to change notification settings - Fork 32
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
Create plugin: Update data source templates #836
Conversation
@@ -79,7 +79,7 @@ export function QueryEditor({ query, onChange, onRunQuery }: Props) { | |||
const { upperLimit, lowerLimit, tickInterval } = query; | |||
|
|||
return ( | |||
<div className="gf-form"> | |||
<> |
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.
Could potentially use the new Box
component here, but it does not change appearance so don't think we need it.
applyTemplateVariables(query: MyQuery, scopedVars: ScopedVars): Record<string, any> { | ||
return { | ||
...query, | ||
queryText: getTemplateSrv().replace(query.queryText, 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.
Regarding scoped variables...currently the ds template for plugin.json
doesn't specify any query options. Should we skip passing the scopredVars variable to getTemplateSrv().replace
?
<div className="gf-form-group"> | ||
<InlineField label="Path" labelWidth={12}> | ||
<> | ||
<InlineField label="Path" labelWidth={14} interactive tooltip={'Json field returned to frontend'}> |
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.
Re label width: Opened a PR in Grafana to increase the width of the name field to 14. That way we at least give the plugin authors a chance to align field width across the entire page.
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.
LGTM! I think there are some more changes we can do to the config editor but lets do that in a follow up PR. Great work on this!
🚀 PR was released in |
What this PR does / why we need it:
Was initially going to replace the usage of
gf-
classnames in forms, but found some more low hanging fruits in the data source templates that I'm fixing.Which issue(s) this PR fixes:
Fixes #782
Special notes for your reviewer:
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
npm install @grafana/create-plugin@4.4.0-canary.836.aa6cb3b.0 npm install @grafana/plugin-e2e@0.24.0-canary.836.aa6cb3b.0 # or yarn add @grafana/create-plugin@4.4.0-canary.836.aa6cb3b.0 yarn add @grafana/plugin-e2e@0.24.0-canary.836.aa6cb3b.0