From f8399fb92c558a3a8a9c4928a96c5327a64fb1f8 Mon Sep 17 00:00:00 2001 From: Sukhvinder Bhullar <129736142+sukhybhullar-nimble@users.noreply.github.com> Date: Thu, 10 Oct 2024 10:16:09 +0100 Subject: [PATCH] Various fixes (#896) Co-authored-by: Sukhvinder Bhullar --- .../Project/BulkEditFileValidatorTests.cs | 2 +- .../Pages/BulkEdit/BulkEditComplete.cshtml | 4 +++- .../Pages/BulkEdit/BulkEditFileUpload.cshtml | 2 +- .../Pages/BulkEdit/BulkEditFileUpload.cshtml.cs | 2 +- .../Services/BulkEdit/BulkEditFileValidator.cs | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.Tests/Project/BulkEditFileValidatorTests.cs b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.Tests/Project/BulkEditFileValidatorTests.cs index 1f988aade..3037a1cfe 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.Tests/Project/BulkEditFileValidatorTests.cs +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects.Tests/Project/BulkEditFileValidatorTests.cs @@ -54,7 +54,7 @@ public void FailsWhenGivenUnsupportedColumn() var result = validator.Validate(table); result.IsValid.Should().BeFalse(); - result.ErrorMessage.Should().Be("File has a invalid column header: LocalPlace"); + result.ErrorMessage.Should().Be("File has an invalid column header: LocalPlace"); } } } diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditComplete.cshtml b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditComplete.cshtml index 697e3579a..9a4ba60cc 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditComplete.cshtml +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditComplete.cshtml @@ -2,6 +2,8 @@ @model Dfe.ManageFreeSchoolProjects.Pages.BulkEdit.BulkEditCompleteModel @{ ViewData["Title"] = "Confirmation"; + var plural = Model.Count > 1 ? "s" : ""; + var confirmationMessage = Model.Count + $" free school project{plural} edited"; } @@ -10,7 +12,7 @@

- @Model.Count free school projects edited + @confirmationMessage

diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml index c5c897d52..fdc85196d 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml @@ -15,7 +15,7 @@ } -@if (Model.Rows == null || Model.Rows.Any() || Model.HasErrors) +@if (Model.Rows == null || (Model.Rows.Any() && Model.HasErrors)) { @if (@Model.FileError != null) { diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml.cs b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml.cs index 15bcba3fb..3976a7711 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml.cs +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Pages/BulkEdit/BulkEditFileUpload.cshtml.cs @@ -118,7 +118,7 @@ public async Task OnPostAsync() else { var errorCount = Rows.Count(x => x.Cells.Any(y => !string.IsNullOrEmpty(y.Error))); - FileError = $"The upload tab has {errorCount} validation errors"; + FileError = $"The enter data tab has {errorCount} validation errors"; SetToUpdateMultipleFields(); } } diff --git a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Services/BulkEdit/BulkEditFileValidator.cs b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Services/BulkEdit/BulkEditFileValidator.cs index 94d46cf1b..2f3ee05ba 100644 --- a/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Services/BulkEdit/BulkEditFileValidator.cs +++ b/Dfe.ManageFreeSchoolProjects/Dfe.ManageFreeSchoolProjects/Services/BulkEdit/BulkEditFileValidator.cs @@ -37,7 +37,7 @@ public FileValidationResult Validate(DataTable table) return new FileValidationResult { IsValid = false, - ErrorMessage = $"File has a invalid column header: {column.ColumnName}" + ErrorMessage = $"File has an invalid column header: {column.ColumnName}" }; } }