mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 02:11:29 +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)}
|
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 styles={iconButtonStyles} className="panelInfoIcon" iconName={this.props.iconName} ariaLabel="ChatBot" />
|
<Icon
|
||||||
|
styles={iconButtonStyles}
|
||||||
|
className="panelInfoIcon"
|
||||||
|
iconName={this.props.iconName}
|
||||||
|
ariaLabel="ChatBot"
|
||||||
|
/>
|
||||||
</div>
|
</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)}
|
{CommandButtonComponent.renderLabel(this.props)}
|
||||||
</div>
|
</div>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -14,21 +14,18 @@ export interface SupportPaneComponentProps {
|
|||||||
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;
|
||||||
@@ -36,11 +33,10 @@ export class SupportPaneComponent extends React.Component<SupportPaneComponentPr
|
|||||||
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} />;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import {
|
|||||||
ContainerConnectionInfo,
|
ContainerConnectionInfo,
|
||||||
IPhoenixConnectionInfoResult,
|
IPhoenixConnectionInfoResult,
|
||||||
IProvisionData,
|
IProvisionData,
|
||||||
IResponse
|
IResponse,
|
||||||
} from "../Contracts/DataModels";
|
} from "../Contracts/DataModels";
|
||||||
import * as ViewModels from "../Contracts/ViewModels";
|
import * as ViewModels from "../Contracts/ViewModels";
|
||||||
import { GitHubOAuthService } from "../GitHub/GitHubOAuthService";
|
import { GitHubOAuthService } from "../GitHub/GitHubOAuthService";
|
||||||
@@ -477,7 +477,7 @@ export default class Explorer {
|
|||||||
headers: {
|
headers: {
|
||||||
[Constants.HttpHeaders.authorization]: authorizationHeader.token,
|
[Constants.HttpHeaders.authorization]: authorizationHeader.token,
|
||||||
Accept: "application/json",
|
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",
|
iconName: "ChatBot",
|
||||||
iconAlt: label,
|
iconAlt: label,
|
||||||
onCommandClick: () => {
|
onCommandClick: () => {
|
||||||
useSidePanel.getState().openSidePanel("Chat Assistant (Beta)", <SupportPaneComponent
|
useSidePanel
|
||||||
directLineToken={container.conversationToken()}
|
.getState()
|
||||||
userToken={userContext.authorizationToken}
|
.openSidePanel(
|
||||||
subId={userContext.subscriptionId}
|
"Chat Assistant (Beta)",
|
||||||
rg={userContext.resourceGroup}
|
<SupportPaneComponent
|
||||||
accName={userContext.databaseAccount.name}
|
directLineToken={container.conversationToken()}
|
||||||
/>);
|
userToken={userContext.authorizationToken}
|
||||||
|
subId={userContext.subscriptionId}
|
||||||
|
rg={userContext.resourceGroup}
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user