Fixed formatting error

This commit is contained in:
Bala Lakshmi Narayanasami
2022-06-28 21:21:25 +05:30
parent 7364ac8628
commit dba50edca2
5 changed files with 63 additions and 63 deletions

View File

@@ -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"

View File

@@ -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} />;
} }
} }

View File

@@ -196,34 +196,34 @@ 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";