From 7622e1872d1904e7697d258ffbe4363dfbe9c000 Mon Sep 17 00:00:00 2001 From: Long Alan Date: Thu, 12 Mar 2020 17:51:42 +0800 Subject: [PATCH 1/2] message received bugfix --- Composer/packages/client/src/utils/dialogUtil.ts | 2 +- Composer/packages/lib/shared/src/appschema.ts | 2 +- Composer/packages/lib/shared/src/labelMap.ts | 4 ++-- Composer/packages/lib/shared/src/types/schema.ts | 4 ++-- Composer/packages/lib/shared/src/viewUtils.ts | 2 +- Composer/packages/server/schemas/editor.schema | 2 +- Composer/packages/server/schemas/sdk.schema | 12 ++++++------ 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Composer/packages/client/src/utils/dialogUtil.ts b/Composer/packages/client/src/utils/dialogUtil.ts index de8fb2216d..e15e51d81b 100644 --- a/Composer/packages/client/src/utils/dialogUtil.ts +++ b/Composer/packages/client/src/utils/dialogUtil.ts @@ -43,7 +43,7 @@ export function getDialog(dialogs: DialogInfo[], dialogId: string) { export const eventTypeKey: string = SDKTypes.OnDialogEvent; export const intentTypeKey: string = SDKTypes.OnIntent; export const activityTypeKey: string = SDKTypes.OnActivity; -export const messageTypeKey: string = SDKTypes.OnMessageActivity; +export const messageTypeKey: string = SDKTypes.OnMessageEventActivity; export const regexRecognizerKey: string = SDKTypes.RegexRecognizer; export function getFriendlyName(data) { diff --git a/Composer/packages/lib/shared/src/appschema.ts b/Composer/packages/lib/shared/src/appschema.ts index 3d9ff52432..38318a0728 100644 --- a/Composer/packages/lib/shared/src/appschema.ts +++ b/Composer/packages/lib/shared/src/appschema.ts @@ -2324,7 +2324,7 @@ export const appschema: OBISchema = { }, }, }, - 'Microsoft.OnMessageReceivedActivity': { + 'Microsoft.OnMessageActivity': { $role: 'unionType(Microsoft.ITriggerCondition)', title: 'On MessageRecieved activity', description: diff --git a/Composer/packages/lib/shared/src/labelMap.ts b/Composer/packages/lib/shared/src/labelMap.ts index f1a03fd2b0..593777bdbf 100644 --- a/Composer/packages/lib/shared/src/labelMap.ts +++ b/Composer/packages/lib/shared/src/labelMap.ts @@ -171,9 +171,9 @@ export const ConceptLabels: { [key in ConceptLabelKey]?: LabelOverride } = { title: formatMessage('Conversation invoked'), subtitle: formatMessage('Invoke activity'), }, - [SDKTypes.OnMessageActivity]: { + [SDKTypes.OnMessageEventActivity]: { title: formatMessage('Message events'), - subtitle: formatMessage('Message recieved activity'), + subtitle: formatMessage('Message activity'), }, [SDKTypes.OnMessageReceivedActivity]: { title: formatMessage('Message received'), diff --git a/Composer/packages/lib/shared/src/types/schema.ts b/Composer/packages/lib/shared/src/types/schema.ts index fa1330a206..faef0548f4 100644 --- a/Composer/packages/lib/shared/src/types/schema.ts +++ b/Composer/packages/lib/shared/src/types/schema.ts @@ -73,8 +73,8 @@ export enum SDKTypes { OnHandoffActivity = 'Microsoft.OnHandoffActivity', OnIntent = 'Microsoft.OnIntent', OnInvokeActivity = 'Microsoft.OnInvokeActivity', - OnMessageActivity = 'Microsoft.OnMessageActivity', - OnMessageReceivedActivity = 'Microsoft.OnMessageReceivedActivity', + OnMessageEventActivity = 'Microsoft.OnMessageEventActivity', + OnMessageReceivedActivity = 'Microsoft.OnMessageActivity', OnMessageDeleteActivity = 'Microsoft.OnMessageDeleteActivity', OnMessageReactionActivity = 'Microsoft.OnMessageReactionActivity', OnMessageUpdateActivity = 'Microsoft.OnMessageUpdateActivity', diff --git a/Composer/packages/lib/shared/src/viewUtils.ts b/Composer/packages/lib/shared/src/viewUtils.ts index 31c92478b4..8b7a4976d8 100644 --- a/Composer/packages/lib/shared/src/viewUtils.ts +++ b/Composer/packages/lib/shared/src/viewUtils.ts @@ -106,7 +106,7 @@ export const dialogGroups: DialogGroupsMap = { SDKTypes.OnUnknownIntent, SDKTypes.OnDialogEvent, SDKTypes.OnActivity, - SDKTypes.OnMessageActivity, + SDKTypes.OnMessageEventActivity, SDKTypes.OnCustomEvent, ], }, diff --git a/Composer/packages/server/schemas/editor.schema b/Composer/packages/server/schemas/editor.schema index 672349bee7..fbbf646a2d 100644 --- a/Composer/packages/server/schemas/editor.schema +++ b/Composer/packages/server/schemas/editor.schema @@ -199,7 +199,7 @@ "title": "Conversation invoked", "subtitle": "Invoke activity" }, - "Microsoft.OnMessageReceivedActivity": { + "Microsoft.OnMessageActivity": { "title": "Message recieved", "subtitle": "Message recieved activity" }, diff --git a/Composer/packages/server/schemas/sdk.schema b/Composer/packages/server/schemas/sdk.schema index be2633ce59..6c02b6104c 100644 --- a/Composer/packages/server/schemas/sdk.schema +++ b/Composer/packages/server/schemas/sdk.schema @@ -351,9 +351,9 @@ "$ref": "#/definitions/Microsoft.OnInvokeActivity" }, { - "title": "Microsoft.OnMessageReceivedActivity", + "title": "Microsoft.OnMessageActivity", "description": "Actions to perform on receipt of an activity with type 'MessageReceived'. Overrides Intent trigger.", - "$ref": "#/definitions/Microsoft.OnMessageReceivedActivity" + "$ref": "#/definitions/Microsoft.OnMessageActivity" }, { "title": "Microsoft.OnMessageDeleteActivity", @@ -4891,9 +4891,9 @@ "$ref": "#/definitions/Microsoft.OnInvokeActivity" }, { - "title": "Microsoft.OnMessageReceivedActivity", + "title": "Microsoft.OnMessageActivity", "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", - "$ref": "#/definitions/Microsoft.OnMessageReceivedActivity" + "$ref": "#/definitions/Microsoft.OnMessageActivity" }, { "title": "Microsoft.OnMessageDeleteActivity", @@ -8184,7 +8184,7 @@ } ] }, - "Microsoft.OnMessageReceivedActivity": { + "Microsoft.OnMessageActivity": { "$role": "union(Microsoft.ITriggerCondition)", "title": "On Message activity", "description": "Actions to perform on receipt of an activity with type 'Message'. Overrides Intent trigger.", @@ -8195,7 +8195,7 @@ "description": "Defines the valid properties for the component you are configuring (from a dialog .schema file)", "type": "string", "pattern": "^[a-zA-Z][a-zA-Z0-9.]*$", - "const": "Microsoft.OnMessageReceivedActivity" + "const": "Microsoft.OnMessageActivity" }, "$copy": { "title": "$copy", From 06081e8e249d02c14c9ade5041551f3a3ed99e12 Mon Sep 17 00:00:00 2001 From: Long Alan Date: Fri, 13 Mar 2020 13:26:08 +0800 Subject: [PATCH 2/2] ut error fix --- .../packages/extensions/obiformeditor/src/schema/uischema.ts | 2 +- Composer/packages/lib/shared/src/appschema.ts | 2 +- Composer/packages/lib/shared/src/labelMap.ts | 2 +- Composer/packages/lib/shared/src/types/schema.ts | 2 +- Composer/packages/lib/shared/src/viewUtils.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Composer/packages/extensions/obiformeditor/src/schema/uischema.ts b/Composer/packages/extensions/obiformeditor/src/schema/uischema.ts index 54b5796491..01fdd5ed71 100644 --- a/Composer/packages/extensions/obiformeditor/src/schema/uischema.ts +++ b/Composer/packages/extensions/obiformeditor/src/schema/uischema.ts @@ -159,7 +159,7 @@ export const uiSchema: { [key in SDKTypes]?: UiSchema } = { [SDKTypes.OnInvokeActivity]: { ...triggerUiSchema, }, - [SDKTypes.OnMessageReceivedActivity]: { + [SDKTypes.OnMessageActivity]: { ...triggerUiSchema, }, [SDKTypes.OnMessageDeleteActivity]: { diff --git a/Composer/packages/lib/shared/src/appschema.ts b/Composer/packages/lib/shared/src/appschema.ts index ffda619b11..6a7bc5eda0 100644 --- a/Composer/packages/lib/shared/src/appschema.ts +++ b/Composer/packages/lib/shared/src/appschema.ts @@ -2331,7 +2331,7 @@ export const appschema: OBISchema = { "Actions to perform on receipt of an activity with type 'MessageRecieved'. Overrides Intent trigger.", type: 'object', properties: { - ...$properties(SDKTypes.OnMessageReceivedActivity), + ...$properties(SDKTypes.OnMessageActivity), condition: { $role: 'expression', title: 'Condition', diff --git a/Composer/packages/lib/shared/src/labelMap.ts b/Composer/packages/lib/shared/src/labelMap.ts index 593777bdbf..1b0e22827c 100644 --- a/Composer/packages/lib/shared/src/labelMap.ts +++ b/Composer/packages/lib/shared/src/labelMap.ts @@ -175,7 +175,7 @@ export const ConceptLabels: { [key in ConceptLabelKey]?: LabelOverride } = { title: formatMessage('Message events'), subtitle: formatMessage('Message activity'), }, - [SDKTypes.OnMessageReceivedActivity]: { + [SDKTypes.OnMessageActivity]: { title: formatMessage('Message received'), subtitle: formatMessage('Message recieved activity'), }, diff --git a/Composer/packages/lib/shared/src/types/schema.ts b/Composer/packages/lib/shared/src/types/schema.ts index faef0548f4..6d4264d5a5 100644 --- a/Composer/packages/lib/shared/src/types/schema.ts +++ b/Composer/packages/lib/shared/src/types/schema.ts @@ -74,7 +74,7 @@ export enum SDKTypes { OnIntent = 'Microsoft.OnIntent', OnInvokeActivity = 'Microsoft.OnInvokeActivity', OnMessageEventActivity = 'Microsoft.OnMessageEventActivity', - OnMessageReceivedActivity = 'Microsoft.OnMessageActivity', + OnMessageActivity = 'Microsoft.OnMessageActivity', OnMessageDeleteActivity = 'Microsoft.OnMessageDeleteActivity', OnMessageReactionActivity = 'Microsoft.OnMessageReactionActivity', OnMessageUpdateActivity = 'Microsoft.OnMessageUpdateActivity', diff --git a/Composer/packages/lib/shared/src/viewUtils.ts b/Composer/packages/lib/shared/src/viewUtils.ts index 8b7a4976d8..21d2cc9abe 100644 --- a/Composer/packages/lib/shared/src/viewUtils.ts +++ b/Composer/packages/lib/shared/src/viewUtils.ts @@ -129,7 +129,7 @@ export const dialogGroups: DialogGroupsMap = { [DialogGroup.MESSAGE_EVENTS]: { label: 'Message events', types: [ - SDKTypes.OnMessageReceivedActivity, + SDKTypes.OnMessageActivity, SDKTypes.OnMessageDeleteActivity, SDKTypes.OnMessageReactionActivity, SDKTypes.OnMessageUpdateActivity,