-
Notifications
You must be signed in to change notification settings - Fork 327
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
Conversation
var objA = JObject.Parse(jsonStringA); | ||
var objB = JObject.Parse(jsonStringB); |
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.
Can we use System.Text.Json instead of Newtonsoft here? https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/migrate-from-newtonsoft?pivots=dotnet-8-0
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.
Ugh, maybe not dotnet/runtime#31433
tools/Dashboard/DevHome.Dashboard/ViewModels/WidgetViewModel.cs
Outdated
Show resolved
Hide resolved
@@ -406,7 +429,7 @@ private void AnnounceWarnings(AdaptiveCard card) | |||
// we may add Caroussels, Tables and Facts to this list. |
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.
nit:
// 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; |
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.
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?
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