mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Deprecation: Create explicit feature toggle to auto-migrate from graph panel (#79369)
This commit is contained in:
@@ -44,7 +44,7 @@ import { getTimeSrv } from '../services/TimeSrv';
|
||||
import { mergePanels, PanelMergeInfo } from '../utils/panelMerge';
|
||||
|
||||
import { DashboardMigrator } from './DashboardMigrator';
|
||||
import { PanelModel, autoMigrateAngular } from './PanelModel';
|
||||
import { PanelModel, autoMigrateAngular, explicitlyControlledMigrationPanels } from './PanelModel';
|
||||
import { TimeModel } from './TimeModel';
|
||||
import { deleteScopeVars, isOnTheSameGridRow } from './utils';
|
||||
|
||||
@@ -173,6 +173,12 @@ export class DashboardModel implements TimeModel {
|
||||
if (options?.autoMigrateOldPanels || !config.angularSupportEnabled || config.featureToggles.autoMigrateOldPanels) {
|
||||
for (const p of this.panelIterator()) {
|
||||
const newType = autoMigrateAngular[p.type];
|
||||
|
||||
// Skip explicitly controlled panels
|
||||
if (explicitlyControlledMigrationPanels.includes(p.type)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!p.autoMigrateFrom && newType) {
|
||||
p.autoMigrateFrom = p.type;
|
||||
p.type = newType;
|
||||
@@ -180,6 +186,21 @@ export class DashboardModel implements TimeModel {
|
||||
}
|
||||
}
|
||||
|
||||
// Explicit handling of graph -> time series migration (and eventually others)
|
||||
if (
|
||||
options?.autoMigrateOldPanels ||
|
||||
!config.angularSupportEnabled ||
|
||||
config.featureToggles.autoMigrateOldPanels ||
|
||||
config.featureToggles.autoMigrateGraphPanel
|
||||
) {
|
||||
for (const p of this.panelIterator()) {
|
||||
if (!p.autoMigrateFrom && p.type === 'graph') {
|
||||
p.autoMigrateFrom = p.type;
|
||||
p.type = 'timeseries';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.addBuiltInAnnotationQuery();
|
||||
this.sortPanelsByGridPos();
|
||||
this.panelsAffectedByVariableChange = null;
|
||||
|
||||
Reference in New Issue
Block a user