Skip to content

Commit

Permalink
ref(js): Remove organization.projects usage in GroupDetails
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Sep 21, 2021
1 parent f2dd7f4 commit 3b499b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions static/app/views/organizationGroupDetails/groupDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Error = typeof ERROR_TYPES[keyof typeof ERROR_TYPES] | null;
type Props = {
api: Client;
organization: Organization;
projects: Project[];
environments: string[];
children: React.ReactNode;
isGlobalSelectionReady: boolean;
Expand Down Expand Up @@ -438,8 +439,7 @@ class GroupDetails extends React.Component<Props, State> {
}

renderError() {
const {organization, location} = this.props;
const projects = organization.projects ?? [];
const {projects, location} = this.props;
const projectId = location.query.project;

const projectSlug = projects.find(proj => proj.id === projectId)?.slug;
Expand Down
8 changes: 6 additions & 2 deletions static/app/views/organizationGroupDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import * as React from 'react';
import {RouteComponentProps} from 'react-router';

import {GlobalSelection, Organization} from 'app/types';
import {GlobalSelection, Organization, Project} from 'app/types';
import {analytics, metric} from 'app/utils/analytics';
import withGlobalSelection from 'app/utils/withGlobalSelection';
import withOrganization, {isLightweightOrganization} from 'app/utils/withOrganization';
import withProjects from 'app/utils/withProjects';

import GroupDetails from './groupDetails';

type Props = {
selection: GlobalSelection;
isGlobalSelectionReady: boolean;
organization: Organization;
projects: Project[];
children: React.ReactNode;
} & RouteComponentProps<{orgId: string; groupId: string}, {}>;

Expand Down Expand Up @@ -53,4 +55,6 @@ class OrganizationGroupDetails extends React.Component<Props> {
}
}

export default withOrganization(withGlobalSelection(OrganizationGroupDetails));
export default withOrganization(
withProjects(withGlobalSelection(OrganizationGroupDetails))
);

0 comments on commit 3b499b2

Please sign in to comment.