Browse Source

ref(crashContent): Move crash content related files to folder (#29509)

Priscila Oliveira 3 years ago
parent
commit
49676c7f6a

+ 11 - 13
static/app/components/events/interfaces/exceptionContent.tsx → static/app/components/events/interfaces/crashContent/exception/content.tsx

@@ -1,33 +1,31 @@
 import * as React from 'react';
 import * as React from 'react';
 import styled from '@emotion/styled';
 import styled from '@emotion/styled';
 
 
-import ExceptionMechanism from 'app/components/events/interfaces/exceptionMechanism';
 import Annotated from 'app/components/events/meta/annotated';
 import Annotated from 'app/components/events/meta/annotated';
 import space from 'app/styles/space';
 import space from 'app/styles/space';
 import {ExceptionType} from 'app/types';
 import {ExceptionType} from 'app/types';
 import {Event} from 'app/types/event';
 import {Event} from 'app/types/event';
 import {STACK_TYPE} from 'app/types/stacktrace';
 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<typeof StackTrace>;
 
 
 type Props = {
 type Props = {
   event: Event;
   event: Event;
   type: STACK_TYPE;
   type: STACK_TYPE;
-  platform: ExceptionStacktraceContentProps['platform'];
-  stackView?: ExceptionStacktraceContentProps['stackView'];
+  platform: StackTraceProps['platform'];
+  stackView?: StackTraceProps['stackView'];
   newestFirst?: boolean;
   newestFirst?: boolean;
 } & Pick<ExceptionType, 'values'> &
 } & Pick<ExceptionType, 'values'> &
   Pick<
   Pick<
-    React.ComponentProps<typeof ExceptionStacktraceContent>,
+    React.ComponentProps<typeof StackTrace>,
     'groupingCurrentLevel' | 'hasHierarchicalGrouping'
     'groupingCurrentLevel' | 'hasHierarchicalGrouping'
   >;
   >;
 
 
-const ExceptionContent = ({
+const Content = ({
   newestFirst,
   newestFirst,
   event,
   event,
   stackView,
   stackView,
@@ -47,8 +45,8 @@ const ExceptionContent = ({
       <Annotated object={exc} objectKey="value" required>
       <Annotated object={exc} objectKey="value" required>
         {value => <StyledPre className="exc-message">{value}</StyledPre>}
         {value => <StyledPre className="exc-message">{value}</StyledPre>}
       </Annotated>
       </Annotated>
-      {exc.mechanism && <ExceptionMechanism data={exc.mechanism} />}
-      <ExceptionStacktraceContent
+      {exc.mechanism && <Mechanism data={exc.mechanism} />}
+      <StackTrace
         data={
         data={
           type === STACK_TYPE.ORIGINAL
           type === STACK_TYPE.ORIGINAL
             ? exc.stacktrace
             ? exc.stacktrace
@@ -74,7 +72,7 @@ const ExceptionContent = ({
   return <div>{children}</div>;
   return <div>{children}</div>;
 };
 };
 
 
-export default ExceptionContent;
+export default Content;
 
 
 const StyledPre = styled('pre')`
 const StyledPre = styled('pre')`
   margin-bottom: ${space(1)};
   margin-bottom: ${space(1)};

+ 3 - 2
static/app/components/events/interfaces/crashContent/exception.tsx → static/app/components/events/interfaces/crashContent/exception/index.tsx

@@ -1,10 +1,11 @@
 import ErrorBoundary from 'app/components/errorBoundary';
 import ErrorBoundary from 'app/components/errorBoundary';
-import ExceptionContent from 'app/components/events/interfaces/exceptionContent';
 import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent';
 import RawExceptionContent from 'app/components/events/interfaces/rawExceptionContent';
 import {ExceptionType, Group, PlatformType, Project} from 'app/types';
 import {ExceptionType, Group, PlatformType, Project} from 'app/types';
 import {Event} from 'app/types/event';
 import {Event} from 'app/types/event';
 import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace';
 import {STACK_TYPE, STACK_VIEW} from 'app/types/stacktrace';
 
 
+import Content from './content';
+
 type Props = {
 type Props = {
   stackType: STACK_TYPE;
   stackType: STACK_TYPE;
   projectId: Project['id'];
   projectId: Project['id'];
@@ -37,7 +38,7 @@ const Exception = ({
         platform={platform}
         platform={platform}
       />
       />
     ) : (
     ) : (
-      <ExceptionContent
+      <Content
         type={stackType}
         type={stackType}
         stackView={stackView}
         stackView={stackView}
         values={values}
         values={values}

+ 4 - 4
static/app/components/events/interfaces/exceptionMechanism.tsx → static/app/components/events/interfaces/crashContent/exception/mechanism.tsx

@@ -12,15 +12,15 @@ import Pills from 'app/components/pills';
 import {IconInfo, IconOpen} from 'app/icons';
 import {IconInfo, IconOpen} from 'app/icons';
 import {t} from 'app/locale';
 import {t} from 'app/locale';
 import space from 'app/styles/space';
 import space from 'app/styles/space';
-import {Mechanism} from 'app/types/stacktrace';
+import {StackTraceMechanism} from 'app/types/stacktrace';
 import {isUrl} from 'app/utils';
 import {isUrl} from 'app/utils';
 import {Theme} from 'app/utils/theme';
 import {Theme} from 'app/utils/theme';
 
 
 type Props = {
 type Props = {
-  data: Mechanism;
+  data: StackTraceMechanism;
 };
 };
 
 
-class ExceptionMechanism extends Component<Props> {
+class Mechanism extends Component<Props> {
   render() {
   render() {
     const mechanism = this.props.data;
     const mechanism = this.props.data;
     const {type, description, help_link, handled, meta = {}, data = {}} = mechanism;
     const {type, description, help_link, handled, meta = {}, data = {}} = mechanism;
@@ -86,7 +86,7 @@ class ExceptionMechanism extends Component<Props> {
   }
   }
 }
 }
 
 
-export default ExceptionMechanism;
+export default Mechanism;
 
 
 const Wrapper = styled('div')`
 const Wrapper = styled('div')`
   margin: ${space(2)} 0;
   margin: ${space(2)} 0;

+ 4 - 4
static/app/components/events/interfaces/exceptionStacktraceContent.tsx → 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 {defined} from 'app/utils';
 import EmptyMessage from 'app/views/settings/components/emptyMessage';
 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 = {
 type Props = {
   data: ExceptionValue['stacktrace'];
   data: ExceptionValue['stacktrace'];
@@ -23,7 +23,7 @@ type Props = {
   newestFirst?: boolean;
   newestFirst?: boolean;
 };
 };
 
 
-const ExceptionStacktraceContent = ({
+const StackTrace = ({
   stackView,
   stackView,
   stacktrace,
   stacktrace,
   chainedException,
   chainedException,
@@ -101,4 +101,4 @@ const ExceptionStacktraceContent = ({
   );
   );
 };
 };
 
 
-export default ExceptionStacktraceContent;
+export default StackTrace;

+ 0 - 0
static/app/components/events/interfaces/exceptionTitle.tsx → static/app/components/events/interfaces/crashContent/exception/title.tsx


+ 3 - 2
static/app/components/events/interfaces/crashContent/stacktrace.tsx

@@ -1,11 +1,12 @@
 import ErrorBoundary from 'app/components/errorBoundary';
 import ErrorBoundary from 'app/components/errorBoundary';
 import rawStacktraceContent from 'app/components/events/interfaces/rawStacktraceContent';
 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 {PlatformType} from 'app/types';
 import {Event} from 'app/types/event';
 import {Event} from 'app/types/event';
 import {STACK_VIEW, StacktraceType} from 'app/types/stacktrace';
 import {STACK_VIEW, StacktraceType} from 'app/types/stacktrace';
 
 
+import StacktraceContent from '../stacktraceContent';
+import StacktraceContentV2 from '../stacktraceContentV2';
+
 type Props = Pick<
 type Props = Pick<
   React.ComponentProps<typeof StacktraceContentV2>,
   React.ComponentProps<typeof StacktraceContentV2>,
   'groupingCurrentLevel'
   'groupingCurrentLevel'

+ 1 - 1
static/app/components/events/interfaces/rawExceptionContent.tsx

@@ -20,7 +20,7 @@ type Props = {
   platform: PlatformType;
   platform: PlatformType;
   eventId: Event['id'];
   eventId: Event['id'];
   // XXX: Organization is NOT available for Shared Issues!
   // XXX: Organization is NOT available for Shared Issues!
-  organization: Organization;
+  organization?: Organization;
 } & Pick<ExceptionType, 'values'>;
 } & Pick<ExceptionType, 'values'>;
 
 
 type State = {
 type State = {

+ 2 - 2
static/app/types/index.tsx

@@ -21,7 +21,7 @@ import {Field} from 'app/views/settings/components/forms/type';
 
 
 import {DynamicSamplingRules} from './dynamicSampling';
 import {DynamicSamplingRules} from './dynamicSampling';
 import {Event} from './event';
 import {Event} from './event';
-import {Mechanism, RawStacktrace, StacktraceType} from './stacktrace';
+import {RawStacktrace, StackTraceMechanism, StacktraceType} from './stacktrace';
 
 
 export enum SentryInitRenderReactComponent {
 export enum SentryInitRenderReactComponent {
   INDICATORS = 'Indicators',
   INDICATORS = 'Indicators',
@@ -2046,7 +2046,7 @@ export type ExceptionValue = {
   threadId: number | null;
   threadId: number | null;
   stacktrace: StacktraceType | null;
   stacktrace: StacktraceType | null;
   rawStacktrace: RawStacktrace;
   rawStacktrace: RawStacktrace;
-  mechanism: Mechanism | null;
+  mechanism: StackTraceMechanism | null;
   module: string | null;
   module: string | null;
   frames: Frame[] | null;
   frames: Frame[] | null;
 };
 };

+ 1 - 1
static/app/types/stacktrace.tsx

@@ -39,7 +39,7 @@ type MechanismMeta = {
   };
   };
 };
 };
 
 
-export type Mechanism = {
+export type StackTraceMechanism = {
   handled: boolean;
   handled: boolean;
   synthetic: boolean;
   synthetic: boolean;
   type: string;
   type: string;

+ 1 - 1
tests/js/spec/components/events/interfaces/exceptionMechanism.spec.jsx → tests/js/spec/components/events/interfaces/crashContent/exception/mechanism.spec.jsx

@@ -1,6 +1,6 @@
 import {mountWithTheme} from 'sentry-test/enzyme';
 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('ExceptionMechanism', () => {
   describe('basic attributes', () => {
   describe('basic attributes', () => {

Some files were not shown because too many files changed in this diff