Skip to content

Commit 3a1240c

Browse files
feat(codecov): Add us storage only alert banner to preonboarding
1 parent 5c32a7d commit 3a1240c

File tree

2 files changed

+105
-69
lines changed

2 files changed

+105
-69
lines changed

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

+102-68
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ import styled from '@emotion/styled';
33

44
import testsAnalyticsSummary from 'sentry-images/features/test-analytics-summary.svg';
55

6+
import {Alert} from 'sentry/components/core/alert';
67
import {LinkButton} from 'sentry/components/core/button';
78
import Link from 'sentry/components/links/link';
89
import {IconGithub} from 'sentry/icons';
910
import {t} from 'sentry/locale';
1011
import {space} from 'sentry/styles/space';
12+
import type {Organization} from 'sentry/types/organization';
13+
import {getRegionDataFromOrganization} from 'sentry/utils/regions';
1114

1215
const INSTRUCTIONS_TEXT = {
1316
noOrgs: {
@@ -32,12 +35,39 @@ const INSTRUCTIONS_TEXT = {
3235
// TODO: this should come from the backend
3336
const HAS_INTEGRATED_ORGS = false;
3437

35-
export default function TestPreOnboardingPage() {
38+
interface Props {
39+
organization: Organization;
40+
}
41+
42+
export default function TestPreOnboardingPage({organization}: Props) {
3643
const instructionSet = HAS_INTEGRATED_ORGS
3744
? INSTRUCTIONS_TEXT.hasOrgs
3845
: INSTRUCTIONS_TEXT.noOrgs;
46+
47+
const regionData = getRegionDataFromOrganization(organization);
48+
const isUSStorage = regionData?.name === 'us';
49+
3950
return (
4051
<LayoutGap>
52+
{/* TODO: REMOVE AFTER DEMO */}
53+
<Alert.Container>
54+
<Alert type="info" showIcon>
55+
{t(
56+
'Test Analytics data is stored in the U.S. only. To use this feature, create a new Sentry organization with U.S. data storage.'
57+
)}
58+
</Alert>
59+
</Alert.Container>
60+
{/* TODO: REMOVE AFTER DEMO */}
61+
62+
{!isUSStorage && (
63+
<Alert.Container>
64+
<Alert type="info" showIcon>
65+
{t(
66+
'Test Analytics data is stored in the U.S. only. To use this feature, create a new Sentry organization with U.S. data storage.'
67+
)}
68+
</Alert>
69+
</Alert.Container>
70+
)}
4171
<IntroSection>
4272
<img src={testsAnalyticsSummary} />
4373
<div>
@@ -61,73 +91,77 @@ export default function TestPreOnboardingPage() {
6191
</ItalicP>
6292
</div>
6393
</IntroSection>
64-
<InstructionsSection>
65-
<h2>{instructionSet.header}</h2>
66-
<p>{instructionSet.subtext}</p>
67-
<ButtonBar>
68-
<LinkButton priority="primary" href={instructionSet.mainCTA}>
69-
{instructionSet.mainCTA}
70-
</LinkButton>
71-
<LinkButton priority="default" href="/settings/integrations/github">
72-
Learn more
73-
</LinkButton>
74-
</ButtonBar>
75-
<PrerequisitesSection>
76-
<PrerequisitesTitle>
77-
{t('Prerequisites to connect your GitHub organization:')}
78-
</PrerequisitesTitle>
79-
<Prerequisites>
80-
<Prereq>
81-
<PrereqMainText>{t('Enable GitHub as an Auth Provider')}</PrereqMainText>
82-
<PrereqSubText>
83-
{t(
84-
"Sentry Prevent analyzes your code through your Git provider. You'll need to authenticate to access data from your organizations."
85-
)}
86-
</PrereqSubText>
87-
</Prereq>
88-
<Prereq>
89-
<LinkButton
90-
priority="default"
91-
icon={<IconGithub />}
92-
href="https://github.com"
93-
>
94-
{t('Sign in with GitHub')}
95-
</LinkButton>
96-
</Prereq>
97-
<Prereq>
98-
<PrereqMainText>{t('Install the GitHub Sentry App')}</PrereqMainText>
99-
<PrereqSubText>
100-
<Link to="https://github.com/apps/sentry-io">{t('Install the app')}</Link>
101-
{t(
102-
" on your GitHub org in your Sentry org. You will need to be an Owner of your GitHub organization to fully configure the integration. Note: Once linked, a GitHub org/account can't be connected to another Sentry org."
103-
)}
104-
</PrereqSubText>
105-
</Prereq>
106-
<Prereq>
107-
<PrereqMainText>
108-
{t('Connect your GitHub identities in Sentry')}
109-
</PrereqMainText>
110-
<PrereqSubText>
111-
{t('In your Sentry ')}
112-
<Link to="https://sentry.io/settings/account/identities">
113-
{t('identities')}
114-
</Link>
115-
{t(
116-
" settings, link your GitHub account to your profile. If you're having trouble adding the integration, "
117-
)}
118-
<Link to="https://sentry.io/settings/account/identities">
119-
{t('disconnect')}
120-
</Link>
121-
{t(' then ')}
122-
{/* TODO: figma file links to https://sentry.io/auth/login/?next=/auth/sso/account/settings/social/associate/co[…]D6ee6a67e71b4459e8e4c%26state%3D7nJAqWF3l4bkczXAPzTcfo8EKIvSHyiB
123-
but not sure how to get the link to that currently */}
124-
<Link to="">{t('reconnect')}</Link>
125-
{t(' your GitHub identity.')}
126-
</PrereqSubText>
127-
</Prereq>
128-
</Prerequisites>
129-
</PrerequisitesSection>
130-
</InstructionsSection>
94+
{isUSStorage && (
95+
<InstructionsSection>
96+
<h2>{instructionSet.header}</h2>
97+
<p>{instructionSet.subtext}</p>
98+
<ButtonBar>
99+
<LinkButton priority="primary" href={instructionSet.mainCTA}>
100+
{instructionSet.mainCTA}
101+
</LinkButton>
102+
<LinkButton priority="default" href="/settings/integrations/github">
103+
Learn more
104+
</LinkButton>
105+
</ButtonBar>
106+
<PrerequisitesSection>
107+
<PrerequisitesTitle>
108+
{t('Prerequisites to connect your GitHub organization:')}
109+
</PrerequisitesTitle>
110+
<Prerequisites>
111+
<Prereq>
112+
<PrereqMainText>{t('Enable GitHub as an Auth Provider')}</PrereqMainText>
113+
<PrereqSubText>
114+
{t(
115+
"Sentry Prevent analyzes your code through your Git provider. You'll need to authenticate to access data from your organizations."
116+
)}
117+
</PrereqSubText>
118+
</Prereq>
119+
<Prereq>
120+
<LinkButton
121+
priority="default"
122+
icon={<IconGithub />}
123+
href="https://github.com"
124+
>
125+
{t('Sign in with GitHub')}
126+
</LinkButton>
127+
</Prereq>
128+
<Prereq>
129+
<PrereqMainText>{t('Install the GitHub Sentry App')}</PrereqMainText>
130+
<PrereqSubText>
131+
<Link to="https://github.com/apps/sentry-io">
132+
{t('Install the app')}
133+
</Link>
134+
{t(
135+
" on your GitHub org in your Sentry org. You will need to be an Owner of your GitHub organization to fully configure the integration. Note: Once linked, a GitHub org/account can't be connected to another Sentry org."
136+
)}
137+
</PrereqSubText>
138+
</Prereq>
139+
<Prereq>
140+
<PrereqMainText>
141+
{t('Connect your GitHub identities in Sentry')}
142+
</PrereqMainText>
143+
<PrereqSubText>
144+
{t('In your Sentry ')}
145+
<Link to="https://sentry.io/settings/account/identities">
146+
{t('identities')}
147+
</Link>
148+
{t(
149+
" settings, link your GitHub account to your profile. If you're having trouble adding the integration, "
150+
)}
151+
<Link to="https://sentry.io/settings/account/identities">
152+
{t('disconnect')}
153+
</Link>
154+
{t(' then ')}
155+
{/* TODO: figma file links to https://sentry.io/auth/login/?next=/auth/sso/account/settings/social/associate/co[…]D6ee6a67e71b4459e8e4c%26state%3D7nJAqWF3l4bkczXAPzTcfo8EKIvSHyiB
156+
but not sure how to get the link to that currently */}
157+
<Link to="">{t('reconnect')}</Link>
158+
{t(' your GitHub identity.')}
159+
</PrereqSubText>
160+
</Prereq>
161+
</Prerequisites>
162+
</PrerequisitesSection>
163+
</InstructionsSection>
164+
)}
131165
</LayoutGap>
132166
);
133167
}

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

+3-1
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 useOrganization from 'sentry/utils/useOrganization';
78
import TestPreOnboardingPage from 'sentry/views/codecov/tests/preOnboarding';
89
import {Summaries} from 'sentry/views/codecov/tests/summaries/summaries';
910

@@ -15,6 +16,7 @@ const DEFAULT_CODECOV_DATETIME_SELECTION = {
1516
};
1617

1718
export default function TestsPage() {
19+
const organization = useOrganization();
1820
return (
1921
<LayoutGap>
2022
<p>Test Analytics</p>
@@ -26,7 +28,7 @@ export default function TestsPage() {
2628
</PageFilterBar>
2729
</PageFiltersContainer>
2830
<Summaries />
29-
<TestPreOnboardingPage />
31+
<TestPreOnboardingPage organization={organization} />
3032
</LayoutGap>
3133
);
3234
}

0 commit comments

Comments
 (0)