Skip to content

Commit

Permalink
Following code style guideline
Browse files Browse the repository at this point in the history
  • Loading branch information
joao4all committed Oct 4, 2023
1 parent 54e9c8a commit 1f13936
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
34 changes: 19 additions & 15 deletions COMET.Web.Common/Components/Login.razor
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,27 @@
<!-- <ValidationSummary/> -->

<ul class="validation-errors">
@foreach (var kvp in this.FieldsFocusedStatus)
@foreach (var fieldFocusedStatus in this.FieldsFocusedStatus)
{
if (kvp.Value) continue;
if (fieldFocusedStatus.Value)
{
continue;
}

@if (kvp.Key == "SourceAddress" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.SourceAddress).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.SourceAddress" /></li>
}
@if (kvp.Key == "UserName" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.UserName).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.UserName" /></li>
}
@if (kvp.Key == "Password" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.Password).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.Password" /></li>
}

@if (fieldFocusedStatus.Key == "SourceAddress" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.SourceAddress).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.SourceAddress" /></li>
}

@if (fieldFocusedStatus.Key == "UserName" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.UserName).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.UserName" /></li>
}

@if (fieldFocusedStatus.Key == "Password" && !string.IsNullOrEmpty(editFormContext.GetValidationMessages(() => this.ViewModel.AuthenticationDto.Password).FirstOrDefault()))
{
<li class="validation-message"><ValidationMessage For="() => this.ViewModel.AuthenticationDto.Password" /></li>
}
}
</ul>

Expand Down
1 change: 0 additions & 1 deletion COMET.Web.Common/Components/Login.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ public partial class Login
/// </summary>
public Dictionary<string, bool> FieldsFocusedStatus;


/// <summary>
/// Method invoked when the component is ready to start, having received its
/// initial parameters from its parent in the render tree.
Expand Down

0 comments on commit 1f13936

Please sign in to comment.