mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-21 09:51:11 +00:00
Fixed lint errors
This commit is contained in:
@@ -69,7 +69,7 @@ let configContext: Readonly<ConfigContext> = {
|
||||
ARCADIA_LIVY_ENDPOINT_DNS_ZONE: "dev.azuresynapse.net",
|
||||
GITHUB_CLIENT_ID: "6cb2f63cf6f7b5cbdeca", // Registered OAuth app: https://github.com/organizations/AzureCosmosDBNotebooks/settings/applications/1189306
|
||||
GITHUB_TEST_ENV_CLIENT_ID: "b63fc8cbf87fd3c6e2eb", // Registered OAuth app: https://github.com/organizations/AzureCosmosDBNotebooks/settings/applications/1777772
|
||||
JUNO_ENDPOINT: "https://tools.cosmos.azure.com",
|
||||
JUNO_ENDPOINT: "http://localhost:30009",
|
||||
BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
|
||||
isTerminalEnabled: false,
|
||||
isPhoenixEnabled: false,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Activity } from "botframework-directlinejs";
|
||||
import ReactWebChat, { createDirectLine } from "botframework-webchat";
|
||||
import React from "react";
|
||||
import * as _ from "underscore";
|
||||
@@ -29,7 +30,7 @@ export class SupportPaneComponent extends React.Component<SupportPaneComponentPr
|
||||
const dl =
|
||||
{
|
||||
...directLine,
|
||||
postActivity: (activity: any) => {
|
||||
postActivity: (activity: Activity) => {
|
||||
activity.channelData.token = this.props.userToken;
|
||||
activity.channelData.subId = this.props.subId;
|
||||
activity.channelData.rg = this.props.rg;
|
||||
@@ -39,7 +40,7 @@ export class SupportPaneComponent extends React.Component<SupportPaneComponentPr
|
||||
}
|
||||
}
|
||||
|
||||
return <ReactWebChat directLine={dl} userid={this.userId} styleOptions={styleOptions} />;
|
||||
return <ReactWebChat directLine={dl} userID={this.userId} styleOptions={styleOptions} />;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,28 +468,8 @@ export default class Explorer {
|
||||
useDialog.getState().openDialog(resetConfirmationDialogProps);
|
||||
}
|
||||
|
||||
private getUserName() {
|
||||
const accessToken = userContext?.authorizationToken;
|
||||
if (!accessToken) {
|
||||
return "Cosmos DB User";
|
||||
}
|
||||
|
||||
let name;
|
||||
try {
|
||||
const tokenPayload = decryptJWTToken(accessToken);
|
||||
if (tokenPayload && tokenPayload.hasOwnProperty("name")) {
|
||||
name = tokenPayload.name;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Exception while decrypting token");
|
||||
console.error(error);
|
||||
} finally {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
private async generateConversationToken() {
|
||||
var url = `${configContext.JUNO_ENDPOINT}/api/chatbot/bot${userContext.databaseAccount.id}/conversationToken`;
|
||||
const url = `${configContext.JUNO_ENDPOINT}/api/chatbot/bot${userContext.databaseAccount.id}/conversationToken`;
|
||||
const authorizationHeader = getAuthorizationHeader();
|
||||
|
||||
const response = await fetch(url, {
|
||||
|
||||
Reference in New Issue
Block a user