mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Annotations: Fix query editor rendering on datasource change (#18945)
This commit is contained in:
parent
6a064a1f59
commit
8c79085351
@ -46,7 +46,7 @@ export class AnnotationsEditorCtrl {
|
|||||||
showOptions: any = [{ text: 'All Panels', value: 0 }, { text: 'Specific Panels', value: 1 }];
|
showOptions: any = [{ text: 'All Panels', value: 0 }, { text: 'Specific Panels', value: 1 }];
|
||||||
|
|
||||||
/** @ngInject */
|
/** @ngInject */
|
||||||
constructor($scope: any, private datasourceSrv: DatasourceSrv) {
|
constructor(private $scope: any, private datasourceSrv: DatasourceSrv) {
|
||||||
$scope.ctrl = this;
|
$scope.ctrl = this;
|
||||||
|
|
||||||
this.dashboard = $scope.dashboard;
|
this.dashboard = $scope.dashboard;
|
||||||
@ -59,7 +59,10 @@ export class AnnotationsEditorCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async datasourceChanged() {
|
async datasourceChanged() {
|
||||||
return (this.currentDatasource = await this.datasourceSrv.get(this.currentAnnotation.datasource));
|
const newDatasource = await this.datasourceSrv.get(this.currentAnnotation.datasource);
|
||||||
|
this.$scope.$apply(() => {
|
||||||
|
this.currentDatasource = newDatasource;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
edit(annotation: any) {
|
edit(annotation: any) {
|
||||||
|
Loading…
Reference in New Issue
Block a user