issueOwnershipRuleModal.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. import {Fragment, useEffect} from 'react';
  2. import {css} from '@emotion/react';
  3. import {ModalRenderProps} from 'sentry/actionCreators/modal';
  4. import {t} from 'sentry/locale';
  5. import type {Event, Organization, Project} from 'sentry/types';
  6. import {trackIntegrationAnalytics} from 'sentry/utils/integrationUtil';
  7. import theme from 'sentry/utils/theme';
  8. import ProjectOwnershipModal from 'sentry/views/settings/project/projectOwnership/modal';
  9. interface CreateOwnershipRuleProps extends ModalRenderProps {
  10. issueId: string;
  11. organization: Organization;
  12. project: Project;
  13. eventData?: Event;
  14. }
  15. function IssueOwnershipRuleModal({
  16. Body,
  17. Header,
  18. Footer: _Footer,
  19. organization,
  20. project,
  21. issueId,
  22. eventData,
  23. closeModal,
  24. }: CreateOwnershipRuleProps) {
  25. useEffect(() => {
  26. trackIntegrationAnalytics('project_ownership.modal_opened', {
  27. page: 'issue_details',
  28. organization,
  29. });
  30. }, [organization]);
  31. return (
  32. <Fragment>
  33. <Header closeButton>
  34. <h4>{t('Edit Ownership Rules')}</h4>
  35. </Header>
  36. <Body>
  37. <ProjectOwnershipModal
  38. organization={organization}
  39. project={project}
  40. issueId={issueId}
  41. eventData={eventData}
  42. onCancel={closeModal}
  43. />
  44. </Body>
  45. </Fragment>
  46. );
  47. }
  48. export const modalCss = css`
  49. @media (min-width: ${theme.breakpoints.small}) {
  50. width: 80%;
  51. }
  52. `;
  53. export default IssueOwnershipRuleModal;