Skip to content

Commit 5d35c75

Browse files
committed
Iterate some more
1 parent 06df154 commit 5d35c75

File tree

6 files changed

+244
-430
lines changed

6 files changed

+244
-430
lines changed

static/app/views/settings/seer/overview/autofixOverviewSection.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,18 @@ import {z} from 'zod';
44
import {Alert} from '@sentry/scraps/alert';
55
import {Button} from '@sentry/scraps/button';
66
import {AutoSaveForm, FieldGroup} from '@sentry/scraps/form';
7-
import {FieldMeta} from '@sentry/scraps/form/field/meta';
87
import {Container, Flex, Grid, Stack} from '@sentry/scraps/layout';
98
import {ExternalLink, Link} from '@sentry/scraps/link';
109
import {Text} from '@sentry/scraps/text';
1110

1211
import {updateOrganization} from 'sentry/actionCreators/organizations';
1312
import {hasEveryAccess} from 'sentry/components/acl/access';
1413
import {organizationIntegrationsCodingAgents} from 'sentry/components/events/autofix/useAutofix';
15-
import {LoadingIndicator} from 'sentry/components/loadingIndicator';
1614
import {IconSettings} from 'sentry/icons';
1715
import {t, tct, tn} from 'sentry/locale';
1816
import type {Organization} from 'sentry/types/organization';
1917
import {fetchMutation, useQuery} from 'sentry/utils/queryClient';
2018
import {useOrganization} from 'sentry/utils/useOrganization';
21-
import {SeerOverview} from 'sentry/views/settings/seer/overview/components';
2219
import {useSeerOverviewData} from 'sentry/views/settings/seer/overview/useSeerOverviewData';
2320
import {useAgentOptions} from 'sentry/views/settings/seer/seerAgentHooks';
2421

@@ -84,17 +81,6 @@ export function AutofixOverviewSection({stats, isLoading}: Props) {
8481
title={
8582
<Flex justify="between" gap="md" flexGrow={1}>
8683
<span>{t('Autofix')}</span>
87-
{/* <QuestionTooltip
88-
isHoverable
89-
title={tct(
90-
'These settings apply as new projects are created. Any [link:existing projects] will not be affected.',
91-
{
92-
link: <Link to={`/settings/${organization.slug}/seer/projects/`} />,
93-
}
94-
)}
95-
size="xs"
96-
icon="info"
97-
/> */}
9884
<Text uppercase={false}>
9985
<Link to={`/settings/${organization.slug}/seer/projects/`}>
10086
<Flex align="center" gap="xs">

static/app/views/settings/seer/overview/codeReviewOverviewSection.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,18 @@ import {z} from 'zod';
33

44
import {Button} from '@sentry/scraps/button';
55
import {AutoSaveForm, FieldGroup} from '@sentry/scraps/form';
6-
import {FieldMeta} from '@sentry/scraps/form/field/meta';
76
import {Container, Flex, Grid, Stack} from '@sentry/scraps/layout';
87
import {Link} from '@sentry/scraps/link';
98
import {Text} from '@sentry/scraps/text';
109

1110
import {updateOrganization} from 'sentry/actionCreators/organizations';
1211
import {hasEveryAccess} from 'sentry/components/acl/access';
13-
import {LoadingIndicator} from 'sentry/components/loadingIndicator';
1412
import {IconSettings} from 'sentry/icons';
1513
import {t, tct, tn} from 'sentry/locale';
1614
import {DEFAULT_CODE_REVIEW_TRIGGERS} from 'sentry/types/integrations';
1715
import type {Organization} from 'sentry/types/organization';
1816
import {fetchMutation} from 'sentry/utils/queryClient';
1917
import {useOrganization} from 'sentry/utils/useOrganization';
20-
import {SeerOverview} from 'sentry/views/settings/seer/overview/components';
2118
import {useSeerOverviewData} from 'sentry/views/settings/seer/overview/useSeerOverviewData';
2219

2320
interface Props {
@@ -49,17 +46,6 @@ export function CodeReviewOverviewSection({stats, isLoading}: Props) {
4946
title={
5047
<Flex justify="between" gap="md" flexGrow={1}>
5148
<span>{t('Code Review')}</span>
52-
{/* <QuestionTooltip
53-
isHoverable
54-
title={tct(
55-
'These settings apply as new projects are created. Any [link:existing projects] will not be affected.',
56-
{
57-
link: <Link to={`/settings/${organization.slug}/seer/projects/`} />,
58-
}
59-
)}
60-
size="xs"
61-
icon="info"
62-
/> */}
6349
<Text uppercase={false}>
6450
<Link to={`/settings/${organization.slug}/seer/repos/`}>
6551
<Flex align="center" gap="xs">
Lines changed: 79 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
import {Fragment} from 'react';
1+
import {Fragment, type ComponentProps} from 'react';
22

33
import * as Storybook from 'sentry/stories';
44
import type {
55
IntegrationRepository,
66
OrganizationIntegration,
77
} from 'sentry/types/integrations';
8-
import {SeerOverview} from 'sentry/views/settings/seer/overview/components';
9-
import {SCMOverviewSectionView} from 'sentry/views/settings/seer/overview/scmOverviewSection';
8+
import {SCMOverviewSection} from 'sentry/views/settings/seer/overview/scmOverviewSection';
109

1110
const GITHUB_INTEGRATION: OrganizationIntegration = {
1211
id: '1',
@@ -38,7 +37,7 @@ const REPOS: IntegrationRepository[] = [
3837
{identifier: 'my-org/infra', name: 'my-org/infra', isInstalled: true},
3938
];
4039

41-
const BASE_PROPS = {
40+
const BASE_PROPS: ComponentProps<typeof SCMOverviewSection> = {
4241
canWrite: true,
4342
organizationSlug: 'my-org',
4443
isError: false,
@@ -70,94 +69,99 @@ export default Storybook.story('SCMOverviewSection', story => {
7069
));
7170

7271
story('Loading', () => (
73-
<SeerOverview>
74-
<SCMOverviewSectionView
75-
{...BASE_PROPS}
76-
isPending
77-
supportedScmIntegrations={[]}
78-
seerRepos={[]}
79-
connectedRepos={[]}
80-
unconnectedRepos={[]}
81-
/>
82-
</SeerOverview>
72+
<SCMOverviewSection
73+
{...BASE_PROPS}
74+
isPending
75+
supportedScmIntegrations={[]}
76+
seerRepos={[]}
77+
connectedRepos={[]}
78+
unconnectedRepos={[]}
79+
/>
8380
));
8481

8582
story('Error', () => (
86-
<SeerOverview>
87-
<SCMOverviewSectionView
88-
{...BASE_PROPS}
89-
isError
90-
supportedScmIntegrations={[]}
91-
seerRepos={[]}
92-
connectedRepos={[]}
93-
unconnectedRepos={[]}
94-
/>
95-
</SeerOverview>
83+
<SCMOverviewSection
84+
{...BASE_PROPS}
85+
isError
86+
supportedScmIntegrations={[]}
87+
seerRepos={[]}
88+
connectedRepos={[]}
89+
unconnectedRepos={[]}
90+
/>
9691
));
9792

9893
story('No supported integrations installed', () => (
99-
<SeerOverview>
100-
<SCMOverviewSectionView
101-
{...BASE_PROPS}
102-
supportedScmIntegrations={[]}
103-
seerRepos={[]}
104-
connectedRepos={[]}
105-
unconnectedRepos={[]}
106-
/>
107-
</SeerOverview>
94+
<SCMOverviewSection
95+
{...BASE_PROPS}
96+
supportedScmIntegrations={[]}
97+
seerRepos={[]}
98+
connectedRepos={[]}
99+
unconnectedRepos={[]}
100+
/>
108101
));
109102

110103
story('Integration installed, provider has no accessible repos', () => (
111-
<SeerOverview>
112-
<SCMOverviewSectionView
113-
{...BASE_PROPS}
114-
seerRepos={[]}
115-
connectedRepos={[]}
116-
unconnectedRepos={[]}
117-
/>
118-
</SeerOverview>
104+
<SCMOverviewSection
105+
{...BASE_PROPS}
106+
seerRepos={[]}
107+
connectedRepos={[]}
108+
unconnectedRepos={[]}
109+
/>
119110
));
120111

121-
story('Integration installed, repos visible but none added to Sentry', () => (
122-
<SeerOverview>
123-
<SCMOverviewSectionView {...BASE_PROPS} />
124-
</SeerOverview>
112+
story('Integration installed, 1 repo visible but none added to Sentry', () => (
113+
<SCMOverviewSection {...BASE_PROPS} seerRepos={REPOS.slice(0, 1)} />
125114
));
126115

127-
story('Some repos connected', () => (
128-
<SeerOverview>
129-
<SCMOverviewSectionView
130-
{...BASE_PROPS}
131-
connectedRepos={REPOS.slice(0, 1)}
132-
unconnectedRepos={REPOS.slice(1).map(repo => ({
133-
repo,
134-
integration: GITHUB_INTEGRATION,
135-
}))}
136-
/>
137-
</SeerOverview>
116+
story('Integration installed, >1 repos visible but none added to Sentry', () => (
117+
<SCMOverviewSection {...BASE_PROPS} />
138118
));
139119

140-
story('All repos connected', () => (
141-
<SeerOverview>
142-
<SCMOverviewSectionView
143-
{...BASE_PROPS}
144-
connectedRepos={REPOS}
145-
unconnectedRepos={[]}
146-
/>
147-
</SeerOverview>
120+
story('Loading more repos', () => (
121+
<SCMOverviewSection
122+
{...BASE_PROPS}
123+
isReposPending
124+
connectedRepos={REPOS.slice(0, 1)}
125+
unconnectedRepos={REPOS.slice(1).map(repo => ({
126+
repo,
127+
isReposPending: true,
128+
integration: GITHUB_INTEGRATION,
129+
}))}
130+
/>
131+
));
132+
133+
story('1 of 1 repo added', () => (
134+
<SCMOverviewSection
135+
{...BASE_PROPS}
136+
connectedRepos={REPOS.slice(0, 1)}
137+
unconnectedRepos={[]}
138+
/>
139+
));
140+
141+
story('Some repos added', () => (
142+
<SCMOverviewSection
143+
{...BASE_PROPS}
144+
connectedRepos={REPOS.slice(0, 1)}
145+
unconnectedRepos={REPOS.slice(1).map(repo => ({
146+
repo,
147+
integration: GITHUB_INTEGRATION,
148+
}))}
149+
/>
150+
));
151+
152+
story('All repos added', () => (
153+
<SCMOverviewSection {...BASE_PROPS} connectedRepos={REPOS} unconnectedRepos={[]} />
148154
));
149155

150156
story('Read-only (canWrite: false)', () => (
151-
<SeerOverview>
152-
<SCMOverviewSectionView
153-
{...BASE_PROPS}
154-
canWrite={false}
155-
connectedRepos={REPOS.slice(0, 1)}
156-
unconnectedRepos={REPOS.slice(1).map(repo => ({
157-
repo,
158-
integration: GITHUB_INTEGRATION,
159-
}))}
160-
/>
161-
</SeerOverview>
157+
<SCMOverviewSection
158+
{...BASE_PROPS}
159+
canWrite={false}
160+
connectedRepos={REPOS.slice(0, 1)}
161+
unconnectedRepos={REPOS.slice(1).map(repo => ({
162+
repo,
163+
integration: GITHUB_INTEGRATION,
164+
}))}
165+
/>
162166
));
163167
});

0 commit comments

Comments
 (0)