Skip to content

Commit

Permalink
Merge 842a4b4 into fba06a0
Browse files Browse the repository at this point in the history
  • Loading branch information
ninggao committed Nov 20, 2019
2 parents fba06a0 + 842a4b4 commit 2ba88d6
Show file tree
Hide file tree
Showing 20 changed files with 192 additions and 122 deletions.
30 changes: 27 additions & 3 deletions packages/dialog/templates/en-us/common.lg
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@

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

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

# askHelp
- IF: @{and($retries, $retries > 0)}
- @{join(foreach($expectedProperties, expected, help1(expected)), '\n')}
- ELSE:
-

# help(property)
- IF: @{property}
- @{help1(property)}
Expand Down Expand Up @@ -61,11 +70,26 @@
- @{foreach(turn.schema.properties[property].enum, enum, value(property, enum))}

# clarifyEnumEntity(property)
- Please choose a value for @{name(property)} from \[@{join(foreach(turn.dialogEvent.value.entity.value, val, enumEntityValue(property, val)), ', ')}\]
- ```
@{askHelp()}
Please choose a value for @{name(property)} from \[@{join(foreach(turn.dialogEvent.value.entity.value, val, enumEntityValue(property, val)), ', ')}\]
```

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

# setPropertyMessage(property, val)
- IF: @{contains($expectedProperties, property)}
-
- ELSE:
- @{setUnexpectedPropertyMessage(property, val)}

# setUnexpectedPropertyMessage(property, val)
- IF:@{dialog[property]}
- @{unexpectedPropertyChange(property, val, dialog[property])}
- ELSE:
- @{unexpectedPropertySet(property, val)}

# unexpectedPropertySet(property, val)
- @{name(property)} is set as @{value(property, val)}.

Expand Down Expand Up @@ -125,7 +149,7 @@
- Which property do you want to change?

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

# CompleteConfirmationName
- confirmation
Expand Down
18 changes: 2 additions & 16 deletions packages/dialog/templates/enumAsk.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@
"$schema": "@{appSchema}",
"$type": "Microsoft.OnAsk",
"condition":"and(!$@{property}, contains(dialog.requiredProperties, '@{property}'))",
"actions": [
{
"$type": "Microsoft.IfCondition",
"condition":"$lastExpectedProperty == '@{property}'",
"actions":[
{
"$type": "Microsoft.SendActivity",
"activity": "@{callHelp()}"
}

]
},
"actions": [
{
"$type": "Microsoft.Ask",
"activity": "@{callAsk()}",
Expand All @@ -31,7 +20,4 @@
```

# callAsk
- @\{Ask{property}()}

# callHelp
- @\{help(@PropertyName)}
- @\{Ask{property}()}
31 changes: 5 additions & 26 deletions packages/dialog/templates/enumSetenum.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,9 @@
"entity": "@{property}Entity",
"actions": [
{
"$type": "Microsoft.IfCondition",
"condition": "!turn.dialogevent.value.expected",
"actions":[
{
"$type": "Microsoft.IfCondition",
"condition": "!${property}",
"actions":[
{
"$type": "Microsoft.SendActivity",
"activity": "@{callUnexpectedSet()}"
}
],
"elseActions":[
{
"$type": "Microsoft.SendActivity",
"activity": "@{callUnexpectedChange()}"
}
]
}
]
},
"$type": "Microsoft.SendActivity",
"activity": "@{callSetMessage()}"
},
{
"$type": "Microsoft.SetProperty",
"property": "${property}",
Expand All @@ -40,8 +22,5 @@
}
```

# callUnexpectedSet
- @\{unexpectedPropertySet('@{property}', @@{property}Entity)}

# callUnexpectedChange
- @\{unexpectedPropertyChange('@{property}', @@{property}Entity, $@{property})}
# callSetMessage
- @\{setPropertyMessage('@{property}', @@{property}Entity)}
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetage.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@age"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@age",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@age"
}
]
}
```
13 changes: 4 additions & 9 deletions packages/dialog/templates/stringSetdatetime.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
"$schema": "@{appSchema}",
"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@datetime",
"actions": [
{
"$type": "Microsoft.IfCondition",
"condition": "contains(turn.schema.properties['@{property}'].$mappings,'datetime'",
"actions":[
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "join(@datetime.timex,', ')"
}
]
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "join(@datetime.timex,', ')"
}
]
}
Expand Down
13 changes: 4 additions & 9 deletions packages/dialog/templates/stringSetdatetimeV2.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@
"$schema": "@{appSchema}",
"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity":"@datetimeV2",
"actions": [
{
"$type": "Microsoft.IfCondition",
"condition": "contains(turn.schema.properties['@{property}'].$mappings,'datetimeV2'",
"actions":[
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "join(@datetime.timex,', ')"
}
]
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "join(@datetime.timex,', ')"
}
]
}
Expand Down
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetdimension.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@dimension"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@dimension",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@dimension"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetemail.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@email"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@email",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@email"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetgeographyV2.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@geographyV2"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@geographyV2",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@geographyV2"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetkeyPhrase.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@keyPhrase"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@keyPhrase",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@keyPhrase"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetmoney.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@money"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@money",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@money"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetnumber.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@number"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@number",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@number"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetordinal.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@ordinal"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity":"@ordinal",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@ordinal"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetordinalV2.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@ordinalV2"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@ordinalV2",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@ordinalV2"
}
]
}
```
14 changes: 10 additions & 4 deletions packages/dialog/templates/stringSetpercentage.dialog.lg
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
- ```
{
"$schema": "@{appSchema}",
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@percentage"

"$type": "Microsoft.OnSetProperty",
"property": "@{property}",
"entity": "@percentage",
"actions": [
{
"$type": "Microsoft.SetProperty",
"property": "$@{property}",
"value": "@percentage"
}
]
}
```
Loading

0 comments on commit 2ba88d6

Please sign in to comment.