Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion packages/compass-collection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"@mongodb-js/compass-workspaces": "^1.1.0",
"@mongodb-js/workspace-info": "^1.9.1",
"@mongodb-js/connection-info": "^0.28.1",
"@mongodb-js/mongodb-constants": "^0.33.0",
"bson": "^7.2.0",
"compass-preferences-model": "^3.1.0",
"hadron-document": "^8.11.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { useOpenWorkspace } from '@mongodb-js/compass-workspaces/provider';
import React from 'react';
import { usePreferences } from 'compass-preferences-model/provider';
import toNS from 'mongodb-ns';
import { wrapField } from '@mongodb-js/mongodb-constants';
import { useTelemetry } from '@mongodb-js/compass-telemetry/provider';
import {
buildChartsUrl,
Expand Down Expand Up @@ -66,8 +65,8 @@ const CollectionHeaderActions: React.FunctionComponent<
data-testid="collection-header-open-shell-button"
onClick={() => {
openShellWorkspace(connectionId, {
initialEvaluate: `use ${database}`,
initialInput: `db[${wrapField(collection, true)}].find()`,
initialEvaluate: `use(${JSON.stringify(database)})`,
initialInput: `db[${JSON.stringify(collection)}].find()`,
});
track('Open Shell', { entrypoint: 'collection' }, connectionInfo);
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/compass-e2e-tests/tests/shell.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ describe('Shell', function () {

const output = await getShellOutputText(browser);
expect(output.slice(0, 3)).to.deep.equal([
'use my-sidebar-database',
'use("my-sidebar-database")',
'switched to db my-sidebar-database',
'db["my-sidebar-collection"].find()',
]);
Expand Down
1 change: 0 additions & 1 deletion packages/compass-sidebar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"@mongodb-js/compass-telemetry": "^1.31.0",
"@mongodb-js/compass-workspaces": "^1.1.0",
"@mongodb-js/connection-info": "^0.28.1",
"@mongodb-js/mongodb-constants": "^0.33.0",
"@mongodb-js/workspace-info": "^1.9.1",
"compass-preferences-model": "^3.1.0",
"lodash": "^4.18.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import {
} from '@mongodb-js/compass-connection-import-export';
import { useTelemetry } from '@mongodb-js/compass-telemetry/provider';
import { usePreference } from 'compass-preferences-model/provider';
import { wrapField } from '@mongodb-js/mongodb-constants';
import {
buildPerformanceMetricsUrl,
buildClusterOverviewUrl,
Expand Down Expand Up @@ -374,12 +373,14 @@ const ConnectionsNavigation: React.FC<ConnectionsNavigationProps> = ({
let initialInput: string | undefined = undefined;

if (item.type === 'database') {
initialEvaluate = `use ${item.dbName};`;
initialEvaluate = `use(${JSON.stringify(item.dbName)});`;
}

if (item.type === 'collection') {
initialEvaluate = `use ${item.databaseItem.dbName};`;
initialInput = `db[${wrapField(item.name, true)}].find()`;
initialEvaluate = `use(${JSON.stringify(
item.databaseItem.dbName
)});`;
initialInput = `db[${JSON.stringify(item.name)}].find()`;
}

openShellWorkspace(connectionId, {
Expand Down
2 changes: 1 addition & 1 deletion packages/databases-collections-list/src/items-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const TableControls: React.FunctionComponent<{
openShellWorkspace(
connectionInfo.id,
namespace
? { initialEvaluate: `use ${namespace}` }
? { initialEvaluate: `use(${JSON.stringify(namespace)})` }
: undefined
);
track(
Expand Down
Loading