Skip to content

Commit 12f0930

Browse files
committed
feat(crons/uptime): Move to insights top-level nav
1 parent c9ac330 commit 12f0930

File tree

9 files changed

+64
-83
lines changed

9 files changed

+64
-83
lines changed

static/app/routes.tsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1728,11 +1728,6 @@ function buildRoutes() {
17281728
)}
17291729
/>
17301730
</Route>
1731-
<Route path={`${MODULE_BASE_URLS[ModuleName.UPTIME]}/`}>
1732-
<IndexRoute
1733-
component={make(() => import('sentry/views/insights/uptime/views/overview'))}
1734-
/>
1735-
</Route>
17361731
<Route path={`${MODULE_BASE_URLS[ModuleName.AI]}/`}>
17371732
<IndexRoute
17381733
component={make(
@@ -1748,11 +1743,6 @@ function buildRoutes() {
17481743
)}
17491744
/>
17501745
</Route>
1751-
<Route path={`${MODULE_BASE_URLS[ModuleName.CRONS]}/`}>
1752-
<IndexRoute
1753-
component={make(() => import('sentry/views/insights/crons/views/overview'))}
1754-
/>
1755-
</Route>
17561746
<Route path={`${MODULE_BASE_URLS[ModuleName.SESSIONS]}/`}>
17571747
<IndexRoute
17581748
component={make(() => import('sentry/views/insights/sessions/views/overview'))}
@@ -1811,6 +1801,16 @@ function buildRoutes() {
18111801
<Route path="projects/" component={make(() => import('sentry/views/projects/'))}>
18121802
{projectsChildRoutes}
18131803
</Route>
1804+
<Route path="uptime/">
1805+
<IndexRoute
1806+
component={make(() => import('sentry/views/insights/uptime/views/overview'))}
1807+
/>
1808+
</Route>
1809+
<Route path="crons/">
1810+
<IndexRoute
1811+
component={make(() => import('sentry/views/insights/crons/views/overview'))}
1812+
/>
1813+
</Route>
18141814
</Route>
18151815
);
18161816

static/app/views/insights/common/utils/useModuleURL.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {BASE_URL as AGENTS_BASE_URL} from 'sentry/views/insights/agentMonitoring
44
import {BASE_URL as RESOURCES_BASE_URL} from 'sentry/views/insights/browser/resources/settings';
55
import {BASE_URL as VITALS_BASE_URL} from 'sentry/views/insights/browser/webVitals/settings';
66
import {BASE_URL as CACHE_BASE_URL} from 'sentry/views/insights/cache/settings';
7-
import {BASE_URL as CRONS_BASE_URL} from 'sentry/views/insights/crons/settings';
87
import {BASE_URL as DB_BASE_URL} from 'sentry/views/insights/database/settings';
98
import {BASE_URL as HTTP_BASE_URL} from 'sentry/views/insights/http/settings';
109
import {BASE_URL as AI_BASE_URL} from 'sentry/views/insights/llmMonitoring/settings';
@@ -22,7 +21,6 @@ import {getModuleView} from 'sentry/views/insights/pages/utils';
2221
import {BASE_URL as QUEUE_BASE_URL} from 'sentry/views/insights/queues/settings';
2322
import {BASE_URL as SESSIONS_BASE_URL} from 'sentry/views/insights/sessions/settings';
2423
import {ModuleName} from 'sentry/views/insights/types';
25-
import {BASE_URL as UPTIME_BASE_URL} from 'sentry/views/insights/uptime/settings';
2624

2725
export const MODULE_BASE_URLS: Record<ModuleName, string> = {
2826
[ModuleName.DB]: DB_BASE_URL,
@@ -38,8 +36,6 @@ export const MODULE_BASE_URLS: Record<ModuleName, string> = {
3836
[ModuleName.MOBILE_UI]: MOBILE_UI_BASE_URL,
3937
[ModuleName.MOBILE_VITALS]: MOBILE_SCREENS_BASE_URL,
4038
[ModuleName.SCREEN_RENDERING]: SCREEN_RENDERING_BASE_URL,
41-
[ModuleName.CRONS]: CRONS_BASE_URL,
42-
[ModuleName.UPTIME]: UPTIME_BASE_URL,
4339
[ModuleName.SESSIONS]: SESSIONS_BASE_URL,
4440
[ModuleName.OTHER]: '',
4541
};

static/app/views/insights/crons/settings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {t} from 'sentry/locale';
33
export const MODULE_TITLE = t('Cron Monitors');
44
export const DATA_TYPE = t('Cron Check-In');
55
export const DATA_TYPE_PLURAL = t('Cron Check-Ins');
6-
export const BASE_URL = 'crons';
76

87
export const MODULE_DESCRIPTION = t(
98
'Scheduled monitors that check in on recurring jobs and tell you if they’re running on schedule, failing, or succeeding.'

static/app/views/insights/crons/views/overview.tsx

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {deleteProjectProcessingErrorByType} from 'sentry/actionCreators/monitors
77
import GuideAnchor from 'sentry/components/assistant/guideAnchor';
88
import {Button} from 'sentry/components/core/button';
99
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
10+
import FeedbackWidgetButton from 'sentry/components/feedback/widget/feedbackWidgetButton';
1011
import HookOrDefault from 'sentry/components/hookOrDefault';
1112
import * as Layout from 'sentry/components/layouts/thirds';
1213
import LoadingIndicator from 'sentry/components/loadingIndicator';
@@ -29,7 +30,6 @@ import useApi from 'sentry/utils/useApi';
2930
import {useLocation} from 'sentry/utils/useLocation';
3031
import {useNavigate} from 'sentry/utils/useNavigate';
3132
import useOrganization from 'sentry/utils/useOrganization';
32-
import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
3333
import {
3434
CronsLandingPanel,
3535
isValidGuide,
@@ -51,8 +51,6 @@ import type {
5151
ProcessingErrorType,
5252
} from 'sentry/views/insights/crons/types';
5353
import {makeMonitorListQueryKey} from 'sentry/views/insights/crons/utils';
54-
import {BackendHeader} from 'sentry/views/insights/pages/backend/backendPageHeader';
55-
import {ModuleName} from 'sentry/views/insights/types';
5654

5755
const CronsListPageHeader = HookOrDefault({
5856
hookName: 'component:crons-list-page-header',
@@ -108,19 +106,19 @@ function CronsOverview() {
108106
return (
109107
<Fragment>
110108
<CronsListPageHeader organization={organization} />
111-
<BackendHeader
112-
headerTitle={
113-
<Fragment>
109+
<Layout.Header unified>
110+
<Layout.HeaderContent>
111+
<Layout.Title>
114112
<GuideAnchor target="crons_backend_insights">{MODULE_TITLE}</GuideAnchor>
115113
<PageHeadingQuestionTooltip
116114
docsUrl={MODULE_DOC_LINK}
117115
title={MODULE_DESCRIPTION}
118116
/>
119-
</Fragment>
120-
}
121-
module={ModuleName.CRONS}
122-
headerActions={
117+
</Layout.Title>
118+
</Layout.HeaderContent>
119+
<Layout.HeaderActions>
123120
<ButtonBar gap={1}>
121+
<FeedbackWidgetButton />
124122
<Button
125123
icon={<IconList />}
126124
size="sm"
@@ -140,8 +138,8 @@ function CronsOverview() {
140138
</NewMonitorButton>
141139
)}
142140
</ButtonBar>
143-
}
144-
/>
141+
</Layout.HeaderActions>
142+
</Layout.Header>
145143
<Layout.Body>
146144
<Layout.Main fullWidth>
147145
<Filters>
@@ -194,15 +192,7 @@ function CronsOverview() {
194192
);
195193
}
196194

197-
function PageWithProviders() {
198-
return (
199-
<ModulePageProviders moduleName="crons" pageTitle={t('Overview')}>
200-
<CronsOverview />
201-
</ModulePageProviders>
202-
);
203-
}
204-
205-
export default PageWithProviders;
195+
export default CronsOverview;
206196

207197
const Filters = styled('div')`
208198
display: flex;

static/app/views/insights/pages/backend/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ export const MODULES = [
1313
ModuleName.HTTP,
1414
ModuleName.CACHE,
1515
ModuleName.QUEUE,
16-
ModuleName.CRONS,
17-
ModuleName.UPTIME,
1816
];
1917

2018
export const OVERVIEW_PAGE_ALLOWED_OPS = ['http.server'];

static/app/views/insights/pages/frontend/settings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ export const MODULES = [
3434
ModuleName.HTTP,
3535
ModuleName.RESOURCE,
3636
ModuleName.SESSIONS,
37-
ModuleName.UPTIME,
3837
];
3938

4039
// Mirrors `FRONTEND` in src/sentry/utils/platform_categories.py, except shared platforms are removed

static/app/views/insights/types.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ export enum ModuleName {
1616
MOBILE_UI = 'mobile-ui',
1717
MOBILE_VITALS = 'mobile-vitals',
1818
SCREEN_RENDERING = 'screen-rendering',
19-
CRONS = 'crons',
20-
UPTIME = 'uptime',
2119
SESSIONS = 'sessions',
2220
OTHER = 'other',
2321
}

static/app/views/insights/uptime/views/overview.tsx

Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {hasEveryAccess} from 'sentry/components/acl/access';
66
import {ButtonBar} from 'sentry/components/core/button/buttonBar';
77
import {LinkButton} from 'sentry/components/core/button/linkButton';
88
import EmptyMessage from 'sentry/components/emptyMessage';
9+
import FeedbackWidgetButton from 'sentry/components/feedback/widget/feedbackWidgetButton';
910
import * as Layout from 'sentry/components/layouts/thirds';
1011
import Link from 'sentry/components/links/link';
1112
import LoadingIndicator from 'sentry/components/loadingIndicator';
@@ -31,14 +32,7 @@ import useOrganization from 'sentry/utils/useOrganization';
3132
import useProjects from 'sentry/utils/useProjects';
3233
import {makeAlertsPathname} from 'sentry/views/alerts/pathnames';
3334
import type {UptimeRule} from 'sentry/views/alerts/rules/uptime/types';
34-
import {ModulePageProviders} from 'sentry/views/insights/common/components/modulePageProviders';
3535
import {OwnerFilter} from 'sentry/views/insights/crons/components/ownerFilter';
36-
import {BackendHeader} from 'sentry/views/insights/pages/backend/backendPageHeader';
37-
import {BACKEND_LANDING_SUB_PATH} from 'sentry/views/insights/pages/backend/settings';
38-
import {FrontendHeader} from 'sentry/views/insights/pages/frontend/frontendPageHeader';
39-
import {FRONTEND_LANDING_SUB_PATH} from 'sentry/views/insights/pages/frontend/settings';
40-
import {useDomainViewFilters} from 'sentry/views/insights/pages/useFilters';
41-
import {ModuleName} from 'sentry/views/insights/types';
4236
import {OverviewTimeline} from 'sentry/views/insights/uptime/components/overviewTimeline';
4337
import {
4438
MODULE_DESCRIPTION,
@@ -52,7 +46,6 @@ export default function UptimeOverview() {
5246
const location = useLocation();
5347
const project = decodeList(location.query?.project);
5448
const {projects} = useProjects();
55-
const {view = ''} = useDomainViewFilters();
5649

5750
function makeQueryKey() {
5851
const {query, environment, owner, cursor, sort, asc} = location.query;
@@ -101,40 +94,37 @@ export default function UptimeOverview() {
10194
{settingsLink: <Link to={`/settings/${organization.slug}`} />}
10295
);
10396

104-
const headerProps = {
105-
module: ModuleName.UPTIME,
106-
headerTitle: (
107-
<Fragment>
108-
{MODULE_TITLE}
109-
<PageHeadingQuestionTooltip
110-
docsUrl={MODULE_DOC_LINK}
111-
title={MODULE_DESCRIPTION}
112-
/>
113-
</Fragment>
114-
),
115-
headerActions: (
116-
<ButtonBar gap={1}>
117-
<LinkButton
118-
size="sm"
119-
priority="primary"
120-
to={makeAlertsPathname({
121-
path: `/new/uptime/`,
122-
organization,
123-
})}
124-
icon={<IconAdd isCircled />}
125-
disabled={!canCreateAlert}
126-
title={canCreateAlert ? undefined : permissionTooltipText}
127-
>
128-
{t('Add Uptime Monitor')}
129-
</LinkButton>
130-
</ButtonBar>
131-
),
132-
};
133-
13497
return (
135-
<ModulePageProviders moduleName="uptime" pageTitle={t('Overview')}>
136-
{view === FRONTEND_LANDING_SUB_PATH && <FrontendHeader {...headerProps} />}
137-
{view === BACKEND_LANDING_SUB_PATH && <BackendHeader {...headerProps} />}
98+
<Fragment>
99+
<Layout.Header unified>
100+
<Layout.HeaderContent>
101+
<Layout.Title>
102+
{MODULE_TITLE}
103+
<PageHeadingQuestionTooltip
104+
docsUrl={MODULE_DOC_LINK}
105+
title={MODULE_DESCRIPTION}
106+
/>
107+
</Layout.Title>
108+
</Layout.HeaderContent>
109+
<Layout.HeaderActions>
110+
<ButtonBar gap={1}>
111+
<FeedbackWidgetButton />
112+
<LinkButton
113+
size="sm"
114+
priority="primary"
115+
to={makeAlertsPathname({
116+
path: `/new/uptime/`,
117+
organization,
118+
})}
119+
icon={<IconAdd isCircled />}
120+
disabled={!canCreateAlert}
121+
title={canCreateAlert ? undefined : permissionTooltipText}
122+
>
123+
{t('Add Uptime Monitor')}
124+
</LinkButton>
125+
</ButtonBar>
126+
</Layout.HeaderActions>
127+
</Layout.Header>
138128
<Layout.Body>
139129
<Layout.Main fullWidth>
140130
<Filters>
@@ -190,7 +180,7 @@ export default function UptimeOverview() {
190180
)}
191181
</Layout.Main>
192182
</Layout.Body>
193-
</ModulePageProviders>
183+
</Fragment>
194184
);
195185
}
196186

static/app/views/nav/secondary/sections/insights/insightsSecondaryNav.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,17 @@ export function InsightsSecondaryNav() {
116116
</SecondaryNav.Item>
117117
</AgentInsightsFeature>
118118
</SecondaryNav.Section>
119+
<SecondaryNav.Section id="insights-monitors">
120+
<SecondaryNav.Item
121+
to={`${baseUrl}/uptime/`}
122+
analyticsItemName="insights_uptime"
123+
>
124+
{t('Uptime')}
125+
</SecondaryNav.Item>
126+
<SecondaryNav.Item to={`${baseUrl}/crons/`} analyticsItemName="insights_crons">
127+
{t('Crons')}
128+
</SecondaryNav.Item>
129+
</SecondaryNav.Section>
119130
<SecondaryNav.Section id="insights-projects-all">
120131
<SecondaryNav.Item
121132
to={`${baseUrl}/projects/`}

0 commit comments

Comments
 (0)