projectUserFeedbackProcessing.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import type {RouteComponentProps} from 'react-router';
  2. import Access from 'sentry/components/acl/access';
  3. import {Button} from 'sentry/components/button';
  4. import Form from 'sentry/components/forms/form';
  5. import JsonForm from 'sentry/components/forms/jsonForm';
  6. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  7. import formGroups from 'sentry/data/forms/userFeedbackProcessing';
  8. import {t} from 'sentry/locale';
  9. import type {Organization} from 'sentry/types/organization';
  10. import type {Project} from 'sentry/types/project';
  11. import SettingsPageHeader from 'sentry/views/settings/components/settingsPageHeader';
  12. import PermissionAlert from 'sentry/views/settings/project/permissionAlert';
  13. type RouteParams = {
  14. projectId: string;
  15. };
  16. type Props = RouteComponentProps<RouteParams, {}> & {
  17. organization: Organization;
  18. project: Project;
  19. };
  20. function ProjectUserFeedbackProcessingSettings({
  21. project,
  22. organization,
  23. params: {projectId},
  24. }: Props) {
  25. return (
  26. <SentryDocumentTitle title={t('User Feedback')} projectSlug={project.slug}>
  27. <SettingsPageHeader
  28. title={t('User Feedback')}
  29. action={
  30. <Button external href="https://docs.sentry.io/product/user-feedback/">
  31. {t('Read the docs')}
  32. </Button>
  33. }
  34. />
  35. <PermissionAlert project={project} />
  36. <Form
  37. saveOnBlur
  38. apiMethod="PUT"
  39. apiEndpoint={`/projects/${organization.slug}/${projectId}/`}
  40. initialData={project.options}
  41. >
  42. <Access access={['project:write']} project={project}>
  43. {({hasAccess}) => <JsonForm disabled={!hasAccess} forms={formGroups} />}
  44. </Access>
  45. </Form>
  46. </SentryDocumentTitle>
  47. );
  48. }
  49. export default ProjectUserFeedbackProcessingSettings;