diff --git a/src/Explorer/ContextMenuButtonFactory.tsx b/src/Explorer/ContextMenuButtonFactory.tsx index a52254cc3..70d02e5aa 100644 --- a/src/Explorer/ContextMenuButtonFactory.tsx +++ b/src/Explorer/ContextMenuButtonFactory.tsx @@ -83,7 +83,6 @@ export const createCollectionContextMenuButton = ( items.push({ iconSrc: HostedTerminalIcon, - isDisabled: useNotebook.getState().isShellEnabled && userContext.features.notebooksTemporarilyDown, onClick: () => { const selectedCollection: ViewModels.Collection = useSelectedNode.getState().findSelectedCollection(); if (useNotebook.getState().isShellEnabled) { diff --git a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx index b4427c0ac..8c9edb0cf 100644 --- a/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx +++ b/src/Explorer/Menus/CommandBar/CommandBarComponentButtonFactory.tsx @@ -111,7 +111,7 @@ export function createStaticCommandBarButtons( buttons.push(btn); }); } else { - if (!isRunningOnNationalCloud() && !userContext.features.notebooksTemporarilyDown) { + if (!isRunningOnNationalCloud() && useNotebook.getState().isPhoenix) { buttons.push(createDivider()); buttons.push(createEnableNotebooksButton(container)); } @@ -169,9 +169,7 @@ export function createContextCommandBarButtons( onCommandClick: () => { const selectedCollection: ViewModels.Collection = selectedNodeState.findSelectedCollection(); if (useNotebook.getState().isShellEnabled) { - if (!userContext.features.notebooksTemporarilyDown) { - container.openNotebookTerminal(ViewModels.TerminalKind.Mongo); - } + container.openNotebookTerminal(ViewModels.TerminalKind.Mongo); } else { selectedCollection && selectedCollection.onNewMongoShellClick(); } @@ -179,13 +177,6 @@ export function createContextCommandBarButtons( commandButtonLabel: label, ariaLabel: label, hasPopup: true, - tooltipText: - useNotebook.getState().isShellEnabled && userContext.features.notebooksTemporarilyDown - ? Constants.Notebook.mongoShellTemporarilyDownMsg - : undefined, - disabled: - (selectedNodeState.isDatabaseNodeOrNoneSelected() && userContext.apiType === "Mongo") || - (useNotebook.getState().isShellEnabled && userContext.features.notebooksTemporarilyDown), }; buttons.push(newMongoShellBtn); } diff --git a/src/Explorer/Notebook/useNotebook.ts b/src/Explorer/Notebook/useNotebook.ts index bc2a74372..6a0edd8f9 100644 --- a/src/Explorer/Notebook/useNotebook.ts +++ b/src/Explorer/Notebook/useNotebook.ts @@ -1,3 +1,4 @@ +import { isPublicInternetAccessAllowed } from "Common/DatabaseAccountUtility"; import { cloneDeep } from "lodash"; import { PhoenixClient } from "Phoenix/PhoenixClient"; import create, { UseStore } from "zustand"; @@ -302,7 +303,7 @@ export const useNotebook: UseStore = create((set, get) => ({ let isPhoenix = false; if (userContext.features.phoenix) { const phoenixClient = new PhoenixClient(); - isPhoenix = await phoenixClient.isDbAcountWhitelisted(); + isPhoenix = isPublicInternetAccessAllowed() && (await phoenixClient.isDbAcountWhitelisted()); } set({ isPhoenix }); } diff --git a/src/Explorer/SplashScreen/SplashScreen.tsx b/src/Explorer/SplashScreen/SplashScreen.tsx index c414dc09b..729e77d5e 100644 --- a/src/Explorer/SplashScreen/SplashScreen.tsx +++ b/src/Explorer/SplashScreen/SplashScreen.tsx @@ -221,7 +221,7 @@ export class SplashScreen extends React.Component { }); } - if (useNotebook.getState().isNotebookEnabled && !userContext.features.notebooksTemporarilyDown) { + if (useNotebook.getState().isPhoenix) { heroes.push({ iconSrc: NewNotebookIcon, title: "New Notebook", diff --git a/src/Explorer/Tree/ResourceTree.tsx b/src/Explorer/Tree/ResourceTree.tsx index 3b548630f..17d464404 100644 --- a/src/Explorer/Tree/ResourceTree.tsx +++ b/src/Explorer/Tree/ResourceTree.tsx @@ -516,7 +516,7 @@ export const ResourceTree: React.FC = ({ container }: Resourc isNotebookEnabled && userContext.apiType === "Mongo" && isPublicInternetAccessAllowed() && - !userContext.features.notebooksTemporarilyDown + useNotebook.getState().isPhoenix ) { children.push({ label: "Schema (Preview)", diff --git a/src/Platform/Hosted/extractFeatures.ts b/src/Platform/Hosted/extractFeatures.ts index 655b9430a..3d7931578 100644 --- a/src/Platform/Hosted/extractFeatures.ts +++ b/src/Platform/Hosted/extractFeatures.ts @@ -33,7 +33,6 @@ export type Features = { readonly ttl90Days: boolean; readonly mongoProxyEndpoint?: string; readonly mongoProxyAPIs?: string; - readonly notebooksTemporarilyDown: boolean; readonly enableThroughputCap: boolean; }; @@ -84,7 +83,6 @@ export function extractFeatures(given = new URLSearchParams(window.location.sear autoscaleDefault: "true" === get("autoscaledefault"), partitionKeyDefault: "true" === get("partitionkeytest"), partitionKeyDefault2: "true" === get("pkpartitionkeytest"), - notebooksTemporarilyDown: "true" === get("notebookstemporarilydown", "true"), phoenix: "true" === get("phoenix"), notebooksDownBanner: "true" === get("notebooksDownBanner"), enableThroughputCap: "true" === get("enablethroughputcap"),