From f33f3a55a0200b9e9859bf7f28ad004cdbebb7c0 Mon Sep 17 00:00:00 2001 From: Galen Kistler <109082771+gtk-grafana@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:01:30 -0500 Subject: [PATCH] Loki: Label browser sticky footer (#73243) * Create sticky footer section in loki metrics browser for query preview and action buttons --- .../loki/components/LokiLabelBrowser.tsx | 169 ++++++++++-------- 1 file changed, 92 insertions(+), 77 deletions(-) diff --git a/public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx b/public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx index 1c901a0239e..936255b4a90 100644 --- a/public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx +++ b/public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx @@ -110,9 +110,11 @@ export function facetLabels( const getStyles = (theme: GrafanaTheme2) => ({ wrapper: css` background-color: ${theme.colors.background.secondary}; - padding: ${theme.spacing(2)}; width: 100%; `, + wrapperPadding: css` + padding: ${theme.spacing(2)}; + `, list: css` margin-top: ${theme.spacing(1)}; display: flex; @@ -124,11 +126,20 @@ const getStyles = (theme: GrafanaTheme2) => ({ & + & { margin: ${theme.spacing(2, 0)}; } + position: relative; `, + footerSectionStyles: css` + padding: ${theme.spacing(1)}; + background-color: ${theme.colors.background.primary}; + position: sticky; + bottom: -${theme.spacing(3)}; /* offset the padding on modal */ + left: 0; + `, selector: css` font-family: ${theme.typography.fontFamilyMonospace}; margin-bottom: ${theme.spacing(1)}; + width: 100%; `, status: css` margin-bottom: ${theme.spacing(1)}; @@ -138,6 +149,8 @@ const getStyles = (theme: GrafanaTheme2) => ({ text-overflow: ellipsis; transition: opacity 100ms linear; opacity: 0; + font-size: ${theme.typography.bodySmall.fontSize}; + height: calc(${theme.typography.bodySmall.fontSize} + 10px); `, statusShowing: css` opacity: 1; @@ -434,87 +447,89 @@ export class UnthemedLokiLabelBrowser extends React.Component -
- -
- {labels.map((label) => ( -