diff --git a/Web/Edubase.Web.Resources/ApiMessages.resx b/Web/Edubase.Web.Resources/ApiMessages.resx index bc66cef4f..4e7730d69 100644 --- a/Web/Edubase.Web.Resources/ApiMessages.resx +++ b/Web/Edubase.Web.Resources/ApiMessages.resx @@ -1,64 +1,64 @@ + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> @@ -124,180 +124,178 @@ - Please select an establishment status - + Please select an establishment status + - Please select an establishment type - + Please select an establishment type + - Establishment is not LA maintained, please select another one. - + Establishment is not LA maintained, please select another one. + - Please enter a headteacher/principal/manager first name - + Please enter a headteacher/principal/manager first name + - Please enter a headteacher/principal/manager last name - + Please enter a headteacher/principal/manager last name + - Please select 'Does not apply' for Religious Character - + Please select 'Does not apply' for Religious Character + - Please enter a valid establishment number between 1 and 9999 - + Please enter a valid establishment number between 1 and 9999 + - The establishment number you have entered already exists. Please enter a different establishment number - + The establishment number you have entered already exists. Please enter a different establishment number + - Please enter a valid email address - + Please enter a valid email address + - Please reduce the proprietor's name to fewer than 70 characters - + Please reduce the proprietor's name to fewer than 70 characters + - This type of establishment cannot be changed to a children's centre. Please revert the type of establishment to its original type - + This type of establishment cannot be changed to a children's centre. Please revert the type of establishment to its original type + - You have to remove the link(s) before changing this type of establishment. Please remove the link(s) - + You have to remove the link(s) before changing this type of establishment. Please remove the link(s) + - Please change the close date, so it's later than the open date. - + Please change the close date, so it's later than the open date. + - Only Church of England or Roman Catholic church schools can have a diocese. Please remove the diocese - + Only Church of England or Roman Catholic church schools can have a diocese. Please remove the diocese + - You can't close an establishment with a future close date. Please enter a different close date - + You can't close an establishment with a future close date. Please enter a different close date + - You cannot open an establishment with a future open date. Please enter a different open date - + You cannot open an establishment with a future open date. Please enter a different open date + - This type of establishment cannot belong to a federation/trust/school sponsor. Please remove the link - + This type of establishment cannot belong to a federation/trust/school sponsor. Please remove the link + - Please enter a valid report link - + Please enter a valid report link + - Please select 'Has nursery classes' - + Please select 'Has nursery classes' + - Please select 'Has a sixth form' - + Please select 'Has a sixth form' + - Please change the last inspection date. It cannot be later than today's date. - + Please change the last inspection date. It cannot be later than today's date. + - Please select 'Does not apply' - + Please select 'Does not apply' + - This phase of education isn't valid for this establishment type. Please select a different phase of education - + This phase of education isn't valid for this establishment type. Please select a different phase of education + - Please enter a valid postcode - + Please enter a valid postcode + - Please check the 'Reason establishment closed'. -Please check the 'Establishment close date' - + Please check the 'Reason establishment closed'. Please check the 'Establishment close date' + - Please check the 'Reason establishment opened' -Please check the 'Establishment open date' - + Please check the 'Reason establishment opened'Please check the 'Establishment open date' + - Please leave the capacity field blank - + Please leave the capacity field blank + - This field cannot have a value if the type of resourced provision is set to this. Please change the type of resourced provision - + This field cannot have a value if the type of resourced provision is set to this. Please change the type of resourced provision + - At least one of the SEN priority fields must be selected with this type of resourced provision. Please select a SEN priority field - + At least one of the SEN priority fields must be selected with this type of resourced provision. Please select a SEN priority field + - Please fill in this field - + Please fill in this field + - Please change the statutory high age so that it's higher than the statutory low age - + Please change the statutory high age so that it's higher than the statutory low age + - Please change the statutory low age so that it's lower than the statutory high age - + Please change the statutory low age so that it's lower than the statutory high age + - Please amend the telephone/fax number. It should only contain digits and should not be longer than 40 digits. - + Please amend the telephone/fax number. It should only contain digits and should not be longer than 40 digits. + - Please enter a valid website address - + Please enter a valid website address + - Please select a district - + Please select a district + - Please select a ward - + Please select a ward + - Please select a census ward - + Please select a census ward + - Please select a government office region - + Please select a government office region + - Please select a GSS LA code - + Please select a GSS LA code + - Please enter a valid LSOA code - + Please enter a valid LSOA code + - Please enter a valid MSOA code - + Please enter a valid MSOA code + - Please select a parliamentary constituency - + Please select a parliamentary constituency + - Please select an RSC region - + Please select an RSC region + - Please select an urban/rural description - + Please select an urban/rural description + - Please enter the date term ends - + Please enter the date term ends + - Please enter the date of appointment - + Please enter the date of appointment + - Please enter the email address - + Please enter the email address + - Please enter the first name - + Please enter the first name + - Please enter the last name - + Please enter the last name + - Please enter the telephone number - + Please enter the telephone number + - This URN is not a children's centre URN. Please enter a valid URN - + This URN is not a children's centre URN. Please enter a valid URN + - Please enter a valid first name - + Please enter a valid first name + - Please enter a valid last name - + Please enter a valid last name + - Date of appointment must not be in the future - + Date of appointment must not be in the future + - Date appointment ended must not be before the date of appointment - + Date appointment ended must not be before the date of appointment + - Edit the governor's appointment start date to avoid overlap with an existing governance professional record. - + Edit the governor's appointment start date to avoid overlap with an existing governance professional record. + - Edit the governor's appointment end date to avoid overlap with an existing governance professional record. - + Edit the governor's appointment end date to avoid overlap with an existing governance professional record. + - Date of appointment for governance professionals must be today or in the past. - + Date of appointment for governance professionals must be today or in the past. + diff --git a/Web/Edubase.Web.UI/Assets/Scripts/Entry/add-edit-governor.js b/Web/Edubase.Web.UI/Assets/Scripts/Entry/add-edit-governor.js index d10daf380..a62121478 100644 --- a/Web/Edubase.Web.UI/Assets/Scripts/Entry/add-edit-governor.js +++ b/Web/Edubase.Web.UI/Assets/Scripts/Entry/add-edit-governor.js @@ -4,7 +4,7 @@ const $main = $('#main-content'); $(document).ready(function () { if ($("#IsOriginalSignatoryMember").val() === 'true' || $("#IsOriginalChairOfTrustees").val() === 'true') - $("#governorAppointingBodyInput").prop("disabled", "disabled"); + $("#AppointingBodyId").prop("disabled", "disabled"); }); const unloadHandler = new GiasAttachUnload({ @@ -51,26 +51,26 @@ if (document.getElementById('IsHistoric') && document.getElementById('IsHistoric $("#IsOriginalSignatoryMember").on('change', function (e) { if ($("#IsOriginalSignatoryMember").val() === "true") { - $("#governorAppointingBodyInput").val(16); - $("#governorAppointingBodyInput").prop("disabled", "disabled"); + $("#AppointingBodyId").val(16); + $("#AppointingBodyId").prop("disabled", "disabled"); } else { - $("#governorAppointingBodyInput").prop("disabled", ""); + $("#AppointingBodyId").prop("disabled", ""); } }); $("#IsOriginalChairOfTrustees").on('change', function (e) { if ($("#IsOriginalChairOfTrustees").val() === "true") { - $("#governorAppointingBodyInput").val(19); - $("#governorAppointingBodyInput").prop("disabled", "disabled"); + $("#AppointingBodyId").val(19); + $("#AppointingBodyId").prop("disabled", "disabled"); } else { - $("#governorAppointingBodyInput").prop("disabled", ""); + $("#AppointingBodyId").prop("disabled", ""); } }); $("#governorEdit").submit(function () { - $("#governorAppointingBodyInput").prop("disabled", ""); + $("#AppointingBodyId").prop("disabled", ""); }); - + $('.choose-governor').on('change', function () { unloadHandler.setExitStatus(true); diff --git a/Web/Edubase.Web.UI/Validation/ValidationExtensions.cs b/Web/Edubase.Web.UI/Validation/ValidationExtensions.cs index f2bb8704f..97449c22a 100644 --- a/Web/Edubase.Web.UI/Validation/ValidationExtensions.cs +++ b/Web/Edubase.Web.UI/Validation/ValidationExtensions.cs @@ -1,5 +1,4 @@ using System; -using System.Collections.Generic; using System.Linq; using System.Web.Mvc; using Edubase.Services.Domain; @@ -8,26 +7,8 @@ namespace Edubase.Web.UI.Validation { public static class ValidationExtensions { - /// - /// This was created to handle values from the API that do not map to elements on the UI - /// Ideally this would not be needed and there should be no expectation of items in the UI - /// matching the API. Without time to fully redesign the architecture of this service - /// this has been introduced as another bit tech debt to resolve an immediate issue. - /// 2024-09-12 Scott Dawson - /// - private static readonly Dictionary AlternateValues = new Dictionary - { - { "appointmentDate", "AppointmentStartDate" }, { "stepdownDate", "AppointmentEndDate" } - }; - private static string BuildFieldName(string errorFields, ControllerContext controllerContext) { - //check if an alternate field name is recorded in the AlternateValues dictionary - if (AlternateValues.TryGetValue(errorFields, out var result)) - { - return result; - } - // correct the naming convention by upper casing the first letter var fieldName = errorFields; if (fieldName.Length > 0) diff --git a/Web/Edubase.Web.UI/Views/Shared/EditorTemplates/GovernorViewModel.cshtml b/Web/Edubase.Web.UI/Views/Shared/EditorTemplates/GovernorViewModel.cshtml index 25ee966f0..a373fecc9 100644 --- a/Web/Edubase.Web.UI/Views/Shared/EditorTemplates/GovernorViewModel.cshtml +++ b/Web/Edubase.Web.UI/Views/Shared/EditorTemplates/GovernorViewModel.cshtml @@ -147,7 +147,7 @@ else
@Html.LabelFor(x => x.IsOriginalSignatoryMember, "Original signatory member", new { @class = "govuk-label" }) @Html.ValidationMessageFor(x => x.IsOriginalSignatoryMember, null, new { @class = "govuk-error-message" }) - @Html.DropDownListFor(x => x.IsOriginalSignatoryMember, Model.YesNoSelect, new { @class = string.Concat("govuk-input ", Html.TextBoxValidationClass(x => x.IsOriginalSignatoryMember)) }) + @Html.DropDownListFor(x => x.IsOriginalSignatoryMember, Model.YesNoSelect, new { @class = string.Concat("govuk-select ", Html.TextBoxValidationClass(x => x.IsOriginalSignatoryMember)) })
} } @@ -159,7 +159,7 @@ else
@Html.LabelFor(x => x.IsOriginalChairOfTrustees, "Original chair of trustees", new { @class = "govuk-label" }) @Html.ValidationMessageFor(x => x.IsOriginalChairOfTrustees, null, new { @class = "govuk-error-message" }) - @Html.DropDownListFor(x => x.IsOriginalChairOfTrustees, Model.YesNoSelect, new { @class = string.Concat("govuk-input ", Html.TextBoxValidationClass(x => x.IsOriginalChairOfTrustees))}) + @Html.DropDownListFor(x => x.IsOriginalChairOfTrustees, Model.YesNoSelect, new { @class = string.Concat("govuk-select ", Html.TextBoxValidationClass(x => x.IsOriginalChairOfTrustees))})
} } @@ -345,7 +345,7 @@ else @Html.ValidationMessageFor(x => x.AppointingBodyId, null, new { @class = "govuk-error-message" }) @Html.DropDownListFor(x => x.AppointingBodyId, Model.AppointingBodies, "", - new { id = "governorAppointingBodyInput", @class = string.Concat("govuk-select ", Html.TextBoxValidationClass(x => x.AppointingBodyId)), aria_describedBy = errorsWrapperId, }) + new { id = "AppointingBodyId", @class = string.Concat("govuk-select ", Html.TextBoxValidationClass(x => x.AppointingBodyId)), aria_describedBy = errorsWrapperId, }) } }