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
2 changes: 1 addition & 1 deletion static/app/types/event.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export type EventGroupComponent = {
name: string | null;
values: EventGroupComponent[] | string[];
};
export type EventGroupingConfig = {
type EventGroupingConfig = {
base: string | null;
delegates: string[];
id: string;
Expand Down
12 changes: 0 additions & 12 deletions static/app/views/settings/projectGeneralSettings/index.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import {GroupingConfigsFixture} from 'sentry-fixture/groupingConfigs';
import {OrganizationFixture} from 'sentry-fixture/organization';
import {ProjectFixture} from 'sentry-fixture/project';

Expand Down Expand Up @@ -37,7 +36,6 @@ describe('projectGeneralSettings', () => {
securityTokenHeader: 'x-security-header',
verifySSL: true,
});
const groupingConfigs = GroupingConfigsFixture();
let putMock: jest.Mock;
const mockOnChangeSlug = jest.fn();

Expand All @@ -50,11 +48,6 @@ describe('projectGeneralSettings', () => {

beforeEach(() => {
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: `/organizations/${organization.slug}/grouping-configs/`,
method: 'GET',
body: groupingConfigs,
});
MockApiClient.addMockResponse({
url: `/projects/${organization.slug}/${project.slug}/`,
method: 'GET',
Expand Down Expand Up @@ -471,11 +464,6 @@ describe('projectGeneralSettings', () => {
beforeEach(() => {
mockOnChangeSlug.mockClear();
MockApiClient.clearMockResponses();
MockApiClient.addMockResponse({
url: '/organizations/org-slug/grouping-configs/',
method: 'GET',
body: groupingConfigs,
});
MockApiClient.addMockResponse({
url: '/projects/org-slug/project-slug/environments/',
method: 'GET',
Expand Down
32 changes: 0 additions & 32 deletions static/app/views/settings/projectIssueGrouping/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,47 +13,15 @@ describe('projectIssueGrouping', () => {
const project = projects[0]!;

it('renders successfully', async () => {
const request = MockApiClient.addMockResponse({
url: `/projects/${organization.slug}/${project.slug}/grouping-configs/`,
body: [],
});

render(<ProjectIssueGrouping />, {
organization,
outletContext: {project},
});

expect(request).toHaveBeenCalled();
expect(await screen.findByText('Issue Grouping')).toBeInTheDocument();
});

it('renders error', async () => {
const request = MockApiClient.addMockResponse({
url: `/projects/${organization.slug}/${project.slug}/grouping-configs/`,
body: {
detail: 'Internal Error',
},
statusCode: 500,
});

render(<ProjectIssueGrouping />, {
organization,
outletContext: {project},
});

expect(request).toHaveBeenCalled();
expect(
await screen.findByText('Failed to load grouping configs')
).toBeInTheDocument();
});

it('shows derived grouping enhancements only for superusers', async () => {
// Mock the API response
MockApiClient.addMockResponse({
url: `/projects/${organization.slug}/${project.slug}/grouping-configs/`,
body: [],
});

// First render with a non-superuser
const {rerender} = render(<ProjectIssueGrouping />, {
organization,
Expand Down
32 changes: 0 additions & 32 deletions static/app/views/settings/projectIssueGrouping/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@ import {ExternalLink} from '@sentry/scraps/link';
import {hasEveryAccess} from 'sentry/components/acl/access';
import {Form} from 'sentry/components/forms/form';
import JsonForm from 'sentry/components/forms/jsonForm';
import {LoadingError} from 'sentry/components/loadingError';
import {LoadingIndicator} from 'sentry/components/loadingIndicator';
import {SentryDocumentTitle} from 'sentry/components/sentryDocumentTitle';
import {fields} from 'sentry/data/forms/projectIssueGrouping';
import {t, tct} from 'sentry/locale';
import {ProjectsStore} from 'sentry/stores/projectsStore';
import type {EventGroupingConfig} from 'sentry/types/event';
import type {Project} from 'sentry/types/project';
import {getApiUrl} from 'sentry/utils/api/getApiUrl';
import {useApiQuery} from 'sentry/utils/queryClient';
import {routeTitleGen} from 'sentry/utils/routeTitle';
import {useOrganization} from 'sentry/utils/useOrganization';
import {SettingsPageHeader} from 'sentry/views/settings/components/settingsPageHeader';
Expand All @@ -24,29 +19,6 @@ export default function ProjectIssueGrouping() {
const organization = useOrganization();
const {project} = useProjectSettingsOutlet();

const queryKey = getApiUrl(
'/projects/$organizationIdOrSlug/$projectIdOrSlug/grouping-configs/',
{
path: {organizationIdOrSlug: organization.slug, projectIdOrSlug: project.slug},
}
);
const {
data: groupingConfigs,
isPending,
isError,
refetch,
} = useApiQuery<EventGroupingConfig[]>([queryKey], {staleTime: 0, gcTime: 0});

if (isPending) {
return <LoadingIndicator />;
}

if (isError) {
return (
<LoadingError message={t('Failed to load grouping configs')} onRetry={refetch} />
);
}

const handleSubmit = (response: Project) => {
// This will update our project context
ProjectsStore.onUpdateSuccess(response);
Expand All @@ -58,10 +30,6 @@ export default function ProjectIssueGrouping() {
const hasAccess = hasEveryAccess(['project:write'], {organization, project});

const jsonFormProps = {
additionalFieldProps: {
organization,
groupingConfigs,
},
features: new Set(organization.features),
access,
disabled: !hasAccess,
Expand Down
12 changes: 0 additions & 12 deletions tests/js/fixtures/groupingConfigs.ts

This file was deleted.

Loading