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

Commit b28cf40

Browse files
authored
Nigao/boolean (#595)
* add boolean type * add prebuilt boolean entity, and string-assign-boolean * Update booleanEntity.lu.lg * update askBoolean * formatting * remove booleanEntity.lu, numberEntity.lu, and stringEntity.lu * add numberEntity.lu.lg and stringEntity.lu.lg back
1 parent 47fc4ab commit b28cf40

20 files changed

Lines changed: 265 additions & 57 deletions

packages/dialog/templates/CancelConfirmation-assign-Confirmation.dialog.lg renamed to packages/dialog/templates/CancelConfirmation-assign-boolean.dialog.lg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"$schema": "@{appSchema}",
55
"$kind": "Microsoft.OnAssignEntity",
66
"property": "CancelConfirmation",
7-
"entity": "Confirmation",
7+
"entity": "boolean",
88
"actions": [
99
{
1010
"$kind": "Microsoft.SetProperty",
1111
"property": "$CancelConfirmation",
12-
"value": "=@Confirmation"
12+
"value": "=@boolean"
1313
},
1414
{
1515
"$kind": "Microsoft.IfCondition",
16-
"condition":"$CancelConfirmation == 'yes'",
16+
"condition":"$CancelConfirmation == 'true'",
1717
"actions": [
1818
{
1919
"$kind": "Microsoft.EndDialog"

packages/dialog/templates/ChangePropertyConfirmation-assign-Confirmation.dialog.lg renamed to packages/dialog/templates/ChangePropertyConfirmation-assign-boolean.dialog.lg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"$schema": "@{appSchema}",
55
"$kind": "Microsoft.OnAssignEntity",
66
"property": "ChangePropertyConfirmation",
7-
"entity": "Confirmation",
7+
"entity": "boolean",
88
"actions": [
99
{
1010
"$kind": "Microsoft.SetProperty",
1111
"property": "$ChangePropertyConfirmation",
12-
"value": "=@Confirmation"
12+
"value": "=@boolean"
1313
},
1414
{
1515
"$kind": "Microsoft.IfCondition",
16-
"condition":"$ChangePropertyConfirmation == 'yes'",
16+
"condition":"$ChangePropertyConfirmation == 'true'",
1717
"actions": [
1818
{
1919
"$kind": "Microsoft.Ask",

packages/dialog/templates/CompleteConfirmation-assign-Confirmation.dialog.lg renamed to packages/dialog/templates/CompleteConfirmation-assign-boolean.dialog.lg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"$schema": "@{appSchema}",
55
"$kind": "Microsoft.OnAssignEntity",
66
"property": "CompleteConfirmation",
7-
"entity": "Confirmation",
7+
"entity": "boolean",
88
"actions": [
99
{
1010
"$kind": "Microsoft.SetProperty",
1111
"property": "$CompleteConfirmation",
12-
"value": "=@Confirmation"
12+
"value": "=@boolean"
1313
},
1414
{
1515
"$kind": "Microsoft.IfCondition",
16-
"condition":"$CompleteConfirmation == 'no'",
16+
"condition":"$CompleteConfirmation == 'false'",
1717
"actions": [
1818
{
1919
"$kind": "Microsoft.EndDialog"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
2+
# filename
3+
- @{assignFilename('boolean')}
4+
5+
# template
6+
- ```
7+
{
8+
"$schema": "@{appSchema}",
9+
"$kind": "Microsoft.OnAssignEntity",
10+
"property": "@{property}",
11+
"entity": "boolean",
12+
"actions": [
13+
{
14+
"$kind": "Microsoft.SendActivity",
15+
"activity": "@{callSetMessage()}"
16+
},
17+
{
18+
"$kind": "Microsoft.SetProperty",
19+
"property": "$@{property}",
20+
"value": "=@boolean"
21+
}
22+
]
23+
}
24+
```
25+
26+
# callSetMessage
27+
- @\{setPropertyMessage('@{property}', @boolean)}
28+
29+
[generator.lg](generator.lg)
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# filename
2+
- @{missingFilename()}
3+
4+
# template
5+
- ```
6+
{
7+
"$schema": "@{appSchema}",
8+
"$kind": "Microsoft.OnEndOfActions",
9+
"condition":"!$@{property}",
10+
"priority": "indexOf(dialog.requiredProperties, '@{property}')",
11+
"actions": [
12+
{
13+
"$kind": "Microsoft.Ask",
14+
"activity": "@{callAsk()}",
15+
"expectedProperties": [
16+
"@{property}"
17+
]
18+
}
19+
]
20+
}
21+
```
22+
23+
# callAsk
24+
- @\{Ask@{property}()}
25+
26+
[generator.lg](generator.lg)
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# filename
2+
- @{builtinEntityFilename('booleanEntity')}
3+
4+
# template
5+
- ```
6+
@ list boolean =
7+
- true :
8+
- sure
9+
- yeah
10+
- you bet
11+
- yes please
12+
- ture
13+
- done
14+
- yes
15+
- positive
16+
- 1
17+
- false :
18+
- no way
19+
- no thank you
20+
- never
21+
- not now
22+
- false
23+
- not yet
24+
- no
25+
- negative
26+
- 0
27+
```
28+
29+
[generator.lg](../generator.lg)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# filename
2+
- @{entityLGFilename()}
3+
4+
# template
5+
- ```
6+
# boolean(value)
7+
- SWITCH: \@{value}
8+
- CASE: \@{'true'}
9+
- true
10+
- CASE: \@{'false'}
11+
- false
12+
- DEFAULT:
13+
- Unknown boolean value
14+
```
15+
[generator.lg](../generator.lg)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# filename
2+
- @{propertyFilename()}
3+
4+
# template
5+
- ```
6+
@{AskTemplate()}
7+
@{NameTemplate()}
8+
@{ValueTemplate()}
9+
10+
\[@{schemaName}-@{property}Entity.@{locale}.lg]
11+
\[library.lg]
12+
\[library-Missing.lg]
13+
```
14+
15+
# AskTemplate
16+
- ```
17+
# Ask@{property}
18+
- @\{askBoolean('@{property}')\}
19+
```
20+
21+
# ValueTemplate
22+
- ```
23+
# @{property}(val)
24+
- @\{@{concat(property, 'Entity')}(val)}
25+
```
26+
27+
# NameTemplate
28+
- ```
29+
# @{property}Name
30+
- @{phrase(property, locale)}
31+
```
32+
33+
[generator.lg](../generator.lg)

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

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,32 @@
22
- @{propertyFilename()}
33

44
# template
5-
- @{AskTemplate()}\n@{NameTemplate()}\n@{ValueTemplate()}\n\[@{schemaName}-@{property}Entity.@{locale}.lg]\n\[library.lg]\n\[library-Missing.lg]
5+
- ```
6+
@{AskTemplate()}
7+
@{NameTemplate()}
8+
@{ValueTemplate()}
9+
10+
\[@{schemaName}-@{property}Entity.@{locale}.lg]
11+
\[library.lg]
12+
\[library-Missing.lg]
13+
```
614

715
# AskTemplate
8-
- # Ask@{property}\n- @\{askEnum('@{property}')\}\n
16+
- ```
17+
# Ask@{property}
18+
- @\{askEnum('@{property}')\}
19+
```
920

1021
# ValueTemplate
11-
- # @{property}(val)\n- @\{@{concat(property, 'Entity')}(val)}\n
22+
- ```
23+
# @{property}(val)
24+
- @\{@{concat(property, 'Entity')}(val)}
25+
```
1226

1327
# NameTemplate
14-
- # @{property}Name\n- @{phrase(property, locale)}\n
28+
- ```
29+
# @{property}Name
30+
- @{phrase(property, locale)}
31+
```
1532

1633
[generator.lg](../generator.lg)

packages/dialog/templates/en-us/library-ConfirmationEntity.lg

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)