From 8dc013b8720f29be1cd3f2067d544874ca39176f Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Thu, 6 Mar 2025 13:21:45 +0100 Subject: [PATCH] Alerting: Remove unused component / file (#101568) --- .../alert-details/useRuleViewerPageTitle.tsx | 29 ------------------- 1 file changed, 29 deletions(-) delete mode 100644 public/app/features/alerting/unified/hooks/alert-details/useRuleViewerPageTitle.tsx diff --git a/public/app/features/alerting/unified/hooks/alert-details/useRuleViewerPageTitle.tsx b/public/app/features/alerting/unified/hooks/alert-details/useRuleViewerPageTitle.tsx deleted file mode 100644 index 96495963872..00000000000 --- a/public/app/features/alerting/unified/hooks/alert-details/useRuleViewerPageTitle.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useLayoutEffect } from 'react'; - -import { Branding } from 'app/core/components/Branding/Branding'; -import { useGrafana } from 'app/core/context/GrafanaContext'; -import { CombinedRule } from 'app/types/unified-alerting'; - -/** - * We're definitely doing something odd here, and it all boils down to - * 1. we have a page layout that is different from what forces us to do with pageNav - * 2. because of 1. we don't get to update the pageNav that way and circumvents - * the `usePageTitle` hook in the component - * - * Therefore we are manually setting the breadcrumb and the page title. - */ -export function useRuleViewerPageTitle(rule?: CombinedRule) { - const { chrome } = useGrafana(); - - useLayoutEffect(() => { - if (rule?.name) { - chrome.update({ pageNav: { text: rule.name } }); - } - }, [chrome, rule]); - - if (!rule) { - return; - } - - document.title = `${rule.name} - Alerting - ${Branding.AppTitle}`; -}