diff --git a/static/app/components/events/interfaces/exceptionContent.tsx b/static/app/components/events/interfaces/crashContent/exception/content.tsx similarity index 72% rename from static/app/components/events/interfaces/exceptionContent.tsx rename to static/app/components/events/interfaces/crashContent/exception/content.tsx index db185b27c94897..acf73b34b95836 100644 --- a/static/app/components/events/interfaces/exceptionContent.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/content.tsx @@ -1,33 +1,31 @@ import * as React from 'react'; import styled from '@emotion/styled'; -import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism'; import Annotated from 'app/components/events/meta/annotated'; import space from 'app/styles/space'; import {ExceptionType} from 'app/types'; import {Event} from 'app/types/event'; import {STACK_TYPE} from 'app/types/stacktrace'; -import ExceptionStacktraceContent from './exceptionStacktraceContent'; -import ExceptionTitle from './exceptionTitle'; +import Mechanism from './mechanism'; +import StackTrace from './stackTrace'; +import ExceptionTitle from './title'; -type ExceptionStacktraceContentProps = React.ComponentProps< - typeof ExceptionStacktraceContent ->; +type StackTraceProps = React.ComponentProps; type Props = { event: Event; type: STACK_TYPE; - platform: ExceptionStacktraceContentProps['platform']; - stackView?: ExceptionStacktraceContentProps['stackView']; + platform: StackTraceProps['platform']; + stackView?: StackTraceProps['stackView']; newestFirst?: boolean; } & Pick & Pick< - React.ComponentProps, + React.ComponentProps, 'groupingCurrentLevel' | 'hasHierarchicalGrouping' >; -const ExceptionContent = ({ +const Content = ({ newestFirst, event, stackView, @@ -47,8 +45,8 @@ const ExceptionContent = ({ {value => {value}} - {exc.mechanism && } - } + {children}; }; -export default ExceptionContent; +export default Content; const StyledPre = styled('pre')` margin-bottom: ${space(1)}; diff --git a/static/app/components/events/interfaces/crashContent/exception.tsx b/static/app/components/events/interfaces/crashContent/exception/index.tsx similarity index 92% rename from static/app/components/events/interfaces/crashContent/exception.tsx rename to static/app/components/events/interfaces/crashContent/exception/index.tsx index 843c3dbc355188..af37792e2a32f8 100644 --- a/static/app/components/events/interfaces/crashContent/exception.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/index.tsx @@ -1,10 +1,11 @@ import ErrorBoundary from 'app/components/errorBoundary'; -import ExceptionContent from 'app/components/events/interfaces/exceptionContent'; import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent'; import {ExceptionType, Group, PlatformType, Project} from 'app/types'; import {Event} from 'app/types/event'; import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace'; +import Content from './content'; + type Props = { stackType: STACK_TYPE; projectId: Project['id']; @@ -37,7 +38,7 @@ const Exception = ({ platform={platform} /> ) : ( - { +class Mechanism extends Component { render() { const mechanism = this.props.data; const {type, description, help_link, handled, meta = {}, data = {}} = mechanism; @@ -86,7 +86,7 @@ class ExceptionMechanism extends Component { } } -export default ExceptionMechanism; +export default Mechanism; const Wrapper = styled('div')` margin: ${space(2)} 0; diff --git a/static/app/components/events/interfaces/exceptionStacktraceContent.tsx b/static/app/components/events/interfaces/crashContent/exception/stackTrace.tsx similarity index 93% rename from static/app/components/events/interfaces/exceptionStacktraceContent.tsx rename to static/app/components/events/interfaces/crashContent/exception/stackTrace.tsx index 96a374263003c7..299bad4e67d8a1 100644 --- a/static/app/components/events/interfaces/exceptionStacktraceContent.tsx +++ b/static/app/components/events/interfaces/crashContent/exception/stackTrace.tsx @@ -7,8 +7,8 @@ import {STACK_VIEW} from 'app/types/stacktrace'; import {defined} from 'app/utils'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; -import StacktraceContent from './stacktraceContent'; -import StacktraceContentV2 from './stacktraceContentV2'; +import StacktraceContent from '../../stacktraceContent'; +import StacktraceContentV2 from '../../stacktraceContentV2'; type Props = { data: ExceptionValue['stacktrace']; @@ -23,7 +23,7 @@ type Props = { newestFirst?: boolean; }; -const ExceptionStacktraceContent = ({ +const StackTrace = ({ stackView, stacktrace, chainedException, @@ -101,4 +101,4 @@ const ExceptionStacktraceContent = ({ ); }; -export default ExceptionStacktraceContent; +export default StackTrace; diff --git a/static/app/components/events/interfaces/exceptionTitle.tsx b/static/app/components/events/interfaces/crashContent/exception/title.tsx similarity index 100% rename from static/app/components/events/interfaces/exceptionTitle.tsx rename to static/app/components/events/interfaces/crashContent/exception/title.tsx diff --git a/static/app/components/events/interfaces/crashContent/stacktrace.tsx b/static/app/components/events/interfaces/crashContent/stacktrace.tsx index f3e2492aace04b..b03bc245572b4b 100644 --- a/static/app/components/events/interfaces/crashContent/stacktrace.tsx +++ b/static/app/components/events/interfaces/crashContent/stacktrace.tsx @@ -1,11 +1,12 @@ import ErrorBoundary from 'app/components/errorBoundary'; import rawStacktraceContent from 'app/components/events/interfaces/rawStacktraceContent'; -import StacktraceContent from 'app/components/events/interfaces/stacktraceContent'; -import StacktraceContentV2 from 'app/components/events/interfaces/stacktraceContentV2'; import {PlatformType} from 'app/types'; import {Event} from 'app/types/event'; import {STACK_VIEW, StacktraceType} from 'app/types/stacktrace'; +import StacktraceContent from '../stacktraceContent'; +import StacktraceContentV2 from '../stacktraceContentV2'; + type Props = Pick< React.ComponentProps, 'groupingCurrentLevel' diff --git a/static/app/components/events/interfaces/rawExceptionContent.tsx b/static/app/components/events/interfaces/rawExceptionContent.tsx index 7828aad3fde16a..34c1aca3138505 100644 --- a/static/app/components/events/interfaces/rawExceptionContent.tsx +++ b/static/app/components/events/interfaces/rawExceptionContent.tsx @@ -20,7 +20,7 @@ type Props = { platform: PlatformType; eventId: Event['id']; // XXX: Organization is NOT available for Shared Issues! - organization: Organization; + organization?: Organization; } & Pick; type State = { diff --git a/static/app/types/index.tsx b/static/app/types/index.tsx index a1a712e9b0f34a..fbe35bc641179a 100644 --- a/static/app/types/index.tsx +++ b/static/app/types/index.tsx @@ -21,7 +21,7 @@ import {Field} from 'app/views/settings/components/forms/type'; import {DynamicSamplingRules} from './dynamicSampling'; import {Event} from './event'; -import {Mechanism, RawStacktrace, StacktraceType} from './stacktrace'; +import {RawStacktrace, StackTraceMechanism, StacktraceType} from './stacktrace'; export enum SentryInitRenderReactComponent { INDICATORS = 'Indicators', @@ -2046,7 +2046,7 @@ export type ExceptionValue = { threadId: number | null; stacktrace: StacktraceType | null; rawStacktrace: RawStacktrace; - mechanism: Mechanism | null; + mechanism: StackTraceMechanism | null; module: string | null; frames: Frame[] | null; }; diff --git a/static/app/types/stacktrace.tsx b/static/app/types/stacktrace.tsx index d14c560f89c2be..1898f7f1df894e 100644 --- a/static/app/types/stacktrace.tsx +++ b/static/app/types/stacktrace.tsx @@ -39,7 +39,7 @@ type MechanismMeta = { }; }; -export type Mechanism = { +export type StackTraceMechanism = { handled: boolean; synthetic: boolean; type: string; diff --git a/tests/js/spec/components/events/interfaces/exceptionMechanism.spec.jsx b/tests/js/spec/components/events/interfaces/crashContent/exception/mechanism.spec.jsx similarity index 99% rename from tests/js/spec/components/events/interfaces/exceptionMechanism.spec.jsx rename to tests/js/spec/components/events/interfaces/crashContent/exception/mechanism.spec.jsx index 86841ec0e0e3af..2918c077406298 100644 --- a/tests/js/spec/components/events/interfaces/exceptionMechanism.spec.jsx +++ b/tests/js/spec/components/events/interfaces/crashContent/exception/mechanism.spec.jsx @@ -1,6 +1,6 @@ import {mountWithTheme} from 'sentry-test/enzyme'; -import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism'; +import ExceptionMechanism from 'app/components/events/interfaces/crashContent/exception/mechanism'; describe('ExceptionMechanism', () => { describe('basic attributes', () => { diff --git a/tests/js/spec/components/events/interfaces/exceptionStacktraceContent.spec.jsx b/tests/js/spec/components/events/interfaces/crashContent/exception/stackTrace.spec.jsx similarity index 98% rename from tests/js/spec/components/events/interfaces/exceptionStacktraceContent.spec.jsx rename to tests/js/spec/components/events/interfaces/crashContent/exception/stackTrace.spec.jsx index 5c4a3cb811610f..4b231d432e4f7c 100644 --- a/tests/js/spec/components/events/interfaces/exceptionStacktraceContent.spec.jsx +++ b/tests/js/spec/components/events/interfaces/crashContent/exception/stackTrace.spec.jsx @@ -2,7 +2,7 @@ import cloneDeep from 'lodash/cloneDeep'; import {mountWithTheme} from 'sentry-test/enzyme'; -import ExceptionStacktraceContent from 'app/components/events/interfaces/exceptionStacktraceContent'; +import ExceptionStacktraceContent from 'app/components/events/interfaces/crashContent/exception/stackTrace'; import EmptyMessage from 'app/views/settings/components/emptyMessage'; describe('ExceptionStacktraceContent', () => {