projectUserFeedbackProcessing.tsx 1.7 KB

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