-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: disable membership settings for developer plans (#80226)
since developer plans can only have 1 member, we want to disable membership settings for organizations on a developer plan. we can do this using a new `component:organization-membership-settings` hook (see getsentry/getsentry#15697 for full context) <img width="793" alt="Screenshot 2024-11-12 at 10 51 42 AM" src="https://github.com/user-attachments/assets/1d159406-a3cd-40c7-a48f-e626881eaba8">
- Loading branch information
Showing
4 changed files
with
114 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import type {JsonFormObject} from 'sentry/components/forms/types'; | ||
import {t} from 'sentry/locale'; | ||
import type {BaseRole} from 'sentry/types/organization'; | ||
|
||
// Export route to make these forms searchable by label/help | ||
export const route = '/settings/:orgId/'; | ||
|
||
const formGroups: JsonFormObject[] = [ | ||
{ | ||
title: 'Membership', | ||
fields: [ | ||
{ | ||
name: 'defaultRole', | ||
type: 'select', | ||
label: t('Default Role'), | ||
// seems weird to have choices in initial form data | ||
choices: ({initialData} = {}) => | ||
initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [], | ||
help: t('The default role new members will receive'), | ||
disabled: ({access}) => !access.has('org:admin'), | ||
}, | ||
{ | ||
name: 'openMembership', | ||
type: 'boolean', | ||
label: t('Open Team Membership'), | ||
help: t('Allow organization members to freely join any team'), | ||
}, | ||
{ | ||
name: 'allowMemberInvite', | ||
type: 'boolean', | ||
label: t('Let Members Invite Others'), | ||
help: t( | ||
'Allow organization members to invite other members via email without needing org owner or manager approval.' | ||
), | ||
visible: ({features}) => features.has('members-invite-teammates'), | ||
}, | ||
{ | ||
name: 'allowMemberProjectCreation', | ||
type: 'boolean', | ||
label: t('Let Members Create Projects'), | ||
help: t('Allow organization members to create and configure new projects.'), | ||
}, | ||
{ | ||
name: 'eventsMemberAdmin', | ||
type: 'boolean', | ||
label: t('Let Members Delete Events'), | ||
help: t( | ||
'Allow members to delete events (including the delete & discard action) by granting them the `event:admin` scope.' | ||
), | ||
}, | ||
{ | ||
name: 'alertsMemberWrite', | ||
type: 'boolean', | ||
label: t('Let Members Create and Edit Alerts'), | ||
help: t( | ||
'Allow members to create, edit, and delete alert rules by granting them the `alerts:write` scope.' | ||
), | ||
}, | ||
{ | ||
name: 'attachmentsRole', | ||
type: 'select', | ||
choices: ({initialData = {}}) => | ||
initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [], | ||
label: t('Attachments Access'), | ||
help: t( | ||
'Role required to download event attachments, such as native crash reports or log files.' | ||
), | ||
visible: ({features}) => features.has('event-attachments'), | ||
}, | ||
{ | ||
name: 'debugFilesRole', | ||
type: 'select', | ||
choices: ({initialData = {}}) => | ||
initialData?.orgRoleList?.map((r: BaseRole) => [r.id, r.name]) ?? [], | ||
label: t('Debug Files Access'), | ||
help: t( | ||
'Role required to download debug information files, proguard mappings and source maps.' | ||
), | ||
}, | ||
], | ||
}, | ||
]; | ||
|
||
export default formGroups; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters