Remove unused function in panel utils (#16986) (#17009)

* Remove unused function in panel utils

* remove another unused function
This commit is contained in:
Stacey Gammon 2018-03-07 15:09:25 -05:00 committed by GitHub
parent 74a4bc5c15
commit aec8390558
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,29 +1,7 @@
import { DEFAULT_PANEL_WIDTH, DEFAULT_PANEL_HEIGHT } from '../dashboard_constants';
import chrome from 'ui/chrome';
import _ from 'lodash';
export class PanelUtils {
/**
* Fills in default parameters where not specified.
* @param {PanelState} panel
*/
static initializeDefaults(panel) {
panel.gridData = panel.gridData || {};
panel.gridData.w = panel.gridData.w || DEFAULT_PANEL_WIDTH;
panel.gridData.h = panel.gridData.h || DEFAULT_PANEL_HEIGHT;
if (!panel.id) {
// In the interest of backwards comparability
if (panel.visId) {
panel.id = panel.visId;
panel.type = 'visualization';
delete panel.visId;
} else {
throw new Error('Missing object id on panel');
}
}
}
static convertOldPanelData(panel) {
panel.gridData = {
@ -43,16 +21,6 @@ export class PanelUtils {
return panel;
}
/**
* Returns the panel with the given panelIndex from the panels array (*NOT* the panel at the given index).
* @param panelIndex {number} - Note this is *NOT* the index of the panel in the panels array.
* panelIndex is really a panelId, but is called panelIndex for BWC reasons.
* @param panels {Array<Object>}
*/
static findPanelByPanelIndex(panelIndex, panels) {
return _.find(panels, (panel) => panel.panelIndex === panelIndex);
}
static initPanelIndexes(panels) {
// find the largest panelIndex in all the panels
let maxIndex = this.getMaxPanelIndex(panels);