Skip to content

Commit a401c83

Browse files
authored
fix(stage-wizard): $lookup form changes COMPASS-6770 (#4347)
1 parent abc94d5 commit a401c83

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/lookup/lookup.spec.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,13 +229,17 @@ describe('lookup', function () {
229229
fields: [],
230230
isLoading: false,
231231
type: 'collection',
232-
error: new Error('Failed to fetch fields'),
232+
error: new Error(),
233233
},
234234
},
235235
});
236236
setComboboxValue(/select collection/i, 'test');
237237
openComboBox(/select foreign field/i);
238-
expect(screen.getByText('Failed to fetch fields')).to.exist;
238+
expect(
239+
screen.getByText(
240+
'Failed to fetch the fields. Type the field name manually.'
241+
)
242+
).to.exist;
239243
});
240244
});
241245
});

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/lookup/lookup.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { fetchCollectionFields } from '../../../../modules/collections-fields';
1414
import type { CollectionData } from '../../../../modules/collections-fields';
1515
import type { WizardComponentProps } from '..';
1616

17-
const LOOKUP_TITLE = 'Join documents in';
17+
const LOOKUP_TITLE = 'Join documents from';
1818

1919
type LookupFormState = {
2020
from: string;
@@ -144,7 +144,7 @@ export const LookupForm = ({
144144
})()}
145145
searchLoadingMessage="Fetching fields ..."
146146
searchErrorMessage={
147-
collectionInfo?.error?.message ?? 'Count not fetch fields'
147+
'Failed to fetch the fields. Type the field name manually.'
148148
}
149149
searchEmptyMessage={
150150
!formData.from ? 'Select a collection first.' : undefined
@@ -169,7 +169,7 @@ export const LookupForm = ({
169169
/>
170170
</div>
171171
<div className={formGroup}>
172-
<Body className={titleStyles}>in</Body>
172+
<Body className={titleStyles}>as</Body>
173173
<div className={inputFieldStyles}>
174174
<TextInput
175175
value={formData.as}

packages/compass-aggregations/src/modules/collections-fields.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ describe('collections-fields module', function () {
216216
(ns: string, stage: Document, options: Document) => {
217217
expect(ns).to.equal('test.listings');
218218
expect(stage).to.deep.equal({ size: 1 });
219-
expect(options).to.deep.equal({ maxTimeMS: 5000 });
219+
expect(options).to.deep.equal({ maxTimeMS: 10000 });
220220
return Promise.resolve([{ _id: 12, name: 'test' }]);
221221
}
222222
);
@@ -256,7 +256,7 @@ describe('collections-fields module', function () {
256256
expect(options).to.deep.equal({
257257
limit: 1,
258258
sort: { $natural: -1 },
259-
maxTimeMS: 5000,
259+
maxTimeMS: 10000,
260260
});
261261
return Promise.resolve([{ _id: 12, data: 'test' }]);
262262
}

packages/compass-aggregations/src/modules/collections-fields.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getSchema } from '../utils/get-schema';
55
import toNS from 'mongodb-ns';
66
import { isEqual } from 'lodash';
77

8-
const FETCH_SCHEMA_MAX_TIME_MS = 5000;
8+
const FETCH_SCHEMA_MAX_TIME_MS = 10000;
99

1010
type CollectionType = 'collection' | 'view';
1111
export type CollectionInfo = {

0 commit comments

Comments
 (0)