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

Merging input and action data jsons for Adaptive Cards in Widgets #3759

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

guimafelipe
Copy link
Contributor

Summary of the pull request

The default behavior for Adaptive Cards is to add the data JSON of an action altogether with the existent input data. This change implemented this behavior.

References and relevant issues

Detailed description of the pull request / Additional comments

When a action had data embed in it, it would override all the inputs data from the Adaptive Card. From the documentation, the data is actually intended to be combined with the existent input. This was limiting how widgets could behave and future changes.

Validation steps performed

PR checklist

  • Closes #xxx
  • Tests added/passed
  • Documentation updated

Comment on lines +327 to +328
var objA = JObject.Parse(jsonStringA);
var objB = JObject.Parse(jsonStringB);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, maybe not dotnet/runtime#31433

@@ -406,7 +429,7 @@ private void AnnounceWarnings(AdaptiveCard card)
// we may add Caroussels, Tables and Facts to this list.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
// we may add Caroussels, Tables and Facts to this list.
// we may add Carousels, Tables and Facts to this list.

@@ -24,8 +25,8 @@
using Microsoft.UI.Xaml.Controls;
using Microsoft.Windows.Widgets;
using Microsoft.Windows.Widgets.Hosts;
using Newtonsoft.Json.Linq;
Copy link
Collaborator

@krschau krschau Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To encourage not overusing newtonsoft (and making it more clear where we do), can we remove the using and explicitly qualify where we need to down in the code?

@krschau krschau merged commit 9e0592b into main Sep 12, 2024
4 checks passed
@lauren-ciha lauren-ciha mentioned this pull request Sep 23, 2024
1 task
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.

3 participants