problems: fix datasource selector, closes #692
This commit is contained in:
@@ -2,7 +2,10 @@ import angular from 'angular';
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
const template = `
|
const template = `
|
||||||
<value-select-dropdown variable="ctrl.dsOptions" on-updated="ctrl.onChange(ctrl.dsOptions)">
|
<value-select-dropdown
|
||||||
|
variable="ctrl.dsOptions"
|
||||||
|
on-updated="ctrl.onChange(ctrl.dsOptions)"
|
||||||
|
dashboard="ctrl.dashboard">
|
||||||
</value-select-dropdown>
|
</value-select-dropdown>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@@ -35,6 +38,11 @@ class DatasourceSelectorCtrl {
|
|||||||
return {text: ds, value: ds, selected: _.includes(datasources, ds)};
|
return {text: ds, value: ds, selected: _.includes(datasources, ds)};
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
// Fix for Grafana 6.0
|
||||||
|
// https://github.com/grafana/grafana/blob/v6.0.0/public/app/core/directives/value_select_dropdown.ts#L291
|
||||||
|
this.dashboard = {
|
||||||
|
on: () => {}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange(updatedOptions) {
|
onChange(updatedOptions) {
|
||||||
|
|||||||
Reference in New Issue
Block a user