[automated] Merge branch 'release/3.0-preview6' => 'master' (#10936)
This commit is contained in:
commit
4300f498c7
|
|
@ -14941,9 +14941,19 @@ function enableNavigationInterception() {
|
||||||
function navigateTo(uri, forceLoad) {
|
function navigateTo(uri, forceLoad) {
|
||||||
var absoluteUri = toAbsoluteUri(uri);
|
var absoluteUri = toAbsoluteUri(uri);
|
||||||
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
||||||
|
// It's an internal URL, so do client-side navigation
|
||||||
performInternalNavigation(absoluteUri, false);
|
performInternalNavigation(absoluteUri, false);
|
||||||
}
|
}
|
||||||
|
else if (forceLoad && location.href === uri) {
|
||||||
|
// Force-loading the same URL you're already on requires special handling to avoid
|
||||||
|
// triggering browser-specific behavior issues.
|
||||||
|
// For details about what this fixes and why, see https://github.com/aspnet/AspNetCore/pull/10839
|
||||||
|
var temporaryUri = uri + '?';
|
||||||
|
history.replaceState(null, '', temporaryUri);
|
||||||
|
location.replace(uri);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
// It's either an external URL, or forceLoad is requested, so do a full page load
|
||||||
location.href = uri;
|
location.href = uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2507,9 +2507,19 @@ function enableNavigationInterception() {
|
||||||
function navigateTo(uri, forceLoad) {
|
function navigateTo(uri, forceLoad) {
|
||||||
var absoluteUri = toAbsoluteUri(uri);
|
var absoluteUri = toAbsoluteUri(uri);
|
||||||
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
||||||
|
// It's an internal URL, so do client-side navigation
|
||||||
performInternalNavigation(absoluteUri, false);
|
performInternalNavigation(absoluteUri, false);
|
||||||
}
|
}
|
||||||
|
else if (forceLoad && location.href === uri) {
|
||||||
|
// Force-loading the same URL you're already on requires special handling to avoid
|
||||||
|
// triggering browser-specific behavior issues.
|
||||||
|
// For details about what this fixes and why, see https://github.com/aspnet/AspNetCore/pull/10839
|
||||||
|
var temporaryUri = uri + '?';
|
||||||
|
history.replaceState(null, '', temporaryUri);
|
||||||
|
location.replace(uri);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
// It's either an external URL, or forceLoad is requested, so do a full page load
|
||||||
location.href = uri;
|
location.href = uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -65,8 +65,17 @@ export function navigateTo(uri: string, forceLoad: boolean) {
|
||||||
const absoluteUri = toAbsoluteUri(uri);
|
const absoluteUri = toAbsoluteUri(uri);
|
||||||
|
|
||||||
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
|
||||||
|
// It's an internal URL, so do client-side navigation
|
||||||
performInternalNavigation(absoluteUri, false);
|
performInternalNavigation(absoluteUri, false);
|
||||||
|
} else if (forceLoad && location.href === uri) {
|
||||||
|
// Force-loading the same URL you're already on requires special handling to avoid
|
||||||
|
// triggering browser-specific behavior issues.
|
||||||
|
// For details about what this fixes and why, see https://github.com/aspnet/AspNetCore/pull/10839
|
||||||
|
const temporaryUri = uri + '?';
|
||||||
|
history.replaceState(null, '', temporaryUri);
|
||||||
|
location.replace(uri);
|
||||||
} else {
|
} else {
|
||||||
|
// It's either an external URL, or forceLoad is requested, so do a full page load
|
||||||
location.href = uri;
|
location.href = uri;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -301,6 +301,30 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
|
||||||
Browser.Equal("Not a component!", () => Browser.FindElement(By.Id("test-info")).Text);
|
Browser.Equal("Not a component!", () => Browser.FindElement(By.Id("test-info")).Text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void CanGoBackFromNotAComponent()
|
||||||
|
{
|
||||||
|
SetUrlViaPushState("/");
|
||||||
|
|
||||||
|
// First go to some URL on the router
|
||||||
|
var app = MountTestComponent<TestRouter>();
|
||||||
|
app.FindElement(By.LinkText("Other")).Click();
|
||||||
|
Browser.True(() => Browser.Url.EndsWith("/Other"));
|
||||||
|
|
||||||
|
// Now follow a link out of the SPA entirely
|
||||||
|
app.FindElement(By.LinkText("Not a component")).Click();
|
||||||
|
Browser.Equal("Not a component!", () => Browser.FindElement(By.Id("test-info")).Text);
|
||||||
|
Browser.True(() => Browser.Url.EndsWith("/NotAComponent.html"));
|
||||||
|
|
||||||
|
// Now click back
|
||||||
|
// Because of how the tests are structured with the router not appearing until the router
|
||||||
|
// tests are selected, we can only observe the test selector being there, but this is enough
|
||||||
|
// to show we did go back to the right place and the Blazor app started up
|
||||||
|
Browser.Navigate().Back();
|
||||||
|
Browser.True(() => Browser.Url.EndsWith("/Other"));
|
||||||
|
WaitUntilTestSelectorReady();
|
||||||
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
public void CanNavigateProgrammatically()
|
public void CanNavigateProgrammatically()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@
|
||||||
SuppressOptionsUI="yes"
|
SuppressOptionsUI="yes"
|
||||||
ThemeFile="thm.xml"
|
ThemeFile="thm.xml"
|
||||||
LocalizationFile="thm.wxl"/>
|
LocalizationFile="thm.wxl"/>
|
||||||
<PayloadGroupRef Id="PG_Resources"/>
|
|
||||||
</BootstrapperApplicationRef>
|
</BootstrapperApplicationRef>
|
||||||
|
|
||||||
<!-- Ensure upgrades from 3.0.0 preview 1, 2, and 3. Conditioned for the 3.0.0 family. -->
|
<!-- Ensure upgrades from 3.0.0 preview 1, 2, and 3. Conditioned for the 3.0.0 family. -->
|
||||||
|
|
@ -24,12 +23,6 @@
|
||||||
<?endif?>
|
<?endif?>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
<PayloadGroup Id="PG_Resources">
|
|
||||||
<?foreach lcid in 2052;1028;1029;1031;3082;1036;1040;1041;1042;1045;1046;1049;1055?>
|
|
||||||
<Payload Id="PL_thm_$(var.lcid)" SourceFile="$(var.lcid)\thm.wxl" Name="$(var.lcid)\thm.wxl" Compressed="yes"/>
|
|
||||||
<?endforeach?>
|
|
||||||
</PayloadGroup>
|
|
||||||
|
|
||||||
<!-- Customizations of the default BA -->
|
<!-- Customizations of the default BA -->
|
||||||
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
|
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
|
||||||
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />
|
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@
|
||||||
SuppressOptionsUI="yes"
|
SuppressOptionsUI="yes"
|
||||||
ThemeFile="thm.xml"
|
ThemeFile="thm.xml"
|
||||||
LocalizationFile="thm.wxl"/>
|
LocalizationFile="thm.wxl"/>
|
||||||
<PayloadGroupRef Id="PG_Resources"/>
|
|
||||||
</BootstrapperApplicationRef>
|
</BootstrapperApplicationRef>
|
||||||
|
|
||||||
<!-- Ensure upgrades from 3.0.0 preview 1 and 2 (Preview 3 was not shipped). Conditioned for the 3.0.0 family. Hosting bundle simships x86/x64 so there's
|
<!-- Ensure upgrades from 3.0.0 preview 1 and 2 (Preview 3 was not shipped). Conditioned for the 3.0.0 family. Hosting bundle simships x86/x64 so there's
|
||||||
|
|
@ -19,13 +18,6 @@
|
||||||
<RelatedBundle Action="Upgrade" Id="{EA47395A-BC9B-3ECC-8229-229BC9528DF6}"/>
|
<RelatedBundle Action="Upgrade" Id="{EA47395A-BC9B-3ECC-8229-229BC9528DF6}"/>
|
||||||
<?endif?>
|
<?endif?>
|
||||||
|
|
||||||
<PayloadGroup Id="PG_Resources">
|
|
||||||
<?foreach lcid in 2052;1028;1029;1031;3082;1036;1040;1041;1042;1045;1046;1049;1055?>
|
|
||||||
<Payload Id="PL_thm_$(var.lcid)" SourceFile="$(var.lcid)\thm.wxl" Name="$(var.lcid)\thm.wxl" Compressed="yes"/>
|
|
||||||
<Payload Id="PL_Strings_$(var.lcid)" SourceFile="$(var.lcid)\Strings.wxl" Name="$(var.lcid)\Strings.wxl" Compressed="yes"/>
|
|
||||||
<?endforeach?>
|
|
||||||
</PayloadGroup>
|
|
||||||
|
|
||||||
<!-- Customizations of the default BA -->
|
<!-- Customizations of the default BA -->
|
||||||
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
|
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
|
||||||
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />
|
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue