From 3f68899dbaceb754b2c124850b6d78cc11a94f14 Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Mon, 10 Nov 2025 16:17:29 -0800 Subject: [PATCH 1/2] feat(aci): Rewire insights crons/uptime links to go to Monitors --- .../list/common/insightsRedirectNotice.tsx | 37 +++++++++++++++++++ static/app/views/detectors/list/cron.tsx | 4 ++ static/app/views/detectors/list/uptime.tsx | 4 ++ .../insights/insightsSecondaryNav.tsx | 18 ++++++++- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 static/app/views/detectors/list/common/insightsRedirectNotice.tsx diff --git a/static/app/views/detectors/list/common/insightsRedirectNotice.tsx b/static/app/views/detectors/list/common/insightsRedirectNotice.tsx new file mode 100644 index 00000000000000..0873983377166c --- /dev/null +++ b/static/app/views/detectors/list/common/insightsRedirectNotice.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 InsightsRedirectNotice({children}: {children: React.ReactNode}) { + const [wasRedirectedFromInsights, setWasRedirectedFromInsights] = useQueryState( + 'insightsRedirect', + parseAsBoolean.withOptions({history: 'replace'}).withDefault(false) + ); + + if (!wasRedirectedFromInsights) { + return null; + } + + return ( + } + aria-label={t('Dismiss')} + onClick={() => { + setWasRedirectedFromInsights(false); + }} + /> + } + > + {children} + + ); +} diff --git a/static/app/views/detectors/list/cron.tsx b/static/app/views/detectors/list/cron.tsx index 74c2ed986b48ad..64c4b18c493ec0 100644 --- a/static/app/views/detectors/list/cron.tsx +++ b/static/app/views/detectors/list/cron.tsx @@ -19,6 +19,7 @@ import {HeaderCell} from 'sentry/views/detectors/components/detectorListTable'; 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'; +import {InsightsRedirectNotice} from 'sentry/views/detectors/list/common/insightsRedirectNotice'; import {useDetectorListQuery} from 'sentry/views/detectors/list/common/useDetectorListQuery'; import { MonitorViewContext, @@ -155,6 +156,9 @@ export default function CronDetectorsList() { description={DESCRIPTION} docsUrl={DOCS_URL} > + + {t('Cron monitors have been moved from Insights to Monitors.')} + + + {t('Uptime monitors have been moved from Insights to Monitors.')} + diff --git a/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx b/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx index 3a5e4c3defb7de..c47820577d486a 100644 --- a/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx +++ b/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx @@ -6,6 +6,7 @@ import {FeatureBadge} from 'sentry/components/core/badge/featureBadge'; import {t} from 'sentry/locale'; import useOrganization from 'sentry/utils/useOrganization'; import useProjects from 'sentry/utils/useProjects'; +import {makeMonitorBasePathname} from 'sentry/views/detectors/pathnames'; import { AGENTS_LANDING_SUB_PATH, AI_SIDEBAR_LABEL, @@ -43,6 +44,8 @@ export function InsightsSecondaryNav() { ? starredProjects.slice(0, 8) : nonStarredProjects.filter(project => project.isMember).slice(0, 8); + const hasWorkflowEngineUi = organization.features.includes('workflow-engine-ui'); + return ( @@ -78,12 +81,23 @@ export function InsightsSecondaryNav() { - + {t('Crons')} {t('Uptime')} From 8f63021a40415d98ced85852862f70ad3f2029a5 Mon Sep 17 00:00:00 2001 From: Malachi Willey Date: Thu, 13 Nov 2025 11:26:20 -0800 Subject: [PATCH 2/2] Add isStaff check --- .../secondary/sections/insights/insightsSecondaryNav.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx b/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx index c47820577d486a..9e3aed17acdc65 100644 --- a/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx +++ b/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx @@ -6,6 +6,7 @@ import {FeatureBadge} from 'sentry/components/core/badge/featureBadge'; import {t} from 'sentry/locale'; import useOrganization from 'sentry/utils/useOrganization'; import useProjects from 'sentry/utils/useProjects'; +import {useUser} from 'sentry/utils/useUser'; import {makeMonitorBasePathname} from 'sentry/views/detectors/pathnames'; import { AGENTS_LANDING_SUB_PATH, @@ -30,6 +31,7 @@ import {SecondaryNav} from 'sentry/views/nav/secondary/secondary'; import {PrimaryNavGroup} from 'sentry/views/nav/types'; export function InsightsSecondaryNav() { + const user = useUser(); const organization = useOrganization(); const baseUrl = `/organizations/${organization.slug}/${DOMAIN_VIEW_BASE_URL}`; @@ -44,7 +46,8 @@ export function InsightsSecondaryNav() { ? starredProjects.slice(0, 8) : nonStarredProjects.filter(project => project.isMember).slice(0, 8); - const hasWorkflowEngineUi = organization.features.includes('workflow-engine-ui'); + const shouldRedirectToMonitors = + organization.features.includes('workflow-engine-ui') && !user?.isStaff; return ( @@ -83,7 +86,7 @@ export function InsightsSecondaryNav() {