use popoverContent tooltip

This commit is contained in:
Isabella Siu
2022-04-22 17:29:16 -04:00
parent 8b411f412e
commit 3dceca881a
2 changed files with 26 additions and 4 deletions
@@ -166,12 +166,34 @@ export const VariableQueryEditor = ({ query, datasource, onChange }: Props) => {
placeholder="attribute name"
onBlur={(value: string) => onQueryChange({ ...parsedQuery, attributeName: value })}
label="Attribute Name"
tooltip='Attribute or tag to query on. Tags should be formatted "Tags.<name>".'
tooltip={
<>
{'Attribute or tag to query on. Tags should be formatted "Tags.<name>". '}
<a
href="https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/template-queries-cloudwatch/#selecting-attributes"
target="_blank"
rel="noreferrer"
>
See the documentation for more details
</a>
</>
}
/>
<InlineField
label="Filters"
labelWidth={20}
tooltip='Pre-defined ec2:DescribeInstances filters/tags and the values to filter on. Tags should be formatted "tag:<name>. See the documentation for more details.'
tooltip={
<>
<a
href="https://grafana.com/docs/grafana/latest/datasources/aws-cloudwatch/template-queries-cloudwatch/#selecting-attributes"
target="_blank"
rel="noreferrer"
>
Pre-defined ec2:DescribeInstances filters/tags
</a>
{' and the values to filter on. Tags should be formatted tag:<name>.'}
</>
}
>
<MultiFilter
filters={parsedQuery.ec2Filters}
@@ -1,6 +1,6 @@
import React, { FC, useState } from 'react';
import { InlineField, Input } from '@grafana/ui';
import { InlineField, Input, PopoverContent } from '@grafana/ui';
const LABEL_WIDTH = 20;
@@ -9,7 +9,7 @@ interface VariableTextFieldProps {
placeholder: string;
value: string;
label: string;
tooltip?: string;
tooltip?: PopoverContent;
}
export const VariableTextField: FC<VariableTextFieldProps> = ({ label, onBlur, placeholder, value, tooltip }) => {