This commit is contained in:
2026-05-17 20:54:09 -04:00
parent 6da2183583
commit 74c21ee5cc
3000 changed files with 11794 additions and 15301 deletions

View File

@@ -26,7 +26,7 @@
Label="Password"
HelperText="Choose a strong password"
InputType="InputType.Password"
Validation="@(new Func<string, IEnumerable<string>>(PasswordStrength))" Required="true"
Validation="@(new Func<string, IEnumerable<string>>(PasswordStrength))" Required="!IsUpdate"
RequiredError="Password is required!" />
<MudTextField T="string"
@@ -54,7 +54,16 @@
Color="Color.Primary"
Disabled="@(!_isFormValid)"
Class="ml-auto"
OnClick="@(OnRegister)">Register</MudButton>
OnClick="@(OnRegister)">
@if (IsUpdate)
{
<MudText Typo="Typo.button">Update</MudText>
} else
{
<MudText Typo="Typo.button">Register</MudText>
}
</MudButton>
</DialogActions>
</MudDialog>
@@ -72,9 +81,16 @@
private bool _isFormValid { get; set; } = false;
private static IEnumerable<string> PasswordStrength(string pw)
private IEnumerable<string> PasswordStrength(string pw)
{
if (string.IsNullOrWhiteSpace(pw))
// Do not require the password be entered on an update, we could be changing just the roles or email
if (IsUpdate && string.IsNullOrWhiteSpace(Model.Password))
{
yield return "";
yield break;
}
if (string.IsNullOrWhiteSpace(pw) && !IsUpdate)
{
yield return "Password is required!";
yield break;