Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Add ValidationSummaryTagHelper. #1340

Conversation

NTaylorMullen
Copy link

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 4473a33 to de8706e Compare October 13, 2014 06:27
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from ff71b0b to a8a3ccb Compare October 13, 2014 06:27
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from de8706e to 108a0ba Compare October 13, 2014 17:53
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from a8a3ccb to 7dd31d5 Compare October 13, 2014 17:53
[ContentBehavior(ContentBehavior.Append)]
public class ValidationSummaryTagHelper : TagHelper
{
private static readonly bool DefaultModelErrorsOnlyBehavior = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

rename w/o "Behavior"

@dougbu
Copy link
Contributor

dougbu commented Oct 13, 2014

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 108a0ba to af0ac42 Compare October 14, 2014 00:48
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from 7dd31d5 to b3d6569 Compare October 14, 2014 00:48
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from af0ac42 to 0708aef Compare October 14, 2014 05:32
@NTaylorMullen NTaylorMullen changed the title [Design] Add ValidationSummaryTagHelper. Add ValidationSummaryTagHelper. Oct 14, 2014
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch 2 times, most recently from c490007 to c8615e9 Compare October 14, 2014 05:37
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 0708aef to a33aa3e Compare October 14, 2014 05:37
@NTaylorMullen
Copy link
Author

Addressed code review comments to the exception of the one comment with differing opinions 😄

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from a33aa3e to 342362c Compare October 15, 2014 00:30
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from c8615e9 to 6e4dcb6 Compare October 15, 2014 00:30
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 342362c to 8a24434 Compare October 15, 2014 07:02
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from 6e4dcb6 to 65d5145 Compare October 15, 2014 07:03
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 8a24434 to 673a9ea Compare October 15, 2014 18:20
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from 65d5145 to 3a0403c Compare October 15, 2014 18:21
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 673a9ea to 3ff67ca Compare October 15, 2014 23:45
Assert.Equal("div", output.TagName);
Assert.Empty(output.Attributes);

if (!validationSummary.Equals("None", StringComparison.OrdinalIgnoreCase))
Copy link
Contributor

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 Asserts

@dougbu
Copy link
Contributor

dougbu commented Oct 16, 2014

@NTaylorMullen
Copy link
Author

Addressed code review comments.

@NTaylorMullen
Copy link
Author

Update TagHelper sample to use new validation-summary format.

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationMessage branch from 1cf6935 to 0d4d7c6 Compare October 16, 2014 19:43
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from de98414 to 99f8720 Compare October 16, 2014 19:43

// 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.
Copy link
Contributor

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.

@dougbu
Copy link
Contributor

dougbu commented Oct 16, 2014

⌚ just for a quick look at doc comments in next iteration

Resources.FormatValidationSummaryTagHelper_InvalidValidationSummaryValue(
"validation-summary",
ValidationSummaryValue,
ValidationSummary.All.ToString(),
Copy link
Contributor

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.

@pranavkm
Copy link
Contributor

:shipit: once @dougbu's happy

@NTaylorMullen
Copy link
Author

Updated.

@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from 8edcc0c to 3aa9323 Compare October 16, 2014 23:39
@@ -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>
Copy link
Contributor

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

Copy link
Contributor

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

@dougbu
Copy link
Contributor

dougbu commented Oct 17, 2014

:shipit: after addressing my 2 (or so) minor comments

- Tested ValidationSummaryTagHelper behavior.
- Updated sample to utilize new ValidationSummaryTagHelper format.

#1251
@NTaylorMullen NTaylorMullen force-pushed the TagHelpers_ValidationSummary branch from 3aa9323 to ba111a4 Compare October 17, 2014 00:43
@NTaylorMullen
Copy link
Author

Done in TagHelpersFeature via ba111a4

@NTaylorMullen NTaylorMullen deleted the TagHelpers_ValidationSummary branch October 17, 2014 05:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants