Skip to content

Commit fc00168

Browse files
authored
Merge branch 'main' into autoupdate-from3
2 parents 6a1a527 + e231969 commit fc00168

File tree

67 files changed

+556
-796
lines changed

Some content is hidden

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

67 files changed

+556
-796
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ syn-zhu <[email protected]>
9696
Nikola Irinchev <[email protected]>
9797
djechlin-mongodb <[email protected]>
9898
Dylan Richardson <[email protected]>
99+
Luke Wilson <[email protected]>

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 Jan 20 2025.
2+
This document was automatically generated on Tue Jan 21 2025.
33

44
## List of dependencies
55

configs/testing-library-compass/src/index.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,12 @@ export class MockDataService
109109
implements
110110
Pick<
111111
DataService,
112+
| 'getConnectionString'
113+
| 'getConnectionOptions'
114+
| 'getMongoClientConnectionOptions'
112115
| 'addReauthenticationHandler'
113116
| 'getCurrentTopologyType'
117+
| 'getLastSeenTopology'
114118
| 'getUpdatedSecrets'
115119
| 'disconnect'
116120
| 'instance'
@@ -126,6 +130,12 @@ export class MockDataService
126130
getConnectionOptions() {
127131
return this.connectionOptions;
128132
}
133+
getMongoClientConnectionOptions() {
134+
return {
135+
url: this.connectionOptions.connectionString,
136+
options: { productName: 'Test', productDocsLink: 'http://example.com' },
137+
};
138+
}
129139
addReauthenticationHandler(): void {
130140
// noop
131141
}

docs/tracking-plan.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# Compass Tracking Plan
33

4-
Generated on Mon, Jan 20, 2025
4+
Generated on Tue, Jan 21, 2025
55

66
## Table of Contents
77

package-lock.json

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

packages/compass-app-stores/src/stores/instance-store.ts

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -352,25 +352,14 @@ export function createInstancesStore(
352352
}
353353
);
354354

355-
on(
356-
globalAppRegistry,
357-
'sidebar-filter-navigation-list',
358-
({ connectionId }: { connectionId?: string } = {}) => {
359-
const connectedConnectionIds = Array.from(
360-
instancesManager.listMongoDBInstances().keys()
361-
);
362-
// connectionId will be provided by the sidebar when in single connection
363-
// mode. We don't derive that from the list of connected connections
364-
// because there is a possibility for us to be fetching all collections on
365-
// wrong connection that way
366-
const connectionIds = connectionId
367-
? [connectionId]
368-
: connectedConnectionIds;
369-
for (const id of connectionIds) {
370-
void fetchAllCollections({ connectionId: id });
371-
}
355+
on(globalAppRegistry, 'sidebar-filter-navigation-list', () => {
356+
const connectedConnectionIds = Array.from(
357+
instancesManager.listMongoDBInstances().keys()
358+
);
359+
for (const id of connectedConnectionIds) {
360+
void fetchAllCollections({ connectionId: id });
372361
}
373-
);
362+
});
374363

375364
on(
376365
globalAppRegistry,

packages/compass-collection/src/components/collection-header-actions/collection-header-actions.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,12 @@ const CollectionHeaderActions: React.FunctionComponent<
5555
const { id: connectionId, atlasMetadata } = connectionInfo;
5656
const { openCollectionWorkspace, openEditViewWorkspace, openShellWorkspace } =
5757
useOpenWorkspace();
58-
const {
59-
readOnly: preferencesReadOnly,
60-
enableShell,
61-
enableMultipleConnectionSystem,
62-
} = usePreferences([
63-
'readOnly',
64-
'enableShell',
65-
'enableMultipleConnectionSystem',
66-
]);
58+
const { readOnly: preferencesReadOnly, enableShell: showOpenShellButton } =
59+
usePreferences(['readOnly', 'enableShell']);
6760
const track = useTelemetry();
6861

6962
const { database, collection } = toNS(namespace);
7063

71-
const showOpenShellButton = enableShell && enableMultipleConnectionSystem;
72-
7364
return (
7465
<div
7566
className={collectionHeaderActionsStyles}

packages/compass-components/src/components/document-list/document-edit-actions-footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const StatusMessages: Record<Status, string> = {
6060
['UpdateStart']: 'Updating document…',
6161
['UpdateError']: '',
6262
['UpdateBlocked']:
63-
'Document was modified in the background or it longer exists. Do you wish to continue and possibly overwrite new changes?',
63+
'Document was modified in the background or it no longer exists. Do you wish to continue and possibly overwrite new changes?',
6464
['UpdateSuccess']: 'Document updated.',
6565
['DeleteStart']: 'Removing document…',
6666
['DeleteError']: '',

packages/compass-connection-import-export/src/components/import-modal.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { SelectTable } from './select-table';
1414
import type { ImportExportResult } from '../hooks/common';
1515
import { useOpenModalThroughIpc } from '../hooks/common';
1616
import { useImportConnections } from '../hooks/use-import-connections';
17-
import { usePreference } from 'compass-preferences-model/provider';
1817

1918
const TOAST_TIMEOUT_MS = 5000;
2019

@@ -38,9 +37,6 @@ export function ImportConnectionsModal({
3837
setOpen: (newOpen: boolean, trackingProps?: Record<string, unknown>) => void;
3938
trackingProps?: Record<string, unknown>;
4039
}): React.ReactElement {
41-
const multipleConnectionsEnabled = usePreference(
42-
'enableMultipleConnectionSystem'
43-
);
4440
const { openToast } = useToast('compass-connection-import-export');
4541
const finish = useCallback(
4642
(result: ImportExportResult) => {
@@ -100,16 +96,15 @@ export function ImportConnectionsModal({
10096
variant={conn.selected ? 'yellow' : 'lightgray'}
10197
data-testid={`existing-favorite-badge-${conn.id}`}
10298
>
103-
Existing{' '}
104-
{multipleConnectionsEnabled ? 'Connection' : 'Favorite'}
99+
Existing Connection
105100
</Badge>
106101
)}
107102
</>
108103
),
109104
})),
110105
connectionList.some((conn) => conn.isExistingConnection && conn.selected),
111106
];
112-
}, [connectionList, multipleConnectionsEnabled]);
107+
}, [connectionList]);
113108

114109
return (
115110
<FormModal

packages/compass-connection-import-export/src/hooks/use-export-connections.spec.tsx

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -243,31 +243,28 @@ describe('useExportConnections', function () {
243243
expect(result.current.state.error).to.equal('');
244244
});
245245

246-
context('when multiple connections is enabled', function () {
247-
it('includes also the non-favorites connections in the export list', function () {
248-
const { result } = renderUseExportConnectionsHook(
249-
{},
250-
{
251-
preferences: { enableMultipleConnectionSystem: true },
252-
connections: [
253-
{
254-
id: 'id1',
255-
connectionOptions: {
256-
connectionString: 'mongodb://localhost:2020',
257-
},
258-
favorite: {
259-
name: 'name1',
260-
},
261-
// expecting to include the non-favorite connections as well
262-
savedConnectionType: 'recent',
246+
it('includes also the non-favorites connections in the export list', function () {
247+
const { result } = renderUseExportConnectionsHook(
248+
{},
249+
{
250+
connections: [
251+
{
252+
id: 'id1',
253+
connectionOptions: {
254+
connectionString: 'mongodb://localhost:2020',
263255
},
264-
],
265-
}
266-
);
256+
favorite: {
257+
name: 'name1',
258+
},
259+
// expecting to include the non-favorite connections as well
260+
savedConnectionType: 'recent',
261+
},
262+
],
263+
}
264+
);
267265

268-
expect(result.current.state.connectionList).to.deep.equal([
269-
{ id: 'id1', name: 'name1', selected: true },
270-
]);
271-
});
266+
expect(result.current.state.connectionList).to.deep.equal([
267+
{ id: 'id1', name: 'name1', selected: true },
268+
]);
272269
});
273270
});

0 commit comments

Comments
 (0)