organizationGeneralSettings.tsx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. },
  45. {
  46. title: 'Membership',
  47. fields: [
  48. {
  49. name: 'defaultRole',
  50. type: 'select',
  51. required: true,
  52. label: t('Default Role'),
  53. // seems weird to have choices in initial form data
  54. choices: ({initialData} = {}) =>
  55. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  56. help: t('The default role new members will receive'),
  57. disabled: ({access}) => !access.has('org:admin'),
  58. },
  59. {
  60. name: 'openMembership',
  61. type: 'boolean',
  62. required: true,
  63. label: t('Open Membership'),
  64. help: t('Allow organization members to freely join or leave any team'),
  65. },
  66. {
  67. name: 'eventsMemberAdmin',
  68. type: 'boolean',
  69. label: t('Let Members Delete Events'),
  70. help: t(
  71. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  72. ),
  73. },
  74. {
  75. name: 'alertsMemberWrite',
  76. type: 'boolean',
  77. label: t('Let Members Create and Edit Alerts'),
  78. help: t(
  79. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  80. ),
  81. },
  82. {
  83. name: 'attachmentsRole',
  84. type: 'select',
  85. choices: ({initialData = {}}) =>
  86. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  87. label: t('Attachments Access'),
  88. help: t(
  89. 'Role required to download event attachments, such as native crash reports or log files.'
  90. ),
  91. visible: ({features}) => features.has('event-attachments'),
  92. },
  93. {
  94. name: 'debugFilesRole',
  95. type: 'select',
  96. choices: ({initialData = {}}) =>
  97. initialData?.orgRoleList?.map((r: MemberRole) => [r.id, r.name]) ?? [],
  98. label: t('Debug Files Access'),
  99. help: t(
  100. 'Role required to download debug information files, proguard mappings and source maps.'
  101. ),
  102. },
  103. ],
  104. },
  105. ];
  106. export default formGroups;