From 060728b3d54e1679182f1228ee3c5de5c229ec15 Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Fri, 14 Apr 2023 13:53:12 +0200 Subject: [PATCH] Explore: Add tooltip to explain what logs sample is (#66568) * Explore: Add tooltip to logs sample * Update tooltip --- .../app/features/explore/LogsSamplePanel.tsx | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/public/app/features/explore/LogsSamplePanel.tsx b/public/app/features/explore/LogsSamplePanel.tsx index f1b4383f0ec..8f5a89f4865 100644 --- a/public/app/features/explore/LogsSamplePanel.tsx +++ b/public/app/features/explore/LogsSamplePanel.tsx @@ -13,7 +13,7 @@ import { } from '@grafana/data'; import { reportInteraction } from '@grafana/runtime'; import { DataQuery, TimeZone } from '@grafana/schema'; -import { Button, Collapse, useStyles2 } from '@grafana/ui'; +import { Button, Collapse, Icon, Tooltip, useStyles2 } from '@grafana/ui'; import { dataFrameToLogsModel } from 'app/core/logsModel'; import store from 'app/core/store'; @@ -66,13 +66,7 @@ export function LogsSamplePanel(props: Props) { }; return ( - ); @@ -112,7 +106,19 @@ export function LogsSamplePanel(props: Props) { } return queryResponse?.state !== LoadingState.NotStarted ? ( - + + Logs sample + + + + + } + isOpen={enabled} + collapsible={true} + onToggle={onToggleLogsSampleCollapse} + > {LogsSamplePanelContent} ) : null; @@ -127,4 +133,7 @@ const getStyles = (theme: GrafanaTheme2) => ({ logContainer: css` overflow-x: scroll; `, + infoTooltip: css` + margin-left: ${theme.spacing(1)}; + `, });