mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 18:01:39 +00:00
Format fix
This commit is contained in:
@@ -260,13 +260,18 @@ 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={iconButtonStyles} className="panelInfoIcon" iconName={this.props.iconName} ariaLabel="ChatBot" />
|
||||
<Icon
|
||||
styles={iconButtonStyles}
|
||||
className="panelInfoIcon"
|
||||
iconName={this.props.iconName}
|
||||
ariaLabel="ChatBot"
|
||||
/>
|
||||
</div>
|
||||
} else {
|
||||
<img className="commandIcon" src={this.props.iconSrc} alt={this.props.iconAlt} />
|
||||
}
|
||||
}{" "}
|
||||
else {<img className="commandIcon" src={this.props.iconSrc} alt={this.props.iconAlt} />}
|
||||
{CommandButtonComponent.renderLabel(this.props)}
|
||||
</div>
|
||||
</span>
|
||||
|
||||
@@ -14,21 +14,18 @@ export interface SupportPaneComponentProps {
|
||||
export class SupportPaneComponent extends React.Component<SupportPaneComponentProps> {
|
||||
private readonly userId: string = _.uniqueId();
|
||||
|
||||
|
||||
constructor(props: SupportPaneComponentProps) {
|
||||
super(props);
|
||||
|
||||
}
|
||||
|
||||
public render(): JSX.Element {
|
||||
const styleOptions = {
|
||||
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 dl =
|
||||
{
|
||||
const dl = {
|
||||
...directLine,
|
||||
postActivity: (activity: Activity) => {
|
||||
activity.channelData.token = this.props.userToken;
|
||||
@@ -36,11 +33,10 @@ export class SupportPaneComponent extends React.Component<SupportPaneComponentPr
|
||||
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} />;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
ContainerConnectionInfo,
|
||||
IPhoenixConnectionInfoResult,
|
||||
IProvisionData,
|
||||
IResponse
|
||||
IResponse,
|
||||
} from "../Contracts/DataModels";
|
||||
import * as ViewModels from "../Contracts/ViewModels";
|
||||
import { GitHubOAuthService } from "../GitHub/GitHubOAuthService";
|
||||
@@ -477,7 +477,7 @@ export default class Explorer {
|
||||
headers: {
|
||||
[Constants.HttpHeaders.authorization]: authorizationHeader.token,
|
||||
Accept: "application/json",
|
||||
[Constants.HttpHeaders.contentType]: "application/json"
|
||||
[Constants.HttpHeaders.contentType]: "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -202,20 +202,25 @@ export function createControlCommandBarButtons(container: Explorer): CommandButt
|
||||
iconName: "ChatBot",
|
||||
iconAlt: label,
|
||||
onCommandClick: () => {
|
||||
useSidePanel.getState().openSidePanel("Chat Assistant (Beta)", <SupportPaneComponent
|
||||
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"
|
||||
className: "fonticoncustom",
|
||||
};
|
||||
buttons.push(supportPaneButton);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user