1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-05-08 01:15:49 +02: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 { HelpIcon } from 'component/common/HelpIcon/HelpIcon';
import { IRole } from 'interfaces/role'; import { IRole } from 'interfaces/role';
import { useUsers } from 'hooks/api/getters/useUsers/useUsers'; import { useUsers } from 'hooks/api/getters/useUsers/useUsers';
import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { RoleSelect } from 'component/common/RoleSelect/RoleSelect'; import { RoleSelect } from 'component/common/RoleSelect/RoleSelect';
const StyledForm = styled('form')(() => ({ const StyledForm = styled('form')(() => ({
@ -111,15 +110,12 @@ export const GroupForm: FC<IGroupForm> = ({
}) => { }) => {
const { config: oidcSettings } = useAuthSettings('oidc'); const { config: oidcSettings } = useAuthSettings('oidc');
const { config: samlSettings } = useAuthSettings('saml'); const { config: samlSettings } = useAuthSettings('saml');
const { uiConfig } = useUiConfig();
const { roles } = useUsers(); const { roles } = useUsers();
const isGroupSyncingEnabled = const isGroupSyncingEnabled =
(oidcSettings?.enabled && oidcSettings.enableGroupSyncing) || (oidcSettings?.enabled && oidcSettings.enableGroupSyncing) ||
(samlSettings?.enabled && samlSettings.enableGroupSyncing); (samlSettings?.enabled && samlSettings.enableGroupSyncing);
const groupRootRolesEnabled = Boolean(uiConfig.flags.groupRootRoles);
const roleIdToRole = (rootRoleId: number | null): IRole | null => { const roleIdToRole = (rootRoleId: number | null): IRole | null => {
return roles.find((role: IRole) => role.id === rootRoleId) || null; return roles.find((role: IRole) => role.id === rootRoleId) || null;
}; };
@ -180,14 +176,9 @@ export const GroupForm: FC<IGroupForm> = ({
</StyledDescriptionBlock> </StyledDescriptionBlock>
)} )}
/> />
<ConditionallyRender
condition={groupRootRolesEnabled}
show={
<>
<StyledInputDescription> <StyledInputDescription>
<Box sx={{ display: 'flex' }}> <Box sx={{ display: 'flex' }}>
Do you want to associate a root role with Do you want to associate a root role with this group?
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." /> <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> </Box>
</StyledInputDescription> </StyledInputDescription>
@ -196,14 +187,9 @@ export const GroupForm: FC<IGroupForm> = ({
data-testid="GROUP_ROOT_ROLE" data-testid="GROUP_ROOT_ROLE"
roles={roles} roles={roles}
value={roleIdToRole(rootRole)} value={roleIdToRole(rootRole)}
setValue={role => setValue={role => setRootRole(role?.id || null)}
setRootRole(role?.id || null)
}
/> />
</StyledAutocompleteWrapper> </StyledAutocompleteWrapper>
</>
}
/>
<ConditionallyRender <ConditionallyRender
condition={mode === 'Create'} condition={mode === 'Create'}
show={ show={

View File

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

View File

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

View File

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