From b4bf9d78935ec96a79c360cd858d4ad411a76d44 Mon Sep 17 00:00:00 2001 From: Chris McConnell Date: Wed, 30 Jun 2021 18:23:27 -0700 Subject: [PATCH] Move _text to be siblings of activity. Minor clean-up in text. --- .../en-us/form-DisplayOperation.en-us.lg.lg | 9 ++--- .../standard/en-us/form-extensions.en-us.lg | 38 +------------------ .../standard/en-us/form-prompts.en-us.lg | 34 ++++++++++++++++- 3 files changed, 38 insertions(+), 43 deletions(-) diff --git a/experimental/generation/generator/packages/library/templates/standard/en-us/form-DisplayOperation.en-us.lg.lg b/experimental/generation/generator/packages/library/templates/standard/en-us/form-DisplayOperation.en-us.lg.lg index 9358d7710..16d380045 100644 --- a/experimental/generation/generator/packages/library/templates/standard/en-us/form-DisplayOperation.en-us.lg.lg +++ b/experimental/generation/generator/packages/library/templates/standard/en-us/form-DisplayOperation.en-us.lg.lg @@ -19,18 +19,18 @@ # displayAssignOperation(op, property, value) > Display value for an Assign() operation - IF: \${property && value && isArrayProperty(property)} - - Assign "\${value.text}" to \${propertyName(property)} + - assign "\${value.text}" to \${propertyName(property)} - ELSEIF: \${property && value} - - Set \${propertyName(property)} to "\${value.text}" + - set \${propertyName(property)} to "\${value.text}" - ELSE: - \${displayDefaultOperation(op, property, value)} # displayRemoveOperation(op, property, value) > Display value for a Remove() operation - IF: \${property && value && isArrayProperty(property)} - - Remove "\${value.text}" from \${propertyName(property)} + - remove "\${value.text}" from \${propertyName(property)} - ELSEIF: \${property} - - Clear \${propertyName(property)} + - clear \${propertyName(property)} - ELSE: - \${displayDefaultOperation(op, property, value)} @@ -45,7 +45,6 @@ ${join(flatten([namePlusSwitch(), cases(), default()]), EOL())} - # chooseEntityOperation() > Operation name from the current event entity - \${operationName(turn.dialogEvent.value.operation)} diff --git a/experimental/generation/generator/packages/library/templates/standard/en-us/form-extensions.en-us.lg b/experimental/generation/generator/packages/library/templates/standard/en-us/form-extensions.en-us.lg index 577b5375c..35944f9e2 100644 --- a/experimental/generation/generator/packages/library/templates/standard/en-us/form-extensions.en-us.lg +++ b/experimental/generation/generator/packages/library/templates/standard/en-us/form-extensions.en-us.lg @@ -57,18 +57,6 @@ - ELSE: - -# helpGlobal_text() -> Global help message -- ``` -${requiredProperties()} -${optionalProperties()} -For each property you can add/remove values, clear, show, change or ask for help. -You can also ask for over all help, cancel the whole form or skip a step.``` - -# helpReprompt_text -> Display value on reprompt -- ${if($expectedProperties, join(foreach(where($expectedProperties, expected, isTemplate(`${expected}_RepromptHelp_text`)), expected, template(`${expected}_RepromptHelp_text`)), EOL()), '')} - # publicProperties > Public properties from schema -${dialogClass.schema.$public} @@ -111,22 +99,6 @@ You can also ask for over all help, cancel the whole form or skip a step.``` # confirmUpdate(property, val) > Display confirmation message on update - ${template(if(dialog[property], `${property}_UnexpectedUpdateConfirmation`, `${property}_UnexpectedSetConfirmation`), val)} - -# cancelPrompt_text -> Prompt to cancel a form -- Do you want to end the form? (yes/no) - -# changePropertyPrompt_text -> Prompt for property to change -- Is there any property you want to change? (no or the property name) - -# choosePropertyPrompt_text -> Prompt for what property to change -- Which property do you want to change? - -# notUnderstood_text -> Message for not understanding -- Sorry, I do not understand ${join(foreach(turn.unrecognizedtext, chunk, `'${chunk}'`), ' or ')} >> FUNCTIONS for dialogs @@ -155,8 +127,6 @@ You can also ask for over all help, cancel the whole form or skip a step.``` - ELSE: - ${concat(join(foreach(subArray(list, 0, count(list) - 1), entry, `'${template(templateName, entry)}'`), ', '), `, ${final} `, `'${template(templateName, last(list))}'`)} ->>>>> from form-Choose - >> OnChooseEntity # chooseEnumEntity() @@ -175,13 +145,7 @@ You can also ask for over all help, cancel the whole form or skip a step.``` > Return the name of the template for enum values of entity - ${substring(type, 0, indexOf(type, 'Value'))}Enum_Value ->> OnChooseProperty - -# chooseProperties_text -> Choose between different properties -- Did you mean ${choices(turn.dialogEvent.value, 'chooseProperty', 'or')}? - ->>>>> from form-show +>> Show card # propertiesAsText > Display value for properties as text diff --git a/experimental/generation/generator/packages/library/templates/standard/en-us/form-prompts.en-us.lg b/experimental/generation/generator/packages/library/templates/standard/en-us/form-prompts.en-us.lg index b6ce1d5b3..a9fb39e8a 100644 --- a/experimental/generation/generator/packages/library/templates/standard/en-us/form-prompts.en-us.lg +++ b/experimental/generation/generator/packages/library/templates/standard/en-us/form-prompts.en-us.lg @@ -8,6 +8,10 @@ Text = ${changePropertyPrompt_text()} ] +# changePropertyPrompt_text +> Prompt for property to change +- Is there any property you want to change? (no or the property name) + >> Choose Property Prompt # choosePropertyPrompt @@ -16,6 +20,10 @@ Text = ${choosePropertyPrompt_text()} ] +# choosePropertyPrompt_text +> Prompt for what property to change +- Which property do you want to change? + >> Cancel Prompt # cancelPrompt @@ -24,6 +32,10 @@ Text = ${cancelPrompt_text()} ] +# cancelPrompt_text +> Prompt to cancel a form +- Do you want to end the form? (yes/no) + >> OnChooseProperty Prompt # chooseProperties @@ -32,6 +44,10 @@ Text = ${chooseProperties_text()} ] +# chooseProperties_text +> Choose between different properties +- Did you mean ${choices(turn.dialogEvent.value, 'chooseProperty', 'or')}? + >> Show Card Prompt # propertiesAsActivity(name, properties) @@ -48,6 +64,14 @@ Text = ${helpGlobal_text()} ] +# helpGlobal_text() +> Global help message +- ``` +${requiredProperties()} +${optionalProperties()} +For each property you can add/remove values, clear, show, change or ask for help. +You can also ask for over all help, cancel the whole form or skip a step.``` + >> Help Reprompt # helpReprompt @@ -56,10 +80,18 @@ Text = ${helpReprompt_text()} ] +# helpReprompt_text +> Display value on reprompt +- ${if($expectedProperties, join(foreach(where($expectedProperties, expected, isTemplate(`${expected}_RepromptHelp_text`)), expected, template(`${expected}_RepromptHelp_text`)), EOL()), '')} + >> not Understood Prompt # notUnderstood > Message for not understanding activity [Activity Text = ${notUnderstood_text()} -] \ No newline at end of file +] + +# notUnderstood_text +> Message for not understanding +- Sorry, I do not understand ${join(foreach(turn.unrecognizedtext, chunk, `'${chunk}'`), ' or ')} \ No newline at end of file