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..69e8d68699a0dc 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')}