Skip to content

Commit b4d1784

Browse files
committed
Merge branch 'main' into mock-data-generator-raw-schema-confirmation-screen
2 parents 3cf163e + 17ea5ba commit b4d1784

File tree

13 files changed

+413
-53
lines changed

13 files changed

+413
-53
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,4 @@ Jacob Lu <[email protected]>
112112
Nataly Carbonell <[email protected]>
113113
DarshanaVenkatesh <[email protected]>
114114
Kevin Pamaran <[email protected]>
115+
Leo Generali <[email protected]>

THIRD-PARTY-NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
The following third-party software is used by and included in **Mongodb Compass**.
2-
This document was automatically generated on Fri Sep 05 2025.
2+
This document was automatically generated on Mon Sep 08 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
> the tracking plan for the specific Compass version you can use the following
77
> URL: `https://github.com/mongodb-js/compass/blob/<compass version>/docs/tracking-plan.md`
88
9-
Generated on Fri, Sep 5, 2025
9+
Generated on Mon, Sep 8, 2025
1010

1111
## Table of Contents
1212

package-lock.json

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/atlas-service/src/util.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const config = {
143143
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
144144
},
145145
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
146-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
146+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
147147
},
148148
'atlas-dev': {
149149
ccsBaseUrl: '',
@@ -154,7 +154,7 @@ const config = {
154154
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
155155
},
156156
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
157-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
157+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
158158
},
159159
'atlas-qa': {
160160
ccsBaseUrl: '',
@@ -165,7 +165,7 @@ const config = {
165165
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
166166
},
167167
authPortalUrl: 'https://account-qa.mongodb.com/account/login',
168-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
168+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
169169
},
170170
atlas: {
171171
ccsBaseUrl: '',
@@ -187,7 +187,7 @@ const config = {
187187
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
188188
},
189189
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
190-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
190+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
191191
},
192192
'web-sandbox-atlas-dev': {
193193
ccsBaseUrl: '/ccs',
@@ -198,7 +198,7 @@ const config = {
198198
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
199199
},
200200
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
201-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
201+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
202202
},
203203
'web-sandbox-atlas-qa': {
204204
ccsBaseUrl: '/ccs',
@@ -209,7 +209,7 @@ const config = {
209209
issuer: 'https://auth-qa.mongodb.com/oauth2/default',
210210
},
211211
authPortalUrl: 'https://account-dev.mongodb.com/account/login',
212-
assistantApiBaseUrl: 'https://knowledge.staging.corp.mongodb.com/api/v1',
212+
assistantApiBaseUrl: 'https://knowledge-dev.mongodb.com/api/v1',
213213
},
214214
'web-sandbox-atlas': {
215215
ccsBaseUrl: '/ccs',

packages/compass-assistant/src/compass-assistant-drawer.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ import {
1414
AssistantActionsContext,
1515
AssistantContext,
1616
} from './compass-assistant-provider';
17-
import { usePreference } from 'compass-preferences-model/provider';
17+
import {
18+
useIsAIFeatureEnabled,
19+
usePreference,
20+
} from 'compass-preferences-model/provider';
1821

1922
const assistantTitleStyles = css({
2023
display: 'flex',
@@ -39,6 +42,7 @@ export const CompassAssistantDrawer: React.FunctionComponent<{
3942
const { clearChat } = useContext(AssistantActionsContext);
4043

4144
const enableAIAssistant = usePreference('enableAIAssistant');
45+
const isAiFeatureEnabled = useIsAIFeatureEnabled();
4246

4347
const handleClearChat = useCallback(async () => {
4448
const confirmed = await showConfirmation({
@@ -54,7 +58,7 @@ export const CompassAssistantDrawer: React.FunctionComponent<{
5458
}
5559
}, [clearChat]);
5660

57-
if (!enableAIAssistant) {
61+
if (!enableAIAssistant || !isAiFeatureEnabled) {
5862
return null;
5963
}
6064

packages/compass-assistant/src/compass-assistant-provider.spec.tsx

Lines changed: 59 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,19 +234,67 @@ describe('CompassAssistantProvider', function () {
234234
expect(screen.getByTestId('provider-children')).to.exist;
235235
});
236236

237-
it('does not render assistant drawer when AI assistant is disabled', function () {
238-
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
239-
preferences: {
240-
enableAIAssistant: false,
241-
enableGenAIFeatures: true,
242-
enableGenAIFeaturesAtlasOrg: true,
243-
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
244-
},
237+
describe('disabling the Assistant', function () {
238+
it('does not render assistant drawer when AI assistant is disabled', function () {
239+
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
240+
preferences: {
241+
enableAIAssistant: false,
242+
enableGenAIFeatures: true,
243+
enableGenAIFeaturesAtlasOrg: true,
244+
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
245+
},
246+
});
247+
248+
expect(screen.getByTestId('provider-children')).to.exist;
249+
// The drawer toolbar button should not exist when disabled
250+
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
245251
});
246252

247-
expect(screen.getByTestId('provider-children')).to.exist;
248-
// The drawer toolbar button should not exist when disabled
249-
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
253+
it('does not render assistant drawer when AI features are disabled via isAIFeatureEnabled', function () {
254+
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
255+
preferences: {
256+
enableAIAssistant: true,
257+
// These control isAIFeatureEnabled
258+
enableGenAIFeatures: false,
259+
enableGenAIFeaturesAtlasOrg: true,
260+
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
261+
},
262+
});
263+
264+
expect(screen.getByTestId('provider-children')).to.exist;
265+
// The drawer toolbar button should not exist when AI features are disabled
266+
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
267+
});
268+
269+
it('does not render assistant drawer when Atlas org AI features are disabled', function () {
270+
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
271+
preferences: {
272+
enableAIAssistant: true,
273+
enableGenAIFeatures: true,
274+
enableGenAIFeaturesAtlasOrg: false,
275+
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: true },
276+
},
277+
});
278+
279+
expect(screen.getByTestId('provider-children')).to.exist;
280+
// The drawer toolbar button should not exist when Atlas org AI features are disabled
281+
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
282+
});
283+
284+
it('does not render assistant drawer when cloud feature rollout access is disabled', function () {
285+
render(<TestComponent chat={createMockChat({ messages: [] })} />, {
286+
preferences: {
287+
enableAIAssistant: true,
288+
enableGenAIFeatures: true,
289+
enableGenAIFeaturesAtlasOrg: true,
290+
cloudFeatureRolloutAccess: { GEN_AI_COMPASS: false },
291+
},
292+
});
293+
294+
expect(screen.getByTestId('provider-children')).to.exist;
295+
// The drawer toolbar button should not exist when cloud feature rollout access is disabled
296+
expect(screen.queryByLabelText('MongoDB Assistant')).to.not.exist;
297+
});
250298
});
251299

252300
it('renders the assistant drawer as the first drawer item when AI assistant is enabled', function () {

0 commit comments

Comments
 (0)