organizationMembershipSettings.tsx 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. confirm: {
  26. isDangerous: true,
  27. true: t(
  28. 'This will allow any members of your organization to freely join any team and access any project of your organization. Do you want to continue?'
  29. ),
  30. false: t(
  31. 'This will disallow free access to any team and project within your organization. Do you want to continue?'
  32. ),
  33. },
  34. },
  35. {
  36. name: 'allowMemberInvite',
  37. type: 'boolean',
  38. label: t('Let Members Invite Others'),
  39. help: t(
  40. 'Allow organization members to invite other members via email without needing org owner or manager approval.'
  41. ),
  42. },
  43. {
  44. name: 'allowMemberProjectCreation',
  45. type: 'boolean',
  46. label: t('Let Members Create Projects'),
  47. help: t('Allow organization members to create and configure new projects.'),
  48. },
  49. {
  50. name: 'eventsMemberAdmin',
  51. type: 'boolean',
  52. label: t('Let Members Delete Events'),
  53. help: t(
  54. 'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.'
  55. ),
  56. },
  57. {
  58. name: 'alertsMemberWrite',
  59. type: 'boolean',
  60. label: t('Let Members Create and Edit Alerts'),
  61. help: t(
  62. 'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.'
  63. ),
  64. },
  65. {
  66. name: 'attachmentsRole',
  67. type: 'select',
  68. choices: ({initialData = {}}) =>
  69. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  70. label: t('Attachments Access'),
  71. help: t(
  72. 'Role required to download event attachments, such as native crash reports or log files.'
  73. ),
  74. visible: ({features}) => features.has('event-attachments'),
  75. },
  76. {
  77. name: 'debugFilesRole',
  78. type: 'select',
  79. choices: ({initialData = {}}) =>
  80. initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [],
  81. label: t('Debug Files Access'),
  82. help: t(
  83. 'Role required to download debug information files, proguard mappings and source maps.'
  84. ),
  85. },
  86. ],
  87. },
  88. ];
  89. export default formGroups;