Chore: Fix more strict typescript errors (#35514)

This commit is contained in:
kay delaney
2021-06-14 15:13:48 +01:00
committed by GitHub
parent 6ee2f1fe3e
commit 0f81703c35
18 changed files with 128 additions and 161 deletions

View File

@@ -1,5 +1,6 @@
import React from 'react';
import { QueryEditorHelpProps, DataQuery } from '@grafana/data';
import { QueryEditorHelpProps } from '@grafana/data';
import { PromQuery } from '../types';
const CHEAT_SHEET_ITEMS = [
{
@@ -25,7 +26,7 @@ const CHEAT_SHEET_ITEMS = [
},
];
const PromCheatSheet = (props: QueryEditorHelpProps) => (
const PromCheatSheet = (props: QueryEditorHelpProps<PromQuery>) => (
<div>
<h2>PromQL Cheat Sheet</h2>
{CHEAT_SHEET_ITEMS.map((item, index) => (
@@ -34,7 +35,7 @@ const PromCheatSheet = (props: QueryEditorHelpProps) => (
{item.expression ? (
<div
className="cheat-sheet-item__example"
onClick={(e) => props.onClickExample({ refId: 'A', expr: item.expression } as DataQuery)}
onClick={(e) => props.onClickExample({ refId: 'A', expr: item.expression })}
>
<code>{item.expression}</code>
</div>