-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add ValidationSummaryTagHelper. #1340
Add ValidationSummaryTagHelper. #1340
Conversation
4473a33
to
de8706e
Compare
ff71b0b
to
a8a3ccb
Compare
de8706e
to
108a0ba
Compare
a8a3ccb
to
7dd31d5
Compare
[ContentBehavior(ContentBehavior.Append)] | ||
public class ValidationSummaryTagHelper : TagHelper | ||
{ | ||
private static readonly bool DefaultModelErrorsOnlyBehavior = false; |
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.
rename w/o "Behavior"
⌚ |
108a0ba
to
af0ac42
Compare
7dd31d5
to
b3d6569
Compare
af0ac42
to
0708aef
Compare
c490007
to
c8615e9
Compare
0708aef
to
a33aa3e
Compare
Addressed code review comments to the exception of the one comment with differing opinions 😄 |
a33aa3e
to
342362c
Compare
c8615e9
to
6e4dcb6
Compare
342362c
to
8a24434
Compare
6e4dcb6
to
65d5145
Compare
8a24434
to
673a9ea
Compare
65d5145
to
3a0403c
Compare
673a9ea
to
3ff67ca
Compare
Assert.Equal("div", output.TagName); | ||
Assert.Empty(output.Attributes); | ||
|
||
if (!validationSummary.Equals("None", StringComparison.OrdinalIgnoreCase)) |
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.
split into two tests rather than conditionalizing the Assert
s
⌚ |
Addressed code review comments. |
Update TagHelper sample to use new validation-summary format. |
1cf6935
to
0d4d7c6
Compare
de98414
to
99f8720
Compare
|
||
// TODO: Change to ValidationSummary enum once https://github.com/aspnet/Razor/issues/196 has been completed. | ||
/// <summary> | ||
/// Acceptable values are defined by the <see cref="ValidationSummary"/> enum. |
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.
good second sentence in this <summary/>
. restore first sentence from an earlier iteration to describe that this property is for.
⌚ just for a quick look at doc comments in next iteration |
Resources.FormatValidationSummaryTagHelper_InvalidValidationSummaryValue( | ||
"validation-summary", | ||
ValidationSummaryValue, | ||
ValidationSummary.All.ToString(), |
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.
Shouldn't have to do ToString()
, the string.Format
would do that for you.
once @dougbu's happy |
Updated. |
8edcc0c
to
3aa9323
Compare
@@ -126,4 +126,7 @@ | |||
<data name="FormTagHelper_CannotDetermineAction" xml:space="preserve"> | |||
<value>Cannot determine an {1} for {0}. A {0} with a URL-based {1} must not have attributes starting with {3} or a {2} attribute.</value> | |||
</data> | |||
<data name="ValidationSummaryTagHelper_InvalidValidationSummaryValue" xml:space="preserve"> | |||
<value>Cannot parse {0} value '{1}'. Acceptable values are '{2}', '{3}' and '{4}'.</value> |
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: passing your usual rule back 😸 add "for {2}" just before the first period
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.
quote current {0}
as well -> '{0}'
(though that should probably become {1}
and so on
after addressing my 2 (or so) minor comments |
- Tested ValidationSummaryTagHelper behavior. - Updated sample to utilize new ValidationSummaryTagHelper format. #1251
3aa9323
to
ba111a4
Compare
Done in TagHelpersFeature via ba111a4 |
#1251