From 29cdbe68bd9f9abc6cbbc767b4085348f6675396 Mon Sep 17 00:00:00 2001 From: Jan Monschke Date: Mon, 21 Oct 2024 13:49:39 +0200 Subject: [PATCH] [SecuritySolutuion] Fix misaligned toolbar in alerts table (#196804) ## Summary Some items in the alerts table's toolbar were misaligned. This PR adds a quick fix for these misaligned items but the actual fix will hopefully be done in EUI (https://github.com/elastic/eui/pull/8085) Before: Screenshot 2024-10-18 at 09 47 53 After: Screenshot 2024-10-18 at 09 47 14 Co-authored-by: Elastic Machine (cherry picked from commit 082a89797edaa45a5d20b5378f8d521561800218) --- .../toolbar/components/alerts_count/alerts_count.tsx | 1 + .../toolbar/components/last_updated_at/index.tsx | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/alerts_count/alerts_count.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/alerts_count/alerts_count.tsx index 50eb14ccfa3df..45ca382686752 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/alerts_count/alerts_count.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/alerts_count/alerts_count.tsx @@ -33,6 +33,7 @@ export const AlertsCount = ({ count }: { count: number }) => { border-right: ${euiTheme.border.thin}; margin-right: ${euiTheme.size.s}; padding-right: ${euiTheme.size.m}; + align-self: center; `} > {alertCountText} diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/last_updated_at/index.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/last_updated_at/index.tsx index f2631b9fc0f26..73005464a80c7 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/last_updated_at/index.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/alerts_table/toolbar/components/last_updated_at/index.tsx @@ -9,6 +9,7 @@ import { EuiText, EuiToolTip } from '@elastic/eui'; import { FormattedRelative } from '@kbn/i18n-react'; import React, { useEffect, useMemo, useState } from 'react'; +import { css } from '@emotion/react'; import * as i18n from './translations'; export interface LastUpdatedAtProps { @@ -36,6 +37,12 @@ Updated.displayName = 'Updated'; const prefix = ` ${i18n.UPDATED} `; +const anchorStyles = { + css: css` + align-self: center; + `, +}; + export const LastUpdatedAt = React.memo( ({ compact = false, updatedAt, showUpdating = false }) => { const [date, setDate] = useState(Date.now()); @@ -64,7 +71,10 @@ export const LastUpdatedAt = React.memo( }, [compact, date, showUpdating, updatedAt]); return ( - }> + } + anchorProps={anchorStyles} + > {updateText}