organizationMembershipSettings.tsx 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. },
  34. {
  35. name: 'allowMemberProjectCreation',
  36. type: 'boolean',
  37. label: t('Let Members Create Projects'),
  38. help: t('Allow organization members to create and configure new projects.'),
  39. },
  40. {
  41. name: 'eventsMemberAdmin',
  42. type: 'boolean',
  43. label: t('Let Members Delete Events'),
  44. help: t(
  45. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  46. ),
  47. },
  48. {
  49. name: 'alertsMemberWrite',
  50. type: 'boolean',
  51. label: t('Let Members Create and Edit Alerts'),
  52. help: t(
  53. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  54. ),
  55. },
  56. {
  57. name: 'attachmentsRole',
  58. type: 'select',
  59. choices: ({initialData = {}}) =>
  60. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  61. label: t('Attachments Access'),
  62. help: t(
  63. 'Role required to download event attachments, such as native crash reports or log files.'
  64. ),
  65. visible: ({features}) => features.has('event-attachments'),
  66. },
  67. {
  68. name: 'debugFilesRole',
  69. type: 'select',
  70. choices: ({initialData = {}}) =>
  71. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  72. label: t('Debug Files Access'),
  73. help: t(
  74. 'Role required to download debug information files, proguard mappings and source maps.'
  75. ),
  76. },
  77. ],
  78. },
  79. ];
  80. export default formGroups;