From d656da704237bd44ff8da4562de50046de300114 Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Thu, 13 Nov 2025 11:51:43 -0800 Subject: [PATCH 1/2] feat(aci): redirect alerts nav to monitors --- .../app/views/detectors/list/allMonitors.tsx | 4 ++ .../list/common/alertsRedirectNotice.tsx | 37 +++++++++++++++++++ .../sections/issues/issuesSecondaryNav.tsx | 15 +++++++- 3 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 static/app/views/detectors/list/common/alertsRedirectNotice.tsx diff --git a/static/app/views/detectors/list/allMonitors.tsx b/static/app/views/detectors/list/allMonitors.tsx index 0cfe3dde47f3ee..dabeb79a57e4ad 100644 --- a/static/app/views/detectors/list/allMonitors.tsx +++ b/static/app/views/detectors/list/allMonitors.tsx @@ -1,6 +1,7 @@ import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle'; import WorkflowEngineListLayout from 'sentry/components/workflowEngine/layout/list'; import {t} from 'sentry/locale'; +import {AlertsRedirectNotice} from 'sentry/views/detectors/list/common/alertsRedirectNotice'; import {DetectorListActions} from 'sentry/views/detectors/list/common/detectorListActions'; import {DetectorListContent} from 'sentry/views/detectors/list/common/detectorListContent'; import {DetectorListHeader} from 'sentry/views/detectors/list/common/detectorListHeader'; @@ -23,6 +24,9 @@ export default function AllMonitors() { description={DESCRIPTION} docsUrl={DOCS_URL} > + + {t('Alert Rules have been moved to Monitors and Alerts.')} + diff --git a/static/app/views/detectors/list/common/alertsRedirectNotice.tsx b/static/app/views/detectors/list/common/alertsRedirectNotice.tsx new file mode 100644 index 00000000000000..b09e545240c8a3 --- /dev/null +++ b/static/app/views/detectors/list/common/alertsRedirectNotice.tsx @@ -0,0 +1,37 @@ +import {parseAsBoolean, useQueryState} from 'nuqs'; + +import {Alert} from '@sentry/scraps/alert'; +import {Button} from '@sentry/scraps/button'; + +import {IconClose} from 'sentry/icons'; +import {t} from 'sentry/locale'; + +export function AlertsRedirectNotice({children}: {children: React.ReactNode}) { + const [wasRedirectedFromAlerts, setWasRedirectedFromAlerts] = useQueryState( + 'alertsRedirect', + parseAsBoolean.withOptions({history: 'replace'}).withDefault(false) + ); + + if (!wasRedirectedFromAlerts) { + return null; + } + + return ( + } + aria-label={t('Dismiss')} + onClick={() => { + setWasRedirectedFromAlerts(false); + }} + /> + } + > + {children} + + ); +} diff --git a/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx b/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx index 59685409c52359..da3e9fe180431d 100644 --- a/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx +++ b/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx @@ -4,6 +4,8 @@ import styled from '@emotion/styled'; import {t} from 'sentry/locale'; import useOrganization from 'sentry/utils/useOrganization'; +import {useUser} from 'sentry/utils/useUser'; +import {makeMonitorBasePathname} from 'sentry/views/detectors/pathnames'; import {ISSUE_TAXONOMY_CONFIG} from 'sentry/views/issueList/taxonomies'; import {useNavContext} from 'sentry/views/nav/context'; import {PRIMARY_NAV_GROUP_CONFIG} from 'sentry/views/nav/primary/config'; @@ -81,9 +83,18 @@ export function IssuesSecondaryNav() { } function ConfigureSection({baseUrl}: {baseUrl: string}) { + const user = useUser(); + const organization = useOrganization(); const {layout} = useNavContext(); const isSticky = layout === NavLayout.SIDEBAR; + const shouldRedirectToWorkflowEngineUI = + !user.isStaff && organization.features.includes('workflow-engine-ui'); + + const alertsLink = shouldRedirectToWorkflowEngineUI + ? `${makeMonitorBasePathname(organization.slug)}?alertsRedirect=true` + : `${baseUrl}/alerts/rules/`; + return ( {t('Alerts')} From 7672fcd7cd026b6f65a87f37b67d912d27577467 Mon Sep 17 00:00:00 2001 From: Mia Hsu Date: Thu, 13 Nov 2025 13:16:53 -0800 Subject: [PATCH 2/2] fix activeTo --- .../views/nav/secondary/sections/issues/issuesSecondaryNav.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx b/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx index da3e9fe180431d..69e8d68699a0dc 100644 --- a/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx +++ b/static/app/views/nav/secondary/sections/issues/issuesSecondaryNav.tsx @@ -104,7 +104,7 @@ function ConfigureSection({baseUrl}: {baseUrl: string}) { > {t('Alerts')}