index.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {useEffect} from 'react';
  2. import {RouteComponentProps} from 'react-router';
  3. import {PageFilters} from 'sentry/types';
  4. import {analytics} from 'sentry/utils/analytics';
  5. import useOrganization from 'sentry/utils/useOrganization';
  6. import useProjects from 'sentry/utils/useProjects';
  7. import withPageFilters from 'sentry/utils/withPageFilters';
  8. import GroupDetails from './groupDetails';
  9. type Props = {
  10. children: React.ReactNode;
  11. isGlobalSelectionReady: boolean;
  12. selection: PageFilters;
  13. } & RouteComponentProps<{groupId: string; orgId: string}, {}>;
  14. function OrganizationGroupDetails({selection, ...props}: Props) {
  15. const organization = useOrganization();
  16. const {projects} = useProjects();
  17. const {params} = props;
  18. useEffect(() => {
  19. analytics('issue_page.viewed', {
  20. group_id: parseInt(params.groupId, 10),
  21. org_id: parseInt(organization.id, 10),
  22. });
  23. }, [organization, params.groupId]);
  24. return (
  25. <GroupDetails
  26. key={`${params.groupId}-envs:${selection.environments.join(',')}`}
  27. environments={selection.environments}
  28. organization={organization}
  29. projects={projects}
  30. {...props}
  31. />
  32. );
  33. }
  34. export default withPageFilters(OrganizationGroupDetails);