|
@@ -4,6 +4,7 @@ import cloneDeep from 'lodash/cloneDeep';
|
|
|
import {addErrorMessage, addSuccessMessage} from 'sentry/actionCreators/indicator';
|
|
|
import {removeTeam, updateTeamSuccess} from 'sentry/actionCreators/teams';
|
|
|
import {hasEveryAccess} from 'sentry/components/acl/access';
|
|
|
+import Alert from 'sentry/components/alert';
|
|
|
import {Button} from 'sentry/components/button';
|
|
|
import Confirm from 'sentry/components/confirm';
|
|
|
import FieldGroup from 'sentry/components/forms/fieldGroup';
|
|
@@ -56,6 +57,7 @@ function TeamSettings({team, params}: TeamSettingsProps) {
|
|
|
|
|
|
const hasTeamWrite = hasEveryAccess(['team:write'], {organization, team});
|
|
|
const hasTeamAdmin = hasEveryAccess(['team:admin'], {organization, team});
|
|
|
+ const isIdpProvisioned = team.flags['idp:provisioned'];
|
|
|
|
|
|
const forms = useMemo(() => {
|
|
|
const formsConfig = cloneDeep(teamSettingsFields);
|
|
@@ -81,6 +83,13 @@ function TeamSettings({team, params}: TeamSettingsProps) {
|
|
|
<SentryDocumentTitle title={t('Team Settings')} orgSlug={organization.slug} />
|
|
|
|
|
|
<PermissionAlert access={['team:write']} team={team} />
|
|
|
+ {isIdpProvisioned && (
|
|
|
+ <Alert type="warning" showIcon>
|
|
|
+ {t(
|
|
|
+ "This team is managed through your organization's identity provider. These settings cannot be modified."
|
|
|
+ )}
|
|
|
+ </Alert>
|
|
|
+ )}
|
|
|
|
|
|
<Form
|
|
|
apiMethod="PUT"
|
|
@@ -98,6 +107,7 @@ function TeamSettings({team, params}: TeamSettingsProps) {
|
|
|
additionalFieldProps={{
|
|
|
hasTeamWrite,
|
|
|
}}
|
|
|
+ disabled={isIdpProvisioned}
|
|
|
forms={forms}
|
|
|
/>
|
|
|
</Form>
|
|
@@ -105,6 +115,7 @@ function TeamSettings({team, params}: TeamSettingsProps) {
|
|
|
<Panel>
|
|
|
<PanelHeader>{t('Team Administration')}</PanelHeader>
|
|
|
<FieldGroup
|
|
|
+ disabled={isIdpProvisioned}
|
|
|
label={t('Remove Team')}
|
|
|
help={t(
|
|
|
"This may affect team members' access to projects and associated alert delivery."
|
|
@@ -112,7 +123,7 @@ function TeamSettings({team, params}: TeamSettingsProps) {
|
|
|
>
|
|
|
<div>
|
|
|
<Confirm
|
|
|
- disabled={!hasTeamAdmin}
|
|
|
+ disabled={isIdpProvisioned || !hasTeamAdmin}
|
|
|
onConfirm={handleRemoveTeam}
|
|
|
priority="danger"
|
|
|
message={tct('Are you sure you want to remove the team [team]?', {
|