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 02421f968c108d..cae1cc710a955e 100644 --- a/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx +++ b/static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx @@ -6,6 +6,8 @@ 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, AGENTS_SIDEBAR_LABEL, @@ -33,6 +35,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}`; @@ -47,6 +50,9 @@ export function InsightsSecondaryNav() { ? starredProjects.slice(0, 8) : nonStarredProjects.filter(project => project.isMember).slice(0, 8); + const shouldRedirectToMonitors = + organization.features.includes('workflow-engine-ui') && !user?.isStaff; + return ( @@ -89,12 +95,23 @@ export function InsightsSecondaryNav() { - + {t('Crons')} {t('Uptime')}