From d3221bfd6d28e4d62354ee44bd9ab843664877f9 Mon Sep 17 00:00:00 2001 From: Nick Warms Date: Wed, 8 Jan 2025 09:58:38 +0000 Subject: [PATCH] Replace instances of hard coded strings with constants --- .../Pages/Cookies.cshtml | 1 + .../Pages/Error.cshtml | 1 + .../Pages/Search.cshtml | 1 + .../Pages/Shared/_AppInsights.cshtml | 3 +- .../Pages/Shared/_ContentLayout.cshtml | 1 + .../Pages/Shared/_CookieBanner.cshtml | 1 + .../Pages/Shared/_Footer.cshtml | 1 + .../Pages/Shared/_Header.cshtml | 1 + .../Pages/Shared/_HeaderSearchForm.cshtml | 4 +- .../Pages/Shared/_Layout.cshtml | 3 ++ .../Pages/Shared/_PageSearchForm.cshtml | 10 +++-- .../Pages/Shared/_Pagination.cshtml | 5 ++- .../Trusts/Academies/AcademiesPageModel.cs | 12 ++++-- .../Pages/Trusts/Academies/Details.cshtml.cs | 4 +- .../Academies/FreeSchoolMeals.cshtml.cs | 2 +- .../Trusts/Academies/PupilNumbers.cshtml.cs | 6 ++- .../Trusts/Academies/_AcademiesLayout.cshtml | 7 ++-- .../Trusts/Contacts/ContactsAreaModel.cs | 10 +++-- .../Pages/Trusts/Contacts/EditContactModel.cs | 2 +- .../Pages/Trusts/Contacts/EditSfsoLead.cshtml | 1 + .../EditTrustRelationshipManager.cshtml | 1 + .../Pages/Trusts/Contacts/InDfe.cshtml | 1 + .../Pages/Trusts/Contacts/InDfe.cshtml.cs | 2 +- .../Pages/Trusts/Contacts/InTrust.cshtml | 1 + .../Trusts/Contacts/_EditContactsForm.cshtml | 3 +- .../Trusts/Governance/GovernanceAreaModel.cs | 28 ++++++++----- .../Trusts/Governance/HistoricMembers.cshtml | 1 + .../Governance/HistoricMembers.cshtml.cs | 2 +- .../Pages/Trusts/Governance/Members.cshtml | 1 + .../Pages/Trusts/Governance/Members.cshtml.cs | 2 +- .../Trusts/Governance/TrustLeadership.cshtml | 1 + .../Governance/TrustLeadership.cshtml.cs | 2 +- .../Pages/Trusts/Governance/Trustees.cshtml | 1 + .../Trusts/Governance/Trustees.cshtml.cs | 2 +- .../Trusts/Ofsted/CurrentRatings.cshtml.cs | 2 +- .../Trusts/Ofsted/ImportantDates.cshtml.cs | 2 +- .../Pages/Trusts/Ofsted/OfstedAreaModel.cs | 24 +++++++----- .../Trusts/Ofsted/PreviousRatings.cshtml.cs | 2 +- .../Ofsted/SafeguardingAndConcerns.cshtml.cs | 2 +- .../Pages/Trusts/Ofsted/_OfstedLayout.cshtml | 1 + .../Trusts/Overview/OverviewAreaModel.cs | 14 +++---- .../Overview/ReferenceNumbers.cshtml.cs | 2 +- .../Trusts/Overview/TrustDetails.cshtml.cs | 2 +- .../Trusts/Overview/TrustSummary.cshtml.cs | 2 +- .../Pages/Trusts/TrustsAreaModel.cs | 14 ++++--- .../Pages/Trusts/_TrustBanner.cshtml | 3 +- .../Pages/Trusts/_TrustLayout.cshtml | 1 + .../Pages/Trusts/_TrustNavigation.cshtml | 1 + .../Pages/Trusts/_TrustNavigationLink.cshtml | 5 ++- .../Pages/Trusts/_TrustSubNavigation.cshtml | 1 + .../Trusts/_TrustSubNavigationLink.cshtml | 3 +- .../Pages/ViewConstants.cs | 26 +++++++++++++ .../Services/Export/ExportService.cs | 2 +- .../Academies/AcademiesPageModelTests.cs | 13 ++++--- .../Trusts/Academies/DetailsModelTests.cs | 14 ++++--- .../Academies/FreeSchoolMealsModelTests.cs | 15 ++++--- .../Academies/PupilNumbersModelTests.cs | 17 +++++--- .../Trusts/Contacts/ContactsAreaModelTests.cs | 25 +++++++----- .../Trusts/Contacts/EditSfsoLeadModelTests.cs | 7 ++-- .../EditTrustRelationshipManagerModelTests.cs | 7 ++-- .../Pages/Trusts/Contacts/InDfeModelTests.cs | 23 +++++++---- .../Trusts/Contacts/InTrustModelTests.cs | 23 +++++++---- .../Governance/GovernanceAreaModelTests.cs | 39 ++++++++++++------- .../Governance/HistoricMembersModelTests.cs | 29 +++++++++----- .../Trusts/Governance/MembersModelTests.cs | 29 +++++++++----- .../Governance/TrustLeadershipModelTests.cs | 29 +++++++++----- .../Trusts/Governance/TrusteesModelTests.cs | 29 +++++++++----- .../Trusts/Ofsted/CurrentRatingsModelTests.cs | 32 +++++++++------ .../Trusts/Ofsted/ImportantDatesModelTests.cs | 32 +++++++++------ .../Trusts/Ofsted/OfstedAreaModelTests.cs | 38 +++++++++++------- .../Ofsted/PreviousRatingsModelTests.cs | 32 +++++++++------ .../SafeguardingAndConcernsModelTests.cs | 32 +++++++++------ .../Trusts/Overview/OverviewAreaModelTests.cs | 30 ++++++++------ .../Overview/ReferenceNumbersModelTests.cs | 26 ++++++++----- .../Trusts/Overview/TrustDetailsModelTests.cs | 25 +++++++----- .../Trusts/Overview/TrustSummaryModelTests.cs | 26 ++++++++----- .../Pages/Trusts/TrustsAreaModelTests.cs | 13 +++++-- 77 files changed, 537 insertions(+), 281 deletions(-) diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml index 4ea3c3af8..bfdf7bf19 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Cookies.cshtml @@ -1,5 +1,6 @@ @page @using DfE.FindInformationAcademiesTrusts.Configuration +@using Microsoft.AspNetCore.Mvc.TagHelpers @model CookiesModel @{ diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Error.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Error.cshtml index 930c4c1e2..3122933d0 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Error.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Error.cshtml @@ -1,5 +1,6 @@ @page @using DfE.FindInformationAcademiesTrusts.Configuration +@using Microsoft.FeatureManagement.Mvc.TagHelpers @model ErrorModel @{ diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Search.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Search.cshtml index bf924daf2..72cfbf848 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Search.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Search.cshtml @@ -1,4 +1,5 @@ @page +@using Microsoft.AspNetCore.Mvc.TagHelpers @model SearchModel @{ diff --git a/DfE.FindInformationAcademiesTrusts/Pages/Shared/_AppInsights.cshtml b/DfE.FindInformationAcademiesTrusts/Pages/Shared/_AppInsights.cshtml index edf876966..d1dd2677d 100644 --- a/DfE.FindInformationAcademiesTrusts/Pages/Shared/_AppInsights.cshtml +++ b/DfE.FindInformationAcademiesTrusts/Pages/Shared/_AppInsights.cshtml @@ -1,5 +1,6 @@ +@using NetEscapades.AspNetCore.SecurityHeaders.TagHelpers @{ - var authenticatedUserId = User.Identity is not null && User.Identity.IsAuthenticated ? User.Identity.Name ?? "Unknown" : "Anonymous"; + var authenticatedUserId = User.Identity is not null && User.Identity.IsAuthenticated ? User.Identity.Name ?? "Unknown" : "Anonymous"; }