Skip to content

Commit

Permalink
problems: fix datasource selector, closes #692
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderzobnin committed Mar 1, 2019
1 parent 18babc8 commit a71d101
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/panel-triggers/datasource-selector.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import angular from 'angular';
import _ from 'lodash';

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>
`;

Expand Down Expand Up @@ -35,6 +38,11 @@ class DatasourceSelectorCtrl {
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) {
Expand Down

0 comments on commit a71d101

Please sign in to comment.