PanelEditor: Fixed issue with PanelModel change plugin type (#23949)

This commit is contained in:
Torkel Ödegaard 2020-04-27 17:32:35 +02:00 committed by GitHub
parent 76650e60e4
commit 458f6bdb87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -214,10 +214,15 @@ describe('PanelModel', () => {
});
});
model.editSourceId = 1001;
model.changePlugin(newPlugin);
model.alert = { id: 2 };
});
it('should keep editSourceId', () => {
expect(model.editSourceId).toBe(1001);
});
it('should apply next panel option defaults', () => {
expect(model.getOptions().showThresholdLabels).toBeFalsy();
expect(model.getOptions().showThresholds).toBeUndefined();

View File

@ -84,6 +84,7 @@ const mustKeepProps: { [str: string]: boolean } = {
queryRunner: true,
transformations: true,
fieldConfig: true,
editSourceId: true,
};
const defaults: any = {