Got most of admin panel working. Data issues fixed

This commit is contained in:
Vincent Allen
2025-09-02 09:27:23 -04:00
parent 3d82040e75
commit b2835f65c0
401 changed files with 10478 additions and 10675 deletions

View File

@@ -2,7 +2,8 @@
@using System.ComponentModel.DataAnnotations
@using Microsoft.AspNetCore.Identity
@using OpenArchival.Blazor.Data
@using MyAppName.WebApp.Components.Account
@using OpenArchival.DataAccess
@inject UserManager<ApplicationUser> UserManager
@inject SignInManager<ApplicationUser> SignInManager
@@ -12,31 +13,31 @@
<PageTitle>Delete Personal Data</PageTitle>
<MudText Typo="Typo.h6" GutterBottom="true">Delete personal data</MudText>
<StatusMessage Message="@message" />
<MudAlert Severity="Severity.Error" Variant="Variant.Text">
Deleting this data will permanently remove your account, and this cannot be recovered.
</MudAlert>
<h3>Delete Personal Data</h3>
<EditForm Model="Input" FormName="delete-user" OnValidSubmit="OnValidSubmitAsync" method="post">
<DataAnnotationsValidator />
<div class="alert alert-warning" role="alert">
<p>
<strong>Deleting this data will permanently remove your account, and this cannot be recovered.</strong>
</p>
</div>
<MudGrid>
<div>
<EditForm Model="Input" FormName="delete-user" OnValidSubmit="OnValidSubmitAsync" method="post">
<DataAnnotationsValidator />
<ValidationSummary class="text-danger" role="alert" />
@if (requirePassword)
{
<MudItem md="12">
<MudTextField For="@(() => Input.Password)" @bind-Value="Input.Password" InputType="InputType.Password"
Label="Password" Placeholder="password" HelperText="Please enter your new password."
UserAttributes="@(new() { { "autocomplete", "current-password" }, { "aria-required", "true" } } )" />
</MudItem>
<div class="form-floating mb-3">
<InputText type="password" @bind-Value="Input.Password" id="Input.Password" class="form-control" autocomplete="current-password" aria-required="true" placeholder="Please enter your password." />
<label for="Input.Password" class="form-label">Password</label>
<ValidationMessage For="() => Input.Password" class="text-danger" />
</div>
}
<MudItem md="12">
<MudStaticButton Variant="Variant.Filled" Color="Color.Primary" FullWidth="true" FormAction="FormAction.Submit">Delete data and close my account</MudStaticButton>
</MudItem>
</MudGrid>
</EditForm>
<button class="w-100 btn btn-lg btn-danger" type="submit">Delete data and close my account</button>
</EditForm>
</div>
@code {
private string? message;