Skip to content

Commit f38fdb9

Browse files
feat(codecov): Add onboarding radio selector for GHA or CLI
1 parent ba7bc8f commit f38fdb9

File tree

5 files changed

+103
-1
lines changed

5 files changed

+103
-1
lines changed

static/app/routes.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,9 @@ function buildRoutes() {
20222022
{/* Render tests onboarding without any layout wrapping */}
20232023
<Route
20242024
path="new/"
2025-
component={make(() => import('sentry/views/codecov/tests/onboarding'))}
2025+
component={make(
2026+
() => import('sentry/views/codecov/tests/onboarding/onboarding')
2027+
)}
20262028
/>
20272029
</Route>
20282030
<Route path="tokens/">
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 = {
@@ -26,6 +27,7 @@ export default function TestsPage() {
2627
</PageFiltersContainer>
2728
{/* TODO: Conditionally show these if the branch we're in is the main branch */}
2829
<Summaries />
30+
<TestsOnboardingPage />
2931
</LayoutGap>
3032
);
3133
}

0 commit comments

Comments
 (0)