Skip to content

Update to bootstrap5 #34052

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
merged 52 commits into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
74fb38c
updated Razor MVC Blazor server and Blazor WASM
Mryam1 Jun 15, 2021
99084f7
updated bootstrap5 in MVC, Razor, Blazor Server, Blazor WASM
Mryam1 Jun 15, 2021
397c396
I have added V5 for bootstarp5 and updated layout
Mryam1 Jun 17, 2021
ce27305
V4 -> V5 namespaces
HaoK Jul 3, 2021
2997c2e
Fix public api
HaoK Jul 3, 2021
fe06d3d
Add back bootstrap version tests
HaoK Jul 5, 2021
25b2f22
Add customhive/disable-sdk template notes
HaoK Jul 6, 2021
0319449
Update README.md
HaoK Jul 6, 2021
e7f858b
Check all the links
HaoK Jul 6, 2021
d1854e1
Update layout to use v5 bootstrap cdn
HaoK Jul 7, 2021
4171196
Update _ViewImports.cshtml
HaoK Jul 7, 2021
6c8e0b7
Update _Layout.cshtml
HaoK Jul 7, 2021
799f4d1
Update _ViewImports.cshtml
HaoK Jul 7, 2021
aa92bc7
Update site.css
HaoK Jul 7, 2021
e7d9e33
Update Bootstrap4AuthorizationTests.cs
HaoK Jul 7, 2021
70b9121
Update Bootstrap4ManagementTests.cs
HaoK Jul 7, 2021
e7be661
Update Bootstrap4ManagementTests.cs
HaoK Jul 7, 2021
2e2e5fd
Update Bootstrap4AuthorizationTests.cs
HaoK Jul 7, 2021
051e33c
Update Bootstrap4UserLoginTests.cs
HaoK Jul 7, 2021
4c38581
Update Bootstrap4RegistrationTests.cs
HaoK Jul 7, 2021
d99231e
Update AspNetProcess.cs
HaoK Jul 7, 2021
57e3bd8
Update _Layout.cshtml
HaoK Jul 7, 2021
5399467
Update Run-Razor-Locally.ps1
HaoK Jul 7, 2021
0203a58
Update Run-Starterweb-Locally.ps1
HaoK Jul 7, 2021
00db6ad
Remove scripts/webapp
HaoK Jul 7, 2021
b8813ed
Update Microsoft.AspNetCore.Identity.UI.csproj
HaoK Jul 7, 2021
bce870d
Undo changes
HaoK Jul 7, 2021
3389e70
Fix build
HaoK Jul 7, 2021
42f7aa1
Update ResetAuthenticator.cshtml.cs
HaoK Jul 12, 2021
de819a0
Delete blazorserver.styles.css
HaoK Jul 13, 2021
412e5a7
Fix some differences in samples/tets
HaoK Jul 13, 2021
4cafd92
Remove failing test for now
HaoK Jul 19, 2021
e79a820
Update NavMenu.razor.css
HaoK Jul 20, 2021
6dfb055
Fix samples and cleanup
HaoK Jul 21, 2021
6b2c765
Tweak layout to fix hamburger
HaoK Jul 22, 2021
c4fa5e8
Fix layouts for hamburger
HaoK Jul 22, 2021
bb9a723
Update site.css
HaoK Jul 22, 2021
d798a59
Fix templates test
HaoK Jul 23, 2021
3f1e466
Update _Layout.cshtml
HaoK Jul 23, 2021
f7ba454
Fix headers
HaoK Jul 26, 2021
09bb156
Fix things and undo css changes
HaoK Aug 2, 2021
52f32d4
Undo more changes
HaoK Aug 2, 2021
462a33a
Fix alert
HaoK Aug 2, 2021
56e3787
Update nav menu and fix outline
HaoK Aug 3, 2021
4381027
Move bootstrap5 to wwwroot
HaoK Aug 3, 2021
f5371ee
Fix functionals
HaoK Aug 3, 2021
8358fef
Move license for tests
HaoK Aug 3, 2021
e233e63
Update bootstrap 5.0.0 -> 5.0.2
HaoK Aug 3, 2021
68cfb01
Revert test changes
HaoK Aug 3, 2021
ca5edf1
Update template baselines
HaoK Aug 4, 2021
d8ad127
Update IdentityUIPackageTest.cs
HaoK Aug 4, 2021
c3ad7b2
Update IdentityUIPackageTest.cs
HaoK Aug 4, 2021
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
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@page
@model AccessDeniedModel
@{
ViewData["Title"] = "Access denied";
}

<header>
<h1 class="text-danger">@ViewData["Title"]</h1>
<p class="text-danger">You do not have access to this resource.</p>
</header>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.AspNetCore.Mvc.RazorPages;

namespace Microsoft.AspNetCore.Identity.UI.V5.Pages.Account.Internal
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public class AccessDeniedModel : PageModel
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public void OnGet()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page
@model ConfirmEmailModel
@{
ViewData["Title"] = "Confirm email";
}

<h1>@ViewData["Title"]</h1>
<partial name="_StatusMessage" model="Model.StatusMessage" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;

namespace Microsoft.AspNetCore.Identity.UI.V5.Pages.Account.Internal
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[AllowAnonymous]
[IdentityDefaultUI(typeof(ConfirmEmailModel<>))]
public abstract class ConfirmEmailModel : PageModel
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[TempData]
public string StatusMessage { get; set; }

/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual Task<IActionResult> OnGetAsync(string userId, string code) => throw new NotImplementedException();
}

internal class ConfirmEmailModel<TUser> : ConfirmEmailModel where TUser : class
{
private readonly UserManager<TUser> _userManager;

public ConfirmEmailModel(UserManager<TUser> userManager)
{
_userManager = userManager;
}

public override async Task<IActionResult> OnGetAsync(string userId, string code)
{
if (userId == null || code == null)
{
return RedirectToPage("/Index");
}

var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}

code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ConfirmEmailAsync(user, code);
StatusMessage = result.Succeeded ? "Thank you for confirming your email." : "Error confirming your email.";
return Page();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@page
@model ConfirmEmailChangeModel
@{
ViewData["Title"] = "Confirm email change";
}

<h1>@ViewData["Title"]</h1>
<partial name="_StatusMessage" model="Model.StatusMessage" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.WebUtilities;

namespace Microsoft.AspNetCore.Identity.UI.V5.Pages.Account.Internal
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[AllowAnonymous]
[IdentityDefaultUI(typeof(ConfirmEmailChangeModel<>))]
public abstract class ConfirmEmailChangeModel : PageModel
{
/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
[TempData]
public string StatusMessage { get; set; }

/// <summary>
/// This API supports the ASP.NET Core Identity default UI infrastructure and is not intended to be used
/// directly from your code. This API may change or be removed in future releases.
/// </summary>
public virtual Task<IActionResult> OnGetAsync(string userId, string email, string code) => throw new NotImplementedException();
}

internal class ConfirmEmailChangeModel<TUser> : ConfirmEmailChangeModel where TUser : class
{
private readonly UserManager<TUser> _userManager;
private readonly SignInManager<TUser> _signInManager;

public ConfirmEmailChangeModel(UserManager<TUser> userManager, SignInManager<TUser> signInManager)
{
_userManager = userManager;
_signInManager = signInManager;
}

public override async Task<IActionResult> OnGetAsync(string userId, string email, string code)
{
if (userId == null || email == null || code == null)
{
return RedirectToPage("/Index");
}

var user = await _userManager.FindByIdAsync(userId);
if (user == null)
{
return NotFound($"Unable to load user with ID '{userId}'.");
}

code = Encoding.UTF8.GetString(WebEncoders.Base64UrlDecode(code));
var result = await _userManager.ChangeEmailAsync(user, email, code);
if (!result.Succeeded)
{
StatusMessage = "Error changing email.";
return Page();
}

// In our UI email and user name are one and the same, so when we update the email
// we need to update the user name.
var setUserNameResult = await _userManager.SetUserNameAsync(user, email);
if (!setUserNameResult.Succeeded)
{
StatusMessage = "Error changing user name.";
return Page();
}

await _signInManager.RefreshSignInAsync(user);
StatusMessage = "Thank you for confirming your email change.";
return Page();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
@page
@model ExternalLoginModel
@{
ViewData["Title"] = "Register";
}

<h1>@ViewData["Title"]</h1>
<h2 id="external-login-title">Associate your @Model.ProviderDisplayName account.</h2>
<hr />

<p id="external-login-description" class="text-info">
You've successfully authenticated with <strong>@Model.ProviderDisplayName</strong>.
Please enter an email address for this site below and click the Register button to finish
logging in.
</p>

<div class="row">
<div class="col-md-4">
<form asp-page-handler="Confirmation" asp-route-returnUrl="@Model.ReturnUrl" method="post">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<div class="form-group">
<label asp-for="Input.Email"></label>
<input asp-for="Input.Email" class="form-control" autocomplete="email" />
<span asp-validation-for="Input.Email" class="text-danger"></span>
</div>
<button type="submit" class="btn btn-primary">Register</button>
</form>
</div>
</div>

@section Scripts {
<partial name="_ValidationScriptsPartial" />
}
Loading