Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 15fbb60

Browse files
authored
add numberSetdimension.dialog (#560)
open a new PR to have a clean commits/rebase history
1 parent fe3b112 commit 15fbb60

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

packages/dialog/templates/en-us/common.lg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ Which value do you want for @{name(property)}?
3737
- ELSEIF: @{greater(number, dialogClass.schema.properties[property].maximum)}
3838
- @{number} is greater than the maximum value @{dialogClass.schema.properties[property].maximum}.
3939

40+
# unitsAlert(property)
41+
- IF: @{dialogClass.schema.properties[property].$units}
42+
- Required response for @{property} should be in @{dialogClass.schema.properties[property].$units}.
43+
- ELSE:
44+
- Unit for @{property} is not defined in the schema.
45+
4046
# askString(property)
4147
- ```
4248
@{askHelp()}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# filename
2+
- @{schemaName}-@{property}Setdimension.dialog
3+
4+
# template
5+
- ```
6+
{
7+
"$schema": "@{appSchema}",
8+
"$kind": "Microsoft.OnAssignEntity",
9+
"property": "@{property}",
10+
"entity": "dimension",
11+
"actions": [
12+
{
13+
"$kind": "Microsoft.IfCondition",
14+
"condition": "equals(@dimension.units, dialogClass.schema.properties['@{property}'].$units)",
15+
"actions":[
16+
{
17+
"$kind": "Microsoft.SendActivity",
18+
"activity": "@{callSetMessage()}"
19+
},
20+
{
21+
"$kind": "Microsoft.SetProperty",
22+
"property": "$@{property}",
23+
"value": "=@dimension.number"
24+
}
25+
],
26+
"elseActions":[
27+
{
28+
"$kind": "Microsoft.SendActivity",
29+
"activity": "@{callUnitsAlert()}"
30+
}
31+
]
32+
}
33+
]
34+
}
35+
```
36+
37+
# callSetMessage
38+
- @\{setObjectPropertyMessage('@{property}',string(@dimension.number))}
39+
40+
# callUnitsAlert
41+
- @\{unitsAlert('@{property}')}

0 commit comments

Comments
 (0)