Skip to content

The open alternative to Salesforce, designed for AI.

Created two new env variables (#2120)

bosiraphael2b8a81a05c50
diff --git a/front/src/generated/graphql.tsx b/front/src/generated/graphql.tsx
index b47700e4c8a..7b3cdc668af 100644
--- a/front/src/generated/graphql.tsx
+++ b/front/src/generated/graphql.tsx
@@ -648,7 +648,9 @@ 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;
@@ -1383,6 +1385,8 @@ export type Mutation = {
createOneApiKey: AuthToken;
createOneComment: Comment;
createOneCompany: Company;
+ createOneField: Field;
+ createOneObject: Object;
createOnePerson: Person;
createOnePipelineProgress: PipelineProgress;
createOnePipelineStage: PipelineStage;
@@ -1397,6 +1401,8 @@ export type Mutation = {
deleteManyView: AffectedRows;
deleteManyViewFilter: AffectedRows;
deleteManyViewSort: AffectedRows;
+ deleteOneField: FieldDeleteResponse;
+ deleteOneObject: ObjectDeleteResponse;
deleteOnePipelineStage: PipelineStage;
deleteOneView: View;
deleteUserAccount: User;
@@ -1407,6 +1413,8 @@ export type Mutation = {
signUp: LoginToken;
updateOneActivity: Activity;
updateOneCompany?: Maybe<Company>;
+ updateOneField: Field;
+ updateOneObject: Object;
updateOnePerson?: Maybe<Person>;
updateOnePipelineProgress?: Maybe<PipelineProgress>;
updateOnePipelineStage?: Maybe<PipelineStage>;
@@ -2483,6 +2491,8 @@ export type Query = {
clientConfig: ClientConfig;
currentUser: User;
currentWorkspace: Workspace;
+ field: Field;
+ fields: FieldConnection;
findFavorites: Array<Favorite>;
findManyActivities: Array<Activity>;
findManyApiKey: Array<ApiKey>;
@@ -2500,6 +2510,8 @@ export type Query = {
findUniqueCompany: Company;
findUniquePerson: Person;
findWorkspaceFromInviteHash: Workspace;
+ object: Object;
+ objects: ObjectConnection;
};
@@ -3769,7 +3781,7 @@ export type CheckUserExistsQuery = { __typename?: 'Query', checkUserExists: { __
export type GetClientConfigQueryVariables = Exact<{ [key: string]: never; }>;
-export type GetClientConfigQuery = { __typename?: 'Query', clientConfig: { __typename?: 'ClientConfig', signInPrefilled: 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, 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 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 };
@@ -5212,6 +5224,8 @@ export const GetClientConfigDocument = gql`
password
}
signInPrefilled
+ dataModelSettingsEnabled
+ developersSettingsEnabled
debugMode
telemetry {
enabled
diff --git a/front/src/modules/client-config/components/ClientConfigProvider.tsx b/front/src/modules/client-config/components/ClientConfigProvider.tsx
index be71a8ad407..b0986351f4b 100644
--- a/front/src/modules/client-config/components/ClientConfigProvider.tsx
+++ b/front/src/modules/client-config/components/ClientConfigProvider.tsx
@@ -8,6 +8,8 @@ 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> = ({
@@ -20,6 +22,12 @@ export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
);
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);
@@ -39,6 +47,12 @@ export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
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);
}
@@ -48,6 +62,8 @@ export const ClientConfigProvider: React.FC<React.PropsWithChildren> = ({
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 59b439a2b98..6c173143e78 100644
--- a/front/src/modules/client-config/graphql/queries/getClientConfig.ts
+++ b/front/src/modules/client-config/graphql/queries/getClientConfig.ts
@@ -8,6 +8,8 @@ export const GET_CLIENT_CONFIG = gql`
password
}
signInPrefilled
+ dataModelSettingsEnabled
+ developersSettingsEnabled
debugMode
telemetry {
enabled
diff --git a/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts b/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts
new file mode 100644
index 00000000000..4f839312c8f
--- /dev/null
+++ b/front/src/modules/client-config/states/isDataModelSettingsEnabled.ts
@@ -0,0 +1,6 @@
+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.ts
new file mode 100644
index 00000000000..d745a11ef2b
--- /dev/null
+++ b/front/src/modules/client-config/states/isDevelopersSettingsEnabled.ts
@@ -0,0 +1,6 @@
+import { atom } from 'recoil';
+
+export const isDevelopersSettingsEnabledState = atom<boolean>({
+ key: 'isDevelopersSettingsEnabledState',
+ default: false,
+});
diff --git a/front/src/modules/settings/components/SettingsNavbar.tsx b/front/src/modules/settings/components/SettingsNavbar.tsx
index 7645a966f07..b65beb43484 100644
--- a/front/src/modules/settings/components/SettingsNavbar.tsx
+++ b/front/src/modules/settings/components/SettingsNavbar.tsx
@@ -1,7 +1,10 @@
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,
@@ -26,6 +29,22 @@ 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/api').pathname,
+ end: true,
+ });
+
return (
<SubMenuNavbar backButtonTitle="Settings" displayVersion={true}>
<NavTitle label="User" />
@@ -74,28 +93,22 @@ export const SettingsNavbar = () => {
})
}
/>
- <NavItem
- label="Data model"
- to="/settings/objects"
- Icon={IconHierarchy2}
- active={
- !!useMatch({
- path: useResolvedPath('/settings/objects').pathname,
- end: false,
- })
- }
- />
- <NavItem
- label="Developers"
- to="/settings/apis"
- Icon={IconRobot}
- active={
- !!useMatch({
- path: useResolvedPath('/settings/api').pathname,
- end: true,
- })
- }
- />
+ {isDataModelSettingsEnabled && (
+ <NavItem
+ label="Data model"
+ to="/settings/objects"
+ Icon={IconHierarchy2}
+ active={isDataModelSettingsActive}
+ />
+ )}
+ {isDevelopersSettingsEnabled && (
+ <NavItem
+ label="Developers"
+ to="/settings/apis"
+ Icon={IconRobot}
+ active={isDevelopersSettingsActive}
+ />
+ )}
<NavTitle label="Other" />
<NavItem label="Logout" onClick={handleLogout} Icon={IconLogout} />
</SubMenuNavbar>
diff --git a/front/src/testing/graphqlMocks.ts b/front/src/testing/graphqlMocks.ts
index bec2b0d2143..0f905b58a41 100644
--- a/front/src/testing/graphqlMocks.ts
+++ b/front/src/testing/graphqlMocks.ts
@@ -217,6 +217,8 @@ export const graphqlMocks = [
ctx.data({
clientConfig: {
signInPrefilled: true,
+ dataModelSettingsEnabled: true,
+ developersSettingsEnabled: true,
debugMode: false,
authProviders: { google: true, password: true, magicLink: false },
telemetry: { enabled: false, anonymizationEnabled: true },
diff --git a/server/.env.example b/server/.env.example
index 0f5546ca36c..061db59ecb3 100644
--- a/server/.env.example
+++ b/server/.env.example
@@ -27,3 +27,5 @@ SIGN_IN_PREFILLED=true
# 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
diff --git a/server/.env.test b/server/.env.test
index a976e6eafe4..67be1c20a9f 100644
--- a/server/.env.test
+++ b/server/.env.test
@@ -14,6 +14,8 @@ 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/src/core/client-config/client-config.entity.ts b/server/src/core/client-config/client-config.entity.ts
index c26035d7d6a..f722424aeec 100644
--- a/server/src/core/client-config/client-config.entity.ts
+++ b/server/src/core/client-config/client-config.entity.ts
@@ -41,6 +41,12 @@ export class ClientConfig {
@Field(() => Boolean)
signInPrefilled: boolean;
+ @Field(() => Boolean)
+ dataModelSettingsEnabled: boolean;
+
+ @Field(() => Boolean)
+ developersSettingsEnabled: boolean;
+
@Field(() => Boolean)
debugMode: boolean;
diff --git a/server/src/core/client-config/client-config.resolver.ts b/server/src/core/client-config/client-config.resolver.ts
index 736bfbfae2b..86a7fef7fcf 100644
--- a/server/src/core/client-config/client-config.resolver.ts
+++ b/server/src/core/client-config/client-config.resolver.ts
@@ -22,6 +22,10 @@ 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(),
diff --git a/server/src/integrations/environment/environment.service.ts b/server/src/integrations/environment/environment.service.ts
index 9fc60e96674..82096a4f94e 100644
--- a/server/src/integrations/environment/environment.service.ts
+++ b/server/src/integrations/environment/environment.service.ts
@@ -19,6 +19,18 @@ 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;
}
diff --git a/server/src/integrations/environment/environment.validation.ts b/server/src/integrations/environment/environment.validation.ts
index 5a11350927a..c3bcba2e597 100644
--- a/server/src/integrations/environment/environment.validation.ts
+++ b/server/src/integrations/environment/environment.validation.ts
@@ -36,6 +36,16 @@ 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()