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

Comments

Fix lg:expand cannot retrieve the value from scope with certain paths#994

Merged
boydc2014 merged 7 commits intomainfrom
shuwan/fixLGexpandIssue
Sep 30, 2020
Merged

Fix lg:expand cannot retrieve the value from scope with certain paths#994
boydc2014 merged 7 commits intomainfrom
shuwan/fixLGexpandIssue

Conversation

@cosmicshuai
Copy link
Contributor

closes: #993
By changing the way of read data from scope and reformation of the variables. Now LG can evaluate expressions like ${user.name} correctly.
For example:

# AddItemReadBack
[Activity
    Text = ${HelpPrefix()}, I have added "**${dialog.itemTitle}**" to your **${dialog.listType}** list. You have **${count(user.lists[dialog.listType])}** items in your ${dialog.listType} list.
    ${WelcomeActions()}
]

# HelpPrefix
- Sure
- You bet
- Absolutely

# WelcomeActions
[Activity
    SuggestedActions = Add item | View lists | Remove item | Profile | Cancel | Help
]
{
    "time":"morning",
    "user": {
        "name": "cosmic",
        "lists": {
            "reminder": ["car washing", "laundry", "cooking"]
        }
    },
    "age": 18,
    "dialog": {
        "itemTitle": "Sunday ToDo",
        "listType": "reminder"
    }
}

will return

# AddItemReadBack
- {"lgType":"Activity","text":"Sure, I have added "**Sunday ToDo**" to your **reminder** list. You have **3** items in your reminder list.","suggestedactions":["Add item ","View lists ","Remove item ","Profile ","Cancel ","Help"]}
- {"lgType":"Activity","text":"You bet, I have added "**Sunday ToDo**" to your **reminder** list. You have **3** items in your reminder list.","suggestedactions":["Add item ","View lists ","Remove item ","Profile ","Cancel ","Help"]}
- {"lgType":"Activity","text":"Absolutely, I have added "**Sunday ToDo**" to your **reminder** list. You have **3** items in your reminder list.","suggestedactions":["Add item ","View lists ","Remove item ","Profile ","Cancel ","Help"]}

@cosmicshuai cosmicshuai marked this pull request as draft September 29, 2020 07:58
@cosmicshuai cosmicshuai marked this pull request as ready for review September 29, 2020 08:11
@boydc2014 boydc2014 merged commit 028a4ec into main Sep 30, 2020
@munozemilio munozemilio deleted the shuwan/fixLGexpandIssue branch February 12, 2021 21:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lg:expand command access the scope incorrectly

3 participants