From 49281ce69a3c71595cb6eef63ed516cf2b46684f Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Fri, 9 Jul 2021 16:47:28 -0700 Subject: [PATCH 1/4] fix typo --- .../Teams/js/src/conditions/onTeamsMEBotMessagePreviewSend.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/Teams/js/src/conditions/onTeamsMEBotMessagePreviewSend.ts b/packages/Teams/js/src/conditions/onTeamsMEBotMessagePreviewSend.ts index bc21decd69..1675f3aadd 100644 --- a/packages/Teams/js/src/conditions/onTeamsMEBotMessagePreviewSend.ts +++ b/packages/Teams/js/src/conditions/onTeamsMEBotMessagePreviewSend.ts @@ -11,7 +11,7 @@ import { OnInvokeActivity } from 'botbuilder-dialogs-adaptive'; * and activity.value.botMessagePreviewAction == 'send'. */ export class OnTeamsMEBotMessagePreviewSend extends OnInvokeActivity { - static $kind = 'Teams.OnMEBotMessagePreviewEdit'; + static $kind = 'Teams.OnMEBotMessagePreviewSend'; public commandId?: string; From 05bb768d0d228ff462e80339fa7982ef9fa5b832 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Fri, 9 Jul 2021 16:48:58 -0700 Subject: [PATCH 2/4] delete duplicate, unused .csproj --- ...icrosoft.Bot.Components.Teams.Tests.csproj | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj diff --git a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj b/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj deleted file mode 100644 index f19031a408..0000000000 --- a/tests/unit/packages/Microsoft.Bot.Components.Teams.Tests/Microsoft.Bot.Components.Teams.Tests.csproj +++ /dev/null @@ -1,35 +0,0 @@ - - - - netcoreapp2.1 - netcoreapp3.1 - netcoreapp2.1;netcoreapp3.1 - false - Debug;Release - latest - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - - - Always - - - - From 6e336a82cef4259dcb17b3d1812d5be7422ff862 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Fri, 9 Jul 2021 16:54:49 -0700 Subject: [PATCH 3/4] add tests --- ...nalsTests_OnTeamsActivityTypes.test.dialog | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog b/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog index ef348c61ac..a4b7225a61 100644 --- a/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog +++ b/tests/unit/packages/Teams/Shared Tests/ConditionalTests/ConditionalsTests_OnTeamsActivityTypes.test.dialog @@ -93,6 +93,26 @@ } ] }, + { + "$kind": "Teams.OnMEBotMessagePreviewEdit", + "condition": "turn.activity.text == 'OnMEBotMessagePreviewEdit'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnMEBotMessagePreviewEdit" + } + ] + }, + { + "$kind": "Teams.OnMEBotMessagePreviewSend", + "condition": "turn.activity.text == 'OnMEBotMessagePreviewSend'", + "actions": [ + { + "$kind": "Microsoft.SendActivity", + "activity": "OnMEBotMessagePreviewSend" + } + ] + }, { "$kind": "Teams.OnMECardButtonClicked", "condition": "turn.activity.text == 'OnCardButtonClicked'", @@ -372,6 +392,36 @@ "$kind": "Microsoft.Test.AssertReply", "text": "OnFileConsent" }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnMEBotMessagePreviewEdit", + "value": { + "botMessagePreviewAction": "edit" + }, + "name": "composeExtension/submitAction" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnMEBotMessagePreviewEdit" + }, + { + "$kind": "Microsoft.Test.UserActivity", + "activity": { + "type": "invoke", + "text": "OnMEBotMessagePreviewSend", + "value": { + "botMessagePreviewAction": "send" + }, + "name": "composeExtension/submitAction" + } + }, + { + "$kind": "Microsoft.Test.AssertReply", + "text": "OnMEBotMessagePreviewSend" + }, { "$kind": "Microsoft.Test.UserActivity", "activity": { From dc3ef21cb912df59981486a2e04b42b88c80a894 Mon Sep 17 00:00:00 2001 From: Michael Richardson Date: Mon, 12 Jul 2021 08:24:27 -0700 Subject: [PATCH 4/4] remove unused/dupe onTeamsMEConfigurationSetting --- .../Teams/js/src/adaptiveTeamsBotComponent.ts | 5 ---- .../onTeamsMEConfigurationSetting.ts | 28 ------------------- 2 files changed, 33 deletions(-) delete mode 100644 packages/Teams/js/src/conditions/onTeamsMEConfigurationSetting.ts diff --git a/packages/Teams/js/src/adaptiveTeamsBotComponent.ts b/packages/Teams/js/src/adaptiveTeamsBotComponent.ts index 37f6e4b9b9..85f800e0ab 100644 --- a/packages/Teams/js/src/adaptiveTeamsBotComponent.ts +++ b/packages/Teams/js/src/adaptiveTeamsBotComponent.ts @@ -48,7 +48,6 @@ import { OnTeamsMECardButtonClicked, OnTeamsMEConfigQuerySettingUrl, OnTeamsMEConfigSetting, - OnTeamsMEConfigurationSetting, OnTeamsMEFetchTask, OnTeamsMEQuery, OnTeamsMESelectItem, @@ -185,10 +184,6 @@ export class AdaptiveTeamsBotComponent extends BotComponent { { kind: OnTeamsMEFetchTask.$kind, type: OnTeamsMEFetchTask }, { kind: OnTeamsMEQuery.$kind, type: OnTeamsMEQuery }, { kind: OnTeamsMESelectItem.$kind, type: OnTeamsMESelectItem }, - { - kind: OnTeamsMEConfigurationSetting.$kind, - type: OnTeamsMEConfigurationSetting, - }, { kind: OnTeamsMESubmitAction.$kind, type: OnTeamsMESubmitAction, diff --git a/packages/Teams/js/src/conditions/onTeamsMEConfigurationSetting.ts b/packages/Teams/js/src/conditions/onTeamsMEConfigurationSetting.ts deleted file mode 100644 index 5987339a07..0000000000 --- a/packages/Teams/js/src/conditions/onTeamsMEConfigurationSetting.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { Expression } from 'adaptive-expressions'; -import { Channels } from 'botbuilder'; -import { TurnPath } from 'botbuilder-dialogs'; -import { OnInvokeActivity } from 'botbuilder-dialogs-adaptive'; - -/** - * Actions triggered when a Teams InvokeActivity is received with activity.name='composeExtension/setting'. - */ -export class OnTeamsMEConfigurationSetting extends OnInvokeActivity { - static $kind = 'Teams.OnMEConfigurationSetting'; - - /** - * Create expression for this condition. - * - * @returns {Expression} An [Expression](xref:adaptive-expressions.Expression) used to evaluate this rule. - */ - protected createExpression(): Expression { - return Expression.andExpression( - Expression.parse( - `${TurnPath.activity}.channelId == '${Channels.Msteams}' && ${TurnPath.activity}.name == 'composeExtension/setting'` - ), - super.createExpression() - ); - } -}