organizationGeneralSettings.tsx 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import type {JsonFormObject} from 'sentry/components/forms/types';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import {t, tct} from 'sentry/locale';
  4. import type {BaseRole} from 'sentry/types/organization';
  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. help: tct(
  48. 'Opt-in to [link:ai suggested solution] to get AI help on how to solve an issue.',
  49. {
  50. link: (
  51. <ExternalLink href="https://docs.sentry.io/product/issues/issue-details/ai-suggested-solution/" />
  52. ),
  53. }
  54. ),
  55. },
  56. ],
  57. },
  58. {
  59. title: 'Membership',
  60. fields: [
  61. {
  62. name: 'defaultRole',
  63. type: 'select',
  64. required: true,
  65. label: t('Default Role'),
  66. // seems weird to have choices in initial form data
  67. choices: ({initialData} = {}) =>
  68. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  69. help: t('The default role new members will receive'),
  70. disabled: ({access}) => !access.has('org:admin'),
  71. },
  72. {
  73. name: 'openMembership',
  74. type: 'boolean',
  75. required: true,
  76. label: t('Open Membership'),
  77. help: t('Allow organization members to freely join any team'),
  78. },
  79. {
  80. name: 'eventsMemberAdmin',
  81. type: 'boolean',
  82. label: t('Let Members Delete Events'),
  83. help: t(
  84. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  85. ),
  86. },
  87. {
  88. name: 'alertsMemberWrite',
  89. type: 'boolean',
  90. label: t('Let Members Create and Edit Alerts'),
  91. help: t(
  92. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  93. ),
  94. },
  95. {
  96. name: 'attachmentsRole',
  97. type: 'select',
  98. choices: ({initialData = {}}) =>
  99. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  100. label: t('Attachments Access'),
  101. help: t(
  102. 'Role required to download event attachments, such as native crash reports or log files.'
  103. ),
  104. visible: ({features}) => features.has('event-attachments'),
  105. },
  106. {
  107. name: 'debugFilesRole',
  108. type: 'select',
  109. choices: ({initialData = {}}) =>
  110. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  111. label: t('Debug Files Access'),
  112. help: t(
  113. 'Role required to download debug information files, proguard mappings and source maps.'
  114. ),
  115. },
  116. ],
  117. },
  118. ];
  119. export default formGroups;