DataSource: Default data source is no longer a persisted state but just the default data source for new panels (#45132)

* PanelEdit: Change the meaning of default data source to be just that the default for new panels

* Added migration, and also migration for annotation datasource prop to data source refs

* fix

* Fixing tests

* Fixes to annotation

* Fixing unit test
This commit is contained in:
Torkel Ödegaard
2022-03-08 08:56:12 +01:00
committed by GitHub
parent a9ee446de4
commit 79e5e5c024
23 changed files with 239 additions and 170 deletions

View File

@@ -180,7 +180,7 @@ it('handles a default datasource in a template variable', async () => {
const dashboardModel = new DashboardModel(dashboard, {}, () => dashboard.templating.list);
const exporter = new DashboardExporter();
const exported: any = await exporter.makeExportable(dashboardModel);
expect(exported.templating.list[0].datasource).toBe('${DS_GFDB}');
expect(exported.templating.list[0].datasource.uid).toBe('${DS_GFDB}');
});
describe('given dashboard with repeated panels', () => {
@@ -325,7 +325,7 @@ describe('given dashboard with repeated panels', () => {
});
it('should replace datasource in annotation query', () => {
expect(exported.annotations.list[1].datasource).toBe('${DS_GFDB}');
expect(exported.annotations.list[1].datasource.uid).toBe('${DS_GFDB}');
});
it('should add datasource as input', () => {