Skip to content

Commit a06cd43

Browse files
Merge remote-tracking branch 'origin/main' into beta-releases
2 parents 2fcb047 + 0c31b63 commit a06cd43

File tree

97 files changed

+2192
-1251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+2192
-1251
lines changed

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 Sun Apr 27 2025.
2+
This document was automatically generated on Sun May 04 2025.
33

44
## List of dependencies
55

docs/tracking-plan.md

Lines changed: 1 addition & 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 Sun, Apr 27, 2025
9+
Generated on Sun, May 4, 2025
1010

1111
## Table of Contents
1212

package-lock.json

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

packages/atlas-service/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"email": "[email protected]"
1414
},
1515
"homepage": "https://github.com/mongodb-js/compass",
16-
"version": "0.37.0",
16+
"version": "0.38.0",
1717
"repository": {
1818
"type": "git",
1919
"url": "https://github.com/mongodb-js/compass.git"
@@ -71,17 +71,17 @@
7171
"typescript": "^5.0.4"
7272
},
7373
"dependencies": {
74-
"@mongodb-js/compass-components": "^1.35.1",
74+
"@mongodb-js/compass-components": "^1.35.2",
7575
"@mongodb-js/compass-logging": "^1.6.8",
76-
"@mongodb-js/compass-telemetry": "^1.5.0",
76+
"@mongodb-js/compass-telemetry": "^1.6.0",
7777
"@mongodb-js/compass-user-data": "^0.5.8",
7878
"@mongodb-js/compass-utils": "^0.8.8",
7979
"@mongodb-js/connection-info": "^0.11.9",
8080
"@mongodb-js/devtools-connect": "^3.4.1",
8181
"@mongodb-js/devtools-proxy-support": "^0.4.2",
8282
"@mongodb-js/oidc-plugin": "^1.1.6",
8383
"hadron-app-registry": "^9.4.8",
84-
"compass-preferences-model": "^2.34.0",
84+
"compass-preferences-model": "^2.35.0",
8585
"electron": "^32.3.3",
8686
"hadron-ipc": "^3.4.8",
8787
"lodash": "^4.17.21",

packages/collection-model/index.d.ts

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,18 +64,18 @@ interface CollectionProps {
6464
specialish: boolean;
6565
normal: boolean;
6666
readonly: boolean;
67-
view_on: string;
67+
view_on: string | null;
6868
collation: unknown;
6969
pipeline: unknown[];
7070
validation: unknown;
71-
is_capped: boolean;
72-
document_count: number;
73-
document_size: number;
74-
avg_document_size: number;
75-
storage_size: number;
76-
free_storage_size: number;
77-
index_count: number;
78-
index_size: number;
71+
is_capped: boolean | undefined;
72+
document_count: number | undefined;
73+
document_size: number | undefined;
74+
avg_document_size: number | undefined;
75+
storage_size: number | undefined;
76+
free_storage_size: number | undefined;
77+
index_count: number | undefined;
78+
index_size: number | undefined;
7979
isTimeSeries: boolean;
8080
isView: boolean;
8181
/** Only relevant for a view and identifies collection/view from which this view was created. */
@@ -85,7 +85,13 @@ interface CollectionProps {
8585
is_non_existent: boolean;
8686
}
8787

88-
type CollectionDataService = Pick<DataService, 'collectionStats' | 'collectionInfo' | 'listCollections' | 'isListSearchIndexesSupported'>;
88+
type CollectionDataService = Pick<
89+
DataService,
90+
| 'collectionStats'
91+
| 'collectionInfo'
92+
| 'listCollections'
93+
| 'isListSearchIndexesSupported'
94+
>;
8995

9096
interface Collection extends CollectionProps {
9197
fetch(opts: {
@@ -106,7 +112,10 @@ interface Collection extends CollectionProps {
106112
}
107113

108114
interface CollectionCollection extends Array<Collection> {
109-
fetch(opts: { dataService: CollectionDataService; fetchInfo?: boolean }): Promise<void>;
115+
fetch(opts: {
116+
dataService: CollectionDataService;
117+
fetchInfo?: boolean;
118+
}): Promise<void>;
110119
toJSON(opts?: { derived: boolean }): Array<CollectionProps>;
111120
at(index: number): Collection | undefined;
112121
get(id: string, key?: '_id' | 'name'): Collection | undefined;

packages/collection-model/lib/model.js

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ function pickCollectionInfo({
104104
fle2,
105105
is_non_existent,
106106
}) {
107-
return { type, readonly, view_on, collation, pipeline, validation, clustered, fle2, is_non_existent };
107+
return {
108+
type,
109+
readonly,
110+
view_on,
111+
collation,
112+
pipeline,
113+
validation,
114+
clustered,
115+
fle2,
116+
is_non_existent,
117+
};
108118
}
109119

110120
/**
@@ -232,18 +242,30 @@ const CollectionModel = AmpersandModel.extend(debounceActions(['fetch']), {
232242
},
233243

234244
/**
235-
* @param {{ dataService: import('mongodb-data-service').DataService }} dataService
245+
* @param {{
246+
* dataService: import('mongodb-data-service').DataService,
247+
* fetchInfo: boolean,
248+
* force: boolean
249+
* }} options
236250
* @returns
237251
*/
238252
async fetch({ dataService, fetchInfo = true, force = false }) {
239253
if (!shouldFetch(this.status, force)) {
240254
return;
241255
}
256+
257+
const shouldFetchDbAndCollStats = getParentByType(
258+
this,
259+
'Instance'
260+
).shouldFetchDbAndCollStats;
261+
242262
try {
243263
const newStatus = this.status === 'initial' ? 'fetching' : 'refreshing';
244264
this.set({ status: newStatus });
245265
const [collStats, collectionInfo] = await Promise.all([
246-
dataService.collectionStats(this.database, this.name),
266+
shouldFetchDbAndCollStats
267+
? dataService.collectionStats(this.database, this.name)
268+
: null,
247269
fetchInfo ? dataService.collectionInfo(this.database, this.name) : null,
248270
]);
249271
this.set({
@@ -255,7 +277,7 @@ const CollectionModel = AmpersandModel.extend(debounceActions(['fetch']), {
255277
// If the collection is not unprovisioned `is_non_existent` anymore,
256278
// let's update the parent database model to reflect the change.
257279
// This happens when a user tries to insert first document into a
258-
// collection that doesn't exist yet or creates a new collection
280+
// collection that doesn't exist yet or creates a new collection
259281
// for an unprovisioned database.
260282
if (!this.is_non_existent) {
261283
getParentByType(this, 'Database').set({
@@ -271,7 +293,9 @@ const CollectionModel = AmpersandModel.extend(debounceActions(['fetch']), {
271293
/**
272294
* Fetches collection info and returns a special format of collection metadata
273295
* that events like open-in-new-tab, select-namespace, edit-view require
274-
* @param {{ dataService: import('mongodb-data-service').DataService }} dataService
296+
* @param {{
297+
* dataService: import('mongodb-data-service').DataService,
298+
* }} options
275299
*/
276300
async fetchMetadata({ dataService }) {
277301
try {

packages/collection-model/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mongodb-collection-model",
33
"description": "MongoDB collection model",
44
"author": "Lucas Hrabovsky <[email protected]>",
5-
"version": "5.25.8",
5+
"version": "5.26.0",
66
"bugs": {
77
"url": "https://jira.mongodb.org/projects/COMPASS/issues",
88
"email": "[email protected]"

packages/compass-aggregations/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@mongodb-js/compass-aggregations",
33
"description": "Compass Aggregation Pipeline Builder",
44
"private": true,
5-
"version": "9.54.0",
5+
"version": "9.55.0",
66
"main": "dist/index.js",
77
"compass:main": "src/index.ts",
88
"types": "dist/index.d.ts",
@@ -59,34 +59,34 @@
5959
"@dnd-kit/core": "^6.0.7",
6060
"@dnd-kit/sortable": "^7.0.2",
6161
"@dnd-kit/utilities": "^3.2.1",
62-
"@mongodb-js/atlas-service": "^0.37.0",
63-
"@mongodb-js/compass-app-stores": "^7.38.0",
64-
"@mongodb-js/compass-collection": "^4.51.0",
65-
"@mongodb-js/compass-components": "^1.35.1",
66-
"@mongodb-js/compass-connections": "^1.52.0",
67-
"@mongodb-js/compass-crud": "^13.52.0",
68-
"@mongodb-js/compass-editor": "^0.37.1",
69-
"@mongodb-js/compass-field-store": "^9.27.0",
70-
"@mongodb-js/compass-generative-ai": "^0.32.0",
62+
"@mongodb-js/atlas-service": "^0.38.0",
63+
"@mongodb-js/compass-app-stores": "^7.39.0",
64+
"@mongodb-js/compass-collection": "^4.52.0",
65+
"@mongodb-js/compass-components": "^1.35.2",
66+
"@mongodb-js/compass-connections": "^1.53.0",
67+
"@mongodb-js/compass-crud": "^13.53.0",
68+
"@mongodb-js/compass-editor": "^0.37.2",
69+
"@mongodb-js/compass-field-store": "^9.28.0",
70+
"@mongodb-js/compass-generative-ai": "^0.33.0",
7171
"@mongodb-js/compass-logging": "^1.6.8",
72-
"@mongodb-js/compass-telemetry": "^1.5.0",
72+
"@mongodb-js/compass-telemetry": "^1.6.0",
7373
"@mongodb-js/compass-utils": "^0.8.8",
74-
"@mongodb-js/compass-workspaces": "^0.33.0",
74+
"@mongodb-js/compass-workspaces": "^0.34.0",
7575
"@mongodb-js/explain-plan-helper": "^1.4.8",
7676
"@mongodb-js/mongodb-constants": "^0.11.0",
77-
"@mongodb-js/my-queries-storage": "^0.23.1",
77+
"@mongodb-js/my-queries-storage": "^0.23.2",
7878
"@mongodb-js/shell-bson-parser": "^1.2.0",
7979
"bson": "^6.10.3",
80-
"compass-preferences-model": "^2.34.0",
80+
"compass-preferences-model": "^2.35.0",
8181
"hadron-app-registry": "^9.4.8",
8282
"hadron-document": "^8.8.8",
8383
"hadron-type-checker": "^7.4.8",
8484
"lodash": "^4.17.21",
8585
"mongodb": "^6.14.1",
86-
"mongodb-collection-model": "^5.25.8",
86+
"mongodb-collection-model": "^5.26.0",
8787
"mongodb-data-service": "^22.25.8",
88-
"mongodb-database-model": "^2.25.8",
89-
"mongodb-instance-model": "^12.26.8",
88+
"mongodb-database-model": "^2.26.0",
89+
"mongodb-instance-model": "^12.27.0",
9090
"mongodb-ns": "^2.4.2",
9191
"mongodb-query-parser": "^4.3.0",
9292
"mongodb-schema": "^12.5.2",

packages/compass-aggregations/src/components/pipeline-results-workspace/index.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ describe('PipelineResultsWorkspace', function () {
7272
const onRetry = spy();
7373
await renderPipelineResultsWorkspace({
7474
isError: true,
75-
error: 'Something bad happened',
75+
error: { message: 'Something bad happened' },
7676
onRetry,
7777
});
7878
expect(screen.getByText('Something bad happened')).to.exist;
79-
userEvent.click(screen.getByText('Retry'), undefined, {
79+
userEvent.click(screen.getByText('RETRY'), undefined, {
8080
skipPointerEventsCheck: true,
8181
});
8282
expect(onRetry).to.be.calledOnce;

packages/compass-aggregations/src/components/pipeline-results-workspace/index.tsx

Lines changed: 57 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,19 @@ import {
66
cx,
77
spacing,
88
CancelLoader,
9-
ErrorSummary,
109
Subtitle,
1110
Button,
1211
palette,
12+
Banner,
13+
BannerVariant,
14+
showErrorDetails,
1315
} from '@mongodb-js/compass-components';
1416
import type { RootState } from '../../modules';
15-
import { cancelAggregation, retryAggregation } from '../../modules/aggregation';
17+
import {
18+
type AggregationError,
19+
cancelAggregation,
20+
retryAggregation,
21+
} from '../../modules/aggregation';
1622
import PipelineResultsList from './pipeline-results-list';
1723
import PipelineEmptyResults from './pipeline-empty-results';
1824
import {
@@ -52,6 +58,23 @@ const centered = css({
5258
justifyContent: 'center',
5359
});
5460

61+
const errorBannerStyles = css({
62+
width: '100%',
63+
});
64+
65+
const errorBannerContentStyles = css({
66+
display: 'flex',
67+
justifyContent: 'space-between',
68+
});
69+
70+
const errorBannerTextStyles = css({
71+
flex: 1,
72+
});
73+
74+
const errorDetailsBtnStyles = css({
75+
marginLeft: spacing[100],
76+
});
77+
5578
const ResultsContainer: React.FunctionComponent<{ center?: boolean }> = ({
5679
children,
5780
center,
@@ -102,7 +125,7 @@ type PipelineResultsWorkspaceProps = {
102125
documents: HadronDocument[];
103126
isLoading?: boolean;
104127
isError?: boolean;
105-
error?: string | null;
128+
error?: AggregationError;
106129
isEmpty?: boolean;
107130
isMergeOrOutPipeline?: boolean;
108131
mergeOrOutDestination?: string | null;
@@ -133,12 +156,38 @@ export const PipelineResultsWorkspace: React.FunctionComponent<
133156
if (isError && error) {
134157
results = (
135158
<ResultsContainer>
136-
<ErrorSummary
159+
<Banner
137160
data-testid="pipeline-results-error"
138-
errors={error}
139-
onAction={onRetry}
140-
actionText="Retry"
141-
/>
161+
variant={BannerVariant.Danger}
162+
className={errorBannerStyles}
163+
>
164+
<div className={errorBannerContentStyles}>
165+
<div className={errorBannerTextStyles}>{error?.message}</div>
166+
<Button
167+
size="xsmall"
168+
onClick={onRetry}
169+
data-testid="pipeline-results-error-retry-button"
170+
className={errorDetailsBtnStyles}
171+
>
172+
RETRY
173+
</Button>
174+
{error?.info && (
175+
<Button
176+
size="xsmall"
177+
onClick={() =>
178+
showErrorDetails({
179+
details: error.info!,
180+
closeAction: 'close',
181+
})
182+
}
183+
data-testid="pipeline-results-error-details-button"
184+
className={errorDetailsBtnStyles}
185+
>
186+
VIEW ERROR DETAILS
187+
</Button>
188+
)}
189+
</div>
190+
</Banner>
142191
</ResultsContainer>
143192
);
144193
} else if (isLoading) {

0 commit comments

Comments
 (0)