-
Notifications
You must be signed in to change notification settings - Fork 540
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
[Templating] Realign platforms on invalid $when behavior #7432
Conversation
Hi @anna-dingler. 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. |
source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCardsTemplateVisitor.cs
Show resolved
Hide resolved
source/dotnet/Library/AdaptiveCards.Templating/AdaptiveCardsTemplateVisitor.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good, my only reservation is the implementation of warning. I will almost say it is necessary to have this implemented before we make next release since we are changing the behavior, adding the warning will give the dev more flexibility to adapt to our changes.
Thanks for reviewing! I'm working on updating the warning implementation now, so I'll make that PR before making the next release. |
* Align templating platforms for invalid boolean behavior * Formatting * Add comment for exposing warnings to caller
* Align templating platforms for invalid boolean behavior * Formatting * Add comment for exposing warnings to caller
* [.NET Templating] Update Boolean expression evaluation (#7223) * Update expansion of Boolean expressions * Add unit test * Add test for property that accepts boolean * [.NET Templating] Resolve commas added in wrong place (#7225) * Update expansion of Boolean expressions * Add unit test * Add test for property that accepts boolean * Resolve extra commas in temaplting output * [Templating] Realign platforms on invalid $when behavior (#7432) * Align templating platforms for invalid boolean behavior * Formatting * Add comment for exposing warnings to caller * [Templating] Expose warnings/errors to callers (#7437) * In progress: log warnings * Error log for .NET * Add error logging for NodeJS * Resolve comments on PR * Consolidate ArrayList declarations and fix testing nuget package * Rearrange Expand methods and add comments * Refactor to add the errors to template instance * Update warning message * Get warnings from last template expansion * Add markdown file changes Co-authored-by: Paul Campbell <paulcam@microsoft.com>
Related Issue
Fixes #6630
Description
Realign expected behavior for invalid boolean expressions for $when on JS and .NET Templating platforms.
Scenarios:
"$when": "notAnExpression"
)"$when": "${invalidExpression}"
)In both scenarios, the $when condition should evaluate to
false
(drop the element) and issue a warning.Sample Card
Test 1 - Not an Expression
Test 2 - Invalid Expression No Data
Test 3 - Invalid Expression with Data
Card
Data
How Verified
Verified manually with adaptivecards-site and WPF Visualizer. I also added test cases to both platforms.
Microsoft Reviewers: Open in CodeFlow