From 8dcb0ba24acf4e094ce7dc5212f05607e865c4e6 Mon Sep 17 00:00:00 2001 From: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:57:32 +0200 Subject: [PATCH] mantine-ui: add query warnings display to graph view Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com> --- web/ui/mantine-ui/src/pages/query/Graph.tsx | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/web/ui/mantine-ui/src/pages/query/Graph.tsx b/web/ui/mantine-ui/src/pages/query/Graph.tsx index b461c4ff06..082fa340d2 100644 --- a/web/ui/mantine-ui/src/pages/query/Graph.tsx +++ b/web/ui/mantine-ui/src/pages/query/Graph.tsx @@ -84,6 +84,20 @@ const Graph: FC = ({ range: UPlotChartRange; } | null>(null); + // Helper function to render warnings. + const renderWarnings = (warnings?: string[]) => { + return warnings?.map((w, idx) => ( + } + > + {w} + + )); + }; + useEffect(() => { if (data !== undefined) { setDataAndRange({ @@ -148,9 +162,12 @@ const Graph: FC = ({ if (result.length === 0) { return ( - }> - This query returned no data. - + + }> + This query returned no data. + + {renderWarnings(dataAndRange.data.warnings)} + ); } @@ -166,6 +183,7 @@ const Graph: FC = ({ graphing the equivalent instant vector selector instead. )} + {renderWarnings(dataAndRange.data.warnings)}