organizationMembershipSettings.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import type {JsonFormObject} from 'sentry/components/forms/types';
  2. import {t} from 'sentry/locale';
  3. import type {BaseRole} from 'sentry/types/organization';
  4. // Export route to make these forms searchable by label/help
  5. export const route = '/settings/:orgId/';
  6. const formGroups: JsonFormObject[] = [
  7. {
  8. title: 'Membership',
  9. fields: [
  10. {
  11. name: 'defaultRole',
  12. type: 'select',
  13. label: t('Default Role'),
  14. // seems weird to have choices in initial form data
  15. choices: ({initialData} = {}) =>
  16. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  17. help: t('The default role new members will receive'),
  18. disabled: ({access}) => !access.has('org:admin'),
  19. },
  20. {
  21. name: 'openMembership',
  22. type: 'boolean',
  23. label: t('Open Team Membership'),
  24. help: t('Allow organization members to freely join any team'),
  25. },
  26. {
  27. name: 'allowMemberInvite',
  28. type: 'boolean',
  29. label: t('Let Members Invite Others'),
  30. help: t(
  31. 'Allow organization members to invite other members via email without needing org owner or manager approval.'
  32. ),
  33. visible: ({features}) => features.has('members-invite-teammates'),
  34. },
  35. {
  36. name: 'allowMemberProjectCreation',
  37. type: 'boolean',
  38. label: t('Let Members Create Projects'),
  39. help: t('Allow organization members to create and configure new projects.'),
  40. },
  41. {
  42. name: 'eventsMemberAdmin',
  43. type: 'boolean',
  44. label: t('Let Members Delete Events'),
  45. help: t(
  46. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  47. ),
  48. },
  49. {
  50. name: 'alertsMemberWrite',
  51. type: 'boolean',
  52. label: t('Let Members Create and Edit Alerts'),
  53. help: t(
  54. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  55. ),
  56. },
  57. {
  58. name: 'attachmentsRole',
  59. type: 'select',
  60. choices: ({initialData = {}}) =>
  61. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  62. label: t('Attachments Access'),
  63. help: t(
  64. 'Role required to download event attachments, such as native crash reports or log files.'
  65. ),
  66. visible: ({features}) => features.has('event-attachments'),
  67. },
  68. {
  69. name: 'debugFilesRole',
  70. type: 'select',
  71. choices: ({initialData = {}}) =>
  72. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  73. label: t('Debug Files Access'),
  74. help: t(
  75. 'Role required to download debug information files, proguard mappings and source maps.'
  76. ),
  77. },
  78. ],
  79. },
  80. ];
  81. export default formGroups;