DatasourceRef: keep uid/type ref when using template variables (#41785)

This commit is contained in:
Ryan McKinley
2021-11-17 07:55:12 +01:00
committed by GitHub
parent b4faee786f
commit bce7cb3ebf
6 changed files with 23 additions and 4 deletions
@@ -591,6 +591,9 @@ export interface DataSourceInstanceSettings<T extends DataSourceJsonData = DataS
*/
basicAuth?: string;
withCredentials?: boolean;
/** When the name+uid are based on template variables, maintain access to the real values */
rawRef?: DataSourceRef;
}
/**
@@ -124,7 +124,7 @@ class DataSourceWithBackend<
throw new Error(`Unknown Datasource: ${JSON.stringify(q.datasource)}`);
}
datasource = getDataSourceRef(ds);
datasource = ds.rawRef ?? getDataSourceRef(ds);
}
return {