Skip to content

Commit 7984f10

Browse files
authored
ref(coverage): Refactor prevent views (#104534)
<!-- Describe your PR here. -->
1 parent 47e8e4a commit 7984f10

33 files changed

+2
-1096
lines changed

static/app/components/charts/baseChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ function BaseChart({
707707
}
708708

709709
// Tooltip styles shared for regular and portalled tooltips
710-
export const getTooltipStyles = (p: {theme: Theme}) => css`
710+
const getTooltipStyles = (p: {theme: Theme}) => css`
711711
/* Tooltip styling */
712712
.tooltip-series,
713713
.tooltip-footer {

static/app/components/charts/treeCoverageSunburstChart.tsx

Lines changed: 0 additions & 235 deletions
This file was deleted.

static/app/components/commandPalette/useGlobalCommandPaletteActions.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,13 +207,6 @@ function useNavigationActions(): CommandPaletteAction[] {
207207
];
208208

209209
const preventChildren: CommandPaletteActionChild[] = [
210-
makeCommandPaletteLink({
211-
display: {
212-
label: t('Coverage'),
213-
},
214-
to: `${prefix}/prevent/coverage/commits/`,
215-
hidden: !organization.features.includes('codecov-ui'),
216-
}),
217210
makeCommandPaletteLink({
218211
display: {
219212
label: t('Tests'),

static/app/router/routes.tsx

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -2442,83 +2442,11 @@ function buildRoutes(): RouteObject[] {
24422442
children: exploreChildren,
24432443
};
24442444

2445-
// This is a layout route that will render a header for a commit
2446-
const codecovCommitRoutes: SentryRouteObject = {
2447-
path: 'commits/:sha/',
2448-
component: make(() => import('sentry/views/prevent/coverage/commits/commitWrapper')),
2449-
children: [
2450-
{
2451-
index: true,
2452-
component: make(
2453-
() => import('sentry/views/prevent/coverage/commits/commitDetail')
2454-
),
2455-
},
2456-
{
2457-
path: 'history/',
2458-
component: make(
2459-
() => import('sentry/views/prevent/coverage/commits/commitHistory')
2460-
),
2461-
},
2462-
{
2463-
path: 'yaml/',
2464-
component: make(() => import('sentry/views/prevent/coverage/commits/commitYaml')),
2465-
},
2466-
],
2467-
};
2468-
2469-
// This is a layout route that will render a header for a pull request
2470-
const codecovPRRoutes: SentryRouteObject = {
2471-
path: 'pulls/:pullId/',
2472-
component: make(() => import('sentry/views/prevent/coverage/pulls/pullWrapper')),
2473-
children: [
2474-
{
2475-
index: true,
2476-
component: make(() => import('sentry/views/prevent/coverage/pulls/pullDetail')),
2477-
},
2478-
],
2479-
};
2480-
24812445
const codecovChildren: SentryRouteObject[] = [
24822446
{
24832447
index: true,
24842448
redirectTo: 'ai-code-review/new/',
24852449
},
2486-
{
2487-
path: 'coverage/',
2488-
children: [
2489-
// This is a layout route that will render a header for coverage
2490-
{
2491-
component: make(() => import('sentry/views/prevent/coverage/coverageWrapper')),
2492-
children: [
2493-
{
2494-
path: 'file-explorer/',
2495-
component: make(() => import('sentry/views/prevent/coverage/coverage')),
2496-
},
2497-
{
2498-
path: 'commits/',
2499-
component: make(() => import('sentry/views/prevent/coverage/commits')),
2500-
},
2501-
{
2502-
path: 'pulls/',
2503-
component: make(() => import('sentry/views/prevent/coverage/pulls')),
2504-
},
2505-
{
2506-
path: 'coverage-trend/',
2507-
component: make(
2508-
() => import('sentry/views/prevent/coverage/coverageTrend')
2509-
),
2510-
},
2511-
],
2512-
},
2513-
// Render coverage onboarding without any layout wrapping
2514-
{
2515-
path: 'new/',
2516-
component: make(() => import('sentry/views/prevent/coverage/onboarding')),
2517-
},
2518-
codecovCommitRoutes,
2519-
codecovPRRoutes,
2520-
],
2521-
},
25222450
{
25232451
path: 'tests/',
25242452
component: make(() => import('sentry/views/prevent/tests/testsWrapper')),

static/app/views/nav/secondary/sections/prevent/preventSecondaryNav.spec.tsx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jest.mock('sentry/utils/analytics', () => ({
99
trackAnalytics: jest.fn(),
1010
}));
1111

12-
const ALL_AVAILABLE_FEATURES = ['codecov-ui', 'prevent-test-analytics'];
12+
const ALL_AVAILABLE_FEATURES = ['prevent-test-analytics'];
1313

1414
describe('PreventSecondaryNav', () => {
1515
beforeEach(() => {
@@ -36,30 +36,6 @@ describe('PreventSecondaryNav', () => {
3636
});
3737
});
3838

39-
it('renders the correct coverage link', () => {
40-
render(
41-
<NavContextProvider>
42-
<Nav />
43-
<div id="main" />
44-
</NavContextProvider>,
45-
{
46-
organization: OrganizationFixture({features: ALL_AVAILABLE_FEATURES}),
47-
initialRouterConfig: {
48-
location: {
49-
pathname: '/organizations/org-slug/prevent/coverage/commits/',
50-
},
51-
},
52-
}
53-
);
54-
55-
const coverageLink = screen.getByRole('link', {name: 'Coverage'});
56-
expect(coverageLink).toBeInTheDocument();
57-
expect(coverageLink).toHaveAttribute(
58-
'href',
59-
'/organizations/org-slug/prevent/coverage/commits/'
60-
);
61-
});
62-
6339
it('renders the correct tests link', () => {
6440
render(
6541
<NavContextProvider>

0 commit comments

Comments
 (0)