Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ describe('Collection ai query', function () {
);

await browser.setFeature('enableGenAIFeaturesAtlasProject', true);
await browser.setFeature(
'enableGenAISampleDocumentPassingOnAtlasProject',
true
);
await browser.setFeature('enableGenAISampleDocumentPassing', true);
await browser.setFeature('enableGenAIFeaturesAtlasOrg', true);
await browser.setFeature('optInGenAIFeatures', true);
});
Expand Down Expand Up @@ -165,10 +162,7 @@ describe('Collection ai query', function () {
);

await browser.setFeature('enableGenAIFeaturesAtlasProject', true);
await browser.setFeature(
'enableGenAISampleDocumentPassingOnAtlasProject',
true
);
await browser.setFeature('enableGenAISampleDocumentPassing', true);
await browser.setFeature('enableGenAIFeaturesAtlasOrg', false);
await browser.setFeature('optInGenAIFeatures', true);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ describe('AIOptInModal Component', function () {
it('should show warning banner when AI features are disabled', async function () {
await mockPreferences.savePreferences({
enableGenAIFeaturesAtlasProject: false,
enableGenAISampleDocumentPassingOnAtlasProject: false,
});
render(
<PreferencesProvider value={mockPreferences}>
Expand All @@ -147,7 +146,7 @@ describe('AIOptInModal Component', function () {
it('should show info banner with correct copy when only the "Sending Sample Field Values in DE Gen AI Features" setting is disabled', async function () {
await mockPreferences.savePreferences({
enableGenAIFeaturesAtlasProject: true,
enableGenAISampleDocumentPassingOnAtlasProject: false,
enableGenAISampleDocumentPassing: false,
});
render(
<PreferencesProvider value={mockPreferences}>
Expand All @@ -169,7 +168,7 @@ describe('AIOptInModal Component', function () {
it('should show info banner with correct copy when both project settings are enabled', async function () {
await mockPreferences.savePreferences({
enableGenAIFeaturesAtlasProject: true,
enableGenAISampleDocumentPassingOnAtlasProject: true,
enableGenAISampleDocumentPassing: true,
});
render(
<PreferencesProvider value={mockPreferences}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export const AIOptInModal: React.FunctionComponent<OptInModalProps> = ({
}) => {
const isProjectAIEnabled = usePreference('enableGenAIFeaturesAtlasProject');
const isSampleDocumentPassingEnabled = usePreference(
'enableGenAISampleDocumentPassingOnAtlasProject'
'enableGenAISampleDocumentPassing'
);
const track = useTelemetry();
const darkMode = useDarkMode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const editablePreferences: (keyof UserPreferences)[] = [
'showIndexesGuidanceVariant',

// Exposed for testing purposes.
'enableGenAISampleDocumentPassingOnAtlasProject',
'enableGenAISampleDocumentPassing',
'enableGenAIFeaturesAtlasOrg',
'enableGenAIFeaturesAtlasProject',
'enableDataModeling',
Expand Down
11 changes: 0 additions & 11 deletions packages/compass-preferences-model/src/preferences-schema.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ export type NonUserPreferences = {

export type AtlasProjectPreferences = {
enableGenAIFeaturesAtlasProject: boolean;
enableGenAISampleDocumentPassingOnAtlasProject: boolean;
};

export type AtlasOrgPreferences = {
Expand Down Expand Up @@ -1000,16 +999,6 @@ export const storedUserPreferencesProps: Required<{
validator: z.boolean().default(true),
type: 'boolean',
},
enableGenAISampleDocumentPassingOnAtlasProject: {
ui: false,
cli: true,
global: true,
description: {
short: 'Enable Gen AI Sample Document Passing on Atlas Project Level',
},
validator: z.boolean().default(true),
type: 'boolean',
},
enableGenAIFeaturesAtlasOrg: {
ui: false,
cli: true,
Expand Down
6 changes: 3 additions & 3 deletions packages/compass-web/sandbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const App = () => {
csrfToken,
csrfTime,
enableGenAIFeaturesAtlasProject,
enableGenAISampleDocumentPassingOnAtlasProject,
enableGenAISampleDocumentPassing,
enableGenAIFeaturesAtlasOrg,
optInGenAIFeatures,
} = projectParams ?? {};
Expand Down Expand Up @@ -131,8 +131,8 @@ const App = () => {
showDisabledConnections: true,
enableGenAIFeaturesAtlasProject:
isAtlas && !!enableGenAIFeaturesAtlasProject,
enableGenAISampleDocumentPassingOnAtlasProject:
isAtlas && !!enableGenAISampleDocumentPassingOnAtlasProject,
enableGenAISampleDocumentPassing:
isAtlas && !!enableGenAISampleDocumentPassing,
enableGenAIFeaturesAtlasOrg:
isAtlas && !!enableGenAIFeaturesAtlasOrg,
optInGenAIFeatures: isAtlas && !!optInGenAIFeatures,
Expand Down
8 changes: 4 additions & 4 deletions packages/compass-web/sandbox/sandbox-atlas-sign-in.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ProjectParams = {
csrfToken: string;
csrfTime: string;
enableGenAIFeaturesAtlasProject: boolean;
enableGenAISampleDocumentPassingOnAtlasProject: boolean;
enableGenAISampleDocumentPassing: boolean;
enableGenAIFeaturesAtlasOrg: boolean;
optInGenAIFeatures: boolean;
};
Expand Down Expand Up @@ -131,9 +131,9 @@ export function useAtlasProxySignIn(): AtlasLoginReturnValue {
csrfTime,
optInGenAIFeatures: isOptedIntoDataExplorerGenAIFeatures,
enableGenAIFeaturesAtlasOrg: genAIFeaturesEnabled,
enableGenAISampleDocumentPassingOnAtlasProject:
groupEnabledFeatureFlags.includes(
'ENABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING'
enableGenAISampleDocumentPassing:
!groupEnabledFeatureFlags.includes(
'DISABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING'
Copy link
Member Author

@Anemy Anemy Sep 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use DISABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING on web instead of ENABLE_DATA_EXPLORER_GEN_AI_SAMPLE_DOCUMENT_PASSING. (Feature flags would only exist if they're set to true by default. Otherwise it would error in the backend, so we made the logic inverse 🙃 .)
https://jira.mongodb.org/browse/CLOUDP-290870

),
enableGenAIFeaturesAtlasProject: groupEnabledFeatureFlags.includes(
'ENABLE_DATA_EXPLORER_GEN_AI_FEATURES'
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-web/src/preferences.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function useCompassWebPreferences(
enableImportExport: false,
enableGenAIFeatures: true,
enableGenAIFeaturesAtlasProject: false,
enableGenAISampleDocumentPassingOnAtlasProject: false,
enableGenAISampleDocumentPassing: false,
enableGenAIFeaturesAtlasOrg: false,
enablePerformanceAdvisorBanner: true,
enableMyQueries: false,
Expand Down
Loading