Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Tag} from '@sentry/scraps/badge';
import {Container, Flex, Grid, Stack} from '@sentry/scraps/layout';
import {Heading, Text} from '@sentry/scraps/text';
import {Text} from '@sentry/scraps/text';
import {Tooltip} from '@sentry/scraps/tooltip';

import type {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand Down Expand Up @@ -36,17 +36,17 @@ export function ScmFeatureInfoCards({
<Stack gap="xl" width="100%" justify="center">
<Stack gap="md">
{platformName ? (
<Heading as="h3" size="xl">
<Text bold size="md" density="comfortable">
{tct('Available with [platformName]', {
platformName: (
<Text as="span" bold variant="accent">
{platformName}
</Text>
),
})}
</Heading>
</Text>
) : null}
<Text size="lg" variant="secondary" density="comfortable">
<Text size="md" variant="secondary" density="comfortable">
{t('In the next step, run our setup wizard to choose what to instrument')}
</Text>
</Stack>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Flex, Stack} from '@sentry/scraps/layout';
import {Heading, Text} from '@sentry/scraps/text';
import {Text} from '@sentry/scraps/text';

import type {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';
import type {DisabledProducts} from 'sentry/components/onboarding/productSelection';
Expand Down Expand Up @@ -30,9 +30,9 @@ export function ScmFeatureSelectionCards({
return (
<Stack gap="xl" width="100%" justify="center">
<Flex justify="between" align="center">
<Heading as="h3" size="xl">
<Text bold size="md" density="comfortable">
{t('What do you want to instrument?')}
</Heading>
</Text>
{availableFeatures.length > 1 ? (
<Text size="sm" variant="secondary">
{t('Choose one or more')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export function ScmIntegrationConnect({
onChange={handleIntegrationSelect}
/>
) : (
<Text variant="secondary" bold size="sm" density="compressed" uppercase>
<Text bold size="sm" density="compressed" uppercase>
{t(
'Connected to %s / %s',
effectiveIntegration.provider.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
platformProductAvailability,
} from 'sentry/components/onboarding/productSelection';
import {PLATFORM_PRODUCT_INFO} from 'sentry/data/platformProductInfo.generated';
import {IconBroadcast, IconBusiness, IconGeneric} from 'sentry/icons';
import {IconBroadcast, IconBusiness} from 'sentry/icons';
import {t, tct} from 'sentry/locale';
import type {Repository} from 'sentry/types/integrations';
import type {OnboardingSelectedSDK} from 'sentry/types/onboarding';
Expand Down Expand Up @@ -440,8 +440,8 @@ export function ScmPlatformFeaturesCore({
>
<Flex justify="between" align="center">
<Flex align="center" gap="sm">
<IconBroadcast size="sm" variant="secondary" />
<Text variant="secondary" bold size="sm" density="comfortable" uppercase>
<IconBroadcast size="sm" />
<Text bold size="md" density="comfortable">
{t('Auto-detected from your repository')}
</Text>
</Flex>
Expand Down Expand Up @@ -491,8 +491,7 @@ export function ScmPlatformFeaturesCore({
>
<Flex justify="between" align="center">
<Flex align="center" gap="sm">
<IconGeneric size="sm" variant="secondary" />
<Text variant="secondary" bold size="sm" density="comfortable" uppercase>
<Text bold size="md" density="comfortable">
{t('Select a platform')}
</Text>
</Flex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ describe('ScmProjectDetailsCore', () => {
it('renders the project name, team, and alert-frequency fields', () => {
renderCore();

expect(screen.getByText('Give your project a name')).toBeInTheDocument();
expect(screen.getByText('Assign a team')).toBeInTheDocument();
expect(screen.getByText('Project name')).toBeInTheDocument();
expect(screen.getByText('Team')).toBeInTheDocument();
expect(screen.getByText('Alert frequency')).toBeInTheDocument();
expect(screen.getByPlaceholderText('project-name')).toHaveValue('my-project');
});
Expand All @@ -54,7 +54,7 @@ describe('ScmProjectDetailsCore', () => {
it('hides the team selector for a no-access member', () => {
renderCore({isOrgMemberWithNoAccess: true});

expect(screen.getByText('Give your project a name')).toBeInTheDocument();
expect(screen.queryByText('Assign a team')).not.toBeInTheDocument();
expect(screen.getByText('Project name')).toBeInTheDocument();
expect(screen.queryByText('Team')).not.toBeInTheDocument();
});
});
99 changes: 54 additions & 45 deletions static/app/views/onboarding/components/scmProjectDetailsCore.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import {useEffect} from 'react';

import {Input} from '@sentry/scraps/input';
import {Container, Flex, Stack} from '@sentry/scraps/layout';
import {Container, Grid, Stack} from '@sentry/scraps/layout';
import {Text} from '@sentry/scraps/text';

import {TeamSelector} from 'sentry/components/teamSelector';
import {IconGroup, IconProject, IconSiren} from 'sentry/icons';
import {t} from 'sentry/locale';
import type {Team} from 'sentry/types/organization';
import {trackAnalytics} from 'sentry/utils/analytics';
Expand Down Expand Up @@ -66,61 +65,71 @@ export function ScmProjectDetailsCore({

return (
<Stack gap="3xl" width="100%" maxWidth={contentMaxWidth}>
<Stack gap="md">
<Flex gap="md" align="center">
<IconProject size="md" variant="secondary" />
<Container>
<Text bold size="lg" density="comfortable">
{t('Give your project a name')}
</Text>
</Container>
</Flex>
<Input
type="text"
placeholder={t('project-name')}
value={projectName}
onChange={e => onProjectNameChange(e.target.value)}
onBlur={onProjectNameBlur}
/>
</Stack>

{!isOrgMemberWithNoAccess && (
<Grid width="100%" columns={{sm: '1fr', md: '1fr 1fr'}} gap="2xl">
<Stack gap="md">
<Flex gap="md" align="center">
<IconGroup size="md" />
<Stack gap="xs">
<Container>
<Text bold size="lg" density="comfortable">
{t('Assign a team')}
<Text bold size="md" density="comfortable">
{t('Project name')}
</Text>
</Container>
</Flex>
<TeamSelector
allowCreate
name="team"
aria-label={t('Select a Team')}
clearable={false}
placeholder={t('Select a Team')}
teamFilter={(tm: Team) => tm.access.includes('team:admin')}
value={teamSlug}
onChange={onTeamChange}
<Container>
<Text variant="muted" density="comfortable">
{t('Slug used in URLs and SDK config')}
</Text>
</Container>
</Stack>
<Input
type="text"
placeholder={t('project-name')}
value={projectName}
onChange={e => onProjectNameChange(e.target.value)}
onBlur={onProjectNameBlur}
/>
</Stack>
)}

{!isOrgMemberWithNoAccess && (
<Stack gap="md">
<Stack gap="xs">
<Container>
<Text bold size="md" density="comfortable">
{t('Team')}
</Text>
</Container>
<Container>
<Text variant="muted" density="comfortable">
{t('Set who owns alerts for this project')}
</Text>
</Container>
</Stack>
<TeamSelector
allowCreate
name="team"
aria-label={t('Select a Team')}
clearable={false}
placeholder={t('Select a Team')}
teamFilter={(tm: Team) => tm.access.includes('team:admin')}
value={teamSlug}
onChange={onTeamChange}
/>
</Stack>
)}
</Grid>
Comment thread
cursor[bot] marked this conversation as resolved.

<Stack gap="md">
<Flex gap="md" align="center">
<IconSiren size="md" />
<Stack gap="xs">
<Container>
<Text bold size="lg" density="comfortable">
<Text bold size="md" density="comfortable">
{t('Alert frequency')}
</Text>
</Container>
</Flex>
<Container>
<Text variant="muted" size="lg" density="comfortable">
{t('Get notified when things go wrong')}
</Text>
</Container>
<Container>
<Text variant="muted" density="comfortable">
{t('Get notified when things go wrong')}
</Text>
</Container>
</Stack>

<ScmAlertFrequency {...alertRuleConfig} onFieldChange={onAlertChange} />
</Stack>
</Stack>
Expand Down
20 changes: 6 additions & 14 deletions static/app/views/onboarding/scmPlatformFeatures.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ describe('ScmPlatformFeatures', () => {
const props = defaultProps({selectedRepository: mockRepository});
render(<ScmPlatformFeatures {...props} />, {organization});

expect(
await screen.findByRole('heading', {level: 3, name: 'Available with Next.js'})
).toBeInTheDocument();
expect(await screen.findByText(/^Available with/)).toBeInTheDocument();
expect(props.onPlatformChange).toHaveBeenCalledWith(
expect.objectContaining({key: 'javascript-nextjs'})
);
Expand All @@ -158,9 +156,7 @@ describe('ScmPlatformFeatures', () => {
{organization}
);

expect(
await screen.findByRole('heading', {level: 3, name: 'Available with Next.js'})
).toBeInTheDocument();
expect(await screen.findByText(/^Available with/)).toBeInTheDocument();
expect(screen.getByText('Error monitoring')).toBeInTheDocument();
expect(screen.getByText('Tracing')).toBeInTheDocument();
expect(screen.getByText('Session replay')).toBeInTheDocument();
Expand All @@ -187,9 +183,7 @@ describe('ScmPlatformFeatures', () => {
await screen.findByText('What do you want to instrument?')
).toBeInTheDocument();
expect(screen.getByRole('checkbox', {name: /Tracing/})).toBeInTheDocument();
expect(
screen.queryByRole('heading', {level: 3, name: /^Available with /})
).not.toBeInTheDocument();
expect(screen.queryByText(/^Available with/)).not.toBeInTheDocument();
});

it('skips the feature-cards block for platforms in neither map', async () => {
Expand Down Expand Up @@ -217,9 +211,7 @@ describe('ScmPlatformFeatures', () => {

await screen.findByRole('button', {name: 'Continue'});

expect(
screen.queryByRole('heading', {level: 3, name: /^Available with /})
).not.toBeInTheDocument();
expect(screen.queryByText(/^Available with/)).not.toBeInTheDocument();
expect(
screen.queryByText('What do you want to instrument?')
).not.toBeInTheDocument();
Expand Down Expand Up @@ -513,7 +505,7 @@ describe('ScmPlatformFeatures', () => {
{organization}
);

await screen.findByRole('heading', {level: 3, name: 'Available with Next.js'});
await screen.findByText(/^Available with/);

const detectedCalls = trackAnalyticsSpy.mock.calls.filter(
([event, params]) =>
Expand Down Expand Up @@ -549,7 +541,7 @@ describe('ScmPlatformFeatures', () => {
);

// First repo auto-detects Next.js and fires the detected event once.
await screen.findByRole('heading', {level: 3, name: 'Available with Next.js'});
await screen.findByText(/^Available with/);
expect(
trackAnalyticsSpy.mock.calls.filter(
([event, params]) =>
Expand Down
6 changes: 3 additions & 3 deletions static/app/views/onboarding/scmProjectDetails.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ describe('ScmProjectDetails', () => {
expect(await screen.findByText('Project details')).toBeInTheDocument();
});

it('renders section headers with icons', async () => {
it('renders section headers', async () => {
render(<ScmProjectDetails {...defaultProps({selectedPlatform: mockPlatform})} />, {
organization,
});

expect(await screen.findByText('Give your project a name')).toBeInTheDocument();
expect(screen.getByText('Assign a team')).toBeInTheDocument();
expect(await screen.findByText('Project name')).toBeInTheDocument();
expect(screen.getByText('Team')).toBeInTheDocument();
expect(screen.getByText('Alert frequency')).toBeInTheDocument();
expect(screen.getByText('Get notified when things go wrong')).toBeInTheDocument();
});
Expand Down
Loading
Loading