Skip to content

Commit 4313d6e

Browse files
committed
enable cloudshell with vnet config enabled
1 parent 83eafd4 commit 4313d6e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Explorer/ContextMenuButtonFactory.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ export const createCollectionContextMenuButton = (
9696
iconSrc: HostedTerminalIcon,
9797
onClick: () => {
9898
const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection();
99-
if (useNotebook.getState().isShellEnabled) {
99+
if (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) {
100100
container.openNotebookTerminal(ViewModels.TerminalKind.Mongo);
101101
} else {
102102
selectedCollection && selectedCollection.onNewMongoShellClick();
103103
}
104104
},
105-
label: useNotebook.getState().isShellEnabled ? "Open Mongo Shell" : "New Shell",
105+
label: (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) ? "Open Mongo Shell" : "New Shell",
106106
});
107107
}
108108

109-
if (useNotebook.getState().isShellEnabled && userContext.apiType === "Cassandra") {
109+
if ((useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) && userContext.apiType === "Cassandra") {
110110
items.push({
111111
iconSrc: HostedTerminalIcon,
112112
onClick: () => {

src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ export function createContextCommandBarButtons(
125125
const buttons: CommandButtonComponentProps[] = [];
126126

127127
if (!selectedNodeState.isDatabaseNodeOrNoneSelected() && userContext.apiType === "Mongo") {
128-
const label = useNotebook.getState().isShellEnabled ? "Open Mongo Shell" : "New Shell";
128+
const label = (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) ? "Open Mongo Shell" : "New Shell";
129129
const newMongoShellBtn: CommandButtonComponentProps = {
130130
iconSrc: HostedTerminalIcon,
131131
iconAlt: label,
132132
onCommandClick: () => {
133133
const selectedCollection: ViewModels.Collection = selectedNodeState.findSelectedCollection();
134-
if (useNotebook.getState().isShellEnabled) {
134+
if (useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) {
135135
container.openNotebookTerminal(ViewModels.TerminalKind.Mongo);
136136
} else {
137137
selectedCollection && selectedCollection.onNewMongoShellClick();
@@ -145,7 +145,7 @@ export function createContextCommandBarButtons(
145145
}
146146

147147
if (
148-
useNotebook.getState().isShellEnabled &&
148+
(useNotebook.getState().isShellEnabled || userContext.features.enableCloudShell) &&
149149
!selectedNodeState.isDatabaseNodeOrNoneSelected() &&
150150
userContext.apiType === "Cassandra"
151151
) {

0 commit comments

Comments
 (0)