-
Notifications
You must be signed in to change notification settings - Fork 57
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
FrameMeta: add PreferredVisualizationPluginId field to API #705
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.
LGTM. @ifrost - does this mean, are we deprecating preferredVisualisationType
?
Also can we have set of typed aliases for common/mostly used plugin ids such as timeseries, stat etc to avoid typos in future?
type PluginId string
const (
PluginIdTimeSeriesPanel PluginId = "timeseries"
PluginIdStatPanel PluginId = "stat"
)
/// and then use as
PreferredVisualizationPluginID PluginId `json:"preferredVisualisationPluginId,omitempty"`
No, preferredVisualisationType is a more generic type, while preferredVisualisationPluginId is used to override the visualization type to a specific plugin. It's marked as alpha, we will see if we need both properties in the future.
Sounds like a good idea. I'm not sure how to guarantee that such an enum would stay up to date in case something changes or is being added, though. Maybe there should be a schema for it that would generate ts and go types? |
Usually we don't change plugin ids. So this won't be a problem. Also this accepts string as a fallback. ( for community plugins, string should work as a fallback ). Also this enum approach doesn't guarantee but adding one level of protection and adding convenience. Just an idea but not necessarily to go with this PR. |
We do not change plugin ids per se but we want to introduce aliases grafana/grafana#69874 and maybe UIDs for plugins internally as heads up to @yesoreyeram and @ifrost (fyi @wbrowne ) |
What this PR does / why we need it:
This will add the field '' to the FrameMeta type. This is linked to the PR I have open on grafana/grafana grafana/grafana#66982.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: