From e7b697c9f3a65fdd655a7c1b85e77fcb177d4446 Mon Sep 17 00:00:00 2001 From: Ivana Date: Wed, 29 Sep 2021 12:29:41 +0200 Subject: [PATCH] Set exemplars to falsee if they are disabled --- .../datasource/prometheus/components/PromExemplarField.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx b/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx index 42412381868..0b173db7bfb 100644 --- a/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx +++ b/public/app/plugins/datasource/prometheus/components/PromExemplarField.tsx @@ -25,6 +25,13 @@ export function PromExemplarField({ datasource, onChange, isEnabled, refId }: Pr }; }, [datasource, refId]); + // If exemplars are disabled, set them to false + useEffect(() => { + if (error) { + onChange(false); + } + }, [error, onChange]); + const iconButtonStyles = cx( { [styles.activeIcon]: isEnabled,