From e100866c33e9116b20c4c3f958c6d2276fe89222 Mon Sep 17 00:00:00 2001 From: TJ Date: Wed, 14 Apr 2021 10:55:10 -0600 Subject: [PATCH 1/3] fix: Show speech modality when the activity includes input hint --- .../lib/code-editor/src/lg/ModalityPivot.tsx | 10 +++ .../packages/server/src/locales/en-US.json | 66 ++++++++++--------- 2 files changed, 46 insertions(+), 30 deletions(-) diff --git a/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx b/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx index 29d93ec762..6e30e46f7f 100644 --- a/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx +++ b/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx @@ -168,6 +168,11 @@ const getInitialModalities = (structuredResponse?: PartialStructuredResponse): M const modalities = Object.keys(structuredResponse || {}).filter((m) => modalityTypes.includes(m as ModalityType) ) as ModalityType[]; + + if (structuredResponse?.InputHint && !structuredResponse.Speak) { + modalities.push('Speak'); + } + return modalities.length ? modalities : ['Text']; }; @@ -284,6 +289,11 @@ export const ModalityPivot = React.memo((props: Props) => { const mergedResponse = mergeWith({}, structuredResponse) as PartialStructuredResponse; delete mergedResponse[modality]; + // Remove Input Hint when the user deletes the Speech modality + if (modality === 'Speak') { + delete mergedResponse.InputHint; + } + setStructuredResponse(mergedResponse); const mappedResponse = structuredResponseToString(mergedResponse); onTemplateChange(lgOption.templateId, mappedResponse); diff --git a/Composer/packages/server/src/locales/en-US.json b/Composer/packages/server/src/locales/en-US.json index d2a2819d71..02bc104a8b 100644 --- a/Composer/packages/server/src/locales/en-US.json +++ b/Composer/packages/server/src/locales/en-US.json @@ -815,14 +815,8 @@ "copy_9748f9f": { "message": "Copy" }, - "copy_and_share_this_information_with_your_azure_ad_2cb02ba1": { - "message": "Copy and share this information with your Azure admin. After your QNA key is provisioned, you will be ready to test your bot with qna." - }, - "copy_and_share_this_information_with_your_azure_ad_2ec77eeb": { - "message": "Copy and share this information with your Azure admin. After your Luis key is provisioned, you will be ready to test your bot." - }, - "copy_and_share_this_information_with_your_azure_ad_a41b99ea": { - "message": "Copy and share this information with your Azure admin. After your Speech key is provisioned, you will be ready to test your bot with speech." + "copy_and_share_this_information_with_your_azure_ad_68be5396": { + "message": "Copy and share this information with your Azure admin to provision resources on your behalf." }, "copy_content_for_translation_7affbcbb": { "message": "Copy content for translation" @@ -953,8 +947,8 @@ "create_new_luis_resources_a1a8fad5": { "message": "Create new LUIS resources" }, - "create_new_qna_resources_ea2f7b37": { - "message": "Create new QNA resources" + "create_new_qna_resources_f21ea0cf": { + "message": "Create new QnA resources" }, "create_new_speech_resources_73a921be": { "message": "Create new Speech resources" @@ -1724,9 +1718,6 @@ "generate_44e33e72": { "message": "Generate" }, - "generate_a_resource_request_9d5bcacd": { - "message": "Generate a resource request" - }, "generate_dialog_b80a85b2": { "message": "Generate dialog" }, @@ -1793,6 +1784,9 @@ "handoff_activity_14363a20": { "message": "Handoff activity" }, + "handoff_to_admin_c104b028": { + "message": "Handoff to admin" + }, "handover_to_human_1a619574": { "message": "Handover to human" }, @@ -1814,9 +1808,21 @@ "home_351838cd": { "message": "Home" }, + "how_would_you_like_to_provision_this_resource_174f805d": { + "message": "How would you like to provision this resource?" + }, "http_request_79847109": { "message": "HTTP Request" }, + "i_am_working_on_a_microsoft_bot_framework_project__12049dd4": { + "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a Language Understanding resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffluis" + }, + "i_am_working_on_a_microsoft_bot_framework_project__1295ee05": { + "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a Speech resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffdls" + }, + "i_am_working_on_a_microsoft_bot_framework_project__9b5f3f78": { + "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a QnAMaker resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffqnamaker" + }, "i_want_to_keep_the_template_content_in_the_file_ju_769331d9": { "message": "I want to keep the template content in the file, just want to dereference from this response (hint: keep the content if you currently, or plan to re-use in another location)" }, @@ -1898,8 +1904,8 @@ "input_your_details_below_to_create_a_new_luis_reso_75ca7d17": { "message": "Input your details below to create a new LUIS resource. You will be able to manage your new resource in the Azure portal. Learn more" }, - "input_your_details_below_to_create_a_new_qna_resou_82b28d39": { - "message": "Input your details below to create a new QNA resource. You will be able to manage your new resource in the Azure portal. Learn more" + "input_your_details_below_to_create_a_new_qna_resou_b32404f2": { + "message": "Input your details below to create a new QnA resource. You will be able to manage your new resource in the Azure portal. Learn more" }, "input_your_details_below_to_create_a_new_speech_re_51b79b16": { "message": "Input your details below to create a new Speech resource. You will be able to manage your new resource in the Azure portal. Learn more" @@ -1946,8 +1952,8 @@ "install_the_update_and_restart_composer_fac30a61": { "message": "Install the update and restart Composer." }, - "instructions_for_your_azure_admin_7da1c5aa": { - "message": "Instructions for your Azure admin:" + "instructions_for_your_azure_admin_aa780628": { + "message": "Instructions for your Azure admin" }, "integer_7f378275": { "message": "integer" @@ -2069,6 +2075,9 @@ "learn_more_14816ec": { "message": "Learn More." }, + "learn_more_7a8d626": { + "message": "Learn More" + }, "learn_more_a79a7918": { "message": "Learn more" }, @@ -2492,8 +2501,8 @@ "no_existing_luis_resource_found_in_this_subscripti_22642816": { "message": "No existing LUIS resource found in this subscription. Click “Next” to create new." }, - "no_existing_qna_resource_found_in_this_subscriptio_a547349b": { - "message": "No existing QNA resource found in this subscription. Click “Next” to create new." + "no_existing_qna_resource_found_in_this_subscriptio_c70e340": { + "message": "No existing QnA resource found in this subscription. Click “Next” to create new." }, "no_existing_speech_resource_found_in_this_subscrip_4bc27bc3": { "message": "No existing Speech resource found in this subscription. Click “Next” to create a new one." @@ -3188,6 +3197,9 @@ "schema_24739a48": { "message": "Schema" }, + "schema_definition_not_found_in_sdk_schema_1102ce9b": { + "message": "Schema definition not found in sdk.schema." + }, "schemaid_doesn_t_exists_select_an_schema_to_edit_o_9cccc954": { "message": "{ schemaId } doesn''t exists, select an schema to edit or create a new one" }, @@ -3278,8 +3290,8 @@ "select_property_type_45c6e68e": { "message": "Select property type" }, - "select_qna_keys_29abf5cb": { - "message": "Select QNA keys" + "select_qna_keys_e616cc57": { + "message": "Select QnA keys" }, "select_runtime_version_to_add_d63d383b": { "message": "Select runtime version to add" @@ -3302,12 +3314,6 @@ "select_your_azure_subscription_and_choose_from_exi_1e05256f": { "message": "Select your Azure subscription and choose from existing Speech keys, or create a new Speech resource. Learn more" }, - "select_your_azure_subscription_and_choose_from_exi_73b6e4d6": { - "message": "Select your Azure subscription and choose from existing QNA keys, or create a new QNA resource. Learn more" - }, - "select_your_azure_subscription_and_choose_from_exi_ff2b2416": { - "message": "Select your Azure subscription and choose from existing LUIS keys, or create a new LUIS resource. Learn more" - }, "selection_field_86d1dc94": { "message": "selection field" }, @@ -3638,6 +3644,9 @@ "the_following_qna_key_has_been_successfully_added__7c97bbc0": { "message": "The following QnA key has been successfully added to your bot project:" }, + "the_following_qna_resource_was_successfully_create_84173ca4": { + "message": "The following QnA resource was successfully created and added to your bot project:" + }, "the_following_speech_key_has_been_successfully_add_4bf0b587": { "message": "The following Speech key has been successfully added to your bot project:" }, @@ -3989,9 +3998,6 @@ "user_is_typing_typing_activity_cd938615": { "message": "User is typing (Typing activity)" }, - "using_the_azure_portal_create_a_language_understan_15e2f51f": { - "message": "Using the Azure portal, create a Language Understanding resource. Create these in a subscription that the developer has accesss to. This will result in an authoring key and an endpoint key. Provide these keys to the developer in a secure manner." - }, "validating_35b79a96": { "message": "Validating..." }, From 8c3c7a2a2c3e11e98db270d9be85a25ab3ed4ce4 Mon Sep 17 00:00:00 2001 From: TJ Date: Wed, 14 Apr 2021 11:03:08 -0600 Subject: [PATCH 2/3] lint --- Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx b/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx index 6e30e46f7f..5b9a8b95b4 100644 --- a/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx +++ b/Composer/packages/lib/code-editor/src/lg/ModalityPivot.tsx @@ -169,7 +169,7 @@ const getInitialModalities = (structuredResponse?: PartialStructuredResponse): M modalityTypes.includes(m as ModalityType) ) as ModalityType[]; - if (structuredResponse?.InputHint && !structuredResponse.Speak) { + if (structuredResponse?.InputHint && !structuredResponse.Speak) { modalities.push('Speak'); } From 5921aec14a0a87182dea3ce28b22634a49412788 Mon Sep 17 00:00:00 2001 From: TJ Date: Wed, 14 Apr 2021 11:03:50 -0600 Subject: [PATCH 3/3] revert en-us changes --- .../packages/server/src/locales/en-US.json | 66 +++++++++---------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/Composer/packages/server/src/locales/en-US.json b/Composer/packages/server/src/locales/en-US.json index 02bc104a8b..d2a2819d71 100644 --- a/Composer/packages/server/src/locales/en-US.json +++ b/Composer/packages/server/src/locales/en-US.json @@ -815,8 +815,14 @@ "copy_9748f9f": { "message": "Copy" }, - "copy_and_share_this_information_with_your_azure_ad_68be5396": { - "message": "Copy and share this information with your Azure admin to provision resources on your behalf." + "copy_and_share_this_information_with_your_azure_ad_2cb02ba1": { + "message": "Copy and share this information with your Azure admin. After your QNA key is provisioned, you will be ready to test your bot with qna." + }, + "copy_and_share_this_information_with_your_azure_ad_2ec77eeb": { + "message": "Copy and share this information with your Azure admin. After your Luis key is provisioned, you will be ready to test your bot." + }, + "copy_and_share_this_information_with_your_azure_ad_a41b99ea": { + "message": "Copy and share this information with your Azure admin. After your Speech key is provisioned, you will be ready to test your bot with speech." }, "copy_content_for_translation_7affbcbb": { "message": "Copy content for translation" @@ -947,8 +953,8 @@ "create_new_luis_resources_a1a8fad5": { "message": "Create new LUIS resources" }, - "create_new_qna_resources_f21ea0cf": { - "message": "Create new QnA resources" + "create_new_qna_resources_ea2f7b37": { + "message": "Create new QNA resources" }, "create_new_speech_resources_73a921be": { "message": "Create new Speech resources" @@ -1718,6 +1724,9 @@ "generate_44e33e72": { "message": "Generate" }, + "generate_a_resource_request_9d5bcacd": { + "message": "Generate a resource request" + }, "generate_dialog_b80a85b2": { "message": "Generate dialog" }, @@ -1784,9 +1793,6 @@ "handoff_activity_14363a20": { "message": "Handoff activity" }, - "handoff_to_admin_c104b028": { - "message": "Handoff to admin" - }, "handover_to_human_1a619574": { "message": "Handover to human" }, @@ -1808,21 +1814,9 @@ "home_351838cd": { "message": "Home" }, - "how_would_you_like_to_provision_this_resource_174f805d": { - "message": "How would you like to provision this resource?" - }, "http_request_79847109": { "message": "HTTP Request" }, - "i_am_working_on_a_microsoft_bot_framework_project__12049dd4": { - "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a Language Understanding resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffluis" - }, - "i_am_working_on_a_microsoft_bot_framework_project__1295ee05": { - "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a Speech resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffdls" - }, - "i_am_working_on_a_microsoft_bot_framework_project__9b5f3f78": { - "message": "I am working on a Microsoft Bot Framework project, and I now require some Azure resources to be created. Please follow the instructions below to create these resources and provide them to me.\n\n1. Using the Azure portal, please create a QnAMaker resource on my behalf.\n2. Once provisioned, securely share the resulting credentials with me as described in the link below.\n\nDetailed instructions:\nhttps://aka.ms/bfcomposerhandoffqnamaker" - }, "i_want_to_keep_the_template_content_in_the_file_ju_769331d9": { "message": "I want to keep the template content in the file, just want to dereference from this response (hint: keep the content if you currently, or plan to re-use in another location)" }, @@ -1904,8 +1898,8 @@ "input_your_details_below_to_create_a_new_luis_reso_75ca7d17": { "message": "Input your details below to create a new LUIS resource. You will be able to manage your new resource in the Azure portal. Learn more" }, - "input_your_details_below_to_create_a_new_qna_resou_b32404f2": { - "message": "Input your details below to create a new QnA resource. You will be able to manage your new resource in the Azure portal. Learn more" + "input_your_details_below_to_create_a_new_qna_resou_82b28d39": { + "message": "Input your details below to create a new QNA resource. You will be able to manage your new resource in the Azure portal. Learn more" }, "input_your_details_below_to_create_a_new_speech_re_51b79b16": { "message": "Input your details below to create a new Speech resource. You will be able to manage your new resource in the Azure portal. Learn more" @@ -1952,8 +1946,8 @@ "install_the_update_and_restart_composer_fac30a61": { "message": "Install the update and restart Composer." }, - "instructions_for_your_azure_admin_aa780628": { - "message": "Instructions for your Azure admin" + "instructions_for_your_azure_admin_7da1c5aa": { + "message": "Instructions for your Azure admin:" }, "integer_7f378275": { "message": "integer" @@ -2075,9 +2069,6 @@ "learn_more_14816ec": { "message": "Learn More." }, - "learn_more_7a8d626": { - "message": "Learn More" - }, "learn_more_a79a7918": { "message": "Learn more" }, @@ -2501,8 +2492,8 @@ "no_existing_luis_resource_found_in_this_subscripti_22642816": { "message": "No existing LUIS resource found in this subscription. Click “Next” to create new." }, - "no_existing_qna_resource_found_in_this_subscriptio_c70e340": { - "message": "No existing QnA resource found in this subscription. Click “Next” to create new." + "no_existing_qna_resource_found_in_this_subscriptio_a547349b": { + "message": "No existing QNA resource found in this subscription. Click “Next” to create new." }, "no_existing_speech_resource_found_in_this_subscrip_4bc27bc3": { "message": "No existing Speech resource found in this subscription. Click “Next” to create a new one." @@ -3197,9 +3188,6 @@ "schema_24739a48": { "message": "Schema" }, - "schema_definition_not_found_in_sdk_schema_1102ce9b": { - "message": "Schema definition not found in sdk.schema." - }, "schemaid_doesn_t_exists_select_an_schema_to_edit_o_9cccc954": { "message": "{ schemaId } doesn''t exists, select an schema to edit or create a new one" }, @@ -3290,8 +3278,8 @@ "select_property_type_45c6e68e": { "message": "Select property type" }, - "select_qna_keys_e616cc57": { - "message": "Select QnA keys" + "select_qna_keys_29abf5cb": { + "message": "Select QNA keys" }, "select_runtime_version_to_add_d63d383b": { "message": "Select runtime version to add" @@ -3314,6 +3302,12 @@ "select_your_azure_subscription_and_choose_from_exi_1e05256f": { "message": "Select your Azure subscription and choose from existing Speech keys, or create a new Speech resource. Learn more" }, + "select_your_azure_subscription_and_choose_from_exi_73b6e4d6": { + "message": "Select your Azure subscription and choose from existing QNA keys, or create a new QNA resource. Learn more" + }, + "select_your_azure_subscription_and_choose_from_exi_ff2b2416": { + "message": "Select your Azure subscription and choose from existing LUIS keys, or create a new LUIS resource. Learn more" + }, "selection_field_86d1dc94": { "message": "selection field" }, @@ -3644,9 +3638,6 @@ "the_following_qna_key_has_been_successfully_added__7c97bbc0": { "message": "The following QnA key has been successfully added to your bot project:" }, - "the_following_qna_resource_was_successfully_create_84173ca4": { - "message": "The following QnA resource was successfully created and added to your bot project:" - }, "the_following_speech_key_has_been_successfully_add_4bf0b587": { "message": "The following Speech key has been successfully added to your bot project:" }, @@ -3998,6 +3989,9 @@ "user_is_typing_typing_activity_cd938615": { "message": "User is typing (Typing activity)" }, + "using_the_azure_portal_create_a_language_understan_15e2f51f": { + "message": "Using the Azure portal, create a Language Understanding resource. Create these in a subscription that the developer has accesss to. This will result in an authoring key and an endpoint key. Provide these keys to the developer in a secure manner." + }, "validating_35b79a96": { "message": "Validating..." },