Skip to content

Commit

Permalink
Fix for submit bed request, Bed Brigade Near Me Images, Admin Clear C…
Browse files Browse the repository at this point in the history
…ache
  • Loading branch information
GregFinzer committed Nov 14, 2024
1 parent 0284fc2 commit 50e9476
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@page "/administration/admin/serverinfo"
@layout Layout.AdminLayout
@page "/administration/admin/serverinfo"

@using System;
@using System.Diagnostics;
Expand Down Expand Up @@ -56,6 +57,10 @@
</tbody>
</table>

<h3 class="mb-4">Clear Cache</h3>
<p>Click the button below to clear the cache.</p>
<button class="btn btn-primary" @onclick="ClearCache">Clear Cache</button>

@code {
private string ProcessorArchitecture { get; set; }
private string ProcessorName { get; set; }
Expand All @@ -65,6 +70,8 @@
private double FreeMemory { get; set; }
private float CpuUtilization { get; set; }
private string Timezone { get; set; }
[Inject] private ICachingService _cachingService { get; set; }
[Inject] private ToastService _toastService { get; set; }

protected override void OnInitialized()
{
Expand Down Expand Up @@ -152,4 +159,12 @@
}

}

private Task ClearCache()
{
_cachingService.ClearAll();
_toastService.Success("Cache Cleared", "The cache has been cleared.");
return Task.CompletedTask;
}

}
1 change: 1 addition & 0 deletions BedBrigade.Client/Components/Pages/BedBrigadeNearMe.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/bed-brigade-near-me"

<PageTitle>@($"{_lc.Keys["TheBedBrigade"]} | {_lc.Keys["FindABedBrigade"]}")</PageTitle>
<RotatorContainer RotatorTitle="@_lc.Keys["FindABedBrigade"]" ImagePath="pages/BedBrigadeNearMe" LocationId="1" />
<SearchLocation Title="@_lc.Keys["FindABedBrigade"]" />

@code {
Expand Down
10 changes: 10 additions & 0 deletions BedBrigade.Client/Components/Pages/BedRequest.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,16 @@ private async Task<bool> IsValid()
return false;
}

if (newRequest.PrimaryLanguage != "English")
{
if (string.IsNullOrEmpty(newRequest.SpeakEnglish))
{
_validationMessageStore.Add(new FieldIdentifier(newRequest, nameof(newRequest.SpeakEnglish)), _lc.Keys["RequiredSpeakEnglish"]);
await ShowValidationMessage(_lc.Keys["BedRequestFormNotCompleted"]);
return false;
}
}

bool isPhoneValid = Validation.IsValidPhoneNumber(newRequest.Phone);

if (!isPhoneValid)
Expand Down
2 changes: 1 addition & 1 deletion BedBrigade.Common/Models/NewBedRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public class NewBedRequest
[Required(ErrorMessage = "Please select your Primary Language")]
public string PrimaryLanguage { get; set; } = string.Empty;

[Required(ErrorMessage = "Please select your English ability level")]

public string SpeakEnglish { get; set; } = string.Empty;


Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 50e9476

Please sign in to comment.