Skip to content

Commit 7b8c5bc

Browse files
committed
resolve merge conflicts
2 parents 1a3c96d + 8eec63f commit 7b8c5bc

File tree

10 files changed

+331
-32
lines changed

10 files changed

+331
-32
lines changed

.evergreen/functions.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ variables:
5353
MONGODB_RUNNER_LOG_DIR: ${workdir}/src/.testserver/
5454
DOCKERHUB_USERNAME: ${dockerhub_username}
5555
DOCKERHUB_PASSWORD: ${dockerhub_password}
56+
REQUESTER: ${requester}
5657
- &compass-e2e-secrets
5758
E2E_TESTS_METRICS_URI: ${e2e_tests_metrics_string}
5859
E2E_TESTS_ATLAS_HOST: ${e2e_tests_atlas_host}
@@ -421,7 +422,8 @@ functions:
421422
params:
422423
working_dir: src
423424
shell: bash
424-
include_expansions_in_env: [AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
425+
include_expansions_in_env:
426+
[AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN]
425427
env:
426428
ARTIFACTORY_USERNAME: ${artifactory_username}
427429
ARTIFACTORY_PASSWORD: ${artifactory_password}
@@ -506,7 +508,7 @@ functions:
506508
publish:
507509
- command: ec2.assume_role
508510
params:
509-
role_arn: "arn:aws:iam::119629040606:role/s3-access.cdn-origin-compass"
511+
role_arn: 'arn:aws:iam::119629040606:role/s3-access.cdn-origin-compass'
510512
- command: shell.exec
511513
params:
512514
working_dir: src
@@ -661,7 +663,7 @@ functions:
661663
- command: github.generate_token
662664
params:
663665
expansion_name: generated_token
664-
permissions: # optional
666+
permissions: # optional
665667
actions: write
666668
- command: shell.exec
667669
# Fail the task if it's idle for 10 mins

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 Mon Apr 21 2025.
2+
This document was automatically generated on Wed Apr 23 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 12 additions & 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 Mon, Apr 21, 2025
9+
Generated on Wed, Apr 23, 2025
1010

1111
## Table of Contents
1212

@@ -153,6 +153,7 @@ Generated on Mon, Apr 21, 2025
153153
- [Screen](#event--ScreenEvent)
154154
- [Secret Storage Not Available](#event--SecretStorageNotAvailableEvent)
155155
- [Experiment Viewed](#event--ExperimentViewedEvent)
156+
- [Create Index Button Clicked](#event--CreateIndexButtonClickedEvent)
156157

157158
### Performance Tab
158159

@@ -1789,6 +1790,16 @@ a system that doesn't offer a suitable secret storage backend.
17891790
- **test_name** (required): `string`
17901791
- **is_compass_web** (optional): `true | undefined`
17911792

1793+
<a name="event--CreateIndexButtonClickedEvent"></a>
1794+
1795+
### Create Index Button Clicked
1796+
1797+
**Properties**:
1798+
1799+
- **flow** (optional): `"Start with Query" | "Start with Index" | undefined`
1800+
- **context** (required): `"Create Index Modal"`
1801+
- **is_compass_web** (optional): `true | undefined`
1802+
17921803
## Performance Tab
17931804

17941805
<a name="event--CurrentOpShowOperationDetailsEvent"></a>

packages/compass-generative-ai/src/components/ai-optin-modal.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,16 @@ export const AIOptInModal: React.FunctionComponent<OptInModalProps> = ({
116116
{isProjectAIEnabled
117117
? 'AI features are enabled for project users with data access.'
118118
: 'AI features are disabled for project users.'}{' '}
119-
Project Owners can change this setting in the{' '}
119+
Project Owners can {isProjectAIEnabled ? 'disable' : 'enable'} Data
120+
Explorer AI features in the{' '}
120121
{PROJECT_SETTINGS_LINK !== null ? (
121122
<Link href={PROJECT_SETTINGS_LINK} target="_blank">
122-
AI features
123+
Project Settings
123124
</Link>
124125
) : (
125-
'AI features '
126+
'Project Settings'
126127
)}
127-
section.
128+
.
128129
</Banner>
129130
<div className={disclaimerStyles}>
130131
This is a feature powered by generative AI, and may give inaccurate

packages/compass-indexes/src/components/create-index-form/create-index-form.tsx

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
useConnectionSupports,
1919
} from '@mongodb-js/compass-connections/provider';
2020
import { usePreference } from 'compass-preferences-model/provider';
21+
import IndexFlowSection from './index-flow-section';
2122
import QueryFlowSection from './query-flow-section';
2223

2324
const createIndexModalFieldsStyles = css({
@@ -80,6 +81,8 @@ function CreateIndexForm({
8081
});
8182
}, [schemaFields]);
8283

84+
const showIndexesGuidanceIndexFlow =
85+
showIndexesGuidanceVariant && currentTab === 'IndexFlow';
8386
const showIndexesGuidanceQueryFlow =
8487
showIndexesGuidanceVariant && currentTab === 'QueryFlow';
8588

@@ -89,7 +92,11 @@ function CreateIndexForm({
8992
className={createIndexModalFieldsStyles}
9093
data-testid="create-index-form"
9194
>
92-
{showIndexesGuidanceVariant ? (
95+
{!showIndexesGuidanceVariant ? (
96+
<Body weight="medium" className={indexFieldsHeaderStyles}>
97+
Index fields
98+
</Body>
99+
) : (
93100
<RadioBoxGroup
94101
aria-labelledby="index-flows"
95102
data-testid="create-index-form-flows"
@@ -107,29 +114,46 @@ function CreateIndexForm({
107114
Start with a Query
108115
</RadioBox>
109116
</RadioBoxGroup>
110-
) : (
111-
<Body weight="medium" className={indexFieldsHeaderStyles}>
112-
Index fields
113-
</Body>
114117
)}
115118

116-
{/* Only show the fields if user is in the Start with an index flow or if they're in the control */}
117-
{fields.length > 0 &&
118-
(!showIndexesGuidanceVariant || currentTab === 'IndexFlow') ? (
119-
<CreateIndexFields
120-
schemaFields={schemaFieldNames}
121-
fields={fields}
122-
serverVersion={serverVersion}
123-
isRemovable={!(fields.length > 1)}
124-
onSelectFieldNameClick={onSelectFieldNameClick}
125-
onSelectFieldTypeClick={onSelectFieldTypeClick}
126-
onAddFieldClick={onAddFieldClick}
127-
onRemoveFieldClick={onRemoveFieldClick}
128-
/>
119+
{fields.length > 0 ? (
120+
// Variant UI
121+
showIndexesGuidanceVariant && showIndexesGuidanceIndexFlow ? (
122+
<IndexFlowSection
123+
createIndexFieldsComponent={
124+
<CreateIndexFields
125+
schemaFields={schemaFieldNames}
126+
fields={fields}
127+
serverVersion={serverVersion}
128+
isRemovable={!(fields.length > 1)}
129+
onSelectFieldNameClick={onSelectFieldNameClick}
130+
onSelectFieldTypeClick={onSelectFieldTypeClick}
131+
onAddFieldClick={onAddFieldClick}
132+
onRemoveFieldClick={onRemoveFieldClick}
133+
/>
134+
}
135+
/>
136+
) : (
137+
// Control UI
138+
!showIndexesGuidanceQueryFlow && (
139+
<CreateIndexFields
140+
schemaFields={schemaFieldNames}
141+
fields={fields}
142+
serverVersion={serverVersion}
143+
isRemovable={!(fields.length > 1)}
144+
onSelectFieldNameClick={onSelectFieldNameClick}
145+
onSelectFieldTypeClick={onSelectFieldTypeClick}
146+
onAddFieldClick={onAddFieldClick}
147+
onRemoveFieldClick={onRemoveFieldClick}
148+
/>
149+
)
150+
)
129151
) : null}
130-
131-
{showIndexesGuidanceQueryFlow && <QueryFlowSection />}
132152
</div>
153+
154+
{showIndexesGuidanceQueryFlow && <QueryFlowSection />}
155+
156+
{/* TODO in CLOUDP-314036: update the accordion design */}
133157
<Accordion data-testid="create-index-modal-toggle-options" text="Options">
134158
<div
135159
data-testid="create-index-modal-options"
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from 'react';
2+
import { render, screen } from '@mongodb-js/testing-library-compass';
3+
import IndexFlowSection from './index-flow-section';
4+
import { expect } from 'chai';
5+
6+
describe('IndexFlowSection', () => {
7+
const renderComponent = (createIndexFieldsComponent?: JSX.Element) => {
8+
render(
9+
<IndexFlowSection
10+
createIndexFieldsComponent={createIndexFieldsComponent ?? null}
11+
/>
12+
);
13+
};
14+
it('renders the Input Index header', () => {
15+
renderComponent();
16+
expect(screen.getByText('Input Index')).to.be.visible;
17+
});
18+
19+
it('renders the Code Equivalent toggle', () => {
20+
renderComponent();
21+
expect(screen.getByLabelText('Toggle Code Equivalent')).to.be.visible;
22+
});
23+
24+
it('renders the Show me covered queries button', () => {
25+
renderComponent();
26+
expect(screen.getByText('Show me covered queries')).to.be.visible;
27+
});
28+
29+
it('renders the Covered Queries header', () => {
30+
renderComponent();
31+
expect(screen.getByText('Covered Queries')).to.be.visible;
32+
});
33+
34+
it('renders the provided createIndexFieldsComponent', () => {
35+
const mockComponent = (
36+
<div data-testid="mock-component">Mock Component</div>
37+
);
38+
renderComponent(mockComponent);
39+
expect(screen.getByTestId('mock-component')).to.be.visible;
40+
});
41+
42+
it('renders the covered queries examples', () => {
43+
renderComponent();
44+
expect(screen.getByTestId('index-flow-section-covered-queries-examples')).to
45+
.exist;
46+
});
47+
48+
it('renders the optimal query examples', () => {
49+
renderComponent();
50+
expect(screen.getByTestId('index-flow-section-optimal-query-examples')).to
51+
.exist;
52+
});
53+
54+
it('renders the Learn More link', () => {
55+
renderComponent();
56+
const link = screen.getByText('Learn More');
57+
expect(link).to.be.visible;
58+
});
59+
});

0 commit comments

Comments
 (0)