Skip to content

Commit 36eddd0

Browse files
feat(codecov): Add onboarding radio selector for GHA or CLI
1 parent a5b30bc commit 36eddd0

File tree

6 files changed

+104
-18
lines changed

6 files changed

+104
-18
lines changed

static/app/routes.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2101,7 +2101,9 @@ function buildRoutes() {
21012101
{/* Render tests onboarding without any layout wrapping */}
21022102
<Route
21032103
path="new/"
2104-
component={make(() => import('sentry/views/codecov/tests/onboarding'))}
2104+
component={make(
2105+
() => import('sentry/views/codecov/tests/onboarding/onboarding')
2106+
)}
21052107
/>
21062108
</Route>
21072109
<Route path="tokens/">

static/app/views/codecov/tests/onboarding.tsx

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

static/app/views/codecov/tests/onboarding.spec.tsx renamed to static/app/views/codecov/tests/onboarding/onboarding.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {OrganizationFixture} from 'sentry-fixture/organization';
22

33
import {render, screen} from 'sentry-test/reactTestingLibrary';
44

5-
import TestAnalyticsOnboardingPage from 'sentry/views/codecov/tests/onboarding';
5+
import TestAnalyticsOnboardingPage from 'sentry/views/codecov/tests/onboarding/onboarding';
66

77
const COVERAGE_FEATURE = 'codecov-ui';
88

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import {useState} from 'react';
2+
import styled from '@emotion/styled';
3+
4+
import RadioGroup from 'sentry/components/forms/controls/radioGroup';
5+
import {t} from 'sentry/locale';
6+
import {space} from 'sentry/styles/space';
7+
8+
type SetupOption = 'githubAction' | 'cli';
9+
10+
export default function TestsOnboardingPage() {
11+
const [selectedOption, setSelectedOption] = useState<SetupOption>('githubAction');
12+
13+
return (
14+
<LayoutGap>
15+
<p>Test Analytics Onboarding</p>
16+
<OnboardingContainer>
17+
<IntroContainer>
18+
<GetStartedHeader>{t('Get Started with Test Analytics')}</GetStartedHeader>
19+
<TAValueText>
20+
{t(
21+
'Test Analytics offers data on test run times, failure rates, and identifies flaky tests to help decrease the risk of deployment failures and make it easier to ship new features quickly.'
22+
)}
23+
</TAValueText>
24+
</IntroContainer>
25+
<SelectOptionHeader>Select a setup option</SelectOptionHeader>
26+
<RadioGroup
27+
label="Select a setup option"
28+
value={selectedOption}
29+
onChange={opt => setSelectedOption(opt as SetupOption)}
30+
choices={[
31+
['githubAction', t('Use GitHub Actions to run my CI')],
32+
['cli', t("Use Sentry Prevent's CLI to upload testing reports")],
33+
]}
34+
/>
35+
</OnboardingContainer>
36+
</LayoutGap>
37+
);
38+
}
39+
40+
const LayoutGap = styled('div')`
41+
display: grid;
42+
gap: ${space(2)};
43+
`;
44+
45+
const OnboardingContainer = styled('div')`
46+
padding: ${space(1.5)} ${space(4)};
47+
border: 1px solid ${p => p.theme.border};
48+
border-radius: ${p => p.theme.borderRadius};
49+
`;
50+
51+
const IntroContainer = styled('div')`
52+
border-bottom: 1px solid ${p => p.theme.border};
53+
padding-bottom: ${space(3)};
54+
`;
55+
56+
const GetStartedHeader = styled('h2')`
57+
font-size: 1.625rem;
58+
color: ${p => p.theme.tokens.content.primary};
59+
line-height: 40px;
60+
`;
61+
62+
const TAValueText = styled('p')`
63+
font-size: ${p => p.theme.fontSizeLarge};
64+
color: ${p => p.theme.tokens.content.primary};
65+
`;
66+
67+
const SelectOptionHeader = styled('h5')`
68+
font-size: ${p => p.theme.fontSizeExtraLarge};
69+
color: ${p => p.theme.tokens.content.primary};
70+
margin-top: ${space(3)};
71+
`;
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import styled from '@emotion/styled';
2+
3+
import {space} from 'sentry/styles/space';
4+
5+
const Container = styled('div')`
6+
display: flex;
7+
flex-direction: column;
8+
gap: ${space(1)};
9+
border: 1px solid ${p => p.theme.border};
10+
border-radius: ${p => p.theme.borderRadius};
11+
padding: ${space(2)} ${space(3)};
12+
`;
13+
14+
const Header = styled('h5')`
15+
font-size: ${p => p.theme.fontSizeExtraLarge};
16+
color: ${p => p.theme.gray300};
17+
`;
18+
19+
const Content = styled('div')`
20+
/* flex-grow: 1; */
21+
`;
22+
23+
export const OnboardingStep = {
24+
Container,
25+
Header,
26+
Content,
27+
};

static/app/views/codecov/tests/tests.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {DatePicker} from 'sentry/components/codecov/datePicker/datePicker';
44
import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
55
import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
66
import {space} from 'sentry/styles/space';
7+
import TestsOnboardingPage from 'sentry/views/codecov/tests/onboarding/onboarding';
78
import {Summaries} from 'sentry/views/codecov/tests/summaries/summaries';
89

910
const DEFAULT_CODECOV_DATETIME_SELECTION = {
@@ -25,6 +26,7 @@ export default function TestsPage() {
2526
</PageFilterBar>
2627
</PageFiltersContainer>
2728
<Summaries />
29+
<TestsOnboardingPage />
2830
</LayoutGap>
2931
);
3032
}

0 commit comments

Comments
 (0)