Skip to content

Commit b58573a

Browse files
authored
chore: remove early journey index experiment CLOUDP-320224 (#7560)
1 parent 7a1fd65 commit b58573a

23 files changed

+66
-2026
lines changed

THIRD-PARTY-NOTICES.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,6 @@ This document was automatically generated on Wed Nov 12 2025.
401401
| **[mongodb-connection-string-url](#2e1146256a89ebd24e3398881e03807fe363d58444e6b7952ea50bd6108707bc)** | 3.0.1 | Apache-2.0 |
402402
| **[mongodb-connection-string-url](#1fd70d8a07ac5222eca41b7f648d7e56e854e4947d54123daeca8614d050a545)** | 3.0.2 | Apache-2.0 |
403403
| **[mongodb-log-writer](#985aaa38a9ce4a6f192fbd3fba7f9a713cf11718348d09268e92b363cfa0067f)** | 2.4.4 | Apache-2.0 |
404-
| **[mongodb-mql-engines](#f3c3cf99d701af28ef931ec96d633f53a8010e9a64fe99de829cd0788725e29d)** | 0.0.4 | Apache-2.0 |
405404
| **[mongodb-ns](#1cd7eed8e558e278003bafc11ef70f899d5d7c2e4e604a3223e4fa11a0f85fa7)** | 3.0.1 | Apache-2.0 |
406405
| **[mongodb-ns](#15cc8a3da3a5e870e2d1230562cb9b6bbacd596d19d09daf5ad4d7bdbe331fa1)** | 3.0.3 | Apache-2.0 |
407406
| **[mongodb-query-parser](#15068a4e6d825438a4e6d365a3566f58762ef216402070179557503b775f3ff4)** | 4.3.0 | Apache-2.0 |
@@ -28840,12 +28839,6 @@ License files:
2884028839

2884128840
<a id="f3c3cf99d701af28ef931ec96d633f53a8010e9a64fe99de829cd0788725e29d"></a>
2884228841

28843-
### [mongodb-mql-engines](https://www.npmjs.com/package/mongodb-mql-engines) (version 0.0.4)
28844-
28845-
License tags: Apache-2.0
28846-
28847-
<a id="1cd7eed8e558e278003bafc11ef70f899d5d7c2e4e604a3223e4fa11a0f85fa7"></a>
28848-
2884928842
### [mongodb-ns](https://www.npmjs.com/package/mongodb-ns) (version 3.0.1)
2885028843

2885128844
License tags: Apache-2.0

docs/tracking-plan.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2282,7 +2282,6 @@ a system that doesn't offer a suitable secret storage backend.
22822282

22832283
**Properties**:
22842284

2285-
- **flow** (optional): `"Start with Query" | "Start with Index" | undefined`
22862285
- **context** (required): `"Create Index Modal"`
22872286
- **is_compass_web** (optional): `true | undefined`
22882287

package-lock.json

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

packages/compass-indexes/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@
8484
"mongodb": "^6.19.0",
8585
"mongodb-collection-model": "^5.36.0",
8686
"mongodb-data-service": "^22.35.0",
87-
"mongodb-mql-engines": "^0.0.4",
8887
"mongodb-ns": "^3.0.1",
8988
"mongodb-query-parser": "^4.3.0",
9089
"react": "^17.0.2",

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { css, Banner, spacing, Button } from '@mongodb-js/compass-components';
33
import { connect } from 'react-redux';
44
import { areAllFieldsFilledIn } from '../../utils/create-index-modal-validation';
5-
import type { Field, Tab } from '../../modules/create-index';
5+
import type { Field } from '../../modules/create-index';
66
import type { RootState } from '../../modules';
77
import { useTelemetry } from '@mongodb-js/compass-telemetry/provider';
88

@@ -33,32 +33,16 @@ function CreateIndexActions({
3333
onCreateIndexClick,
3434
onCancelCreateIndexClick,
3535
fields,
36-
currentTab,
37-
indexSuggestions,
3836
}: {
3937
error: string | null;
4038
onErrorBannerCloseClick: () => void;
4139
onCreateIndexClick: () => void;
4240
onCancelCreateIndexClick: () => void;
4341
fields: Field[];
44-
currentTab: Tab;
45-
indexSuggestions: Record<string, number> | null;
4642
}) {
4743
const track = useTelemetry();
4844

49-
let isCreateIndexButtonDisabled = false;
50-
// Disable create index button if the user is in Query Flow and has no suggestions
51-
if (currentTab === 'QueryFlow') {
52-
if (indexSuggestions === null) {
53-
isCreateIndexButtonDisabled = true;
54-
}
55-
}
56-
// Or if they are in the Index Flow but have not completed the fields
57-
else {
58-
if (!areAllFieldsFilledIn(fields)) {
59-
isCreateIndexButtonDisabled = true;
60-
}
61-
}
45+
const isCreateIndexButtonDisabled = !areAllFieldsFilledIn(fields);
6246

6347
return (
6448
<div className={containerStyles}>
@@ -102,11 +86,9 @@ function CreateIndexActions({
10286
}
10387

10488
const mapState = ({ createIndex }: RootState) => {
105-
const { fields, currentTab, indexSuggestions } = createIndex;
89+
const { fields } = createIndex;
10690
return {
10791
fields,
108-
currentTab,
109-
indexSuggestions,
11092
};
11193
};
11294

Lines changed: 33 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,54 @@
11
import React from 'react';
2-
import { render, screen, fireEvent } from '@mongodb-js/testing-library-compass';
2+
import { render, screen, userEvent } from '@mongodb-js/testing-library-compass';
3+
import { Provider } from 'react-redux';
34
import { CreateIndexForm } from './create-index-form';
45
import type { Field } from '../../modules/create-index';
56
import { expect } from 'chai';
6-
import type { SinonSpy } from 'sinon';
7-
87
import { setupStore } from '../../../test/setup-store';
9-
import sinon from 'sinon';
10-
import { Provider } from 'react-redux';
118

129
describe('CreateIndexForm', () => {
13-
let onTabClickSpy: SinonSpy;
14-
const store = setupStore();
15-
16-
beforeEach(function () {
17-
onTabClickSpy = sinon.spy();
18-
});
10+
const defaultProps = {
11+
namespace: 'test.collection',
12+
fields: [
13+
{ name: 'field1', type: '1' },
14+
{ name: 'field2', type: '-1' },
15+
] as Field[],
16+
serverVersion: '5.0.0',
17+
onSelectFieldNameClick: () => {},
18+
onSelectFieldTypeClick: () => {},
19+
onAddFieldClick: () => {},
20+
onRemoveFieldClick: () => {},
21+
query: null,
22+
};
1923

20-
const renderComponent = ({
21-
showIndexesGuidanceVariant,
22-
}: {
23-
showIndexesGuidanceVariant?: boolean;
24-
}) => {
25-
render(
24+
const renderWithStore = (props = defaultProps) => {
25+
const store = setupStore();
26+
return render(
2627
<Provider store={store}>
27-
<CreateIndexForm
28-
namespace="testNamespace"
29-
fields={
30-
[
31-
{ name: 'field1', type: 'string' },
32-
{ name: 'field2', type: 'number' },
33-
] as Field[]
34-
}
35-
serverVersion="5.0.0"
36-
currentTab="IndexFlow"
37-
onSelectFieldNameClick={() => {}}
38-
onSelectFieldTypeClick={() => {}}
39-
onAddFieldClick={() => {}}
40-
onRemoveFieldClick={() => {}}
41-
onTabClick={onTabClickSpy}
42-
showIndexesGuidanceVariant={showIndexesGuidanceVariant || false}
43-
query={null}
44-
/>
28+
<CreateIndexForm {...props} />
4529
</Provider>
4630
);
4731
};
4832

4933
it('renders the create index form', () => {
50-
renderComponent({});
34+
renderWithStore();
5135
expect(screen.getByTestId('create-index-form')).to.exist;
5236
});
5337

54-
describe('when showIndexesGuidanceVariant is false', () => {
55-
it('renders the RadioBoxGroup', () => {
56-
renderComponent({});
57-
expect(screen.queryByTestId('create-index-form-flows')).not.to.exist;
58-
});
38+
it('renders the index fields section', () => {
39+
renderWithStore();
40+
expect(screen.getByText('Index fields')).to.exist;
5941
});
6042

61-
describe('when showIndexesGuidanceVariant is true', () => {
62-
it('renders the RadioBoxGroup', () => {
63-
renderComponent({ showIndexesGuidanceVariant: true });
64-
expect(screen.getByTestId('create-index-form-flows')).to.exist;
65-
});
66-
it('calls onTabClick when a RadioBox is selected', () => {
67-
renderComponent({ showIndexesGuidanceVariant: true });
68-
const radioBox = screen.getByLabelText('Start with a Query');
69-
fireEvent.click(radioBox);
70-
expect(onTabClickSpy).to.be.calledWith('QueryFlow');
71-
});
43+
it('renders standard index options when accordion is expanded', () => {
44+
renderWithStore();
45+
expect(screen.getByTestId('create-index-modal-toggle-options')).to.exist;
46+
47+
// Click to expand the options accordion
48+
const optionsButton = screen.getByText('Options');
49+
expect(optionsButton).to.exist;
50+
userEvent.click(optionsButton);
51+
52+
expect(screen.getByTestId('create-index-modal-options')).to.exist;
7253
});
7354
});

0 commit comments

Comments
 (0)