The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Remove three old env variables (#2297)
bosiraphaeldda911fea7d0
diff --git a/front/src/AppNavbar.tsx b/front/src/AppNavbar.tsxindex 2d8180e7771..ce27370ffa1 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 && <ObjectMetadataNavItems />}+ <ObjectMetadataNavItems /></MainNavbar>) : (<SettingsNavbar />diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsxindex bf31c91ee6c..268e0a67755 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- developersSettingsEnableddebugModetelemetry {enabled@@ -4654,7 +4649,6 @@ export const GetClientConfigDocument = gql`supportDriversupportFrontChatId}- flexibleBackendEnabled}}`;diff --git a/front/src/modules/client-config/components/ClientConfigProvider.tsx b/front/src/modules/client-config/components/ClientConfigProvider.tsxindex b0986351f4b..de6fbc7fafa 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<React.PropsWithChildren> = ({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<React.PropsWithChildren> = ({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<React.PropsWithChildren> = ({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.tsindex 6c173143e78..a5502c9017b 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- developersSettingsEnableddebugModetelemetry {enabled@@ -19,7 +17,6 @@ export const GET_CLIENT_CONFIG = gql`supportDriversupportFrontChatId}- flexibleBackendEnabled}}`;diff --git a/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts b/front/src/modules/client-config/states/isDataModelSettingsEnabled.tsdeleted file mode 100644index 4f839312c8f..00000000000--- a/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts+++ /dev/null@@ -1,6 +0,0 @@-import { atom } from 'recoil';--export const isDataModelSettingsEnabledState = atom<boolean>({- key: 'isDataModelSettingsEnabledState',- default: false,-});diff --git a/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts b/front/src/modules/client-config/states/isDevelopersSettingsEnabled.tsdeleted file mode 100644index d745a11ef2b..00000000000--- a/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts+++ /dev/null@@ -1,6 +0,0 @@-import { atom } from 'recoil';--export const isDevelopersSettingsEnabledState = atom<boolean>({- key: 'isDevelopersSettingsEnabledState',- default: false,-});diff --git a/front/src/modules/client-config/states/isFlexibleBackendEnabledState.ts b/front/src/modules/client-config/states/isFlexibleBackendEnabledState.tsdeleted file mode 100644index 7cbf7232219..00000000000--- a/front/src/modules/client-config/states/isFlexibleBackendEnabledState.ts+++ /dev/null@@ -1,6 +0,0 @@-import { atom } from 'recoil';--export const isFlexibleBackendEnabledState = atom<boolean>({- key: 'isFlexibleBackendEnabledState',- default: false,-});diff --git a/front/src/modules/settings/components/SettingsNavbar.tsx b/front/src/modules/settings/components/SettingsNavbar.tsxindex 7bdba5db03d..3b616ac45c9 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 (<SubMenuNavbar backButtonTitle="Settings" displayVersion={true}><NavTitle label="User" />@@ -93,22 +74,30 @@ export const SettingsNavbar = () => {})}/>- {isDataModelSettingsEnabled && (- <NavItem- label="Data model"- to="/settings/objects"- Icon={IconHierarchy2}- active={isDataModelSettingsActive}- />- )}- {isDevelopersSettingsEnabled && (- <NavItem- label="Developers"- to="/settings/developers/api-keys"- Icon={IconRobot}- active={isDevelopersSettingsActive}- />- )}++ <NavItem+ label="Data model"+ to="/settings/objects"+ Icon={IconHierarchy2}+ active={+ !!useMatch({+ path: useResolvedPath('/settings/objects').pathname,+ end: false,+ })+ }+ />++ <NavItem+ label="Developers"+ to="/settings/developers/api-keys"+ Icon={IconRobot}+ active={+ !!useMatch({+ path: useResolvedPath('/settings/developers/api-keys').pathname,+ end: true,+ })+ }+ /><NavTitle label="Other" /><NavItem label="Logout" onClick={handleLogout} Icon={IconLogout} /></SubMenuNavbar>diff --git a/front/src/testing/graphqlMocks.ts b/front/src/testing/graphqlMocks.tsindex 30fef3b0b73..6cd4f7d9175 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.exampleindex 47f7b64d966..55a06ac2afc 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://[email protected]/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 filediff --git a/server/.env.test b/server/.env.testindex 67be1c20a9f..a976e6eafe4 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=90ddiff --git a/server/package.json b/server/package.jsonindex fbb35581bb3..bf969cee1f8 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.tsindex c47fe7605c1..959c97163b5 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 requestconst 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.tsindex f722424aeec..079a76008e0 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.tsindex 86a7fef7fcf..1f4d753ba19 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.tsindex 10671206e65..86f63f5b7ba 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<boolean>('SIGN_IN_PREFILLED') ?? false;}- isDataModelSettingsEnabled(): boolean {- return (- this.configService.get<boolean>('IS_DATA_MODEL_SETTINGS_ENABLED') ?? false- );- }-- isDevelopersSettingsEnabled(): boolean {- return (- this.configService.get<boolean>('IS_DEVELOPERS_SETTINGS_ENABLED') ?? false- );- }-isTelemetryEnabled(): boolean {return this.configService.get<boolean>('TELEMETRY_ENABLED') ?? true;}@@ -41,10 +29,6 @@ export class EnvironmentService {);}- isFlexibleBackendEnabled(): boolean {- return this.configService.get<boolean>('FLEXIBLE_BACKEND_ENABLED') ?? false;- }-getPort(): number {return this.configService.get<number>('PORT') ?? 3000;}diff --git a/server/src/integrations/environment/environment.validation.ts b/server/src/integrations/environment/environment.validation.tsindex c3bcba2e597..331b5c7a747 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()