mirror of
https://github.com/grafana/grafana.git
synced 2026-08-26 05:17:26 -05:00
feat(export): added grafana version to requires array, #5084
This commit is contained in:
@@ -78,6 +78,14 @@ export class DashboardExporter {
|
||||
templateizeDatasourceUsage(annotationDef);
|
||||
}
|
||||
|
||||
// add grafana version
|
||||
requires['grafana'] = {
|
||||
type: 'grafana',
|
||||
id: 'grafana',
|
||||
name: 'Grafana',
|
||||
version: config.buildInfo.version
|
||||
};
|
||||
|
||||
return Promise.all(promises).then(() => {
|
||||
_.each(datasources, (value, key) => {
|
||||
inputs.push(value);
|
||||
|
||||
@@ -14,6 +14,10 @@ describe.only('given dashboard with repeated panels', function() {
|
||||
annotations: { list: [] },
|
||||
};
|
||||
|
||||
config.buildInfo = {
|
||||
version: "3.0.2"
|
||||
};
|
||||
|
||||
dash.templating.list.push({
|
||||
name: 'apps',
|
||||
type: 'query',
|
||||
@@ -104,5 +108,12 @@ describe.only('given dashboard with repeated panels', function() {
|
||||
expect(require.version).to.be("1.1.0");
|
||||
});
|
||||
|
||||
it('should add grafana version', function() {
|
||||
var require = _.findWhere(exported.__requires, {name: 'Grafana'});
|
||||
expect(require.type).to.be("grafana");
|
||||
expect(require.id).to.be("grafana");
|
||||
expect(require.version).to.be("3.0.2");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user