mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Timeseries Panel: Retain alerts when migrating from old graph (#36514)
Closes #36106
This commit is contained in:
parent
7df0010412
commit
8d66db09bf
@ -124,6 +124,7 @@ export interface PanelEditorProps<T = any> {
|
|||||||
export interface PanelModel<TOptions = any> {
|
export interface PanelModel<TOptions = any> {
|
||||||
/** ID of the panel within the current dashboard */
|
/** ID of the panel within the current dashboard */
|
||||||
id: number;
|
id: number;
|
||||||
|
alert?: any;
|
||||||
/** Panel options */
|
/** Panel options */
|
||||||
options: TOptions;
|
options: TOptions;
|
||||||
/** Field options configuration */
|
/** Field options configuration */
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
exports[`Graph Migrations legend with multiple values 1`] = `
|
exports[`Graph Migrations legend with multiple values 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -53,6 +54,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations legend with single value 1`] = `
|
exports[`Graph Migrations legend with single value 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -79,6 +81,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations legend without values 1`] = `
|
exports[`Graph Migrations legend without values 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -103,6 +106,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations preserves colors from series overrides 1`] = `
|
exports[`Graph Migrations preserves colors from series overrides 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -157,6 +161,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations preserves series overrides using a regex alias 1`] = `
|
exports[`Graph Migrations preserves series overrides using a regex alias 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -211,6 +216,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations simple bars 1`] = `
|
exports[`Graph Migrations simple bars 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -237,6 +243,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations stacking groups 1`] = `
|
exports[`Graph Migrations stacking groups 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -322,6 +329,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations stacking simple 1`] = `
|
exports[`Graph Migrations stacking simple 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -377,6 +385,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations stairscase 1`] = `
|
exports[`Graph Migrations stairscase 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -416,6 +425,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations stepped line 1`] = `
|
exports[`Graph Migrations stepped line 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
@ -463,6 +473,7 @@ Object {
|
|||||||
|
|
||||||
exports[`Graph Migrations twoYAxis 1`] = `
|
exports[`Graph Migrations twoYAxis 1`] = `
|
||||||
Object {
|
Object {
|
||||||
|
"alert": undefined,
|
||||||
"fieldConfig": Object {
|
"fieldConfig": Object {
|
||||||
"defaults": Object {
|
"defaults": Object {
|
||||||
"custom": Object {
|
"custom": Object {
|
||||||
|
@ -45,6 +45,7 @@ export const graphPanelChangedHandler: PanelTypeChangedHandler = (
|
|||||||
fieldConfig: prevFieldConfig,
|
fieldConfig: prevFieldConfig,
|
||||||
});
|
});
|
||||||
panel.fieldConfig = fieldConfig; // Mutates the incoming panel
|
panel.fieldConfig = fieldConfig; // Mutates the incoming panel
|
||||||
|
panel.alert = prevOptions.angular.alert;
|
||||||
return options;
|
return options;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user