mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user