1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01:00

chore: remove group root role toggle (#4026)

This commit is contained in:
Simon Hornby 2023-07-05 14:33:33 +02:00 committed by GitHub
parent 9f5b7b610a
commit b0e4c8a57e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 36 deletions

View File

@ -12,7 +12,6 @@ import { Link } from 'react-router-dom';
import { HelpIcon } from 'component/common/HelpIcon/HelpIcon';
import { IRole } from 'interfaces/role';
import { useUsers } from 'hooks/api/getters/useUsers/useUsers';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { RoleSelect } from 'component/common/RoleSelect/RoleSelect';
const StyledForm = styled('form')(() => ({
@ -111,15 +110,12 @@ export const GroupForm: FC<IGroupForm> = ({
}) => {
const { config: oidcSettings } = useAuthSettings('oidc');
const { config: samlSettings } = useAuthSettings('saml');
const { uiConfig } = useUiConfig();
const { roles } = useUsers();
const isGroupSyncingEnabled =
(oidcSettings?.enabled && oidcSettings.enableGroupSyncing) ||
(samlSettings?.enabled && samlSettings.enableGroupSyncing);
const groupRootRolesEnabled = Boolean(uiConfig.flags.groupRootRoles);
const roleIdToRole = (rootRoleId: number | null): IRole | null => {
return roles.find((role: IRole) => role.id === rootRoleId) || null;
};
@ -180,30 +176,20 @@ export const GroupForm: FC<IGroupForm> = ({
</StyledDescriptionBlock>
)}
/>
<ConditionallyRender
condition={groupRootRolesEnabled}
show={
<>
<StyledInputDescription>
<Box sx={{ display: 'flex' }}>
Do you want to associate a root role with
this group?
<HelpIcon tooltip="When you associate an Admin or Editor role with this group, users in this group will automatically inherit the role globally. Note that groups with a root role association cannot be assigned to projects." />
</Box>
</StyledInputDescription>
<StyledAutocompleteWrapper>
<RoleSelect
data-testid="GROUP_ROOT_ROLE"
roles={roles}
value={roleIdToRole(rootRole)}
setValue={role =>
setRootRole(role?.id || null)
}
/>
</StyledAutocompleteWrapper>
</>
}
/>
<StyledInputDescription>
<Box sx={{ display: 'flex' }}>
Do you want to associate a root role with this group?
<HelpIcon tooltip="When you associate an Admin or Editor role with this group, users in this group will automatically inherit the role globally. Note that groups with a root role association cannot be assigned to projects." />
</Box>
</StyledInputDescription>
<StyledAutocompleteWrapper>
<RoleSelect
data-testid="GROUP_ROOT_ROLE"
roles={roles}
value={roleIdToRole(rootRole)}
setValue={role => setRootRole(role?.id || null)}
/>
</StyledAutocompleteWrapper>
<ConditionallyRender
condition={mode === 'Create'}
show={

View File

@ -46,7 +46,6 @@ export interface IFlags {
notifications?: boolean;
personalAccessTokensKillSwitch?: boolean;
demo?: boolean;
groupRootRoles?: boolean;
googleAuthEnabled?: boolean;
disableBulkToggle?: boolean;
segmentContextFieldUsage?: boolean;

View File

@ -79,7 +79,6 @@ exports[`should create default config 1`] = `
"embedProxyFrontend": true,
"featuresExportImport": true,
"googleAuthEnabled": false,
"groupRootRoles": false,
"maintenanceMode": false,
"messageBanner": {
"enabled": false,
@ -112,7 +111,6 @@ exports[`should create default config 1`] = `
"embedProxyFrontend": true,
"featuresExportImport": true,
"googleAuthEnabled": false,
"groupRootRoles": false,
"maintenanceMode": false,
"messageBanner": {
"enabled": false,

View File

@ -15,7 +15,6 @@ export type IFlagKey =
| 'proPlanAutoCharge'
| 'personalAccessTokensKillSwitch'
| 'cleanClientApi'
| 'groupRootRoles'
| 'migrationLock'
| 'demo'
| 'googleAuthEnabled'
@ -79,10 +78,6 @@ const flags: IFlags = {
false,
),
cleanClientApi: parseEnvVarBoolean(process.env.CLEAN_CLIENT_API, false),
groupRootRoles: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_ROOT_ROLE_GROUPS,
false,
),
migrationLock: parseEnvVarBoolean(process.env.MIGRATION_LOCK, false),
demo: parseEnvVarBoolean(process.env.UNLEASH_DEMO, false),
strategySplittedButton: parseEnvVarBoolean(