Commit Graph

191 Commits

Author SHA1 Message Date
Doug Bunting 869825b16c
Quick fix: Add test of #2890
- tests added (ages ago) in aspnet/Mvc@a045324 no longer fail when `__` handling removed
2018-03-19 11:59:52 -07:00
Doug Bunting f061d328d9
Do not use `FormattedModelValue` in password editor template
- #7418
- add quirk switch to reverse this if necessary
2018-03-05 08:33:16 -08:00
Jass Bagga 8d1c85ab74
Add overload for AddModelError without ModelMetadata (#7407)
Addresses #6102
2018-03-02 11:03:46 -08:00
Doug Bunting daf341df35 Add more tests of #7033 scenarios 2018-02-21 15:11:52 -08:00
Charlie Daly 4f3e044928 HtmlHelper.DisplayTextFor should use DisplayAttribute of enums
- #7033
2018-02-21 15:11:51 -08:00
Fabien Lavocat c062d637fe Add new contructor in SelectListItem.cs 2018-02-06 11:01:24 -08:00
Javier Calvarro Nelson 17a407bba2 [Fixes #7271] Support covariant casting of ViewDataDictionary<T>
On HtmlHelper<T> we now support contextualizing an instance of
HtmlHelper<TBase> with a ViewDataDictionary<TDerived> in
ViewContext.ViewData.

This can happen in some situations when the model for a RazorPage has
been changed using a page application model convention.

In these cases we just build a new ViewDataDictionary<TBase> and pass in
the TDerived model as an instance.
2018-01-23 17:31:03 -08:00
Kiran Challa 00c6b53b06 [Fixes #7115] Update property type check in SaveTempDataPropertyFilterBase to match TempDataSerializer requirements 2018-01-10 15:08:01 -08:00
Pranav K b196708a3e Merge tag '2.0.2' into dev 2018-01-10 10:02:54 -08:00
Doug Bunting ecedbd5372 Allow `null` or empty `fullName` in one special case
- #6662
- users can now provide a `name` or `data-valmsg-for` attribute to avoid `ArgumentException`s
  - affects `<input>`, `<select>`, `<textarea>` elements and validation message `<div>`s
- remove `fullName` check in `DefaultHtmlGenerator.GetCurrentValues(...)` entirely

The new workaround is _not_ identical to changing `ViewData.TemplateInfo.HtmlFieldPrefix`
- does not change where expression values are found in `ModelState` or `ViewData`
- likely needs to be combined with additional workarounds i.e. for advanced use only

nits:
- clean up some excessive argument naming; add a few missing argument names
- take VS suggestions in changed classes e.g. inline a few variable declarations
- clean up some test data
2018-01-09 08:53:37 -08:00
Doug Bunting 1fa1d7df3e Add missing `RenderPartial(...)` overload
- #7127
- also remove some redundant `null` checks
2018-01-05 11:27:54 -08:00
N. Taylor Mullen 7cea779b7a Update JsonHelper to escape HTML.
- This functionality can be disabled by setting the `Switch.Microsoft.AspNetCore.Mvc.AllowJsonHtml` switch in an app.config.
- Updated tests to react to this new behavior.
- Exposed a new `PublicSerializerSettings` property on `JsonOutputFormatter` so we can accurately copy settings from the used output formatter in `JsonHelper`.
2017-12-07 16:12:43 -08:00
Kiran Challa e09ea40551 [Fixes #6591] TempData should support nullable types 2017-12-04 15:33:22 -08:00
Jass Bagga 5fffd464cd
Support input type "week" (#7045) 2017-11-16 16:00:15 -08:00
Pranav K b6144142fe Update samples and tests to target netcoreapp2.1 2017-11-13 14:58:40 -08:00
Jass Bagga bb07119b4a
Handle "month" input type (#7022)
Addresses #6615
2017-11-09 10:25:36 -08:00
Nate McMaster 2e4bc548f5
Pin tool and package versions to make builds more repeatable (#7013) 2017-10-31 19:18:14 -07:00
Pranav K 41efa409a4 Remove TestOptionsManager 2017-10-30 17:49:15 -07:00
Nate McMaster 3bfb023679 Update how PackageReference versions are set
Changes:
 - Remove floating versions
 - Disable myget feeds during a Universe build
 - Use package-specific MSBuild variables. Pattern = `packageId.Pascalize() + "PackageVersion"`, with a few exceptions.
2017-10-09 11:11:24 -07:00
Nate McMaster 3f02482617 Minor test code changes to resolve xUnit2013 build error 2017-10-05 16:04:20 -07:00
Ryan Nowak 38712609bb Design extensibility for executors
We have all of these executors but they aren't really
documented/supported for extensibility today. This change introduces a
pattern for action result executors so we can make them extensible.
2017-09-22 10:32:55 -07:00
Doug Bunting fd9cb08790 Add Switch.Microsoft.AspNetCore.Mvc.UseDateTimeTypeForDateTimeOffset quirks mode
- patch recipients can use switch to undo the #6648 fix
2017-09-18 15:13:43 -07:00
Doug Bunting 6041c6b966 Auto-select `type="text"` for `DateTimeOffset` values
- cherry-picked from 7e4a8fe in dev
- #6648
- a different take on #4871
- `DateTime` can also round-trip `DateTimeKind.UTC` with `[DataType("datetimeoffset")]` or `[UIHint("datetimeoffset")]`
- since they're now handled differently by default, add more `DateTime` tests
- expand tests involving `Html5DateRenderingMode.CurrentCulture`

nits: make VS-suggested changes to files updated in this PR
2017-09-18 15:13:33 -07:00
Kiran Challa 3beb310866 Avoid saving TempData in case of unhandled exceptions. [Fixes #6598] BUG? Accessing TempData prevent response to have content on error. 2017-09-07 13:13:27 -07:00
Doug Bunting 7e4a8fe479 Auto-select `type="text"` for `DateTimeOffset` values
- #6648
- a different take on #4871
- `DateTime` can also round-trip `DateTimeKind.UTC` with `[DataType("datetimeoffset")]` or `[UIHint("datetimeoffset")]`
- since they're now handled differently by default, add more `DateTime` tests
- expand tests involving `Html5DateRenderingMode.CurrentCulture`

nits: make VS-suggested changes to files updated in this PR
2017-09-05 16:05:13 -07:00
Doug Bunting 8645ada6b5 Remove no-op behaviour for no-content `<label></label>` elements
- #6638
2017-08-31 09:21:44 -07:00
bchavez 16c267d95e House Cleaning - Spelling and grammar 🚿 2017-08-30 14:58:44 -07:00
Nate McMaster b811e69d00 Use PackageLineup to manage PackageReference versions
- Move the Mvc.Performance project from test/ to benchmarks/.
 - Remove the Version attribute on PackageReference.
 - Add a reference to two PackageLineup's.
 - Add snippet to README explaining the additional requirement to run build.cmd /t:restore.
 - Add a target to check that packages have been pinned.
2017-08-30 12:14:11 -07:00
Kiran Challa b2f9ad1b67 Changed CookieTempDataProvider's CookieSecurePolicy from SameAsRequest to None 2017-08-29 14:55:52 -07:00
Kiran Challa cfc05104e4 Updated to use WebEncoders utility's Base64Url encode/decode functionality 2017-08-29 08:37:28 -07:00
Pranav K 3e8da43279 Pinning versions for 2.0.0 2017-08-17 15:00:47 -07:00
Nate McMaster 3a710c3d64 Upgrade to xunit 2.3.0-beta4 2017-08-17 10:45:03 -07:00
Nate McMaster b43b244830 Use Directory.Build.props/targets 2017-08-16 12:30:13 -07:00
Ryan Nowak f80f7cefa5 Fix #6480
This change logs when we encounter and exception reading temp data from a
cookie and swallows the exception. Additionally, we clear the cookie so
that this won't happen on subsequent requests.

This will handle cases where data protection is misconfigured, or a
request just has general garbage in the cookies.
2017-07-07 13:14:03 -07:00
Chris R b9541be20d React to ISession cancellation changes 2017-07-05 14:34:48 -07:00
Nate McMaster 1eb7f9e032 Add CookieBuilder to CookieTempDataProviderOptions and obsolete duplicate API (#6472) 2017-07-05 10:19:13 -07:00
Ryan Nowak a23307e2b1 Check for properties that can't befound
If you give ModelExpressionProvider a lambda with a private property
you'll end up here. This wasn't common before, but it seems like users
are more likely to try it with pages.

Model Metadata and Model Binding don't handle private properties, so
supporting it in Model Expressions seems less than useful.

This isn't a breaking change because this case would have resulted in a
null-ref. Addresses #6400
2017-07-04 13:26:17 -07:00
Doug Bunting 293ac81fe1 Use ordinal comparisons in `ExpressionTextCache`
- #6349
- C# field and property names are case-sensitive
  - it's not important (where this cache is used) that HTML field names are case-insenstive
2017-06-29 14:59:06 -07:00
Nate McMaster 12ea28af5c React to API change in HttpAbstractions 2017-06-27 17:33:46 -07:00
Ryan Nowak dfe04bc917 Fix #5979 - Remove hardcoding of tempdata for pages 2017-06-12 15:05:36 -07:00
Ryan Brandenburg 03404cd3df Return to NetStandard 2017-05-25 10:34:16 -07:00
Ryan Nowak 2992f8e38a Separate PageContext and ViewContext
This change decouples PageContext and ViewContext completely.
2017-05-24 16:01:52 -07:00
Jass Bagga 9d38e2523c Add methods to TagBuilder (#6287)
Addresses #5689
2017-05-19 12:23:16 -07:00
Jass Bagga 51c142ae91 Modify GetProperties overload (#6276)
Addresses https://github.com/aspnet/Common/issues/219
2017-05-16 13:34:14 -07:00
Nate McMaster d70bfdd1ea Upgrade test framework versions and fix test issues 2017-05-15 14:11:27 -07:00
Jass Bagga b758a86a38 Modify ViewComponent_CannotFindComponent error message (#6263) 2017-05-12 14:15:29 -07:00
Pranav K 1c5e417606 Change TFM to netcoreapp2.0 (#6234)
* Change TFM to netcoreapp2.0
2017-05-04 18:11:26 -07:00
Doug Bunting cacee2a837 Break fix: Undo part of 141b637
- affected test using a test factory for `HttpResponseStreamWriter`s
2017-04-23 21:48:42 -07:00
Doug Bunting 141b637d20 Bump `MemoryPoolHttpResponseStreamWriter` buffer size up to 16K `char`s
- #3516
- fix tests that relied on otherwise-unused `HttpResponseStreamWriter.DefaultBufferSize`
2017-04-23 16:15:58 -07:00
Kiran Challa f4d84f50cd Upgrading Moq to 4.7.1 2017-04-20 17:07:50 -07:00