Skip to content

Commit ff755bf

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 3241d69 + 390c921 commit ff755bf

File tree

3 files changed

+29
-20
lines changed

3 files changed

+29
-20
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ This document was automatically generated on Wed Apr 17 2024.
249249
| **[ejson-shell-parser](#88e1a447c02d9ef3274034c023a5ebcec8188381b1bd951de7c57c140f7f3d4b)** | 2.0.1 | MIT |
250250
| **[electron-dl](#e97e034c7b93c63e7a433d75f6f1de3e0668764225ebbd61dbde8d1b55d6f3b7)** | 3.5.0 | MIT |
251251
| **[electron-squirrel-startup](#dcda22e402581a033ec2a017d6d05c094bf3173c1b03ae0471b2ce9078d3f601)** | 1.0.0 | Apache-2.0 |
252-
| **[electron](#ad35eed0d5dc019b2a1b78fbd7a5cc660fa2de2ca7810045df9fdc1866366e7a)** | 28.2.10 | MIT |
252+
| **[electron](#c246c219a293f45342a6d310a565ea32e0861f3064f377b40c6036a348c9bd44)** | 29.3.0 | MIT |
253253
| **[encodeurl](#b89152db475e86531e570f87b45d8a51aa5e5d87d4cc3b960cee7b8febf1d26a)** | 1.0.2 | MIT |
254254
| **[end-of-stream](#fadc10994f5fa767d06fb25cfff35fb17a895daf3bc3477c782907668ed16563)** | 1.4.4 | MIT |
255255
| **[ensure-error](#3b1eba5276d89414cef21a1007e85c4f1d6749bf57b300e082ab23975a41dbc9)** | 3.0.1 | MIT |
@@ -449,7 +449,7 @@ This document was automatically generated on Wed Apr 17 2024.
449449
| **[ms](#2083576c5af8054927640b4788059806d07e250a26066c9ccb2d928394fb9226)** | 2.1.3 | MIT |
450450
| **[napi-build-utils](#26912b5ff7632f262d64273f99cd1a869376c5c378960e24501585e35b31054a)** | 1.0.2 | MIT |
451451
| **[negotiator](#e3856213d8f0a7d28cd4166e53ec7e2c019cb7becf4a8535097bac28d21e8579)** | 0.6.3 | MIT |
452-
| **[node-abi](#20fad7d445931097574f4af1495e728fb65673f1571f4d81ae4f01e6ede407c4)** | 3.57.0 | MIT |
452+
| **[node-abi](#1205ef3be96460c2364cc79d6bbbfb2f6bf895ce33be64bc8cca25c7c3dfa18c)** | 3.58.0 | MIT |
453453
| **[node-addon-api](#af9f7588524ca4e68f4efe7b24aea46d9c8004263b1d7cf3b558f86d87a163e8)** | 4.3.0 | MIT |
454454
| **[node-fetch](#364527ef1b51cc6ac34872b931049c9e25b5014f9b40e3898c84e1a830e21720)** | 2.6.7 | MIT |
455455
| **[node-fetch](#23d7d5a419e9a25e6384dee4aa24f7162544418f0cdc2d92e94e2cf924507b8c)** | 2.7.0 | MIT |
@@ -20880,9 +20880,9 @@ License files:
2088020880
See the License for the specific language governing permissions and
2088120881
limitations under the License.
2088220882

20883-
<a id="ad35eed0d5dc019b2a1b78fbd7a5cc660fa2de2ca7810045df9fdc1866366e7a"></a>
20883+
<a id="c246c219a293f45342a6d310a565ea32e0861f3064f377b40c6036a348c9bd44"></a>
2088420884

20885-
### [electron](https://www.npmjs.com/package/electron) (version 28.2.10)
20885+
### [electron](https://www.npmjs.com/package/electron) (version 29.3.0)
2088620886

2088720887
License tags: MIT
2088820888

@@ -29884,9 +29884,9 @@ License files:
2988429884
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2988529885
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2988629886

29887-
<a id="20fad7d445931097574f4af1495e728fb65673f1571f4d81ae4f01e6ede407c4"></a>
29887+
<a id="1205ef3be96460c2364cc79d6bbbfb2f6bf895ce33be64bc8cca25c7c3dfa18c"></a>
2988829888

29889-
### [node-abi](https://www.npmjs.com/package/node-abi) (version 3.57.0)
29889+
### [node-abi](https://www.npmjs.com/package/node-abi) (version 3.58.0)
2989029890

2989129891
License tags: MIT
2989229892

packages/compass-settings/src/components/modal.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,15 @@ import Sidebar from './sidebar';
2020
import { saveSettings, closeModal } from '../stores/settings';
2121
import type { RootState } from '../stores';
2222
import { getUserInfo } from '../stores/atlas-login';
23-
import {
24-
useIsAIFeatureEnabled,
25-
useHasAIFeatureCloudRolloutAccess,
26-
} from 'compass-preferences-model/provider';
23+
import { useHasAIFeatureCloudRolloutAccess } from 'compass-preferences-model/provider';
2724

2825
type Settings = {
2926
name: string;
3027
component: React.ComponentType;
3128
};
3229

3330
type SettingsModalProps = {
31+
isAIFeatureEnabled: boolean;
3432
isOpen: boolean;
3533
isOIDCEnabled: boolean;
3634
onMount?: () => void;
@@ -60,14 +58,14 @@ const settingsStyles = css(
6058
);
6159

6260
export const SettingsModal: React.FunctionComponent<SettingsModalProps> = ({
61+
isAIFeatureEnabled,
6362
isOpen,
6463
onMount,
6564
onClose,
6665
onSave,
6766
isOIDCEnabled,
6867
hasChangedSettings,
6968
}) => {
70-
const aiFeatureEnabled = useIsAIFeatureEnabled();
7169
const aiFeatureHasCloudRolloutAccess = useHasAIFeatureCloudRolloutAccess();
7270
const onMountRef = useRef(onMount);
7371

@@ -84,7 +82,7 @@ export const SettingsModal: React.FunctionComponent<SettingsModalProps> = ({
8482
if (
8583
isOIDCEnabled ||
8684
// because oidc options overlap with atlas login used for ai feature
87-
aiFeatureEnabled
85+
isAIFeatureEnabled
8886
) {
8987
settings.push({
9088
name: 'OIDC (Preview)',
@@ -151,6 +149,7 @@ export default connect(
151149
return {
152150
isOpen:
153151
state.settings.isModalOpen && state.settings.loadingState === 'ready',
152+
isAIFeatureEnabled: !!state.settings.settings.enableGenAIFeatures,
154153
isOIDCEnabled: !!state.settings.settings.enableOidc,
155154
hasChangedSettings: state.settings.updatedFields.length > 0,
156155
};
Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
import React from 'react';
2+
import { css, spacing } from '@mongodb-js/compass-components';
3+
import { connect } from 'react-redux';
4+
5+
import type { RootState } from '../../stores';
26
import SettingsList from './settings-list';
3-
import { useIsAIFeatureEnabled } from 'compass-preferences-model/provider';
47
import { ConnectedAtlasLoginSettings } from './atlas-login';
5-
import { css, spacing } from '@mongodb-js/compass-components';
68

79
const atlasSettingsContainerStyles = css({
810
marginTop: spacing[3],
911
});
1012

11-
export const GenAISettings: React.FunctionComponent = () => {
12-
const aiFeatureEnabled = useIsAIFeatureEnabled();
13-
13+
export const GenAISettings: React.FunctionComponent<{
14+
isAIFeatureEnabled: boolean;
15+
}> = ({ isAIFeatureEnabled }) => {
1416
return (
1517
<div data-testid="gen-ai-settings">
1618
<div>
@@ -20,16 +22,24 @@ export const GenAISettings: React.FunctionComponent = () => {
2022
</div>
2123
<SettingsList fields={['enableGenAIFeatures']} />
2224

23-
{aiFeatureEnabled && (
25+
{isAIFeatureEnabled && (
2426
<>
2527
<div className={atlasSettingsContainerStyles}>
2628
<ConnectedAtlasLoginSettings></ConnectedAtlasLoginSettings>
2729
</div>
28-
<SettingsList fields={['enableGenAISampleDocumentPassing']} />
30+
{/* TODO(COMPASS-7865): We're currently sending our sample field values to the server
31+
and into the ai prompt as regular JSON. This means the AI isn't generating good
32+
results with certain bson types. It'll take a bit of work server
33+
side for us to do this. In the meantime we are hiding this setting. */}
34+
{/* <SettingsList fields={['enableGenAISampleDocumentPassing']} /> */}
2935
</>
3036
)}
3137
</div>
3238
);
3339
};
3440

35-
export default GenAISettings;
41+
const mapState = (state: RootState) => ({
42+
isAIFeatureEnabled: !!state.settings.settings.enableGenAIFeatures,
43+
});
44+
45+
export default connect(mapState, null)(GenAISettings);

0 commit comments

Comments
 (0)