mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Turns on annotations in Graph and TimeSeries (#33402)
* Annotations: Turns on annotations in Graph and TimeSeries * Refactor: moves to notPersistedProperties
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
|||||||
EventBusSrv,
|
EventBusSrv,
|
||||||
FieldConfigSource,
|
FieldConfigSource,
|
||||||
PanelPlugin,
|
PanelPlugin,
|
||||||
|
PanelPluginDataSupport,
|
||||||
ScopedVars,
|
ScopedVars,
|
||||||
urlUtil,
|
urlUtil,
|
||||||
} from '@grafana/data';
|
} from '@grafana/data';
|
||||||
@@ -61,6 +62,7 @@ const notPersistedProperties: { [str: string]: boolean } = {
|
|||||||
editSourceId: true,
|
editSourceId: true,
|
||||||
configRev: true,
|
configRev: true,
|
||||||
getDisplayTitle: true,
|
getDisplayTitle: true,
|
||||||
|
dataSupport: true,
|
||||||
};
|
};
|
||||||
|
|
||||||
// For angular panels we need to clean up properties when changing type
|
// For angular panels we need to clean up properties when changing type
|
||||||
@@ -171,6 +173,7 @@ export class PanelModel implements DataConfigSource {
|
|||||||
declare cachedPluginOptions: Record<string, PanelOptionsCache>;
|
declare cachedPluginOptions: Record<string, PanelOptionsCache>;
|
||||||
legend?: { show: boolean; sort?: string; sortDesc?: boolean };
|
legend?: { show: boolean; sort?: string; sortDesc?: boolean };
|
||||||
plugin?: PanelPlugin;
|
plugin?: PanelPlugin;
|
||||||
|
dataSupport?: PanelPluginDataSupport;
|
||||||
|
|
||||||
private queryRunner?: PanelQueryRunner;
|
private queryRunner?: PanelQueryRunner;
|
||||||
|
|
||||||
@@ -354,6 +357,7 @@ export class PanelModel implements DataConfigSource {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.dataSupport = plugin.dataSupport;
|
||||||
this.applyPluginOptionDefaults(plugin, false);
|
this.applyPluginOptionDefaults(plugin, false);
|
||||||
this.resendLastResult();
|
this.resendLastResult();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export class PanelQueryRunner {
|
|||||||
constructor(dataConfigSource: DataConfigSource) {
|
constructor(dataConfigSource: DataConfigSource) {
|
||||||
this.subject = new ReplaySubject(1);
|
this.subject = new ReplaySubject(1);
|
||||||
this.dataConfigSource = dataConfigSource;
|
this.dataConfigSource = dataConfigSource;
|
||||||
|
this.dataSupport = this.dataConfigSource.dataSupport;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ export const plugin = new PanelPlugin<GraphPanelOptions, GraphFieldConfig>(null)
|
|||||||
FieldConfigProperty.Mappings,
|
FieldConfigProperty.Mappings,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
.setDataSupport({ annotations: true, alertStates: true })
|
||||||
.setMigrationHandler(graphPanelMigrationHandler);
|
.setMigrationHandler(graphPanelMigrationHandler);
|
||||||
|
|
||||||
// Use the angular ctrt rather than a react one
|
// Use the angular ctrt rather than a react one
|
||||||
|
|||||||
@@ -25,4 +25,5 @@ export const plugin = new PanelPlugin<Options, GraphFieldConfig>(TimeSeriesPanel
|
|||||||
});
|
});
|
||||||
|
|
||||||
addLegendOptions(builder);
|
addLegendOptions(builder);
|
||||||
});
|
})
|
||||||
|
.setDataSupport({ annotations: true });
|
||||||
|
|||||||
Reference in New Issue
Block a user