mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
comment cleanup
This commit is contained in:
parent
09ba8cd5d3
commit
8cca611727
@ -27,10 +27,15 @@ export interface PanelEditorProps<T = any> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the existing model before the component is loaded
|
||||
* This is useful for fixing options as configuration changes
|
||||
* The object passed in is the panel model.... but not typed
|
||||
* since that is not in grafana ui
|
||||
* This function is called with the full panelModel before
|
||||
* the pluginPanel is constructed. This gives you an opportunity
|
||||
* to validate the panel settings before the panel loads.
|
||||
*
|
||||
* @param panelModel the whole panel object. including the configuration
|
||||
* saved for other panels
|
||||
*
|
||||
* @returns the validated panel options that will be passed into the
|
||||
* panel constructor
|
||||
*/
|
||||
export type PanelOptionsValidator<T = any> = (panelModel: any) => T;
|
||||
|
||||
|
@ -96,7 +96,8 @@ export class DashboardPanel extends PureComponent<Props, State> {
|
||||
}
|
||||
}
|
||||
|
||||
// This is be called before the plugin constructor, so the initial properties are valid
|
||||
// This is called before the plugin is added to the three,
|
||||
// it allows plugins to update options before loading
|
||||
validateOptions = (plugin: PanelPlugin, panel: PanelModel) => {
|
||||
const { reactPanel } = plugin.exports;
|
||||
if (reactPanel && reactPanel.optionsValidator) {
|
||||
|
Loading…
Reference in New Issue
Block a user