Commit Graph

3030 Commits

Author SHA1 Message Date
Doug Bunting 0a4c06eefb Suppress validation summary `<div>` when nothing is generated
- #2372
- make the `ValidationSummaryTagHelper` behave consistently with `Html.ValidationSummar()`
2016-09-27 15:51:51 -07:00
Ryan Brandenburg 6cdd0451da DisplayMetadata use DisplayNameAttribute 2016-09-27 15:24:21 -07:00
Doug Bunting f222fa4349 Correct examination of `IHtmlHelper.Label()` return value
- #5317
- previously worked only because `TagBuilder` cannot be empty and `HtmlString` overrides `ToString()`
 - `TagBuilder.ToString()` (now the type's `FullName`) is also never empty
- copy `NullHtmlEncoder` from Razor and give it a better name (`PassThroughHtmlEncoder`)
 - not available in this project and (from its namespace) not intended for general use
2016-09-27 10:00:29 -07:00
Doug Bunting 27e4822a7b Preserve `class` casing when merging a `TagBuilder` into a `TagHelperOutput`
- #5313

Also:
- preserve existing `TagHelperAttribute.ValueStyle`
 - fix this in `UrlResolutionTagHelper`, `LinkTagHelper`, and `ScriptTagHelper` as well
- correct handling of non-`string` `classAttribute.Value`s in `TagHelperOutputExtensions`
 - relates to #3918 because new `ClassAttributeHtmlContent` is smaller than any concatenated attribute value

nit: clean up `CacheTagHelper` whitespace and `using`s
2016-09-26 15:56:30 -07:00
Ajay Bhargav Baaskaran 0d782d9d9a Adding design time support for ViewComponent TagHelpers 2016-09-23 16:58:01 -07:00
Ryan Brandenburg 03b3d6bec8 Use DataAnnotationLocalizerProvider for Display localization 2016-09-23 10:05:42 -07:00
Doug Bunting 9c6c8410e2 Get rid of some duplicate test data
- remove a few warnings from output when testing in VS
2016-09-21 14:52:52 -07:00
Steve Smith 3866ee72e0 Fixing typos Dowload -> Download 2016-09-20 15:55:19 -07:00
Kiran Challa 01f7ecd9d9 [Fixes #5154] Stream should be suppressed from model metadata validation 2016-09-19 11:10:03 -07:00
Ajay Bhargav Baaskaran 3c05d10430 Set designTime to false 2016-09-19 10:49:01 -07:00
Ajay Bhargav Baaskaran b3fe8b30ac Moved VCTHDFactory to .Internal namespace 2016-09-16 15:50:44 -07:00
Ajay Bhargav Baaskaran 5ad5f7a3f9 Addressed feedback 2016-09-16 11:01:51 -07:00
Ajay Bhargav Baaskaran 0cfd5363f8 Added ViewComponentTagHelperDescriptorResolver and related stuff 2016-09-15 17:12:43 -07:00
Pranav K 760c8f3867 Ensure Append writes to the right page after Clear 2016-09-14 18:57:21 -07:00
Ajay Bhargav Baaskaran 42027b6cc2 [Fixes #5243] Handle null values in TempData properly 2016-09-14 15:41:38 -07:00
Pranav K d9ff1d81d6 PagedBufferedTextWriter does not flush synchronous data prior to writing data asynchronously
Fixes #5241
2016-09-14 14:52:06 -07:00
Pranav K 43071319aa Buffer rendered CacheTagHelper content strings to a custom TextWriter
Fixes #4893
2016-09-14 14:47:37 -07:00
Pranav K a480378a44 Make AuthorizeFilter constructable
* Make AuthorizeFilter constructable

Fixes #5253
2016-09-14 13:43:56 -07:00
Pranav K 994835ce47 Remove IViewsProvider and make view lookup to the feature provider 2016-09-14 13:40:05 -07:00
Doug Bunting 809d2bf7ec Add `ValidationHtmlAttributeProvider` to make `AddValidationAttributes()` available
- #5028
- helpers similar to our HTML or tag helpers can use the new singleton to examine or add validation attributes
 - in the most common case, helpers add validation attributes to a `TagBuilder`
- separate `DefaultValidationHtmlAttributeProvider` from `DefaultHtmlGenerator`
 - avoids creating two instances of the `DefaultHtmlGenerator` singleton
 - would be even uglier to require callers to cast an `IHtmlGenerator` to `ValidationHtmlAttributeProvider`
- `[Obsolete]` old `DefaultHtmlGenerator` constructor
2016-09-13 21:07:18 -07:00
Pranav K 4a5e1f4a72 Use as cast instead of C-style cast for IVewContextAware helpers
Fixes #5254
2016-09-12 16:34:02 -07:00
Doug Bunting eee1a9fef4 Do not generate a validation summary when `excludePropertyErrors` unless specific model has an error
- #5209
- update affected `HtmlHelperValiationSummaryTest` and functional tests
- add `ValidationSummaryTagHelperTest` tests to cover related scenarios

##### Behaviour changes when no errors exist for the model:
###### Tag helper
``` html
<div asp-validation-summary="ModelOnly" class="order"><h3>Oopsie<h3></div>
```
previously generated
``` html
<div class="order validation-summary-errors"><h3>Oopsie</h3><ul><li style="display:none"></li>
</ul></div>
```
and now generates
``` html
<div class="order"><h3>Oopsie</h3></div>
```
###### HTML helper
``` c#
@Html.ValidationSummary(excludePropertyErrors: true, message: "Oopsie")
```
previously generated
``` html
<div class=\"validation-summary-errors\"><span>Oopsie</span>
<ul><li style=\"display:none\"></li>
</ul></div>
```
and now generates nothing (`@HtmlString.Empty`).
2016-09-08 15:36:47 -07:00
Ryan Brandenburg 43a0a5a9f1 Replace ConfigureOptions with IConfigureOptions 2016-09-08 15:19:07 -07:00
N. Taylor Mullen 17c6cfcb4e Actually fix build break. 2016-09-08 11:25:55 -07:00
N. Taylor Mullen 11af25b9b7 Fix travis build break. 2016-09-08 11:21:21 -07:00
Doug Bunting 755b702823 Correct test failures on Windows with `git config core.autocrlf false`
- line endings in checked-out files do not necessarily match `Environment.NewLine`
2016-09-08 09:20:05 -07:00
Ajay Bhargav Baaskaran 4677bf13fa Reverting accidental changes 2016-09-08 08:28:51 -07:00
Crystal Qian 7a98ff1a64 Added view component tag helper code generator. (#5195)
This addresses #1051. There is one more pull request that needs to be completed/merged (for `CompositeTagHelperDescriptorResolver` and friends). After that, runtime should work!
2016-09-08 10:35:01 -04:00
Crystal Qian 05392cbf35 Added view component tag helper code generator. (#5195)
This addresses #1051. There is one more pull request that needs to be completed/merged (for `CompositeTagHelperDescriptorResolver` and friends). After that, runtime should work!
2016-09-07 20:30:09 -04:00
Ryan Brandenburg 830983a477 Fixes #5198 Stops caching of Enum display values (#5185)
Fixes #5197 GetEnumSelectList uses IStringLocalizer
Fixes #4215 Html.DisplayFor now checks DisplayAttributes on enums
2016-09-07 16:00:17 -07:00
Ajay Bhargav Baaskaran 21236cc98e [Fixes #5016] Perf: Check for OPTIONS before looking for CORS headers 2016-09-06 14:48:57 -07:00
Doug Bunting c5d7fa63cc Increase .travis.yml consistency between repos
- aspnet/Universe#349
- minimize `dotnet` setup time; no need for caching
- `KOREBUILD_TEST_DNXCORE` env variable isn't used anymore
- no need for icu4c w/ current `dotnet` builds
2016-09-04 20:01:12 -07:00
Christian Weiss a5db01169a Fixed comment in Filters/FilterCollection (#5225) 2016-09-03 11:04:58 -07:00
Doug Bunting fae0e9a66e Handle `!ConvertEmptyStringToNull` cases correctly in `SimpleTypeModelBinder`
- #4988
- preserve whitespace as the setting demands
 - correct previous `string.IsNullOrEmpty()` call to match previous `ValueProviderResultExtensions.ConvertTo()` use
- short-circuit other `string`-to-`string` conversions (as `ValueProviderResultExtensions.ConvertTo()` does)
- correct documentation of `ConvertEmptyStringToNull` properties
- add more tests of these scenarios and remove duplicate `BindModel_ValidValueProviderResult_ConvertEmptyStringsToNull()` test
2016-09-02 16:15:18 -07:00
Christian Weiss 6016966dcf Typo in comment of MvcJsonMvcOptionsSetup (#5221) 2016-09-02 14:30:50 -07:00
Doug Bunting 2659904061 Build on be73cd7 to include `<input type="image"/>`, reduce duplication, and add tests
- consolidate `ButtonTagHelper` and `SubmitTagHelper` into `FormActionTagHelper`
- consolidate `ButtonTagHelperTest` and `SubmitTagHelperTest` into `FormActionTagHelperTest`

nits:
- do not allocate dictionaries in the `<a>` or `<form>` tag helpers unless needed
- clean up some hard-to-maintain whitespace
2016-09-01 20:03:13 -07:00
Shahriar Gholami be73cd77bf Add buttonTagHelper and submitTagHelper for formaction
Addresses #1668
2016-08-31 22:02:47 -07:00
Crystal Qian df81f8be57 Added a view component tag helper descriptor factory (#5189) 2016-08-31 17:31:04 -07:00
Doug Bunting 34a4c8c191 Add more tests covering `asp-format` use
- also add comments requested in PR #5109 and #5205
2016-08-31 12:34:22 -07:00
muhammed baykal 4bda1cbe6d Implemented asp-format support in input[type=hidden] tag helper. 2016-08-30 18:37:19 -07:00
Kiran Challa f7ee16170c [Fixes #5161] Support running middleware pipeline as part of a resource filter 2016-08-30 09:26:04 -07:00
Ajay Bhargav Baaskaran 499fefcc03 Added some missing docs 2016-08-26 16:35:44 -07:00
Ajay Bhargav Baaskaran a6a4b5369a [Fixes #5166] Support passing instance directly when invoking ViewComponents with single parameter 2016-08-26 16:33:42 -07:00
Ajay Bhargav Baaskaran 9ed753288f [Fixes #5170] Fixed KeyNotFoundException in UrlHelperFactory.GetUrlHelper() 2016-08-26 11:27:02 -07:00
Nate McMaster 3aa6d739ce
Fix broken test caused by logging change aspnet/Logging#480 2016-08-26 10:59:30 -07:00
Kiran Challa ece8f33a65 [Fixes #5175] Async resource filters' short circuited result getting executed more than once. 2016-08-25 16:30:41 -07:00
N. Taylor Mullen 7036e2b0f5 Change `ViewComponent.View()` to flow the `ViewData.Model`.
- This is more consistent with how controllers work.

#4882
2016-08-25 10:22:23 -07:00
Pranav K c942eab6e2 Adding support for Razor precompilation
Fixes #3917
2016-08-19 07:27:51 -07:00
N. Taylor Mullen 2f46113556 Merge branch 'rel/1.0.1' into dev 2016-08-17 14:34:15 -07:00
N. Taylor Mullen 516d91670a Merge branch 'rel/1.0.1' (early part) into dev 2016-08-17 14:34:04 -07:00