grafana/public/app/plugins/datasource/grafana/annotation_ctrl.ts
Jack Westbrook 4178ebc0a1
Annotations: Fixes issues loading angular annotation query editors and updating annotation query model (#32903)
* style(dashboardsettings): disable eslint react hooks exhaustive deps warning

* Unrelated fix

* Fix annotation angular loading issues

* Fixing update issue

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2021-04-13 13:16:56 +02:00

23 lines
699 B
TypeScript

import { SelectableValue } from '@grafana/data';
import { GrafanaAnnotationType } from './types';
export const annotationTypes: Array<SelectableValue<GrafanaAnnotationType>> = [
{ text: 'Dashboard', value: GrafanaAnnotationType.Dashboard },
{ text: 'Tags', value: GrafanaAnnotationType.Tags },
];
export class GrafanaAnnotationsQueryCtrl {
declare annotation: any;
types = annotationTypes;
/** @ngInject */
constructor($scope: any) {
this.annotation = $scope.ctrl.annotation;
this.annotation.type = this.annotation.type || GrafanaAnnotationType.Tags;
this.annotation.limit = this.annotation.limit || 100;
}
static templateUrl = 'partials/annotations.editor.html';
}