From d49243bc557d2d12d2d998755616d69508eab5b5 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 2 May 2022 15:38:41 -0400 Subject: [PATCH] Variables: allow Regex tooltip links to be clickable (#48560) (#48597) Fixes #48558 I had to rebase in some additional changes from #47907 (specifically 87de4d7) Co-authored-by: Adam Simpson --- .../grafana-ui/src/components/Forms/InlineField.tsx | 11 ++++++++++- .../grafana-ui/src/components/Forms/InlineLabel.tsx | 5 ++++- .../features/variables/editor/VariableTextField.tsx | 4 +++- .../features/variables/query/QueryVariableEditor.tsx | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/packages/grafana-ui/src/components/Forms/InlineField.tsx b/packages/grafana-ui/src/components/Forms/InlineField.tsx index c7806e649e7..a46ec3d642f 100644 --- a/packages/grafana-ui/src/components/Forms/InlineField.tsx +++ b/packages/grafana-ui/src/components/Forms/InlineField.tsx @@ -23,6 +23,8 @@ export interface Props extends Omit = ({ @@ -38,6 +40,7 @@ export const InlineField: FC = ({ grow, error, transparent, + interactive, ...htmlProps }) => { const theme = useTheme2(); @@ -46,7 +49,13 @@ export const InlineField: FC = ({ const labelElement = typeof label === 'string' ? ( - + {label} ) : ( diff --git a/packages/grafana-ui/src/components/Forms/InlineLabel.tsx b/packages/grafana-ui/src/components/Forms/InlineLabel.tsx index 03f1045c109..32e21247969 100644 --- a/packages/grafana-ui/src/components/Forms/InlineLabel.tsx +++ b/packages/grafana-ui/src/components/Forms/InlineLabel.tsx @@ -23,6 +23,8 @@ export interface Props extends Omit = ({ tooltip, width, transparent, + interactive, as: Component = 'label', ...rest }) => { @@ -43,7 +46,7 @@ export const InlineLabel: FunctionComponent = ({ {children} {tooltip && ( - + )} diff --git a/public/app/features/variables/editor/VariableTextField.tsx b/public/app/features/variables/editor/VariableTextField.tsx index 5d8b5c4ed61..05b3a4a92a2 100644 --- a/public/app/features/variables/editor/VariableTextField.tsx +++ b/public/app/features/variables/editor/VariableTextField.tsx @@ -14,6 +14,7 @@ interface VariableTextFieldProps { labelWidth?: number; grow?: boolean; onBlur?: (event: FormEvent) => void; + interactive?: boolean; } export function VariableTextField({ @@ -28,9 +29,10 @@ export function VariableTextField({ onBlur, tooltip, grow, + interactive, }: PropsWithChildren): ReactElement { return ( - + onChange={this.onRegExChange} onBlur={this.onRegExBlur} labelWidth={20} + interactive={true} tooltip={
Optional, if you want to extract part of a series name or metric node segment. Named capture groups