1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-03-23 00:16:25 +01:00

Remove clone env and sync sso group flags (#2596)

Removes feature flags for syncing sso groups and clone environment.
These features are being made generally available for all who have
access to environments and sso groups
This commit is contained in:
Simon Hornby 2022-12-05 12:07:15 +02:00 committed by GitHub
parent 4a3d26065f
commit 447bd44c99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 52 additions and 98 deletions

View File

@ -40,7 +40,6 @@ export const OidcAuth = () => {
const { hasAccess } = useContext(AccessContext);
const { config } = useAuthSettings('oidc');
const { updateSettings, errors, loading } = useAuthSettingsApi('oidc');
const ssoSyncShown = Boolean(uiConfig.flags.syncSSOGroups);
useEffect(() => {
if (config.discoverUrl) {
@ -240,15 +239,10 @@ export const OidcAuth = () => {
/>
</Grid>
</Grid>
<ConditionallyRender
condition={ssoSyncShown}
show={
<SsoGroupSettings
ssoType="OIDC"
data={data}
setValue={setValue}
/>
}
<SsoGroupSettings
ssoType="OIDC"
data={data}
setValue={setValue}
/>
<AutoCreateForm data={data} setValue={setValue} />

View File

@ -40,7 +40,6 @@ export const SamlAuth = () => {
const { hasAccess } = useContext(AccessContext);
const { config } = useAuthSettings('saml');
const { updateSettings, errors, loading } = useAuthSettingsApi('saml');
const ssoSyncShown = Boolean(uiConfig.flags.syncSSOGroups);
useEffect(() => {
if (config.entityId) {
@ -251,15 +250,11 @@ export const SamlAuth = () => {
/>
</Grid>
</Grid>
<ConditionallyRender
condition={ssoSyncShown}
show={
<SsoGroupSettings
ssoType="SAML"
data={data}
setValue={setValue}
/>
}
<SsoGroupSettings
ssoType="SAML"
data={data}
setValue={setValue}
/>
<AutoCreateForm data={data} setValue={setValue} />

View File

@ -128,41 +128,31 @@ export const GroupForm: FC<IGroupForm> = ({
data-testid={UG_DESC_ID}
/>
<ConditionallyRender
condition={
Boolean(uiConfig.flags.syncSSOGroups) && !isOss()
}
condition={isGroupSyncingEnabled}
show={
<ConditionallyRender
condition={isGroupSyncingEnabled}
show={
<>
<StyledInputDescription>
Is this group associated with SSO
groups?
</StyledInputDescription>
<StyledItemList
label="SSO group ID / name"
value={mappingsSSO}
onChange={setMappingsSSO}
/>
</>
}
elseShow={() => (
<StyledDescriptionBlock>
<Box sx={{ display: 'flex' }}>
You can enable SSO groups syncronization
if needed
<HelpIcon tooltip="SSO groups syncronization allows SSO groups to be mapped to Unleash groups, so that user group membership is properly synchronized." />
</Box>
<Link data-loading to={`/admin/auth`}>
<span data-loading>
View SSO configuration
</span>
</Link>
</StyledDescriptionBlock>
)}
/>
<>
<StyledInputDescription>
Is this group associated with SSO groups?
</StyledInputDescription>
<StyledItemList
label="SSO group ID / name"
value={mappingsSSO}
onChange={setMappingsSSO}
/>
</>
}
elseShow={() => (
<StyledDescriptionBlock>
<Box sx={{ display: 'flex' }}>
You can enable SSO groups syncronization if
needed
<HelpIcon tooltip="SSO groups syncronization allows SSO groups to be mapped to Unleash groups, so that user group membership is properly synchronized." />
</Box>
<Link data-loading to={`/admin/auth`}>
<span data-loading>View SSO configuration</span>
</Link>
</StyledDescriptionBlock>
)}
/>
<ConditionallyRender
condition={mode === 'Create'}

View File

@ -118,31 +118,26 @@ export const EnvironmentActionCellPopover = ({
</StyledMenuItem>
)}
</PermissionHOC>
<ConditionallyRender
condition={Boolean(uiConfig.flags.cloneEnvironment)}
show={
<PermissionHOC permission={ADMIN}>
{({ hasAccess }) => (
<StyledMenuItem
onClick={() => {
onClone();
handleClose();
}}
disabled={!hasAccess}
>
<ListItemIcon>
<CopyIcon />
</ListItemIcon>
<ListItemText>
<Typography variant="body2">
Clone
</Typography>
</ListItemText>
</StyledMenuItem>
)}
</PermissionHOC>
}
/>
<PermissionHOC permission={ADMIN}>
{({ hasAccess }) => (
<StyledMenuItem
onClick={() => {
onClone();
handleClose();
}}
disabled={!hasAccess}
>
<ListItemIcon>
<CopyIcon />
</ListItemIcon>
<ListItemText>
<Typography variant="body2">
Clone
</Typography>
</ListItemText>
</StyledMenuItem>
)}
</PermissionHOC>
<PermissionHOC permission={UPDATE_ENVIRONMENT}>
{({ hasAccess }) => (
<StyledMenuItem

View File

@ -40,9 +40,7 @@ export interface IFlags {
UG?: boolean;
ENABLE_DARK_MODE_SUPPORT?: boolean;
embedProxyFrontend?: boolean;
syncSSOGroups?: boolean;
changeRequests?: boolean;
cloneEnvironment?: boolean;
variantsPerEnvironment?: boolean;
tokensLastSeen?: boolean;
favorites?: boolean;

View File

@ -71,14 +71,12 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false,
"batchMetrics": false,
"changeRequests": false,
"cloneEnvironment": false,
"embedProxy": true,
"embedProxyFrontend": true,
"favorites": false,
"networkView": false,
"proxyReturnAllToggles": false,
"responseTimeWithAppName": false,
"syncSSOGroups": false,
"toggleTagFiltering": false,
"tokensLastSeen": false,
"variantsPerEnvironment": false,
@ -90,14 +88,12 @@ exports[`should create default config 1`] = `
"anonymiseEventLog": false,
"batchMetrics": false,
"changeRequests": false,
"cloneEnvironment": false,
"embedProxy": true,
"embedProxyFrontend": true,
"favorites": false,
"networkView": false,
"proxyReturnAllToggles": false,
"responseTimeWithAppName": false,
"syncSSOGroups": false,
"toggleTagFiltering": false,
"tokensLastSeen": false,
"variantsPerEnvironment": false,

View File

@ -14,10 +14,6 @@ export const defaultExperimentalOptions = {
process.env.UNLEASH_EXPERIMENTAL_CHANGE_REQUESTS,
false,
),
syncSSOGroups: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_SYNC_SSO_GROUPS,
false,
),
embedProxyFrontend: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_EMBED_PROXY_FRONTEND,
true,
@ -30,10 +26,6 @@ export const defaultExperimentalOptions = {
process.env.UNLEASH_EXPERIMENTAL_RESPONSE_TIME_WITH_APP_NAME,
false,
),
cloneEnvironment: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_CLONE_ENVIRONMENT,
false,
),
toggleTagFiltering: parseEnvVarBoolean(
process.env.UNLEASH_EXPERIMENTAL_TOGGLE_TAG_FILTERING,
false,
@ -70,9 +62,7 @@ export interface IExperimentalOptions {
embedProxyFrontend?: boolean;
batchMetrics?: boolean;
anonymiseEventLog?: boolean;
syncSSOGroups?: boolean;
changeRequests?: boolean;
cloneEnvironment?: boolean;
proxyReturnAllToggles?: boolean;
variantsPerEnvironment?: boolean;
tokensLastSeen?: boolean;

View File

@ -38,9 +38,7 @@ process.nextTick(async () => {
batchMetrics: true,
anonymiseEventLog: false,
responseTimeWithAppName: true,
syncSSOGroups: true,
changeRequests: true,
cloneEnvironment: true,
toggleTagFiltering: true,
favorites: true,
variantsPerEnvironment: true,

View File

@ -27,9 +27,7 @@ export function createTestConfig(config?: IUnleashOptions): IUnleashConfig {
embedProxy: true,
embedProxyFrontend: true,
batchMetrics: true,
syncSSOGroups: true,
changeRequests: true,
cloneEnvironment: true,
variantsPerEnvironment: true,
favorites: true,
},