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:
parent
9f5b7b610a
commit
b0e4c8a57e
@ -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,14 +176,9 @@ 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?
|
||||
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>
|
||||
@ -196,14 +187,9 @@ export const GroupForm: FC<IGroupForm> = ({
|
||||
data-testid="GROUP_ROOT_ROLE"
|
||||
roles={roles}
|
||||
value={roleIdToRole(rootRole)}
|
||||
setValue={role =>
|
||||
setRootRole(role?.id || null)
|
||||
}
|
||||
setValue={role => setRootRole(role?.id || null)}
|
||||
/>
|
||||
</StyledAutocompleteWrapper>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
<ConditionallyRender
|
||||
condition={mode === 'Create'}
|
||||
show={
|
||||
|
@ -46,7 +46,6 @@ export interface IFlags {
|
||||
notifications?: boolean;
|
||||
personalAccessTokensKillSwitch?: boolean;
|
||||
demo?: boolean;
|
||||
groupRootRoles?: boolean;
|
||||
googleAuthEnabled?: boolean;
|
||||
disableBulkToggle?: boolean;
|
||||
segmentContextFieldUsage?: boolean;
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user