Skip to content

Commit 6a236ec

Browse files
authored
feat(settings): enable sample documents setting COMPASS-7931 (#5857)
1 parent b319a42 commit 6a236ec

File tree

3 files changed

+7
-55
lines changed

3 files changed

+7
-55
lines changed

packages/compass-preferences-model/src/feature-flags.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export type FeatureFlags = {
1919
showInsights: boolean;
2020
enableRenameCollectionModal: boolean;
2121
enableNewMultipleConnectionSystem: boolean;
22-
showGenAIPassSampleDocumentsSetting: boolean;
2322
};
2423

2524
export const featureFlags: Required<{
@@ -74,17 +73,4 @@ export const featureFlags: Required<{
7473
long: 'Allows users to open multiple connections in the same window.',
7574
},
7675
},
77-
78-
/**
79-
* Feature flag for showing the option to pass sample documents with our query and aggregation generation requests.
80-
* Enables showing the `enableGenAISampleDocumentPassing` setting in the settings UI so folks can turn it on.
81-
* Epic: COMPASS-7584
82-
*/
83-
showGenAIPassSampleDocumentsSetting: {
84-
stage: 'development',
85-
description: {
86-
short: 'Enable showing the sample document gen ai setting.',
87-
long: 'Allows users to show a setting to enable the passing of sample field values with our query and aggregation generation requests.',
88-
},
89-
},
9076
};

packages/compass-settings/src/components/settings/gen-ai-settings.spec.tsx

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ function renderGenAiSettings({
1616
}) {
1717
return render(
1818
<Provider store={store}>
19-
<GenAISettings
20-
isAIFeatureEnabled
21-
showGenAIPassSampleDocumentsSetting={false}
22-
{...props}
23-
/>
19+
<GenAISettings isAIFeatureEnabled {...props} />
2420
</Provider>
2521
);
2622
}
@@ -55,43 +51,18 @@ describe('GenAISettings', function () {
5551
beforeEach(async function () {
5652
store = configureStore();
5753
await store.dispatch(fetchSettings());
58-
});
59-
60-
it('shows the atlas login setting', function () {
6154
renderGenAiSettings({
6255
store,
6356
});
6457
container = screen.getByTestId('gen-ai-settings');
65-
expect(container).to.include.text(atlasLoginSettingText);
6658
});
6759

68-
describe('when the showGenAIPassSampleDocumentsSetting feature flag is disabled', function () {
69-
beforeEach(function () {
70-
renderGenAiSettings({
71-
store,
72-
});
73-
container = screen.getByTestId('gen-ai-settings');
74-
});
75-
76-
it('does not show the enableGenAISampleDocumentPassing setting', function () {
77-
expect(container).to.not.include.text(sampleDocsSettingText);
78-
});
60+
it('shows the atlas login setting', function () {
61+
expect(container).to.include.text(atlasLoginSettingText);
7962
});
8063

81-
describe('when the showGenAIPassSampleDocumentsSetting feature flag is enabled', function () {
82-
beforeEach(function () {
83-
renderGenAiSettings({
84-
store,
85-
props: {
86-
showGenAIPassSampleDocumentsSetting: true,
87-
},
88-
});
89-
container = screen.getByTestId('gen-ai-settings');
90-
});
91-
92-
it('does not show the enableGenAISampleDocumentPassing setting', function () {
93-
expect(container).to.include.text(sampleDocsSettingText);
94-
});
64+
it('shows the enableGenAISampleDocumentPassing setting', function () {
65+
expect(container).to.include.text(sampleDocsSettingText);
9566
});
9667
});
9768
});

packages/compass-settings/src/components/settings/gen-ai-settings.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ const atlasSettingsContainerStyles = css({
1212

1313
export const GenAISettings: React.FunctionComponent<{
1414
isAIFeatureEnabled: boolean;
15-
showGenAIPassSampleDocumentsSetting: boolean;
16-
}> = ({ isAIFeatureEnabled, showGenAIPassSampleDocumentsSetting }) => {
15+
}> = ({ isAIFeatureEnabled }) => {
1716
return (
1817
<div data-testid="gen-ai-settings">
1918
<div>
@@ -28,9 +27,7 @@ export const GenAISettings: React.FunctionComponent<{
2827
<div className={atlasSettingsContainerStyles}>
2928
<ConnectedAtlasLoginSettings></ConnectedAtlasLoginSettings>
3029
</div>
31-
{showGenAIPassSampleDocumentsSetting && (
32-
<SettingsList fields={['enableGenAISampleDocumentPassing']} />
33-
)}
30+
<SettingsList fields={['enableGenAISampleDocumentPassing']} />
3431
</>
3532
)}
3633
</div>
@@ -39,8 +36,6 @@ export const GenAISettings: React.FunctionComponent<{
3936

4037
const mapState = (state: RootState) => ({
4138
isAIFeatureEnabled: !!state.settings.settings.enableGenAIFeatures,
42-
showGenAIPassSampleDocumentsSetting:
43-
!!state.settings.settings.showGenAIPassSampleDocumentsSetting,
4439
});
4540

4641
export default connect(mapState, null)(GenAISettings);

0 commit comments

Comments
 (0)