organizationGeneralSettings.tsx 3.2 KB

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