Skip to content

Commit a5d489f

Browse files
only export the provider not the whole context
1 parent 13d5e78 commit a5d489f

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

packages/compass-sidebar/src/components/multiple-connections/sidebar.spec.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ import type { WorkspacesService } from '@mongodb-js/compass-workspaces/provider'
1717
import { WorkspacesServiceProvider } from '@mongodb-js/compass-workspaces/provider';
1818
import { TestMongoDBInstanceManager } from '@mongodb-js/compass-app-stores/provider';
1919
import { ConnectionImportExportProvider } from '@mongodb-js/compass-connection-import-export';
20-
import { AtlasClusterConnectionsOnly, CompassSidebarPlugin } from '../../index';
20+
import {
21+
AtlasClusterConnectionsOnlyProvider,
22+
CompassSidebarPlugin,
23+
} from '../../index';
2124
import type { ConnectionInfo } from '@mongodb-js/compass-connections/provider';
2225
import type AppRegistry from '../../../../hadron-app-registry/dist';
2326

@@ -119,11 +122,11 @@ describe('Multiple Connections Sidebar Component', function () {
119122

120123
if (atlasClusterConnectionsOnly !== undefined) {
121124
component = (
122-
<AtlasClusterConnectionsOnly.Provider
125+
<AtlasClusterConnectionsOnlyProvider
123126
value={atlasClusterConnectionsOnly}
124127
>
125128
{component}
126-
</AtlasClusterConnectionsOnly.Provider>
129+
</AtlasClusterConnectionsOnlyProvider>
127130
);
128131
}
129132

packages/compass-sidebar/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type { ConnectionsService } from '@mongodb-js/compass-connections/provide
1212
import { connectionsLocator } from '@mongodb-js/compass-connections/provider';
1313
import type { Logger } from '@mongodb-js/compass-logging/provider';
1414
import { createLoggerLocator } from '@mongodb-js/compass-logging/provider';
15-
export { AtlasClusterConnectionsOnly } from './components/multiple-connections/connections-navigation';
15+
import { AtlasClusterConnectionsOnly } from './components/multiple-connections/connections-navigation';
1616

1717
export const CompassSidebarPlugin = registerHadronPlugin(
1818
{
@@ -54,3 +54,6 @@ export const CompassSidebarPlugin = registerHadronPlugin(
5454
logger: createLoggerLocator('COMPASS-SIDEBAR-UI'),
5555
}
5656
);
57+
58+
export const AtlasClusterConnectionsOnlyProvider =
59+
AtlasClusterConnectionsOnly.Provider;

packages/compass-web/src/entrypoint.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from '@mongodb-js/compass-collection';
2222
import {
2323
CompassSidebarPlugin,
24-
AtlasClusterConnectionsOnly,
24+
AtlasClusterConnectionsOnlyProvider,
2525
} from '@mongodb-js/compass-sidebar';
2626
import CompassQueryBarPlugin from '@mongodb-js/compass-query-bar';
2727
import { CompassDocumentsPlugin } from '@mongodb-js/compass-crud';
@@ -64,13 +64,13 @@ import { useCompassWebPreferences } from './preferences';
6464
const WithAtlasProviders: React.FC = ({ children }) => {
6565
return (
6666
<AtlasCloudAuthServiceProvider>
67-
<AtlasClusterConnectionsOnly.Provider value={true}>
67+
<AtlasClusterConnectionsOnlyProvider value={true}>
6868
<AtlasServiceProvider>
6969
<AtlasAiServiceProvider apiURLPreset="cloud">
7070
{children}
7171
</AtlasAiServiceProvider>
7272
</AtlasServiceProvider>
73-
</AtlasClusterConnectionsOnly.Provider>
73+
</AtlasClusterConnectionsOnlyProvider>
7474
</AtlasCloudAuthServiceProvider>
7575
);
7676
};

0 commit comments

Comments
 (0)