mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 02:11:29 +00:00
Merge latest master changes to chatbot
This commit is contained in:
@@ -27,6 +27,7 @@ import { getCollectionName, getDatabaseName } from "../../../Utils/APITypeUtils"
|
||||
import { isServerlessAccount } from "../../../Utils/CapabilityUtils";
|
||||
import { isRunningOnNationalCloud } from "../../../Utils/CloudUtils";
|
||||
import { CommandButtonComponentProps } from "../../Controls/CommandButton/CommandButtonComponent";
|
||||
import { SupportPaneComponent } from "../../Controls/SupportPaneComponent/SupportPaneComponent";
|
||||
import Explorer from "../../Explorer";
|
||||
import { useNotebook } from "../../Notebook/useNotebook";
|
||||
import { OpenFullScreen } from "../../OpenFullScreen";
|
||||
@@ -184,6 +185,29 @@ export function createControlCommandBarButtons(container: Explorer): CommandButt
|
||||
const showOpenFullScreen =
|
||||
configContext.platform === Platform.Portal && !isRunningOnNationalCloud() && userContext.apiType !== "Gremlin";
|
||||
|
||||
if (userContext.authType === AuthType.AAD) {
|
||||
const label = "Chat Assistant";
|
||||
const supportPaneButton: CommandButtonComponentProps = {
|
||||
iconName: "ChatBot",
|
||||
iconAlt: label,
|
||||
onCommandClick: () => {
|
||||
useSidePanel.getState().openSidePanel("Chat Assistant (Beta)", <SupportPaneComponent
|
||||
directLineToken={container.conversationToken()}
|
||||
userToken={userContext.authorizationToken}
|
||||
subId={userContext.subscriptionId}
|
||||
rg={userContext.resourceGroup}
|
||||
accName={userContext.databaseAccount.name}
|
||||
/>);
|
||||
},
|
||||
commandButtonLabel: null,
|
||||
ariaLabel: label,
|
||||
tooltipText: label,
|
||||
hasPopup: true,
|
||||
disabled: false
|
||||
};
|
||||
buttons.push(supportPaneButton);
|
||||
}
|
||||
|
||||
if (showOpenFullScreen) {
|
||||
const label = "Open Full Screen";
|
||||
const fullScreenButton: CommandButtonComponentProps = {
|
||||
|
||||
Reference in New Issue
Block a user