From e81a543ff8be44230f190f88466eed2301e2b53e Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Tue, 18 Aug 2020 15:45:49 -0700 Subject: [PATCH 1/3] Handle change to middleware Signed-off-by: Srinaath Ravichandran --- CHANGELOG.md | 1 + .../client/src/ui/editor/emulator/parts/chat/chat.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b431afc3b..e1110adef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [docs] Modified CONTRIBUTING.md to include updated information about global dependencies required to build from source in PR [2153](/~https://github.com/microsoft/BotFramework-Emulator/pull/2153) - [client] Fixed a bug where trying to open the sign-in link on an OAuth card would open the file explorer if ngrok was not configured in PR [2155](/~https://github.com/microsoft/BotFramework-Emulator/pull/2155) - [client] Change to a warning message in inspector when clicking on LUIS trace [2160](/~https://github.com/microsoft/BotFramework-Emulator/pull/2160) +- [client] Handle result from webchat middleware gracefully [2160](/~https://github.com/microsoft/BotFramework-Emulator/pull/2160) ## v4.9.0 - 2020 - 05 - 11 ## Added diff --git a/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx b/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx index 85857555a..c3d5b59cc 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx +++ b/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx @@ -32,7 +32,6 @@ // import { ValueTypes, RestartConversationStatus } from '@bfemulator/app-shared'; -import { User } from '@bfemulator/sdk-shared'; import { Activity, ActivityTypes } from 'botframework-schema'; import ReactWebChat, { createStyleSet } from 'botframework-webchat'; import * as React from 'react'; @@ -139,6 +138,11 @@ export class Chat extends PureComponent { } private activityWrapper(next, card, children): ReactNode { + let childrenContents = null; + const middlewareResult = next(card); + if (middlewareResult) { + childrenContents = middlewareResult(children); + } return ( { onItemRendererClick={this.onItemRendererClick} onItemRendererKeyDown={this.onItemRendererKeyDown} > - {next(card)(children)} + {childrenContents} ); } @@ -203,6 +207,7 @@ export class Chat extends PureComponent { return null; default: + debugger; return this.activityWrapper(next, card, children); } }; From 600ac8e389446da390f755ec959a557f9291e8c8 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Tue, 18 Aug 2020 15:48:42 -0700 Subject: [PATCH 2/3] Changelog updated Signed-off-by: Srinaath Ravichandran --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1110adef..909f42747 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,14 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## v4.10.0 - 2020 - 08 - 18 ## Added - [client] Added a log panel entry at the start of a conversation that displays the bot endpoint in PR [2149](/~https://github.com/microsoft/BotFramework-Emulator/pull/2149) -- [client] - Bumped `botframework-webchat` to v4.10.0 in PR [2142](/~https://github.com/microsoft/BotFramework-Emulator/pull/2142) +- [client] - Bumped `botframework-webchat` to v4.10.0 in PR [2177](/~https://github.com/microsoft/BotFramework-Emulator/pull/2177) ## Fixed - [client] Added missing content to signed in view of Cosmos DB service dialog and fixed product page link in PR [2150](/~https://github.com/microsoft/BotFramework-Emulator/pull/2150) - [docs] Modified CONTRIBUTING.md to include updated information about global dependencies required to build from source in PR [2153](/~https://github.com/microsoft/BotFramework-Emulator/pull/2153) - [client] Fixed a bug where trying to open the sign-in link on an OAuth card would open the file explorer if ngrok was not configured in PR [2155](/~https://github.com/microsoft/BotFramework-Emulator/pull/2155) - [client] Change to a warning message in inspector when clicking on LUIS trace [2160](/~https://github.com/microsoft/BotFramework-Emulator/pull/2160) -- [client] Handle result from webchat middleware gracefully [2160](/~https://github.com/microsoft/BotFramework-Emulator/pull/2160) +- [client] Handle result from webchat middleware gracefully [2177](/~https://github.com/microsoft/BotFramework-Emulator/pull/2177) ## v4.9.0 - 2020 - 05 - 11 ## Added From c849f3f6cb7492c3c53291cd223a30f210d663c5 Mon Sep 17 00:00:00 2001 From: Srinaath Ravichandran Date: Tue, 18 Aug 2020 15:54:18 -0700 Subject: [PATCH 3/3] Removed debugger :) Signed-off-by: Srinaath Ravichandran --- packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx b/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx index c3d5b59cc..172394a47 100644 --- a/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx +++ b/packages/app/client/src/ui/editor/emulator/parts/chat/chat.tsx @@ -207,7 +207,6 @@ export class Chat extends PureComponent { return null; default: - debugger; return this.activityWrapper(next, card, children); } };