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

Commit 1da7e1c

Browse files
authored
Nigao/mergewithmaster (#361)
* merge * add entity fields * set property message in lg * simplify ask dialog * move autohelp into askProperty * set property message in lg * simplify ask dialog * remove duplicate help message * remove empty line
1 parent 8a32dba commit 1da7e1c

20 files changed

+195
-120
lines changed

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

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@
1616

1717
> TODO: We should look at the schema and if a few items list them or do cards or..
1818
# askEnum(property)
19-
- Which value do you want for @{name(property)}?
19+
- ```
20+
@{askHelp()}
21+
Which value do you want for @{name(property)}?
22+
```
2023

2124
# askNumber(property)
2225
- IF: @{turn.schema.properties[property].minimum && turn.schema.properties[property].maximum}
@@ -27,6 +30,12 @@
2730
# askString(property)
2831
- Enter a value for @{name(property)}
2932

33+
# askHelp
34+
- IF: @{and($retries, $retries > 0, toLower($lastIntent)!='help')}
35+
- @{join(foreach($expectedProperties, expected, help1(expected)), '\n')}
36+
- ELSE:
37+
-
38+
3039
# help(property)
3140
- IF: @{property}
3241
- @{help1(property)}
@@ -61,11 +70,26 @@
6170
- @{foreach(turn.schema.properties[property].enum, enum, value(property, enum))}
6271

6372
# clarifyEnumEntity(property)
64-
- Please choose a value for @{name(property)} from \[@{join(foreach(turn.dialogEvent.value.entity.value, val, enumEntityValue(property, val)), ', ')}\]
73+
- ```
74+
@{askHelp()}
75+
Please choose a value for @{name(property)} from \[@{join(foreach(turn.dialogEvent.value.entity.value, val, enumEntityValue(property, val)), ', ')}\]
76+
```
6577

6678
# cancel
6779
- Do you want to end the conversation? (yes/no)
6880

81+
# setPropertyMessage(property, val)
82+
- IF: @{contains($expectedProperties, property)}
83+
-
84+
- ELSE:
85+
- @{setUnexpectedPropertyMessage(property, val)}
86+
87+
# setUnexpectedPropertyMessage(property, val)
88+
- IF:@{dialog[property]}
89+
- @{unexpectedPropertyChange(property, val, dialog[property])}
90+
- ELSE:
91+
- @{unexpectedPropertySet(property, val)}
92+
6993
# unexpectedPropertySet(property, val)
7094
- @{name(property)} is set as @{value(property, val)}.
7195

@@ -125,7 +149,7 @@
125149
- Which property do you want to change?
126150

127151
# notUnderstood
128-
- Sorry, I do not understand @{join(foreach(turn.unrecognizedtext, chunk, concat("'", chunk, "'")), ' or ')}\n\n@{help(null)}
152+
- Sorry, I do not understand @{join(foreach(turn.unrecognizedtext, chunk, concat("'", chunk, "'")), ' or ')}\n
129153

130154
# CompleteConfirmationName
131155
- confirmation

packages/dialog/templates/enumAsk.dialog.lg

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@
77
"$schema": "@{appSchema}",
88
"$type": "Microsoft.OnAsk",
99
"condition":"and(!$@{property}, contains(dialog.requiredProperties, '@{property}'))",
10-
"actions": [
10+
"actions": [
1111
{
12-
"$type": "Microsoft.IfCondition",
13-
"condition":"$lastExpectedProperty == '@{property}'",
14-
"actions":[
15-
{
16-
"$type": "Microsoft.SendActivity",
17-
"activity": "@{callHelp()}"
18-
}
19-
20-
]
12+
"$type": "Microsoft.SetProperty",
13+
"property": "$lastExpectedProperty",
14+
"value": "'@{property}'"
2115
},
2216
{
2317
"$type": "Microsoft.Ask",
@@ -31,7 +25,4 @@
3125
```
3226

3327
# callAsk
34-
- @\{Ask{property}()}
35-
36-
# callHelp
37-
- @\{help(@PropertyName)}
28+
- @\{Ask{property}()}

packages/dialog/templates/enumSetenum.dialog.lg

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,9 @@
1010
"entity": "@{property}Entity",
1111
"actions": [
1212
{
13-
"$type": "Microsoft.IfCondition",
14-
"condition": "!turn.dialogevent.value.expected",
15-
"actions":[
16-
{
17-
"$type": "Microsoft.IfCondition",
18-
"condition": "!${property}",
19-
"actions":[
20-
{
21-
"$type": "Microsoft.SendActivity",
22-
"activity": "@{callUnexpectedSet()}"
23-
}
24-
],
25-
"elseActions":[
26-
{
27-
"$type": "Microsoft.SendActivity",
28-
"activity": "@{callUnexpectedChange()}"
29-
}
30-
]
31-
}
32-
]
33-
},
13+
"$type": "Microsoft.SendActivity",
14+
"activity": "@{callSetMessage()}"
15+
},
3416
{
3517
"$type": "Microsoft.SetProperty",
3618
"property": "${property}",
@@ -40,8 +22,5 @@
4022
}
4123
```
4224

43-
# callUnexpectedSet
44-
- @\{unexpectedPropertySet('@{property}', @@{property}Entity)}
45-
46-
# callUnexpectedChange
47-
- @\{unexpectedPropertyChange('@{property}', @@{property}Entity, $@{property})}
25+
# callSetMessage
26+
- @\{setPropertyMessage('@{property}', @@{property}Entity)}

packages/dialog/templates/stringSetage.dialog.lg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
- ```
77
{
88
"$schema": "@{appSchema}",
9-
"$type": "Microsoft.SetProperty",
10-
"property": "$@{property}",
11-
"value": "@age"
12-
9+
"$type": "Microsoft.OnSetProperty",
10+
"property": "@{property}",
11+
"entity": "@age",
12+
"actions": [
13+
{
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "@age"
17+
}
18+
]
1319
}
1420
```

packages/dialog/templates/stringSetdatetime.dialog.lg

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@
88
"$schema": "@{appSchema}",
99
"$type": "Microsoft.OnSetProperty",
1010
"property": "@{property}",
11+
"entity": "@datetime",
1112
"actions": [
1213
{
13-
"$type": "Microsoft.IfCondition",
14-
"condition": "contains(turn.schema.properties['@{property}'].$mappings,'datetime'",
15-
"actions":[
16-
{
17-
"$type": "Microsoft.SetProperty",
18-
"property": "$@{property}",
19-
"value": "join(@datetime.timex,', ')"
20-
}
21-
]
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "join(@datetime.timex,', ')"
2217
}
2318
]
2419
}

packages/dialog/templates/stringSetdatetimeV2.dialog.lg

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,12 @@
88
"$schema": "@{appSchema}",
99
"$type": "Microsoft.OnSetProperty",
1010
"property": "@{property}",
11+
"entity":"@datetimeV2",
1112
"actions": [
1213
{
13-
"$type": "Microsoft.IfCondition",
14-
"condition": "contains(turn.schema.properties['@{property}'].$mappings,'datetimeV2'",
15-
"actions":[
16-
{
17-
"$type": "Microsoft.SetProperty",
18-
"property": "$@{property}",
19-
"value": "join(@datetime.timex,', ')"
20-
}
21-
]
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "join(@datetime.timex,', ')"
2217
}
2318
]
2419
}

packages/dialog/templates/stringSetdimension.dialog.lg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
- ```
77
{
88
"$schema": "@{appSchema}",
9-
"$type": "Microsoft.SetProperty",
10-
"property": "$@{property}",
11-
"value": "@dimension"
12-
9+
"$type": "Microsoft.OnSetProperty",
10+
"property": "@{property}",
11+
"entity": "@dimension",
12+
"actions": [
13+
{
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "@dimension"
17+
}
18+
]
1319
}
1420
```

packages/dialog/templates/stringSetemail.dialog.lg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
- ```
77
{
88
"$schema": "@{appSchema}",
9-
"$type": "Microsoft.SetProperty",
10-
"property": "$@{property}",
11-
"value": "@email"
12-
9+
"$type": "Microsoft.OnSetProperty",
10+
"property": "@{property}",
11+
"entity": "@email",
12+
"actions": [
13+
{
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "@email"
17+
}
18+
]
1319
}
1420
```

packages/dialog/templates/stringSetgeographyV2.dialog.lg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
- ```
77
{
88
"$schema": "@{appSchema}",
9-
"$type": "Microsoft.SetProperty",
10-
"property": "$@{property}",
11-
"value": "@geographyV2"
12-
9+
"$type": "Microsoft.OnSetProperty",
10+
"property": "@{property}",
11+
"entity": "@geographyV2",
12+
"actions": [
13+
{
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "@geographyV2"
17+
}
18+
]
1319
}
1420
```

packages/dialog/templates/stringSetkeyPhrase.dialog.lg

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
- ```
77
{
88
"$schema": "@{appSchema}",
9-
"$type": "Microsoft.SetProperty",
10-
"property": "$@{property}",
11-
"value": "@keyPhrase"
12-
9+
"$type": "Microsoft.OnSetProperty",
10+
"property": "@{property}",
11+
"entity": "@keyPhrase",
12+
"actions": [
13+
{
14+
"$type": "Microsoft.SetProperty",
15+
"property": "$@{property}",
16+
"value": "@keyPhrase"
17+
}
18+
]
1319
}
1420
```

0 commit comments

Comments
 (0)