From 6c77430775413dbc84bd9e3a289e6fa41db6058c Mon Sep 17 00:00:00 2001 From: Bala Lakshmi Narayanasami Date: Tue, 10 May 2022 15:34:58 +0530 Subject: [PATCH] Fixed lint errors --- src/ConfigContext.ts | 2 +- .../SupportPaneComponent.tsx | 5 +++-- src/Explorer/Explorer.tsx | 22 +------------------ 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/src/ConfigContext.ts b/src/ConfigContext.ts index a226b9794..e8394a65f 100644 --- a/src/ConfigContext.ts +++ b/src/ConfigContext.ts @@ -69,7 +69,7 @@ let configContext: Readonly = { 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, diff --git a/src/Explorer/Controls/SupportPaneComponent/SupportPaneComponent.tsx b/src/Explorer/Controls/SupportPaneComponent/SupportPaneComponent.tsx index 7f8fc542d..67d4f97f0 100644 --- a/src/Explorer/Controls/SupportPaneComponent/SupportPaneComponent.tsx +++ b/src/Explorer/Controls/SupportPaneComponent/SupportPaneComponent.tsx @@ -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 { + 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; + return ; } } diff --git a/src/Explorer/Explorer.tsx b/src/Explorer/Explorer.tsx index ad904ffe6..bc2f60db6 100644 --- a/src/Explorer/Explorer.tsx +++ b/src/Explorer/Explorer.tsx @@ -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, {