From 97cb4ad11458ffd2a4bbac7d64b20294af8c4640 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Fri, 27 Sep 2024 22:48:21 +1000 Subject: [PATCH] [8.x] fix: [Obs Alerts > Rule Detail][SCREEN READER]: H1 tag should not include secondary information: 0001 (#193961) (#194288) # Backport This will backport the following commits from `main` to `8.x`: - [fix: [Obs Alerts > Rule Detail][SCREEN READER]: H1 tag should not include secondary information: 0001 (#193961)](https://github.com/elastic/kibana/pull/193961) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Alexey Antonov --- .../{page_title.tsx => page_title_content.tsx} | 10 ++-------- .../public/pages/rule_details/rule_details.tsx | 8 ++++++-- 2 files changed, 8 insertions(+), 10 deletions(-) rename x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/{page_title.tsx => page_title_content.tsx} (89%) diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title.tsx b/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title_content.tsx similarity index 89% rename from x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title.tsx rename to x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title_content.tsx index f951ffdff44ba..fe53dd84c48d1 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title.tsx +++ b/x-pack/plugins/observability_solution/observability/public/pages/rule_details/components/page_title_content.tsx @@ -12,24 +12,18 @@ import type { Rule } from '@kbn/triggers-actions-ui-plugin/public'; import { useKibana } from '../../../utils/kibana_react'; import { getHealthColor } from '../helpers/get_health_color'; -interface PageTitleProps { +interface PageTitleContentProps { rule: Rule; } -export function PageTitle({ rule }: PageTitleProps) { +export function PageTitleContent({ rule }: PageTitleContentProps) { const { triggersActionsUi: { getRuleTagBadge: RuleTagBadge }, } = useKibana().services; return ( <> - - - {rule.name} - - - {rule.executionStatus.status.charAt(0).toUpperCase() + diff --git a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx b/x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx index 31ae9e41d0529..e8270434c12b2 100644 --- a/x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx +++ b/x-pack/plugins/observability_solution/observability/public/pages/rule_details/rule_details.tsx @@ -18,7 +18,7 @@ import { usePluginContext } from '../../hooks/use_plugin_context'; import { useFetchRule } from '../../hooks/use_fetch_rule'; import { useFetchRuleTypes } from '../../hooks/use_fetch_rule_types'; import { useGetFilteredRuleTypes } from '../../hooks/use_get_filtered_rule_types'; -import { PageTitle } from './components/page_title'; +import { PageTitleContent } from './components/page_title_content'; import { DeleteConfirmationModal } from './components/delete_confirmation_modal'; import { CenterJustifiedSpinner } from '../../components/center_justified_spinner'; import { NoRuleFoundPanel } from './components/no_rule_found_panel'; @@ -200,7 +200,11 @@ export function RuleDetailsPage() { , + pageTitle: rule.name, + pageTitleProps: { + 'data-test-subj': 'ruleName', + }, + children: , bottomBorder: false, rightSideItems: [