diff --git a/Composer/packages/extensions/obiformeditor/src/Form/fields/BaseField.tsx b/Composer/packages/extensions/obiformeditor/src/Form/fields/BaseField.tsx index f9236f1ae2..c16c7b9e03 100644 --- a/Composer/packages/extensions/obiformeditor/src/Form/fields/BaseField.tsx +++ b/Composer/packages/extensions/obiformeditor/src/Form/fields/BaseField.tsx @@ -38,6 +38,7 @@ export function BaseField(props: BaseFieldProps): JSX.Element { let descriptionOverride; let helpLink; let helpLinkText; + let helpLinkLabel; let key = idSchema.__id; if (schema.title) { @@ -46,6 +47,7 @@ export function BaseField(props: BaseFieldProps): JSX.Element { descriptionOverride = get(SDKOverrides, 'description'); helpLink = get(SDKOverrides, 'helpLink'); helpLinkText = get(SDKOverrides, 'helpLinkText'); + helpLinkLabel = get(SDKOverrides, 'helpLinkLabel'); } // use dialogId as the key because the focusPath may not be enough @@ -81,6 +83,7 @@ export function BaseField(props: BaseFieldProps): JSX.Element { description={getDescription()} helpLink={helpLink} helpLinkText={helpLinkText} + helpLinkLabel={helpLinkLabel} id={key} /> )} diff --git a/Composer/packages/extensions/obiformeditor/src/Form/fields/RootField.tsx b/Composer/packages/extensions/obiformeditor/src/Form/fields/RootField.tsx index a6a0a4876a..13c7699798 100644 --- a/Composer/packages/extensions/obiformeditor/src/Form/fields/RootField.tsx +++ b/Composer/packages/extensions/obiformeditor/src/Form/fields/RootField.tsx @@ -19,6 +19,7 @@ const overrideDefaults = { description: undefined, helpLink: undefined, helpLinkText: undefined, + helpLinkLabel: undefined, }; interface RootFieldProps { @@ -74,11 +75,16 @@ export const RootField: React.FC = props => { {sdkOverrides.description !== false && (description || schema.description) && (

{getDescription()} - {sdkOverrides.helpLink && sdkOverrides.helpLinkText && ( + {sdkOverrides.helpLink && sdkOverrides.helpLinkText && sdkOverrides.helpLinkLabel && ( <>

- + {sdkOverrides.helpLinkText} diff --git a/Composer/packages/extensions/obiformeditor/src/Form/widgets/WidgetLabel.tsx b/Composer/packages/extensions/obiformeditor/src/Form/widgets/WidgetLabel.tsx index c95362eaf6..7e3e33d079 100644 --- a/Composer/packages/extensions/obiformeditor/src/Form/widgets/WidgetLabel.tsx +++ b/Composer/packages/extensions/obiformeditor/src/Form/widgets/WidgetLabel.tsx @@ -13,10 +13,11 @@ interface DescriptionCalloutProps { id?: string; helpLink?: string; helpLinkText?: string; + helpLinkLabel?: string; } const DescriptionCallout: React.FC = props => { - const { description, title, id, helpLink, helpLinkText } = props; + const { description, title, id, helpLink, helpLinkText, helpLinkLabel } = props; if (!description) { return null; @@ -31,11 +32,11 @@ const DescriptionCallout: React.FC = props => {

{title}

{description} - {helpLink && helpLinkText && ( + {helpLink && helpLinkText && helpLinkLabel && ( <>

- + {helpLinkText} @@ -72,10 +73,11 @@ interface WidgetLabelProps { inline?: boolean; helpLink?: string; helpLinkText?: string; + helpLinkLabel?: string; } export const WidgetLabel: React.FC = props => { - const { label, description, id, inline, helpLink, helpLinkText } = props; + const { label, description, id, inline, helpLink, helpLinkText, helpLinkLabel } = props; if (!label) { return null; @@ -100,6 +102,8 @@ export const WidgetLabel: React.FC = props => { id={id} helpLink={helpLink} helpLinkText={helpLinkText} + helpLinkLabel={helpLinkLabel} + aria-label={helpLinkLabel} /> ); diff --git a/Composer/packages/server/schemas/editor.schema b/Composer/packages/server/schemas/editor.schema index fbbf646a2d..fe638a081d 100644 --- a/Composer/packages/server/schemas/editor.schema +++ b/Composer/packages/server/schemas/editor.schema @@ -17,17 +17,20 @@ "description": "This configures a data driven dialog via a collection of events and actions.", "title": "Adaptive dialog", "helpLink": "https://aka.ms/botframework", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about Adaptive dialog" }, "Microsoft.AttachmentInput": { "title": "Prompt for Attachment", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.BeginDialog": { "title": "Begin a Dialog", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.OnCancelDialog": { "title": "Dialog cancelled", @@ -36,12 +39,14 @@ "Microsoft.CancelAllDialogs": { "title": "Cancel All Dialogs", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.ChoiceInput": { "title": "Prompt with multi-choice", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.ConditionalSelector": { "title": "ConditionalSelector" @@ -49,12 +54,14 @@ "Microsoft.ConfirmInput": { "title": "Prompt for confirmation", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.DateTimeInput": { "title": "Prompt for a date", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.DebugBreak": { "title": "Debug Break" @@ -62,12 +69,14 @@ "Microsoft.DeleteProperty": { "title": "Delete a Property", "helpLink": "https://aka.ms/bfc-using-memory", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation flow and memory" }, "Microsoft.DeleteProperties": { "title": "Delete Properties", "helpLink": "https://aka.ms/bfc-using-memory", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation flow and memory" }, "Microsoft.EditActions": { "title": "Modify active dialog" @@ -75,22 +84,26 @@ "Microsoft.EditArray": { "title": "Edit an Array Property", "helpLink": "https://aka.ms/bfc-using-memory", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation flow and memory" }, "Microsoft.EmitEvent": { "title": "Emit a custom event", "helpLink": "https://aka.ms/bfc-custom-events", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about custom events" }, "Microsoft.EndDialog": { "title": "End Dialog", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.EndTurn": { "title": "End Turn", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.FirstSelector": { "title": "FirstSelector" @@ -98,22 +111,26 @@ "Microsoft.Foreach": { "title": "Loop: For Each", "helpLink": "https://aka.ms/bfc-controlling-conversation-flow", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about controlling conversation flow" }, "Microsoft.ForeachPage": { "title": "Loop: For Each Page", "helpLink": "https://aka.ms/bfc-controlling-conversation-flow", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about controlling conversation flow" }, "Microsoft.HttpRequest": { "title": "HTTP Request", "helpLink": "https://aka.ms/bfc-using-http", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about using HTTP" }, "Microsoft.IfCondition": { "title": "Branch: If/Else", "helpLink": "https://aka.ms/bfc-controlling-conversation-flow", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about controlling conversation flow" }, "Microsoft.LanguagePolicy": { "title": "LanguagePolicy" @@ -121,13 +138,15 @@ "Microsoft.LogAction": { "title": "Log to console", "helpLink": "https://aka.ms/bfc-debugging-bots", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about debugginb bots" }, "Microsoft.LuisRecognizer": { "description": "To understand what the user says, your dialog needs a 'Recognizer', that includes example words and sentences that users may use.", "title": "Language Understanding", "helpLink": "https://aka.ms/BFC-Using-LU", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about Language Understanding" }, "Microsoft.MostSpecificSelector": { "title": "MostSpecificSelector" @@ -136,17 +155,20 @@ "description": "To understand what the user says, your dialog needs a 'Recognizer', that includes example words and sentences that users may use.", "title": "Language Understanding", "helpLink": "https://aka.ms/BFC-Using-LU", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about Language Understanding" }, "Microsoft.NumberInput": { "title": "Prompt for a number", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.OAuthInput": { "title": "OAuth Login", "helpLink": "https://aka.ms/bfc-using-oauth", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about using OAuth" }, "Microsoft.OnActivity": { "title": "Activities", @@ -161,7 +183,8 @@ "subtitle": "ConversationUpdate activity", "description": "Handle the events fired when a user begins a new conversation with the bot.", "helpLink": "https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-conversations?view=azure-bot-service-4.0#conversation-lifetime", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation update activities" }, "Microsoft.OnDialogEvent": { "title": "Dialog events", @@ -230,7 +253,8 @@ "Microsoft.QnAMakerDialog": { "title": "QnAMakerDialog", "helpLink": "https://aka.ms/bfc-using-QnA", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about QnA Maker" }, "Microsoft.RandomSelector": { "title": "RandomSelector" @@ -242,12 +266,14 @@ "Microsoft.RepeatDialog": { "title": "Repeat this Dialog", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.ReplaceDialog": { "title": "Replace this Dialog", "helpLink": "https://aka.ms/bfc-understanding-dialogs", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about dialogs" }, "Microsoft.Rule": { "title": "Rule" @@ -258,32 +284,38 @@ "Microsoft.SendActivity": { "title": "Send an Activity", "helpLink": "https://aka.ms/bfc-send-activity", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about sending messages" }, "Microsoft.SetProperty": { "title": "Set a Property", "helpLink": "https://aka.ms/bfc-using-memory", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation flow and memory" }, "Microsoft.SetProperties": { "title": "Set Properties", "helpLink": "https://aka.ms/bfc-using-memory", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about conversation flow and memory" }, "Microsoft.SwitchCondition": { "title": "Branch: Switch", "helpLink": "https://aka.ms/bfc-controlling-conversation-flow", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about controlling conversation flow" }, "Microsoft.TextInput": { "title": "Prompt for text", "helpLink": "https://aka.ms/bfc-ask-for-user-input", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about prompts" }, "Microsoft.TraceActivity": { "title": "Emit a trace event", "helpLink": "https://aka.ms/bfc-debugging-bots", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about debugging bots" }, "Microsoft.TrueSelector": { "title": "TrueSelector" @@ -292,7 +324,8 @@ "description": "To understand what the user says, your dialog needs a 'Recognizer', that includes example words and sentences that users may use.", "title": "Language Understanding", "helpLink": "https://aka.ms/BFC-Using-LU", - "helpLinkText": "Learn more" + "helpLinkText": "Learn more", + "helpLinkLabel": "Learn more about Language Understanding" } } }