From b642af88c79211c7910f33b2e150a2dcf3632f54 Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:06:00 +0000 Subject: [PATCH 1/6] update project list view --- .../Models/AcademyConversionProject.cs | 1 + .../Pages/ProjectList/Index.cshtml | 17 +---- .../Shared/FormAMatProjectListRow.cshtml | 39 ------------ .../Shared/SponsoredProjectListRow.cshtml | 46 -------------- .../Shared/VoluntaryProjectListRow.cshtml | 45 ------------- .../Pages/Shared/_ProjectListRows.cshtml | 63 +++++++++++++++++++ .../Utils/ProjectListHelper.cs | 3 +- .../ViewModels/ProjectListViewModel.cs | 1 + 8 files changed, 68 insertions(+), 147 deletions(-) delete mode 100644 Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/FormAMatProjectListRow.cshtml delete mode 100644 Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/SponsoredProjectListRow.cshtml delete mode 100644 Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/VoluntaryProjectListRow.cshtml create mode 100644 Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Models/AcademyConversionProject.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Models/AcademyConversionProject.cs index 2cc9d77e9..df5cba080 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Models/AcademyConversionProject.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions.Data/Models/AcademyConversionProject.cs @@ -49,6 +49,7 @@ public class AcademyConversionProject public string ConversionSupportGrantEnvironmentalImprovementGrant { get; set; } public bool? ConversionSupportGrantAmountChanged { get; set; } public DateTime? DaoPackSentDate { get; set; } + public string Region { get; set; } // Annex B public bool? AnnexBFormReceived { get; set; } diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml index 4a70c624c..3ee232b4c 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml @@ -51,24 +51,9 @@ - - - - - - - @{ - var index = 0; - foreach (ProjectListViewModel project in Model.Projects) - { - - - - - index++; - } + }
Projects (@Model.ProjectCount)
Application informationProject status and dates
diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/FormAMatProjectListRow.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/FormAMatProjectListRow.cshtml deleted file mode 100644 index fb58aad23..000000000 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/FormAMatProjectListRow.cshtml +++ /dev/null @@ -1,39 +0,0 @@ -@using Dfe.Academisation.ExtensionMethods -@using Dfe.PrepareConversions.TagHelpers -@model ProjectListRowViewModel - - - -

- - @Model.Item.SchoolName - - URN: @Model.Item.SchoolURN -

-

-

Route: @Model.Item.TypeAndRoute.RouteDescription()
-
Application to join a trust: @Model.Item.NameOfTrust
- @if (@Model.Item.LocalAuthority.IsEmpty() is false) - { -
Local authority: @Model.Item.LocalAuthority
- } -

- - -

- @Model.Item.Status.Value -

-

- - Project created date: @Model.Item.CreatedOn.ToDateString()
-
- - @("Advisory board date: " + Model.Item.HeadTeacherBoardDate)
-
- - Opening date: - @Model.Item.ProposedAcademyOpeningDate - -

- - \ No newline at end of file diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/SponsoredProjectListRow.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/SponsoredProjectListRow.cshtml deleted file mode 100644 index e7a9e2351..000000000 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/SponsoredProjectListRow.cshtml +++ /dev/null @@ -1,46 +0,0 @@ -@using Dfe.PrepareConversions.TagHelpers -@using Dfe.Academisation.ExtensionMethods -@model ProjectListRowViewModel - - - -

- - @Model.Item.SchoolName - - URN: @Model.Item.SchoolURN -

-

-

Route: @Model.Item.TypeAndRoute.RouteDescription()
-
Application to join a trust: @Model.Item.NameOfTrust
- - @if (@Model.Item.LocalAuthority.IsEmpty() is false) - { -
Local authority: @Model.Item.LocalAuthority
- } -
- Delivery officer: - Empty - @Model.Item.AssignedUserFullName -
-

- - -

- @Model.Item.Status.Value -

-

- - Project created date: @Model.Item.CreatedOn.ToDateString()
-
- - @("Advisory board date: " + Model.Item.HeadTeacherBoardDate)
-
- - Opening date: - EMPTY - @Model.Item.ProposedAcademyOpeningDate - -

- - \ No newline at end of file diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/VoluntaryProjectListRow.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/VoluntaryProjectListRow.cshtml deleted file mode 100644 index 893310905..000000000 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/VoluntaryProjectListRow.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@using Dfe.Academisation.ExtensionMethods -@using Dfe.PrepareConversions.TagHelpers -@model ProjectListRowViewModel - - - -

- - @Model.Item.SchoolName - - URN: @Model.Item.SchoolURN -

-

-

Route: @Model.Item.TypeAndRoute.RouteDescription()
-
Application to join a trust: @Model.Item.NameOfTrust
- @if (@Model.Item.LocalAuthority.IsEmpty() is false) - { -
Local authority: @Model.Item.LocalAuthority
- } -
- Delivery officer: - Empty - @Model.Item.AssignedUserFullName -
-

- - -

- @Model.Item.Status.Value -

-

- - Project created date: @Model.Item.CreatedOn.ToDateString()
-
- - @("Advisory board date: " + Model.Item.HeadTeacherBoardDate)
-
- - Opening date: - EMPTY - @Model.Item.ProposedAcademyOpeningDate - -

- - \ No newline at end of file diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml new file mode 100644 index 000000000..fe6cbc756 --- /dev/null +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml @@ -0,0 +1,63 @@ +@using Dfe.Academisation.ExtensionMethods +@using Dfe.PrepareConversions.TagHelpers +@model List + +@{ + var index = 0; + + foreach (var project in Model) + { + var projectRow = project.Row(index); + + var isFormAMat = project.IsFormAMat; + var matTypeClass = isFormAMat ? "form-a-mat" : "join-a-mat"; + var link = isFormAMat ? @Links.FormAMat.Index.Page : @Links.TaskList.Index.Page; + + + +
+ + @projectRow.Item.SchoolName + +
+
+ URN: @projectRow.Item.SchoolURN +
+ @if (@projectRow.Item.LocalAuthority.IsEmpty() is false) + { +
+ Local authority: + @projectRow.Item.LocalAuthority +
+ } +
+ Region: + @projectRow.Item.Region +
+
+ Incoming trust: + @projectRow.Item.NameOfTrust +
+
+ Advisory board date: + Empty + @projectRow.Item.HeadTeacherBoardDate +
+ @if (!isFormAMat) + { +
+ Assigned to: + Empty + @projectRow.Item.AssignedUserFullName +
+ } +
+ @projectRow.Item.Status.Value +
+ + + + index++; + } +} + diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Utils/ProjectListHelper.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions/Utils/ProjectListHelper.cs index 2a3d1ea71..1ebef1d50 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Utils/ProjectListHelper.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Utils/ProjectListHelper.cs @@ -25,7 +25,8 @@ public static ProjectListViewModel Build(AcademyConversionProject academyConvers Status = MapProjectStatus(academyConversionProject.ProjectStatus), AssignedUserFullName = academyConversionProject.AssignedUser?.FullName, CreatedOn = academyConversionProject.CreatedOn, - TypeAndRoute = academyConversionProject.AcademyTypeAndRoute + TypeAndRoute = academyConversionProject.AcademyTypeAndRoute, + Region = academyConversionProject.Region }; } diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/ViewModels/ProjectListViewModel.cs b/Dfe.PrepareConversions/Dfe.PrepareConversions/ViewModels/ProjectListViewModel.cs index c5db15240..6ef92156c 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/ViewModels/ProjectListViewModel.cs +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/ViewModels/ProjectListViewModel.cs @@ -17,6 +17,7 @@ public class ProjectListViewModel: ProjectTypeBase public string AssignedUserFullName { get; init; } public DateTime? CreatedOn { get; init; } public string TypeAndRoute { get; init; } + public string Region { get; set; } public bool ShowHtbDate => string.IsNullOrWhiteSpace(HeadTeacherBoardDate) is false; public bool ShowProposedOpeningDate => string.IsNullOrWhiteSpace(ProposedAcademyOpeningDate) is false; From 6acbac0861e218011bf1559e4741e5494d7ac524 Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:21:16 +0000 Subject: [PATCH 2/6] re-add thead to remove code smell --- .../Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml index 3ee232b4c..612ab2186 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml @@ -50,7 +50,8 @@ - + + @{ From 369c9f57cbec15676215ca14d98c11c30f29722d Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Wed, 13 Dec 2023 14:52:16 +0000 Subject: [PATCH 3/6] re-add table heading --- .../Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml index 612ab2186..8b3aee2d3 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml @@ -51,6 +51,9 @@
Projects (@Model.ProjectCount)
+ @{ From 6916e7d80d3dd1fcaf2cc6af891f136313c5e315 Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Wed, 13 Dec 2023 15:05:52 +0000 Subject: [PATCH 4/6] remove boolean literal - code smell --- .../Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml | 6 +++--- .../Pages/Shared/_ProjectListRows.cshtml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml index 8b3aee2d3..d8e5a46dd 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/ProjectList/Index.cshtml @@ -51,9 +51,9 @@
Projects (@Model.ProjectCount)
+ +
- + + + @{ diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml index fe6cbc756..d81096cbf 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml @@ -23,7 +23,7 @@
URN: @projectRow.Item.SchoolURN
- @if (@projectRow.Item.LocalAuthority.IsEmpty() is false) + @if (!@projectRow.Item.LocalAuthority.IsEmpty()) {
Local authority: From 1769d5ba23ada87778ce012296f3ed6a1fed6660 Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Wed, 13 Dec 2023 16:50:10 +0000 Subject: [PATCH 5/6] Change incoming trust to title case. Change empty tag descriptions --- .../Pages/Shared/_ProjectListRows.cshtml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml index d81096cbf..04fe5c216 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml @@ -36,18 +36,18 @@
Incoming trust: - @projectRow.Item.NameOfTrust + @projectRow.Item.NameOfTrust.ToTitleCase()
Advisory board date: - Empty + Unconfirmed @projectRow.Item.HeadTeacherBoardDate
@if (!isFormAMat) {
Assigned to: - Empty + Unassigned @projectRow.Item.AssignedUserFullName
} From 6f7c6620dae002f6022741517c4a2c04fc66f17d Mon Sep 17 00:00:00 2001 From: Elijah Aremu <45821029+elielijah321@users.noreply.github.com> Date: Thu, 14 Dec 2023 10:15:53 +0000 Subject: [PATCH 6/6] Add margin to rows --- .../Pages/Shared/_ProjectListRows.cshtml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml index 04fe5c216..8dd06b907 100644 --- a/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml +++ b/Dfe.PrepareConversions/Dfe.PrepareConversions/Pages/Shared/_ProjectListRows.cshtml @@ -20,38 +20,38 @@ @projectRow.Item.SchoolName -
+
URN: @projectRow.Item.SchoolURN
@if (!@projectRow.Item.LocalAuthority.IsEmpty()) { -
+
Local authority: @projectRow.Item.LocalAuthority
} -
+
Region: @projectRow.Item.Region
-
+
Incoming trust: @projectRow.Item.NameOfTrust.ToTitleCase()
-
+
Advisory board date: Unconfirmed @projectRow.Item.HeadTeacherBoardDate
@if (!isFormAMat) { -
+
Assigned to: Unassigned @projectRow.Item.AssignedUserFullName
} -
+
@projectRow.Item.Status.Value
Projects (@Model.ProjectCount)
- -
Application information