Skip to content

[automated] Merge branch 'release/6.0-rc1' => 'release/6.0' #35646

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/docker/bionic.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM microsoft/dotnet:2.1-runtime-deps-bionic
FROM mcr.microsoft.com/dotnet/runtime-deps:2.1-bionic

ARG USER
ARG USER_ID
Expand Down
62 changes: 62 additions & 0 deletions src/Components/Components/src/NavigationManagerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public static class NavigationManagerExtensions
[typeof(string)] = value => Format((string)value)!,
[typeof(bool)] = value => Format((bool)value),
[typeof(DateTime)] = value => Format((DateTime)value),
[typeof(DateOnly)] = value => Format((DateOnly)value),
[typeof(TimeOnly)] = value => Format((TimeOnly)value),
[typeof(decimal)] = value => Format((decimal)value),
[typeof(double)] = value => Format((double)value),
[typeof(float)] = value => Format((float)value),
Expand All @@ -51,6 +53,18 @@ private static string Format(DateTime value)
private static string? Format(DateTime? value)
=> value?.ToString(CultureInfo.InvariantCulture);

private static string Format(DateOnly value)
=> value.ToString(CultureInfo.InvariantCulture);

private static string? Format(DateOnly? value)
=> value?.ToString(CultureInfo.InvariantCulture);

private static string Format(TimeOnly value)
=> value.ToString(CultureInfo.InvariantCulture);

private static string? Format(TimeOnly? value)
=> value?.ToString(CultureInfo.InvariantCulture);

private static string Format(decimal value)
=> value.ToString(CultureInfo.InvariantCulture);

Expand Down Expand Up @@ -289,6 +303,54 @@ public static string GetUriWithQueryParameter(this NavigationManager navigationM
public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, DateTime? value)
=> GetUriWithQueryParameter(navigationManager, name, Format(value));

/// <summary>
/// Returns a URI that is constructed by updating <see cref="NavigationManager.Uri"/> with a single parameter
/// added or updated.
/// </summary>
/// <param name="navigationManager">The <see cref="NavigationManager"/>.</param>
/// <param name="name">The name of the parameter to add or update.</param>
/// <param name="value">The value of the parameter to add or update.</param>
public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, DateOnly value)
=> GetUriWithQueryParameter(navigationManager, name, Format(value));

/// <summary>
/// Returns a URI that is constructed by updating <see cref="NavigationManager.Uri"/> with a single parameter
/// added, updated, or removed.
/// </summary>
/// <param name="navigationManager">The <see cref="NavigationManager"/>.</param>
/// <param name="name">The name of the parameter to add or update.</param>
/// <param name="value">The value of the parameter to add or update.</param>
/// <remarks>
/// If <paramref name="value"/> is <c>null</c>, the parameter will be removed if it exists in the URI.
/// Otherwise, it will be added or updated.
/// </remarks>
public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, DateOnly? value)
=> GetUriWithQueryParameter(navigationManager, name, Format(value));

/// <summary>
/// Returns a URI that is constructed by updating <see cref="NavigationManager.Uri"/> with a single parameter
/// added or updated.
/// </summary>
/// <param name="navigationManager">The <see cref="NavigationManager"/>.</param>
/// <param name="name">The name of the parameter to add or update.</param>
/// <param name="value">The value of the parameter to add or update.</param>
public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, TimeOnly value)
=> GetUriWithQueryParameter(navigationManager, name, Format(value));

/// <summary>
/// Returns a URI that is constructed by updating <see cref="NavigationManager.Uri"/> with a single parameter
/// added, updated, or removed.
/// </summary>
/// <param name="navigationManager">The <see cref="NavigationManager"/>.</param>
/// <param name="name">The name of the parameter to add or update.</param>
/// <param name="value">The value of the parameter to add or update.</param>
/// <remarks>
/// If <paramref name="value"/> is <c>null</c>, the parameter will be removed if it exists in the URI.
/// Otherwise, it will be added or updated.
/// </remarks>
public static string GetUriWithQueryParameter(this NavigationManager navigationManager, string name, TimeOnly? value)
=> GetUriWithQueryParameter(navigationManager, name, Format(value));

/// <summary>
/// Returns a URI that is constructed by updating <see cref="NavigationManager.Uri"/> with a single parameter
/// added or updated.
Expand Down
4 changes: 4 additions & 0 deletions src/Components/Components/src/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ static Microsoft.AspNetCore.Components.EventCallbackFactoryBinderExtensions.Crea
static Microsoft.AspNetCore.Components.EventCallbackFactoryBinderExtensions.CreateBinder(this Microsoft.AspNetCore.Components.EventCallbackFactory! factory, object! receiver, System.Action<System.TimeOnly?>! setter, System.TimeOnly? existingValue, string! format, System.Globalization.CultureInfo? culture = null) -> Microsoft.AspNetCore.Components.EventCallback<Microsoft.AspNetCore.Components.ChangeEventArgs!>
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.DateTime value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.DateTime? value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.DateOnly value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.DateOnly? value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.TimeOnly value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.TimeOnly? value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.Guid value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, System.Guid? value) -> string!
static Microsoft.AspNetCore.Components.NavigationManagerExtensions.GetUriWithQueryParameter(this Microsoft.AspNetCore.Components.NavigationManager! navigationManager, string! name, bool value) -> string!
Expand Down
10 changes: 10 additions & 0 deletions src/Components/Components/src/Routing/UrlValueConstraint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ private static bool TryParse(ReadOnlySpan<char> str, out string result)
private static bool TryParse(ReadOnlySpan<char> str, out DateTime result)
=> DateTime.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);

private static bool TryParse(ReadOnlySpan<char> str, out DateOnly result)
=> DateOnly.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);

private static bool TryParse(ReadOnlySpan<char> str, out TimeOnly result)
=> TimeOnly.TryParse(str, CultureInfo.InvariantCulture, DateTimeStyles.None, out result);

private static bool TryParse(ReadOnlySpan<char> str, out decimal result)
=> decimal.TryParse(str, NumberStyles.Number, CultureInfo.InvariantCulture, out result);

Expand All @@ -65,6 +71,10 @@ private static bool TryParse(ReadOnlySpan<char> str, out long result)
var x when x == typeof(bool?) => new NullableTypedUrlValueConstraint<bool>(bool.TryParse),
var x when x == typeof(DateTime) => new TypedUrlValueConstraint<DateTime>(TryParse),
var x when x == typeof(DateTime?) => new NullableTypedUrlValueConstraint<DateTime>(TryParse),
var x when x == typeof(DateOnly) => new TypedUrlValueConstraint<DateOnly>(TryParse),
var x when x == typeof(DateOnly?) => new NullableTypedUrlValueConstraint<DateOnly>(TryParse),
var x when x == typeof(TimeOnly) => new TypedUrlValueConstraint<TimeOnly>(TryParse),
var x when x == typeof(TimeOnly?) => new NullableTypedUrlValueConstraint<TimeOnly>(TryParse),
var x when x == typeof(decimal) => new TypedUrlValueConstraint<decimal>(TryParse),
var x when x == typeof(decimal?) => new NullableTypedUrlValueConstraint<decimal>(TryParse),
var x when x == typeof(double) => new TypedUrlValueConstraint<double>(TryParse),
Expand Down
2 changes: 1 addition & 1 deletion src/Components/Web.JS/dist/Release/blazor.server.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public async Task ReloadingThePage_GracefullyDisconnects_TheCurrentCircuit()
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);

// Assert
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

[Fact]
Expand All @@ -76,8 +76,8 @@ public async Task ClosingTheBrowserWindow_GracefullyDisconnects_TheCurrentCircui

// Assert
Assert.True(GracefulDisconnectCompletionSource.Task.IsCompletedSuccessfully);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

[Fact]
Expand All @@ -90,8 +90,8 @@ public async Task ClosingTheBrowserWindow_GracefullyDisconnects_WhenNavigatingAw

// Assert
Assert.Equal(GracefulDisconnectCompletionSource.Task, task);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.Contains((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

[Fact]
Expand All @@ -103,8 +103,8 @@ public async Task NavigatingToProtocolLink_DoesNotGracefullyDisconnect_TheCurren
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);

// Assert
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

[Fact]
Expand All @@ -116,8 +116,8 @@ public async Task DownloadAction_DoesNotGracefullyDisconnect_TheCurrentCircuit()
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);

// Assert
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

[Fact]
Expand All @@ -129,8 +129,8 @@ public async Task DownloadHref_DoesNotGracefullyDisconnect_TheCurrentCircuit()
await Task.WhenAny(Task.Delay(10000), GracefulDisconnectCompletionSource.Task);

// Assert
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages);
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitTerminatedGracefully"), Messages.ToArray());
Assert.DoesNotContain((Extensions.Logging.LogLevel.Debug, "CircuitDisconnectedPermanently"), Messages.ToArray());
}

private void Log(WriteContext wc)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ public void CanFocusDuringOnAfterRenderAsyncWithFocusInEvent(string triggerButto
Browser.Equal("focus-input-onafterrender", () => Browser.SwitchTo().ActiveElement().GetAttribute("id"));

// As well as actually focusing and triggering the onfocusin event, we should not be seeing any errors
var log = Browser.Manage().Logs.GetLog(LogType.Browser);
var log = Browser.Manage().Logs.GetLog(LogType.Browser).ToArray();
Assert.DoesNotContain(log, entry => entry.Level == LogLevel.Severe);
}

Expand Down
Loading