@@ -19,10 +19,16 @@ import { AuthType } from "../../../AuthType";
1919import * as Constants from "../../../Common/Constants" ;
2020import { Platform , configContext } from "../../../ConfigContext" ;
2121import * as ViewModels from "../../../Contracts/ViewModels" ;
22- import { userContext } from "../../../UserContext" ;
22+ import {
23+ userContext ,
24+ isVCoreMongoNativeAuthDisabled ,
25+ VCoreMongoNativeAuthDisabledMessage ,
26+ VCoreMongoNativeAuthLearnMoreUrl ,
27+ } from "../../../UserContext" ;
2328import { isRunningOnNationalCloud } from "../../../Utils/CloudUtils" ;
2429import { useSidePanel } from "../../../hooks/useSidePanel" ;
2530import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent" ;
31+ import { useDialog } from "../../Controls/Dialog" ;
2632import Explorer from "../../Explorer" ;
2733import { useNotebook } from "../../Notebook/useNotebook" ;
2834import { BrowseQueriesPane } from "../../Panes/BrowseQueriesPane/BrowseQueriesPane" ;
@@ -499,12 +505,21 @@ function createOpenTerminalButtonByKind(
499505 const label = `Open ${ terminalFriendlyName ( ) } shell` ;
500506 const tooltip =
501507 "This feature is not yet available in your account's region. View supported regions here: https://aka.ms/cosmos-enable-notebooks." ;
508+ const isNativeAuthDisabled = terminalKind === ViewModels . TerminalKind . VCoreMongo && isVCoreMongoNativeAuthDisabled ( ) ;
502509 const disableButton =
503- ! useNotebook . getState ( ) . isNotebooksEnabledForAccount && ! useNotebook . getState ( ) . isNotebookEnabled ;
510+ ( ! useNotebook . getState ( ) . isNotebooksEnabledForAccount && ! useNotebook . getState ( ) . isNotebookEnabled ) ||
511+ isNativeAuthDisabled ;
504512 return {
505513 iconSrc : HostedTerminalIcon ,
506514 iconAlt : label ,
507515 onCommandClick : ( ) => {
516+ if ( isNativeAuthDisabled ) {
517+ useDialog . getState ( ) . showOkModalDialog ( "Native Authentication Disabled" , VCoreMongoNativeAuthDisabledMessage , {
518+ linkText : "Learn more" ,
519+ linkUrl : VCoreMongoNativeAuthLearnMoreUrl ,
520+ } ) ;
521+ return ;
522+ }
508523 if ( useNotebook . getState ( ) . isNotebookEnabled || userContext . features . enableCloudShell ) {
509524 container . openNotebookTerminal ( terminalKind ) ;
510525 }
@@ -513,7 +528,7 @@ function createOpenTerminalButtonByKind(
513528 hasPopup : false ,
514529 disabled : disableButton ,
515530 ariaLabel : label ,
516- tooltipText : ! disableButton ? "" : tooltip ,
531+ tooltipText : isNativeAuthDisabled ? VCoreMongoNativeAuthDisabledMessage : ! disableButton ? "" : tooltip ,
517532 } ;
518533}
519534
0 commit comments