- #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
- #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`).
- Updated `ScriptTagHelper` and `LinkTagHelper` to maintain their quotes on generated script tags.
- Removed `TagHelperOutputExtensions`. It's no longer needed.
- We no longer string replace quotes directly. We rely on encoding and the initial representation of an attribute to ensure quotes don't break generated attributes.
- Updated tests.
- relates to #4445
- also relates to #4309 / fb07fee though restored and renamed files are slightly different
- latest Unobtrusive version; copy just one file under `wwwroot`
- add JavaScript file and CDN links to enable manual testing of `[Remote]` tests in `BasicWebSite`
- include renamed files for recreating the minimized JavaScript file manually
- intent was to make HTML helper output close to the tag helper output but source got over-complicated
- the output files for `Order.cshtml` and `OrderUsingHtmlHelpers.cshtml` now differ only in attribute order
- i.e. HTML helpers output attribute alphabetically while tag helpers output them in order added
- #4116
- generalize rules for `ModelMetadata` creation; minimize metadata changes when Model is updated
- down to a single special case in VDD for `Nullable<T>`
- note existing functional tests did not need to change
- remove `ViewDataDictionary(ViewDataDictionary, object)` constructor; use `new VDD<object>(source, model)`
- allow all `Model` assignments in a view component
- copy-constructed VDD in `ViewComponentContext` previously preserved the source's declared type
nits:
- do not call `virtual SetModel()` method from constructor; now mostly redundant
- logic in copy constructor and `SetModel()` is consistent but different enough to keep code separate
- add some missing doc comments
- fix doc comment property versus type confusion; never need to specify `ViewDataDictionary.` prefix
- fix a few `TemplateBuilder` comments and remove unnecessary `model: null` argument to VDD constructor
- #4083
- `<link>` tag helper did not HTML encode `href` values in fallback elements
- `<script>` tag helper did not correctly encode any attribute value in fallback elements
- e.g. double quotes in literal strings would slip through
- only needed to change one existing unit test (!!); so added a bunch
nit: use `Process()`, not `ProcessAsync()` in `<script>` tag helper tests
- Modified `UrlResolutionTagHelper` to utilize new CSS selector attributes to restrict when it applies. It now only appies to tags that have their values starting with `~/`.
- `UrlResolutionTagHelper` no longer applies to dynamic content such as `href="@SomethingResultingInTildaSlash"`.
- Updated tests to reflect new behavior.
- This bit was missed when changing the `ViewComponent` invocation pattern resulting in the inability to invoke `ViewComponent`s with arguments in a `Controller`.
#4004
- have one test muted at the moment in our CI
- add `Reset()` action to the service, enabling `// Arrange` to bring `Index()` content to a known state
- add a couple more tests to `TagHelperSampleTest` covering the new action and empty `Index()` list
nits:
- use `ViewData`, not `ViewBag`