Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix break caused by AEL behavioral change in v4.10 #5101

Merged
merged 2 commits into from
Nov 20, 2020
Merged

Conversation

dclaux
Copy link
Member

@dclaux dclaux commented Nov 20, 2020

Related Issue

Fixes #5100

Description

Works around a behavioral change in AEL introduced in version 4.10 which causes single expressions such as ${age} to be generated as concat and produce strings instead of the actual type of the expression.

Test card

{
    "type": "AdaptiveCard",
    "$data": {
        "title": "Not empty"
    },
    "body": [
        {
            "type": "TextBlock",
            "size": "Medium",
            "weight": "Bolder",
            "text": "Test card"
        },
        {
            "type": "TextBlock",
            "text": "Should be visible only if title isn't empty",
            "wrap": true,
            "$when": "${title != ''}"
        }
    ],
    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    "version": "1.3"
}

Without this fix, the "$when" clause will incorrectly evaluate to the string "true". With the fix, it will correctly evaluate to the boolean value true.

How Verified

Verified manually in adaptivecards-designer-app

Microsoft Reviewers: Open in CodeFlow

@ghost
Copy link

ghost commented Nov 20, 2020

Hi @dclaux. Thanks for helping make the AdaptiveCards JS renderer + tooling better. As additional verification, once the JS build succeeds, please go to the test site to test out your website/designer changes.

@dclaux dclaux changed the title Fix break because of AEL change Fix break caused by AEL behavioral change in v4.10 Nov 20, 2020
@Danieladu
Copy link

It looks OK. If change back to the original model is more convenient, we will also consider it.

@dclaux dclaux merged commit 3dd119b into main Nov 20, 2020
@dclaux dclaux deleted the js/templatin-hotfix branch November 20, 2020 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[JS][Templating] Template engine broken after change in AEL
3 participants