-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Blazor] Form mapping error handling and validation integration for SSR Blazor #48990
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
Conversation
src/Components/Endpoints/src/Binding/DefaultFormValuesSupplier.cs
Outdated
Show resolved
Hide resolved
src/Components/Endpoints/src/Binding/DefaultFormValuesSupplier.cs
Outdated
Show resolved
Hide resolved
src/Components/Forms/src/EditContextModelBindingContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Forms/src/EditContextModelBindingContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Forms/src/EditContextModelBindingContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Forms/src/EditContextModelBindingContextExtensions.cs
Outdated
Show resolved
Hide resolved
...ents/Endpoints/src/Binding/Factories/ComplexType/ComplexTypeExpressionConverterFactoryOfT.cs
Show resolved
Hide resolved
src/Components/Endpoints/src/Binding/DefaultFormValuesSupplier.cs
Outdated
Show resolved
Hide resolved
src/Components/Web/src/Forms/EditContextModelBindingContextExtensions.cs
Show resolved
Hide resolved
src/Components/Web/src/Forms/EditContextModelBindingContextExtensions.cs
Outdated
Show resolved
Hide resolved
src/Components/Web/src/Microsoft.AspNetCore.Components.Web.csproj
Outdated
Show resolved
Hide resolved
...ents/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs
Outdated
Show resolved
Hide resolved
...ts/test/testassets/Components.TestServer/RazorComponents/Pages/Forms/CustomNumberInput.razor
Outdated
Show resolved
Hide resolved
...nents.TestServer/RazorComponents/Pages/Forms/DefaultFormBoundDictionaryParameterErrors.razor
Show resolved
Hide resolved
…yValidationStateChanged on Dispose, if there were registered messages
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.
Nice one! This looks like a solid implementation and it's great to see the extensive testing. I fully appreciate the design has to cope with multiple different viewpoints on how things work (SSR, interactive, MVC) so good job on balancing all that. Thanks for sorting out theFieldIdentifier
-based representation of model errors too.
If we're switching the culture sensitivity by default then it would be ideal to do that in this preview release, but other than that, I'll back out and assume you'll resolve whichever remaining points make sense now and/or file follow-up issues.
/backport to release/8.0-preview6 |
Started backporting to release/8.0-preview6: https://github.com/dotnet/aspnetcore/actions/runs/5379221347 |
…ation integration for SSR Blazor (#49031) Backport of #48990 to release/8.0-preview6 /cc @javiercn # [Blazor] Form mapping error handling and validation integration for SSR Blazor Adds support for error handling and validation to Server Side Rendered Blazor. ## Description Integrates the form data binding experience with Blazor and provides support for error handling. Fixes #46983 (in this specific format) ## Customer Impact This is one of the remaining major functionalities for Blazor Server Side rendering, so we want to make sure we can get as much feedback as possible on the experience. Specially since we are planning an app building exercise. ## Regression? - [ ] Yes - [X] No [If yes, specify the version the behavior has regressed from] ## Risk - [ ] High - [ ] Medium - [X] Low The changes should be additive, and we've included a significant amount of test coverage for the new functionality. ## Verification - [X] Manual (required) - [X] Automated ## Packaging changes reviewed? - [ ] Yes - [ ] No - [X] N/A ---- ## When servicing release/2.1 - [ ] Make necessary changes in eng/PatchConfig.props
Implemented error handling and reporting for form data mapping for Minimal APIs and Blazor.
is thrown from the callback. This enables us to capture as much information as possible in
the presence of errors.
necessary by developers.
UI.
Adds support for reporting errors in Blazor. ModelBindingContext captures the errors and the
attempted values during the binding process and makes them available to the application.
Updated the FormValueSupplier API to better integrate with model binding.
complex values.
a given type is bindable.
Integrates with EditForm and EditContext: