diff --git a/front/src/AppNavbar.tsx b/front/src/AppNavbar.tsx index 2d8180e77..ce27370ff 100644 --- a/front/src/AppNavbar.tsx +++ b/front/src/AppNavbar.tsx @@ -19,7 +19,6 @@ import MainNavbar from '@/ui/navigation/navbar/components/MainNavbar'; import NavItem from '@/ui/navigation/navbar/components/NavItem'; import NavTitle from '@/ui/navigation/navbar/components/NavTitle'; -import { useGetClientConfigQuery } from './generated/graphql'; import { measureTotalFrameLoad } from './utils/measureTotalFrameLoad'; export const AppNavbar = () => { @@ -31,10 +30,6 @@ export const AppNavbar = () => { const isInSubMenu = useIsSubMenuNavbarDisplayed(); const { currentUserDueTaskCount } = useCurrentUserTaskCount(); - const { data } = useGetClientConfigQuery(); - - const isFlexibleBackendEnabled = data?.clientConfig?.flexibleBackendEnabled; - return ( <> {!isInSubMenu ? ( @@ -95,7 +90,7 @@ export const AppNavbar = () => { Icon={IconTargetArrow} active={currentPath === '/opportunities'} /> - {isFlexibleBackendEnabled && } + ) : ( diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx index bf31c91ee..268e0a677 100644 --- a/front/src/generated/graphql.tsx +++ b/front/src/generated/graphql.tsx @@ -658,10 +658,7 @@ export type BoolFilter = { export type ClientConfig = { __typename?: 'ClientConfig'; authProviders: AuthProviders; - dataModelSettingsEnabled: Scalars['Boolean']; debugMode: Scalars['Boolean']; - developersSettingsEnabled: Scalars['Boolean']; - flexibleBackendEnabled: Scalars['Boolean']; signInPrefilled: Scalars['Boolean']; support: Support; telemetry: Telemetry; @@ -3288,7 +3285,7 @@ export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __ export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>; -export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, dataModelSettingsEnabled: boolean, developersSettingsEnabled: boolean, debugMode: boolean, flexibleBackendEnabled: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null } } }; +export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: boolean, debugMode: boolean, authProviders: { __typename?: 'AuthProviders', google: boolean, password: boolean }, telemetry: { __typename?: 'Telemetry', enabled: boolean, anonymizationEnabled: boolean }, support: { __typename?: 'Support', supportDriver: string, supportFrontChatId?: string | null } } }; export type BaseCompanyFieldsFragmentFragment = { __typename?: 'Company', address: string, annualRecurringRevenue?: number | null, createdAt: string, domainName: string, employees?: number | null, id: string, idealCustomerProfile: boolean, linkedinUrl?: string | null, name: string, xUrl?: string | null, _activityCount: number }; @@ -4643,8 +4640,6 @@ export const GetClientConfigDocument = gql` password } signInPrefilled - dataModelSettingsEnabled - developersSettingsEnabled debugMode telemetry { enabled @@ -4654,7 +4649,6 @@ export const GetClientConfigDocument = gql` supportDriver supportFrontChatId } - flexibleBackendEnabled } } `; diff --git a/front/src/modules/client-config/components/ClientConfigProvider.tsx b/front/src/modules/client-config/components/ClientConfigProvider.tsx index b0986351f..de6fbc7fa 100644 --- a/front/src/modules/client-config/components/ClientConfigProvider.tsx +++ b/front/src/modules/client-config/components/ClientConfigProvider.tsx @@ -8,26 +8,14 @@ import { supportChatState } from '@/client-config/states/supportChatState'; import { telemetryState } from '@/client-config/states/telemetryState'; import { useGetClientConfigQuery } from '~/generated/graphql'; -import { isDataModelSettingsEnabledState } from '../states/isDataModelSettingsEnabled'; -import { isDevelopersSettingsEnabledState } from '../states/isDevelopersSettingsEnabled'; -import { isFlexibleBackendEnabledState } from '../states/isFlexibleBackendEnabledState'; - export const ClientConfigProvider: React.FC = ({ children, }) => { const [, setAuthProviders] = useRecoilState(authProvidersState); const [, setIsDebugMode] = useRecoilState(isDebugModeState); - const [, setIsFlexibleBackendEnabled] = useRecoilState( - isFlexibleBackendEnabledState, - ); const [, setIsSignInPrefilled] = useRecoilState(isSignInPrefilledState); - const [, setIsDataModelSettingsEnabled] = useRecoilState( - isDataModelSettingsEnabledState, - ); - const [, setIsDevelopersSettingsEnabled] = useRecoilState( - isDevelopersSettingsEnabledState, - ); + const [, setTelemetry] = useRecoilState(telemetryState); const [isLoading, setIsLoading] = useState(true); const setSupportChat = useSetRecoilState(supportChatState); @@ -44,15 +32,9 @@ export const ClientConfigProvider: React.FC = ({ password: data?.clientConfig.authProviders.password, magicLink: false, }); - setIsFlexibleBackendEnabled(data?.clientConfig.flexibleBackendEnabled); setIsDebugMode(data?.clientConfig.debugMode); setIsSignInPrefilled(data?.clientConfig.signInPrefilled); - setIsDataModelSettingsEnabled( - data?.clientConfig.dataModelSettingsEnabled, - ); - setIsDevelopersSettingsEnabled( - data?.clientConfig.developersSettingsEnabled, - ); + setTelemetry(data?.clientConfig.telemetry); setSupportChat(data?.clientConfig.support); } @@ -60,10 +42,7 @@ export const ClientConfigProvider: React.FC = ({ data, setAuthProviders, setIsDebugMode, - setIsFlexibleBackendEnabled, setIsSignInPrefilled, - setIsDataModelSettingsEnabled, - setIsDevelopersSettingsEnabled, setTelemetry, setIsLoading, loading, diff --git a/front/src/modules/client-config/graphql/queries/getClientConfig.ts b/front/src/modules/client-config/graphql/queries/getClientConfig.ts index 6c173143e..a5502c901 100644 --- a/front/src/modules/client-config/graphql/queries/getClientConfig.ts +++ b/front/src/modules/client-config/graphql/queries/getClientConfig.ts @@ -8,8 +8,6 @@ export const GET_CLIENT_CONFIG = gql` password } signInPrefilled - dataModelSettingsEnabled - developersSettingsEnabled debugMode telemetry { enabled @@ -19,7 +17,6 @@ export const GET_CLIENT_CONFIG = gql` supportDriver supportFrontChatId } - flexibleBackendEnabled } } `; diff --git a/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts b/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts deleted file mode 100644 index 4f839312c..000000000 --- a/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { atom } from 'recoil'; - -export const isDataModelSettingsEnabledState = atom({ - key: 'isDataModelSettingsEnabledState', - default: false, -}); diff --git a/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts b/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts deleted file mode 100644 index d745a11ef..000000000 --- a/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { atom } from 'recoil'; - -export const isDevelopersSettingsEnabledState = atom({ - key: 'isDevelopersSettingsEnabledState', - default: false, -}); diff --git a/front/src/modules/client-config/states/isFlexibleBackendEnabledState.ts b/front/src/modules/client-config/states/isFlexibleBackendEnabledState.ts deleted file mode 100644 index 7cbf72322..000000000 --- a/front/src/modules/client-config/states/isFlexibleBackendEnabledState.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { atom } from 'recoil'; - -export const isFlexibleBackendEnabledState = atom({ - key: 'isFlexibleBackendEnabledState', - default: false, -}); diff --git a/front/src/modules/settings/components/SettingsNavbar.tsx b/front/src/modules/settings/components/SettingsNavbar.tsx index 7bdba5db0..3b616ac45 100644 --- a/front/src/modules/settings/components/SettingsNavbar.tsx +++ b/front/src/modules/settings/components/SettingsNavbar.tsx @@ -1,10 +1,7 @@ import { useCallback } from 'react'; import { useMatch, useNavigate, useResolvedPath } from 'react-router-dom'; -import { useRecoilValue } from 'recoil'; import { useAuth } from '@/auth/hooks/useAuth'; -import { isDataModelSettingsEnabledState } from '@/client-config/states/isDataModelSettingsEnabled'; -import { isDevelopersSettingsEnabledState } from '@/client-config/states/isDevelopersSettingsEnabled'; import { AppPath } from '@/types/AppPath'; import { IconColorSwatch, @@ -29,22 +26,6 @@ export const SettingsNavbar = () => { navigate(AppPath.SignIn); }, [signOut, navigate]); - const isDataModelSettingsEnabled = useRecoilValue( - isDataModelSettingsEnabledState, - ); - const isDevelopersSettingsEnabled = useRecoilValue( - isDevelopersSettingsEnabledState, - ); - - const isDataModelSettingsActive = !!useMatch({ - path: useResolvedPath('/settings/objects').pathname, - end: false, - }); - const isDevelopersSettingsActive = !!useMatch({ - path: useResolvedPath('/settings/developers/api-keys').pathname, - end: true, - }); - return ( @@ -93,22 +74,30 @@ export const SettingsNavbar = () => { }) } /> - {isDataModelSettingsEnabled && ( - - )} - {isDevelopersSettingsEnabled && ( - - )} + + + + diff --git a/front/src/testing/graphqlMocks.ts b/front/src/testing/graphqlMocks.ts index 30fef3b0b..6cd4f7d91 100644 --- a/front/src/testing/graphqlMocks.ts +++ b/front/src/testing/graphqlMocks.ts @@ -212,7 +212,6 @@ export const graphqlMocks = [ return res( ctx.data({ clientConfig: { - flexibleBackendEnabled: true, signInPrefilled: true, dataModelSettingsEnabled: true, developersSettingsEnabled: true, diff --git a/server/.env.example b/server/.env.example index 47f7b64d9..55a06ac2a 100644 --- a/server/.env.example +++ b/server/.env.example @@ -25,7 +25,4 @@ SIGN_IN_PREFILLED=true # SUPPORT_FRONT_CHAT_ID=replace_me_with_front_chat_id # LOGGER_DRIVER=console # SENTRY_DSN=https://xxx@xxx.ingest.sentry.io/xxx -# LOG_LEVEL=error,warn -# FLEXIBLE_BACKEND_ENABLED=false -# IS_DATA_MODEL_SETTINGS_ENABLED=false -# IS_DEVELOPERS_SETTINGS_ENABLED=false +# LOG_LEVEL=error,warn \ No newline at end of file diff --git a/server/.env.test b/server/.env.test index 67be1c20a..a976e6eaf 100644 --- a/server/.env.test +++ b/server/.env.test @@ -14,8 +14,6 @@ REFRESH_TOKEN_SECRET=secret_refresh_token # ———————— Optional ———————— # DEBUG_MODE=false # SIGN_IN_PREFILLED=false -# IS_DATA_MODEL_SETTINGS_ENABLED=false -# IS_DEVELOPERS_SETTINGS_ENABLED=false # ACCESS_TOKEN_EXPIRES_IN=30m # LOGIN_TOKEN_EXPIRES_IN=15m # REFRESH_TOKEN_EXPIRES_IN=90d diff --git a/server/package.json b/server/package.json index fbb35581b..bf969cee1 100644 --- a/server/package.json +++ b/server/package.json @@ -33,7 +33,7 @@ "database:truncate": "npx ts-node ./scripts/truncate-db.ts", "database:migrate": "yarn typeorm:migrate && yarn prisma:migrate", "database:generate": "yarn prisma:generate", - "database:seed": "yarn prisma:seed && yarn command tenant:sync-metadata -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:migrate -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:data-seed -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419", + "database:seed": "yarn prisma:seed && yarn build && yarn command tenant:sync-metadata -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:migrate -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419 && yarn command tenant:data-seed -w twenty-7ed9d212-1c25-4d02-bf25-6aeccf7ea419", "database:reset": "yarn database:truncate && yarn database:init", "command": "node dist/src/command" }, diff --git a/server/src/app.module.ts b/server/src/app.module.ts index c47fe7605..959c97163 100644 --- a/server/src/app.module.ts +++ b/server/src/app.module.ts @@ -58,8 +58,8 @@ import { ExceptionFilter } from './filters/exception.filter'; // Extract JWT from the request const token = ExtractJwt.fromAuthHeaderAsBearerToken()(request.req); - // If there is no token or flexible backend is disabled, return an empty schema - if (!token || !environmentService.isFlexibleBackendEnabled()) { + // If there is no token return an empty schema + if (!token) { return new GraphQLSchema({}); } diff --git a/server/src/core/client-config/client-config.entity.ts b/server/src/core/client-config/client-config.entity.ts index f722424ae..079a76008 100644 --- a/server/src/core/client-config/client-config.entity.ts +++ b/server/src/core/client-config/client-config.entity.ts @@ -41,18 +41,9 @@ export class ClientConfig { @Field(() => Boolean) signInPrefilled: boolean; - @Field(() => Boolean) - dataModelSettingsEnabled: boolean; - - @Field(() => Boolean) - developersSettingsEnabled: boolean; - @Field(() => Boolean) debugMode: boolean; - @Field(() => Boolean) - flexibleBackendEnabled: boolean; - @Field(() => Support) support: Support; } diff --git a/server/src/core/client-config/client-config.resolver.ts b/server/src/core/client-config/client-config.resolver.ts index 86a7fef7f..1f4d753ba 100644 --- a/server/src/core/client-config/client-config.resolver.ts +++ b/server/src/core/client-config/client-config.resolver.ts @@ -22,13 +22,7 @@ export class ClientConfigResolver { this.environmentService.isTelemetryAnonymizationEnabled(), }, signInPrefilled: this.environmentService.isSignInPrefilled(), - dataModelSettingsEnabled: - this.environmentService.isDataModelSettingsEnabled(), - developersSettingsEnabled: - this.environmentService.isDevelopersSettingsEnabled(), debugMode: this.environmentService.isDebugMode(), - flexibleBackendEnabled: - this.environmentService.isFlexibleBackendEnabled(), support: { supportDriver: this.environmentService.getSupportDriver(), supportFrontChatId: this.environmentService.getSupportFrontChatId(), diff --git a/server/src/integrations/environment/environment.service.ts b/server/src/integrations/environment/environment.service.ts index 10671206e..86f63f5b7 100644 --- a/server/src/integrations/environment/environment.service.ts +++ b/server/src/integrations/environment/environment.service.ts @@ -19,18 +19,6 @@ export class EnvironmentService { return this.configService.get('SIGN_IN_PREFILLED') ?? false; } - isDataModelSettingsEnabled(): boolean { - return ( - this.configService.get('IS_DATA_MODEL_SETTINGS_ENABLED') ?? false - ); - } - - isDevelopersSettingsEnabled(): boolean { - return ( - this.configService.get('IS_DEVELOPERS_SETTINGS_ENABLED') ?? false - ); - } - isTelemetryEnabled(): boolean { return this.configService.get('TELEMETRY_ENABLED') ?? true; } @@ -41,10 +29,6 @@ export class EnvironmentService { ); } - isFlexibleBackendEnabled(): boolean { - return this.configService.get('FLEXIBLE_BACKEND_ENABLED') ?? false; - } - getPort(): number { return this.configService.get('PORT') ?? 3000; } diff --git a/server/src/integrations/environment/environment.validation.ts b/server/src/integrations/environment/environment.validation.ts index c3bcba2e5..331b5c7a7 100644 --- a/server/src/integrations/environment/environment.validation.ts +++ b/server/src/integrations/environment/environment.validation.ts @@ -36,16 +36,6 @@ export class EnvironmentVariables { @IsBoolean() SIGN_IN_PREFILLED?: boolean; - @CastToBoolean() - @IsOptional() - @IsBoolean() - IS_DATA_MODEL_SETTINGS_ENABLED?: boolean; - - @CastToBoolean() - @IsOptional() - @IsBoolean() - IS_DEVELOPERS_SETTINGS_ENABLED?: boolean; - @CastToBoolean() @IsOptional() @IsBoolean() @@ -56,11 +46,6 @@ export class EnvironmentVariables { @IsBoolean() TELEMETRY_ANONYMIZATION_ENABLED?: boolean; - @CastToBoolean() - @IsOptional() - @IsBoolean() - FLEXIBLE_BACKEND_ENABLED?: boolean; - @CastToPositiveNumber() @IsNumber() @IsOptional()