Browse Source

make org optional in withOrganization (#21843)

Stephen Cefali 4 years ago
parent
commit
652124ace3

+ 1 - 1
src/sentry/static/sentry/app/components/events/interfaces/frame/context.tsx

@@ -20,7 +20,7 @@ import space from 'app/styles/space';
 type Props = {
   frame: Frame;
   event: Event;
-  organization: Organization; //TODO mark as not optional since it's undefined in the share issue view
+  organization?: Organization;
   registers: {[key: string]: string};
   components: Array<SentryAppComponent>;
   isExpanded?: boolean;

+ 2 - 2
src/sentry/static/sentry/app/utils/withOrganization.tsx

@@ -5,14 +5,14 @@ import getDisplayName from 'app/utils/getDisplayName';
 import {Organization, LightWeightOrganization} from 'app/types';
 
 type InjectedOrganizationProps = {
-  organization: Organization | LightWeightOrganization;
+  organization?: Organization | LightWeightOrganization;
 };
 
 const withOrganization = <P extends InjectedOrganizationProps>(
   WrappedComponent: React.ComponentType<P>
 ) =>
   class extends React.Component<
-    Omit<P, keyof InjectedOrganizationProps> & Partial<InjectedOrganizationProps>
+    Omit<P, keyof InjectedOrganizationProps> & InjectedOrganizationProps
   > {
     static displayName = `withOrganization(${getDisplayName(WrappedComponent)})`;
     static contextTypes = {