Fixed lint errors

This commit is contained in:
Bala Lakshmi Narayanasami
2022-05-10 15:34:58 +05:30
parent 7bc78f126b
commit 6c77430775
3 changed files with 5 additions and 24 deletions

View File

@@ -69,7 +69,7 @@ let configContext: Readonly<ConfigContext> = {
ARCADIA_LIVY_ENDPOINT_DNS_ZONE: "dev.azuresynapse.net", ARCADIA_LIVY_ENDPOINT_DNS_ZONE: "dev.azuresynapse.net",
GITHUB_CLIENT_ID: "6cb2f63cf6f7b5cbdeca", // Registered OAuth app: https://github.com/organizations/AzureCosmosDBNotebooks/settings/applications/1189306 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 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", BACKEND_ENDPOINT: "https://main.documentdb.ext.azure.com",
isTerminalEnabled: false, isTerminalEnabled: false,
isPhoenixEnabled: false, isPhoenixEnabled: false,

View File

@@ -1,3 +1,4 @@
import { Activity } from "botframework-directlinejs";
import ReactWebChat, { createDirectLine } from "botframework-webchat"; import ReactWebChat, { createDirectLine } from "botframework-webchat";
import React from "react"; import React from "react";
import * as _ from "underscore"; import * as _ from "underscore";
@@ -29,7 +30,7 @@ export class SupportPaneComponent extends React.Component<SupportPaneComponentPr
const dl = const dl =
{ {
...directLine, ...directLine,
postActivity: (activity: any) => { 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;
@@ -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} />;
} }
} }

View File

@@ -468,28 +468,8 @@ export default class Explorer {
useDialog.getState().openDialog(resetConfirmationDialogProps); 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() { 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 authorizationHeader = getAuthorizationHeader();
const response = await fetch(url, { const response = await fetch(url, {