[refactor]: Remove isSSOEnabled logic throughout the codebase (#9462)
Eliminated all references to `isSSOEnabled` across the frontend, backend, and configuration files. This change simplifies the codebase by removing unnecessary feature flag checks, associated logic, and environment variables. The SSO feature remains available without reliance on this flag.
This commit is contained in:
@ -178,7 +178,6 @@ export type ClientConfig = {
|
||||
defaultSubdomain?: Maybe<Scalars['String']>;
|
||||
frontDomain: Scalars['String'];
|
||||
isMultiWorkspaceEnabled: Scalars['Boolean'];
|
||||
isSSOEnabled: Scalars['Boolean'];
|
||||
sentry: Sentry;
|
||||
signInPrefilled: Scalars['Boolean'];
|
||||
support: Support;
|
||||
@ -335,7 +334,6 @@ export enum FeatureFlagKey {
|
||||
IsJsonFilterEnabled = 'IsJsonFilterEnabled',
|
||||
IsMicrosoftSyncEnabled = 'IsMicrosoftSyncEnabled',
|
||||
IsPostgreSqlIntegrationEnabled = 'IsPostgreSQLIntegrationEnabled',
|
||||
IsSsoEnabled = 'IsSSOEnabled',
|
||||
IsStripeIntegrationEnabled = 'IsStripeIntegrationEnabled',
|
||||
IsUniqueIndexesEnabled = 'IsUniqueIndexesEnabled',
|
||||
IsViewGroupsEnabled = 'IsViewGroupsEnabled',
|
||||
@ -2082,7 +2080,7 @@ export type UpdateBillingSubscriptionMutation = { __typename?: 'Mutation', updat
|
||||
export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, isMultiWorkspaceEnabled: boolean, isSSOEnabled: boolean, defaultSubdomain?: string | null, frontDomain: string, debugMode: boolean, analyticsEnabled: boolean, chromeExtensionId?: string | null, canManageFeatureFlags: boolean, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean, sso: Array<{ __typename?: 'SSOIdentityProvider', id: string, name: string, type: IdentityProviderType, status: SsoIdentityProviderStatus, issuer: string }> }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null }, api: { __typename?: 'ApiConfig', mutationMaximumAffectedRecords: number } } };
|
||||
export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, isMultiWorkspaceEnabled: boolean, defaultSubdomain?: string | null, frontDomain: string, debugMode: boolean, analyticsEnabled: boolean, chromeExtensionId?: string | null, canManageFeatureFlags: boolean, billing: { __typename?: 'Billing', isBillingEnabled: boolean, billingUrl?: string | null, billingFreeTrialDurationInDays?: number | null }, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean, microsoft: boolean, sso: Array<{ __typename?: 'SSOIdentityProvider', id: string, name: string, type: IdentityProviderType, status: SsoIdentityProviderStatus, issuer: string }> }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null }, sentry: { __typename?: 'Sentry', dsn?: string | null, environment?: string | null, release?: string | null }, captcha: { __typename?: 'Captcha', provider?: CaptchaDriverType | null, siteKey?: string | null }, api: { __typename?: 'ApiConfig', mutationMaximumAffectedRecords: number } } };
|
||||
|
||||
export type SkipSyncEmailOnboardingStepMutationVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
@ -3493,7 +3491,6 @@ export const GetClientConfigDocument = gql`
|
||||
}
|
||||
signInPrefilled
|
||||
isMultiWorkspaceEnabled
|
||||
isSSOEnabled
|
||||
defaultSubdomain
|
||||
frontDomain
|
||||
debugMode
|
||||
|
||||
@ -14,7 +14,6 @@ export const AppRouter = () => {
|
||||
const isCRMMigrationEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsCrmMigrationEnabled,
|
||||
);
|
||||
const isSSOEnabled = useIsFeatureEnabled(FeatureFlagKey.IsSsoEnabled);
|
||||
const isServerlessFunctionSettingsEnabled = useIsFeatureEnabled(
|
||||
FeatureFlagKey.IsFunctionSettingsEnabled,
|
||||
);
|
||||
@ -32,7 +31,6 @@ export const AppRouter = () => {
|
||||
isBillingPageEnabled,
|
||||
isCRMMigrationEnabled,
|
||||
isServerlessFunctionSettingsEnabled,
|
||||
isSSOEnabled,
|
||||
isAdminPageEnabled,
|
||||
)}
|
||||
/>
|
||||
|
||||
@ -266,7 +266,6 @@ type SettingsRoutesProps = {
|
||||
isBillingEnabled?: boolean;
|
||||
isCRMMigrationEnabled?: boolean;
|
||||
isServerlessFunctionSettingsEnabled?: boolean;
|
||||
isSSOEnabled?: boolean;
|
||||
isAdminPageEnabled?: boolean;
|
||||
};
|
||||
|
||||
@ -274,7 +273,6 @@ export const SettingsRoutes = ({
|
||||
isBillingEnabled,
|
||||
isCRMMigrationEnabled,
|
||||
isServerlessFunctionSettingsEnabled,
|
||||
isSSOEnabled,
|
||||
isAdminPageEnabled,
|
||||
}: SettingsRoutesProps) => (
|
||||
<Suspense fallback={<SettingsSkeletonLoader />}>
|
||||
@ -391,12 +389,10 @@ export const SettingsRoutes = ({
|
||||
/>
|
||||
<Route path={SettingsPath.Releases} element={<Releases />} />
|
||||
<Route path={SettingsPath.Security} element={<SettingsSecurity />} />
|
||||
{isSSOEnabled && (
|
||||
<Route
|
||||
path={SettingsPath.NewSSOIdentityProvider}
|
||||
element={<SettingsSecuritySSOIdentifyProvider />}
|
||||
/>
|
||||
)}
|
||||
<Route
|
||||
path={SettingsPath.NewSSOIdentityProvider}
|
||||
element={<SettingsSecuritySSOIdentifyProvider />}
|
||||
/>
|
||||
{isAdminPageEnabled && (
|
||||
<>
|
||||
<Route path={SettingsPath.AdminPanel} element={<SettingsAdmin />} />
|
||||
|
||||
@ -28,7 +28,6 @@ export const useCreateAppRouter = (
|
||||
isBillingEnabled?: boolean,
|
||||
isCRMMigrationEnabled?: boolean,
|
||||
isServerlessFunctionSettingsEnabled?: boolean,
|
||||
isSSOEnabled?: boolean,
|
||||
isAdminPageEnabled?: boolean,
|
||||
) =>
|
||||
createBrowserRouter(
|
||||
@ -65,7 +64,6 @@ export const useCreateAppRouter = (
|
||||
isServerlessFunctionSettingsEnabled={
|
||||
isServerlessFunctionSettingsEnabled
|
||||
}
|
||||
isSSOEnabled={isSSOEnabled}
|
||||
isAdminPageEnabled={isAdminPageEnabled}
|
||||
/>
|
||||
}
|
||||
|
||||
@ -9,7 +9,6 @@ import { isAnalyticsEnabledState } from '@/client-config/states/isAnalyticsEnabl
|
||||
import { isDebugModeState } from '@/client-config/states/isDebugModeState';
|
||||
import { isDeveloperDefaultSignInPrefilledState } from '@/client-config/states/isDeveloperDefaultSignInPrefilledState';
|
||||
import { isMultiWorkspaceEnabledState } from '@/client-config/states/isMultiWorkspaceEnabledState';
|
||||
import { isSSOEnabledState } from '@/client-config/states/isSSOEnabledState';
|
||||
import { sentryConfigState } from '@/client-config/states/sentryConfigState';
|
||||
import { supportChatState } from '@/client-config/states/supportChatState';
|
||||
import { domainConfigurationState } from '@/domain-manager/states/domainConfigurationState';
|
||||
@ -30,7 +29,6 @@ export const ClientConfigProviderEffect = () => {
|
||||
const setIsMultiWorkspaceEnabled = useSetRecoilState(
|
||||
isMultiWorkspaceEnabledState,
|
||||
);
|
||||
const setIsSSOEnabledState = useSetRecoilState(isSSOEnabledState);
|
||||
|
||||
const setBilling = useSetRecoilState(billingState);
|
||||
const setSupportChat = useSetRecoilState(supportChatState);
|
||||
@ -107,7 +105,6 @@ export const ClientConfigProviderEffect = () => {
|
||||
|
||||
setChromeExtensionId(data?.clientConfig?.chromeExtensionId);
|
||||
setApiConfig(data?.clientConfig?.api);
|
||||
setIsSSOEnabledState(data?.clientConfig?.isSSOEnabled);
|
||||
setDomainConfiguration({
|
||||
defaultSubdomain: data?.clientConfig?.defaultSubdomain,
|
||||
frontDomain: data?.clientConfig?.frontDomain,
|
||||
@ -129,7 +126,6 @@ export const ClientConfigProviderEffect = () => {
|
||||
setIsAnalyticsEnabled,
|
||||
error,
|
||||
setDomainConfiguration,
|
||||
setIsSSOEnabledState,
|
||||
setAuthProviders,
|
||||
setCanManageFeatureFlags,
|
||||
]);
|
||||
|
||||
@ -22,7 +22,6 @@ export const GET_CLIENT_CONFIG = gql`
|
||||
}
|
||||
signInPrefilled
|
||||
isMultiWorkspaceEnabled
|
||||
isSSOEnabled
|
||||
defaultSubdomain
|
||||
frontDomain
|
||||
debugMode
|
||||
|
||||
@ -1,6 +0,0 @@
|
||||
import { createState } from '@ui/utilities/state/utils/createState';
|
||||
|
||||
export const isSSOEnabledState = createState<boolean>({
|
||||
key: 'isSSOEnabledState',
|
||||
defaultValue: false,
|
||||
});
|
||||
@ -1,7 +1,6 @@
|
||||
import styled from '@emotion/styled';
|
||||
import { H2Title, IconLock, Section, Tag } from 'twenty-ui';
|
||||
|
||||
import { isSSOEnabledState } from '@/client-config/states/isSSOEnabledState';
|
||||
import { SettingsPageContainer } from '@/settings/components/SettingsPageContainer';
|
||||
import { SettingsReadDocumentationButton } from '@/settings/developers/components/SettingsReadDocumentationButton';
|
||||
import { SettingsSSOIdentitiesProvidersListCard } from '@/settings/security/components/SettingsSSOIdentitiesProvidersListCard';
|
||||
@ -9,9 +8,6 @@ import { SettingsSecurityOptionsList } from '@/settings/security/components/Sett
|
||||
import { getSettingsPagePath } from '@/settings/utils/getSettingsPagePath';
|
||||
import { SettingsPath } from '@/types/SettingsPath';
|
||||
import { SubMenuTopBarContainer } from '@/ui/layout/page/components/SubMenuTopBarContainer';
|
||||
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { FeatureFlagKey } from '~/generated/graphql';
|
||||
|
||||
const StyledContainer = styled.div`
|
||||
width: 100%;
|
||||
@ -29,10 +25,6 @@ const StyledSSOSection = styled(Section)`
|
||||
`;
|
||||
|
||||
export const SettingsSecurity = () => {
|
||||
const isSSOEnabled = useRecoilValue(isSSOEnabledState);
|
||||
const isSSOSectionDisplay =
|
||||
useIsFeatureEnabled(FeatureFlagKey.IsSsoEnabled) && isSSOEnabled;
|
||||
|
||||
return (
|
||||
<SubMenuTopBarContainer
|
||||
title="Security"
|
||||
@ -47,23 +39,21 @@ export const SettingsSecurity = () => {
|
||||
>
|
||||
<SettingsPageContainer>
|
||||
<StyledMainContent>
|
||||
{isSSOSectionDisplay && (
|
||||
<StyledSSOSection>
|
||||
<H2Title
|
||||
title="SSO"
|
||||
description="Configure an SSO connection"
|
||||
adornment={
|
||||
<Tag
|
||||
text={'Enterprise'}
|
||||
color={'transparent'}
|
||||
Icon={IconLock}
|
||||
variant={'border'}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<SettingsSSOIdentitiesProvidersListCard />
|
||||
</StyledSSOSection>
|
||||
)}
|
||||
<StyledSSOSection>
|
||||
<H2Title
|
||||
title="SSO"
|
||||
description="Configure an SSO connection"
|
||||
adornment={
|
||||
<Tag
|
||||
text={'Enterprise'}
|
||||
color={'transparent'}
|
||||
Icon={IconLock}
|
||||
variant={'border'}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
<SettingsSSOIdentitiesProvidersListCard />
|
||||
</StyledSSOSection>
|
||||
<Section>
|
||||
<StyledContainer>
|
||||
<H2Title
|
||||
|
||||
@ -3,7 +3,6 @@ import { CaptchaDriverType, ClientConfig } from '~/generated/graphql';
|
||||
export const mockedClientConfig: ClientConfig = {
|
||||
signInPrefilled: true,
|
||||
isMultiWorkspaceEnabled: false,
|
||||
isSSOEnabled: false,
|
||||
authProviders: {
|
||||
google: true,
|
||||
magicLink: false,
|
||||
|
||||
Reference in New Issue
Block a user