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