organizationGeneralSettings.tsx 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. import {JsonFormObject} from 'sentry/components/forms/types';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import {t, tct} from 'sentry/locale';
  4. import {MemberRole} from 'sentry/types';
  5. import slugify from 'sentry/utils/slugify';
  6. // Export route to make these forms searchable by label/help
  7. export const route = '/settings/:orgId/';
  8. const formGroups: JsonFormObject[] = [
  9. {
  10. // Form "section"/"panel"
  11. title: t('General'),
  12. fields: [
  13. {
  14. name: 'slug',
  15. type: 'string',
  16. required: true,
  17. label: t('Organization Slug'),
  18. help: t('A unique ID used to identify this organization'),
  19. transformInput: slugify,
  20. saveOnBlur: false,
  21. saveMessageAlertType: 'info',
  22. saveMessage: t(
  23. 'You will be redirected to the new organization slug after saving'
  24. ),
  25. },
  26. {
  27. name: 'name',
  28. type: 'string',
  29. required: true,
  30. label: t('Display Name'),
  31. help: t('A human-friendly name for the organization'),
  32. },
  33. {
  34. name: 'isEarlyAdopter',
  35. type: 'boolean',
  36. label: t('Early Adopter'),
  37. help: tct("Opt-in to [link:new features] before they're released to the public", {
  38. link: (
  39. <ExternalLink href="https://docs.sentry.io/product/accounts/early-adopter/" />
  40. ),
  41. }),
  42. },
  43. {
  44. name: 'aiSuggestedSolution',
  45. type: 'boolean',
  46. label: t('AI Suggested Solution'),
  47. visible: ({features}) => features.has('open-ai-suggestion'),
  48. help: tct(
  49. 'Opt-in to [link:ai suggested solution] to get AI help on how to solve an issue.',
  50. {
  51. link: (
  52. <ExternalLink href="https://docs.sentry.io/product/issues/issue-details/ai-suggested-solution/" />
  53. ),
  54. }
  55. ),
  56. },
  57. ],
  58. },
  59. {
  60. title: 'Membership',
  61. fields: [
  62. {
  63. name: 'defaultRole',
  64. type: 'select',
  65. required: true,
  66. label: t('Default Role'),
  67. // seems weird to have choices in initial form data
  68. choices: ({initialData} = {}) =>
  69. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  70. help: t('The default role new members will receive'),
  71. disabled: ({access}) => !access.has('org:admin'),
  72. },
  73. {
  74. name: 'openMembership',
  75. type: 'boolean',
  76. required: true,
  77. label: t('Open Membership'),
  78. help: t('Allow organization members to freely join any team'),
  79. },
  80. {
  81. name: 'eventsMemberAdmin',
  82. type: 'boolean',
  83. label: t('Let Members Delete Events'),
  84. help: t(
  85. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  86. ),
  87. },
  88. {
  89. name: 'alertsMemberWrite',
  90. type: 'boolean',
  91. label: t('Let Members Create and Edit Alerts'),
  92. help: t(
  93. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  94. ),
  95. },
  96. {
  97. name: 'attachmentsRole',
  98. type: 'select',
  99. choices: ({initialData = {}}) =>
  100. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  101. label: t('Attachments Access'),
  102. help: t(
  103. 'Role required to download event attachments, such as native crash reports or log files.'
  104. ),
  105. visible: ({features}) => features.has('event-attachments'),
  106. },
  107. {
  108. name: 'debugFilesRole',
  109. type: 'select',
  110. choices: ({initialData = {}}) =>
  111. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  112. label: t('Debug Files Access'),
  113. help: t(
  114. 'Role required to download debug information files, proguard mappings and source maps.'
  115. ),
  116. },
  117. ],
  118. },
  119. ];
  120. export default formGroups;