[automated] Merge branch 'release/3.0-preview6' => 'master' (#10936)

This commit is contained in:
Nate McMaster 2019-06-07 11:21:00 -07:00 committed by GitHub
commit 4300f498c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 17 deletions

View File

@ -14941,9 +14941,19 @@ function enableNavigationInterception() {
function navigateTo(uri, forceLoad) {
var absoluteUri = toAbsoluteUri(uri);
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
// It's an internal URL, so do client-side navigation
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 {
// It's either an external URL, or forceLoad is requested, so do a full page load
location.href = uri;
}
}

View File

@ -2507,9 +2507,19 @@ function enableNavigationInterception() {
function navigateTo(uri, forceLoad) {
var absoluteUri = toAbsoluteUri(uri);
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
// It's an internal URL, so do client-side navigation
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 {
// It's either an external URL, or forceLoad is requested, so do a full page load
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

View File

@ -65,8 +65,17 @@ export function navigateTo(uri: string, forceLoad: boolean) {
const absoluteUri = toAbsoluteUri(uri);
if (!forceLoad && isWithinBaseUriSpace(absoluteUri)) {
// It's an internal URL, so do client-side navigation
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 {
// It's either an external URL, or forceLoad is requested, so do a full page load
location.href = uri;
}
}

View File

@ -301,6 +301,30 @@ namespace Microsoft.AspNetCore.Components.E2ETest.Tests
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]
public void CanNavigateProgrammatically()
{

View File

@ -8,7 +8,6 @@
SuppressOptionsUI="yes"
ThemeFile="thm.xml"
LocalizationFile="thm.wxl"/>
<PayloadGroupRef Id="PG_Resources"/>
</BootstrapperApplicationRef>
<!-- Ensure upgrades from 3.0.0 preview 1, 2, and 3. Conditioned for the 3.0.0 family. -->
@ -24,12 +23,6 @@
<?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 -->
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />

View File

@ -9,7 +9,6 @@
SuppressOptionsUI="yes"
ThemeFile="thm.xml"
LocalizationFile="thm.wxl"/>
<PayloadGroupRef Id="PG_Resources"/>
</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
@ -19,13 +18,6 @@
<RelatedBundle Action="Upgrade" Id="{EA47395A-BC9B-3ECC-8229-229BC9528DF6}"/>
<?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 -->
<Log Prefix="dd_$(var.BundleLogPrefix)_" Extension=".log" />
<OptionalUpdateRegistration Manufacturer="$(var.BundleRegManufacturer)" ProductFamily="$(var.BundleRegFamily)" Name="$(var.BundleRegName)" />