mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
better comments
This commit is contained in:
@@ -6,16 +6,15 @@ import { TextOptions, defaults } from './types';
|
||||
import { PanelModel } from 'app/features/dashboard/state';
|
||||
|
||||
import get from 'lodash/get';
|
||||
import cloneDeep from 'lodash/cloneDeep';
|
||||
|
||||
export const reactPanel = new ReactPanelPlugin<TextOptions>(TextPanel);
|
||||
|
||||
const validator = (model: PanelModel): TextOptions => {
|
||||
const options = model.options as TextOptions;
|
||||
if (!options) {
|
||||
const old = get(model, 'cachedPluginOptions.text');
|
||||
if (old) {
|
||||
return old;
|
||||
}
|
||||
// Use the same settings from an existing 'text' panel
|
||||
return cloneDeep(get(model, 'cachedPluginOptions.text'));
|
||||
}
|
||||
return options;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user