-
Notifications
You must be signed in to change notification settings - Fork 563
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
[.NET] Return warning when validated inputs don't have an error message #4885
Conversation
/azp run |
No pipelines are associated with this pull request. |
if (input.IsRequired && input.ErrorMessage == null) | ||
{ | ||
context.Warnings.Add(new AdaptiveWarning((int)AdaptiveWarning.WarningStatusCode.NoWarningForValidatedInput, | ||
"Inputs with validation should include an ErrorMessage")); |
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.
@RebeccaAnne do we have a plan to localize these error strings that we bubble out via the AdaptiveWarning/Error object(s)? #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.
There's not currently any plan to localize warning strings. I added it to the doc i'm working on that covers possible areas for localization.
In reply to: 501253546 [](ancestors = 501253546)
if (input.IsRequired && input.ErrorMessage == null) | ||
{ | ||
context.Warnings.Add(new AdaptiveWarning((int)AdaptiveWarning.WarningStatusCode.NoWarningForValidatedInput, | ||
"Inputs with validation should include an ErrorMessage")); |
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.
Is there a common place in the shared .NET library that we could house this string as a variable to reference in all these places vs needing to hardcode the literal each place?
@@ -40,6 +40,12 @@ public static FrameworkElement Render(AdaptiveDateInput input, AdaptiveRenderCon | |||
datePicker.Style = context.GetStyle("Adaptive.Input.Date"); | |||
datePicker.DataContext = input; | |||
|
|||
if (input.IsRequired && input.ErrorMessage == null) |
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.
What;s our behavior for empty or whitespace-only values for the ErrorMessage? #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.
Hi @RebeccaAnne. This non-spec pull request has had no recent activity for the past 5 days . Please take the necessary actions (review, address feedback or commit if reviewed already) to move this along. |
Hi @RebeccaAnne; Thanks for taking action on your previously stale pull request. Resetting staleness. |
🎉 Handy links: |
Related Issue
Fixes #4449
Description
Add warnings for validated inputs without error messages for .NET.
How Verified
.NET tests passed. Confirmed expected behavior using existing MissingErrorMessages.json sample card.
Microsoft Reviewers: Open in CodeFlow