diff --git a/packages/grafana-data/src/types/datasource.ts b/packages/grafana-data/src/types/datasource.ts index 1551dcc4d2f..63159188674 100644 --- a/packages/grafana-data/src/types/datasource.ts +++ b/packages/grafana-data/src/types/datasource.ts @@ -354,7 +354,6 @@ export interface QueryEditorProps< TOptions extends DataSourceJsonData = DataSourceJsonData, TVQuery extends DataQuery = TQuery > { - annotation?: AnnotationQuery; datasource: DSType; query: TVQuery; onRunQuery: () => void; diff --git a/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx b/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx index 4bd8ef950c3..587a5678d67 100644 --- a/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx +++ b/public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx @@ -167,7 +167,6 @@ export default class StandardAnnotationQueryEditor extends PureComponent - {this.renderStatus()} - - -
+ {datasource.type !== 'datasource' && ( + <> + {this.renderStatus()} + + + )} ); } diff --git a/public/app/plugins/datasource/grafana/components/AnnotationQuery.tsx b/public/app/plugins/datasource/grafana/components/AnnotationQuery.tsx index 82d661266a4..6bb6aec5a41 100644 --- a/public/app/plugins/datasource/grafana/components/AnnotationQuery.tsx +++ b/public/app/plugins/datasource/grafana/components/AnnotationQuery.tsx @@ -42,34 +42,34 @@ const limitOptions = [10, 50, 100, 200, 300, 500, 1000, 2000].map((limit) => ({ })); interface Props { - annotation: GrafanaAnnotationQuery; + query: GrafanaAnnotationQuery; onChange: (newValue: GrafanaAnnotationQuery) => void; } -export default function AnnotationQuery({ annotation, onChange }: Props) { - const { limit = 100, matchAny = false, tags = [], type = GrafanaAnnotationType.Tags } = annotation; +export default function AnnotationQuery({ query, onChange }: Props) { + const { limit = 100, matchAny = false, tags = [], type = GrafanaAnnotationType.Tags } = query; const onFilterByChange = (newValue: SelectableValue) => onChange({ - ...annotation, + ...query, type: newValue.value!, }); const onMaxLimitChange = (newValue: SelectableValue) => onChange({ - ...annotation, + ...query, limit: newValue.value!, }); const onMatchAnyChange = (newValue: React.ChangeEvent) => onChange({ - ...annotation, + ...query, matchAny: newValue.target.checked, }); const onTagsChange = (tags: string[]) => onChange({ - ...annotation, + ...query, tags, }); @@ -84,7 +84,7 @@ export default function AnnotationQuery({ annotation, onChange }: Props) {
- {annotation.type === 'tags' && ( + {query.type === 'tags' && ( <>