mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-24 19:31:36 +00:00
Fixed formatting error
This commit is contained in:
@@ -260,11 +260,11 @@ export class CommandButtonComponent extends React.Component<CommandButtonCompone
|
||||
onClick={(e: React.MouseEvent<HTMLSpanElement>) => this.commandClickCallback(e)}
|
||||
>
|
||||
<div className={contentClassName}>
|
||||
if (this.props.iconName){" "}
|
||||
if (this.props.iconName){" "}
|
||||
{
|
||||
<div>
|
||||
<Icon
|
||||
styles={ { root: { marginBottom: -3 } }}
|
||||
styles={{ root: { marginBottom: -3 } }}
|
||||
className="panelInfoIcon"
|
||||
iconName={this.props.iconName}
|
||||
ariaLabel="ChatBot"
|
||||
|
||||
@@ -3,39 +3,39 @@ import ReactWebChat, { createDirectLine } from "botframework-webchat";
|
||||
import * as React from "react";
|
||||
import * as _ from "underscore";
|
||||
export interface SupportPaneComponentProps {
|
||||
directLineToken: string;
|
||||
userToken: string;
|
||||
subId: string;
|
||||
rg: string;
|
||||
accName: string;
|
||||
directLineToken: string;
|
||||
userToken: string;
|
||||
subId: string;
|
||||
rg: string;
|
||||
accName: string;
|
||||
}
|
||||
|
||||
export class SupportPaneComponent extends React.Component<SupportPaneComponentProps> {
|
||||
private readonly userId: string = _.uniqueId();
|
||||
private readonly userId: string = _.uniqueId();
|
||||
|
||||
constructor(props: SupportPaneComponentProps) {
|
||||
super(props);
|
||||
}
|
||||
constructor(props: SupportPaneComponentProps) {
|
||||
super(props);
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
const styleOptions = {
|
||||
bubbleBackground: "rgba(0, 0, 255, .1)",
|
||||
bubbleFromUserBackground: "rgba(0, 255, 0, .1)",
|
||||
};
|
||||
public render(): JSX.Element {
|
||||
const styleOptions = {
|
||||
bubbleBackground: "rgba(0, 0, 255, .1)",
|
||||
bubbleFromUserBackground: "rgba(0, 255, 0, .1)",
|
||||
};
|
||||
|
||||
const directLine = createDirectLine({ token: this.props.directLineToken });
|
||||
const dl = {
|
||||
...directLine,
|
||||
postActivity: (activity: Activity) => {
|
||||
activity.channelData.token = this.props.userToken;
|
||||
activity.channelData.subId = this.props.subId;
|
||||
activity.channelData.rg = this.props.rg;
|
||||
activity.channelData.accName = this.props.accName;
|
||||
const directLine = createDirectLine({ token: this.props.directLineToken });
|
||||
const dl = {
|
||||
...directLine,
|
||||
postActivity: (activity: Activity) => {
|
||||
activity.channelData.token = this.props.userToken;
|
||||
activity.channelData.subId = this.props.subId;
|
||||
activity.channelData.rg = this.props.rg;
|
||||
activity.channelData.accName = this.props.accName;
|
||||
|
||||
return directLine.postActivity(activity);
|
||||
},
|
||||
};
|
||||
return directLine.postActivity(activity);
|
||||
},
|
||||
};
|
||||
|
||||
return <ReactWebChat directLine={dl} userID={this.userId} styleOptions={styleOptions} />;
|
||||
}
|
||||
}
|
||||
return <ReactWebChat directLine={dl} userID={this.userId} styleOptions={styleOptions} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ export default class Explorer {
|
||||
public subId: ko.Observable<string>;
|
||||
public rg: ko.Observable<string>;
|
||||
public accName: ko.Observable<string>;
|
||||
|
||||
|
||||
private _isInitializingNotebooks: boolean;
|
||||
private notebookToImport: {
|
||||
name: string;
|
||||
@@ -113,7 +113,7 @@ export default class Explorer {
|
||||
);
|
||||
|
||||
this.queriesClient = new QueriesClient(this);
|
||||
|
||||
|
||||
this.conversationToken = ko.observable<string>();
|
||||
|
||||
this.generateConversationToken();
|
||||
@@ -490,7 +490,7 @@ export default class Explorer {
|
||||
setTimeout(() => this.generateConversationToken(), (tokenResponse?.expires_in - 1000) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private async _containsDefaultNotebookWorkspace(databaseAccount: DataModels.DatabaseAccount): Promise<boolean> {
|
||||
if (!databaseAccount) {
|
||||
return false;
|
||||
|
||||
@@ -196,35 +196,35 @@ export function createControlCommandBarButtons(container: Explorer): CommandButt
|
||||
const showOpenFullScreen =
|
||||
configContext.platform === Platform.Portal && !isRunningOnNationalCloud() && userContext.apiType !== "Gremlin";
|
||||
|
||||
if (userContext.authType === AuthType.AAD && userContext.features.enableChatbot) {
|
||||
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,
|
||||
className: "fonticoncustom",
|
||||
};
|
||||
buttons.push(supportPaneButton);
|
||||
}
|
||||
|
||||
if (userContext.authType === AuthType.AAD && userContext.features.enableChatbot) {
|
||||
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,
|
||||
className: "fonticoncustom",
|
||||
};
|
||||
buttons.push(supportPaneButton);
|
||||
}
|
||||
|
||||
if (showOpenFullScreen) {
|
||||
const label = "Open Full Screen";
|
||||
const fullScreenButton: CommandButtonComponentProps = {
|
||||
|
||||
@@ -30,7 +30,7 @@ export type Features = {
|
||||
readonly mongoProxyAPIs?: string;
|
||||
readonly enableThroughputCap: boolean;
|
||||
readonly enableChatbot?: boolean;
|
||||
|
||||
|
||||
// can be set via both flight and feature flag
|
||||
autoscaleDefault: boolean;
|
||||
partitionKeyDefault: boolean;
|
||||
|
||||
Reference in New Issue
Block a user