DashboardExport: Correctly templetatize datasource prop now that is's a ref obj (#42305)

This commit is contained in:
Torkel Ödegaard
2021-11-26 10:06:41 +01:00
committed by GitHub
parent b164ce0c9b
commit 1e1403fad1
2 changed files with 13 additions and 6 deletions

View File

@@ -116,7 +116,11 @@ export class DashboardExporter {
pluginName: ds.meta?.name,
};
obj.datasource = '${' + refName + '}';
if (obj.datasource === null || typeof obj.datasource === 'string') {
obj.datasource = '${' + refName + '}';
} else {
obj.datasource.uid = '${' + refName + '}';
}
})
);
};