Variables: allow Regex tooltip links to be clickable (#48560)

Fixes #48558
This commit is contained in:
Adam Simpson
2022-05-02 13:44:23 -04:00
committed by GitHub
parent 4867a6b15f
commit 9db95826a4
2 changed files with 4 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ interface VariableTextFieldProps {
labelWidth?: number; labelWidth?: number;
grow?: boolean; grow?: boolean;
onBlur?: (event: FormEvent<HTMLInputElement>) => void; onBlur?: (event: FormEvent<HTMLInputElement>) => void;
interactive?: boolean;
} }
export function VariableTextField({ export function VariableTextField({
@@ -28,9 +29,10 @@ export function VariableTextField({
onBlur, onBlur,
tooltip, tooltip,
grow, grow,
interactive,
}: PropsWithChildren<VariableTextFieldProps>): ReactElement { }: PropsWithChildren<VariableTextFieldProps>): ReactElement {
return ( return (
<InlineField label={name} labelWidth={labelWidth ?? 12} tooltip={tooltip} grow={grow}> <InlineField interactive={interactive} label={name} labelWidth={labelWidth ?? 12} tooltip={tooltip} grow={grow}>
<Input <Input
type="text" type="text"
id={name} id={name}

View File

@@ -201,6 +201,7 @@ export class QueryVariableEditorUnConnected extends PureComponent<Props, State>
onChange={this.onRegExChange} onChange={this.onRegExChange}
onBlur={this.onRegExBlur} onBlur={this.onRegExBlur}
labelWidth={20} labelWidth={20}
interactive={true}
tooltip={ tooltip={
<div> <div>
Optional, if you want to extract part of a series name or metric node segment. Named capture groups Optional, if you want to extract part of a series name or metric node segment. Named capture groups