Skip to content

Commit

Permalink
add numberSetdimension.dialog (#560)
Browse files Browse the repository at this point in the history
open a new PR to have a clean commits/rebase history
  • Loading branch information
ninggao authored Feb 11, 2020
1 parent fe3b112 commit 15fbb60
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/dialog/templates/en-us/common.lg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ Which value do you want for @{name(property)}?
- ELSEIF: @{greater(number, dialogClass.schema.properties[property].maximum)}
- @{number} is greater than the maximum value @{dialogClass.schema.properties[property].maximum}.

# unitsAlert(property)
- IF: @{dialogClass.schema.properties[property].$units}
- Required response for @{property} should be in @{dialogClass.schema.properties[property].$units}.
- ELSE:
- Unit for @{property} is not defined in the schema.

# askString(property)
- ```
@{askHelp()}
Expand Down
41 changes: 41 additions & 0 deletions packages/dialog/templates/numberSetdimension.dialog.lg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# filename
- @{schemaName}-@{property}Setdimension.dialog

# template
- ```
{
"$schema": "@{appSchema}",
"$kind": "Microsoft.OnAssignEntity",
"property": "@{property}",
"entity": "dimension",
"actions": [
{
"$kind": "Microsoft.IfCondition",
"condition": "equals(@dimension.units, dialogClass.schema.properties['@{property}'].$units)",
"actions":[
{
"$kind": "Microsoft.SendActivity",
"activity": "@{callSetMessage()}"
},
{
"$kind": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "=@dimension.number"
}
],
"elseActions":[
{
"$kind": "Microsoft.SendActivity",
"activity": "@{callUnitsAlert()}"
}
]
}
]
}
```

# callSetMessage
- @\{setObjectPropertyMessage('@{property}',string(@dimension.number))}

# callUnitsAlert
- @\{unitsAlert('@{property}')}

0 comments on commit 15fbb60

Please sign in to comment.