From 3eb687d08b700ae13e141a0e091440ac0faa3939 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Mon, 12 Sep 2022 09:31:10 +0100 Subject: [PATCH 01/12] DLSV2-548 Adds required to text-input vc model Populates aria-required attribute as true or false accordingly and appends "(optional)" to labels if not already present. --- .../ViewComponents/TextInputViewComponent.cs | 7 +++++-- .../Common/ViewComponents/TextInputViewModel.cs | 7 +++++-- .../Views/ChangePassword/Index.cshtml | 9 ++++++--- .../Views/Login/Index.cshtml | 6 ++++-- .../Views/MyAccount/EditDetails.cshtml | 15 ++++++++++----- .../Views/Register/LearnerInformation.cshtml | 3 ++- .../Views/Register/Password.cshtml | 6 ++++-- .../Views/Register/PersonalInformation.cshtml | 9 ++++++--- .../Views/RegisterAdmin/Password.cshtml | 6 ++++-- .../RegisterAdmin/PersonalInformation.cshtml | 9 ++++++--- .../LearnerInformation.cshtml | 3 ++- .../RegisterDelegateByCentre/Password.cshtml | 3 ++- .../PersonalInformation.cshtml | 12 ++++++++---- .../Views/ResetPassword/Index.cshtml | 6 ++++-- .../Views/SetPassword/Index.cshtml | 6 ++++-- .../Shared/Components/TextInput/Default.cshtml | 5 +++-- .../Views/Shared/_EditRegistrationNumber.cshtml | 3 ++- .../Views/Supervisor/MyStaffList.cshtml | 3 ++- .../Centre/Configuration/EditCentreDetails.cshtml | 6 ++++-- .../Configuration/EditCentreManagerDetails.cshtml | 12 ++++++++---- .../Configuration/EditCentreWebsiteDetails.cshtml | 15 ++++++++++----- .../AddRegistrationPromptConfigureAnswers.cshtml | 3 ++- .../EditRegistrationPrompt.cshtml | 3 ++- .../CourseSetup/AdminFields/AddAdminField.cshtml | 3 ++- .../CourseSetup/AdminFields/EditAdminField.cshtml | 3 ++- .../CourseSetup/Shared/_EditCourseName.cshtml | 3 ++- .../Shared/_EditCoursePasswordAndEmail.cshtml | 6 ++++-- .../DelegateGroups/AddDelegateGroup.cshtml | 3 ++- .../Delegates/DelegateGroups/EditGroupName.cshtml | 3 ++- .../EditDelegateCourseAdminField.cshtml | 3 ++- .../Delegates/EditDelegate/Index.cshtml | 15 ++++++++++----- .../Delegates/SetDelegatePassword/Index.cshtml | 3 ++- 32 files changed, 133 insertions(+), 66 deletions(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/TextInputViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/TextInputViewComponent.cs index 29738bcdab..b767f54680 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/TextInputViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/TextInputViewComponent.cs @@ -17,6 +17,7 @@ public class TextInputViewComponent : ViewComponent /// Leave blank for no hint. /// Leave blank to set no autocomplete on the input element. /// + /// /// public IViewComponentResult Invoke( string aspFor, @@ -26,7 +27,8 @@ public IViewComponentResult Invoke( bool spellCheck, string hintText, string autocomplete, - string cssClass + string cssClass, + bool required ) { var model = ViewData.Model; @@ -47,7 +49,8 @@ string cssClass string.IsNullOrEmpty(autocomplete) ? null : autocomplete, errorMessages, string.IsNullOrEmpty(cssClass) ? null : cssClass, - string.IsNullOrEmpty(hintText) ? null : hintText + string.IsNullOrEmpty(hintText) ? null : hintText, + required ); return View(textBoxViewModel); } diff --git a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/TextInputViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/TextInputViewModel.cs index 72c97aefff..c293aa1942 100644 --- a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/TextInputViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/TextInputViewModel.cs @@ -15,7 +15,8 @@ public TextInputViewModel( string? autocomplete, IEnumerable errorMessages, string? cssClass = null, - string? hintText = null + string? hintText = null, + bool required = false ) { var errorMessageList = errorMessages.ToList(); @@ -23,12 +24,13 @@ public TextInputViewModel( Id = id; Class = cssClass; Name = name; - Label = label; + Label = (!required && !label.EndsWith("(optional)") ? label + " (optional)" : label); Value = value; Type = type; SpellCheck = spellCheck; Autocomplete = autocomplete; HintText = hintText; + Required = required; ErrorMessages = errorMessageList; HasError = errorMessageList.Any(); } @@ -42,6 +44,7 @@ public TextInputViewModel( public bool SpellCheck { get; set; } public string? Autocomplete { get; set; } public string? HintText { get; set; } + public bool Required { get; set; } public IEnumerable ErrorMessages { get; set; } public readonly bool HasError; } diff --git a/DigitalLearningSolutions.Web/Views/ChangePassword/Index.cshtml b/DigitalLearningSolutions.Web/Views/ChangePassword/Index.cshtml index 427ebca147..0f7884fa6d 100644 --- a/DigitalLearningSolutions.Web/Views/ChangePassword/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/ChangePassword/Index.cshtml @@ -29,7 +29,8 @@ spell-check="false" hint-text="" autocomplete="current-password" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/Login/Index.cshtml b/DigitalLearningSolutions.Web/Views/Login/Index.cshtml index 5be566fef0..31d14de10b 100644 --- a/DigitalLearningSolutions.Web/Views/Login/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/Login/Index.cshtml @@ -28,7 +28,8 @@ spell-check="false" hint-text="" autocomplete="username" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" />
diff --git a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml index 8e2d306212..275f818e2d 100644 --- a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml +++ b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml @@ -51,7 +51,8 @@ spell-check="false" autocomplete="given-name" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true"/> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> @if (Model.IsDelegateUser) { @@ -113,7 +116,8 @@ spell-check="false" autocomplete="" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="@customField.Mandatory" /> } }
@@ -158,7 +162,8 @@ spell-check="false" autocomplete="" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true"/> diff --git a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml index a54c4e4868..cdc342e695 100644 --- a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml @@ -56,7 +56,8 @@ spell-check="false" hint-text="" autocomplete="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="@customField.Mandatory" /> } } diff --git a/DigitalLearningSolutions.Web/Views/Register/Password.cshtml b/DigitalLearningSolutions.Web/Views/Register/Password.cshtml index 41c9d2be4f..c19876e260 100644 --- a/DigitalLearningSolutions.Web/Views/Register/Password.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/Password.cshtml @@ -23,7 +23,8 @@ spell-check="false" autocomplete="new-password" hint-text="Your new password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> Back diff --git a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml index 315bcc223b..dc6d086c3e 100644 --- a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml @@ -61,7 +61,8 @@ spell-check="false" hint-text="" autocomplete="given-name" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true"/> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/RegisterAdmin/Password.cshtml b/DigitalLearningSolutions.Web/Views/RegisterAdmin/Password.cshtml index 130eaaa776..c394f3a566 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterAdmin/Password.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterAdmin/Password.cshtml @@ -23,7 +23,8 @@ spell-check="false" autocomplete="new-password" hint-text="Your new password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true"/> + css-class="nhsuk-u-width-one-half" + required="true" /> Back diff --git a/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml index 81a980d286..239f198c42 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml @@ -31,7 +31,8 @@ spell-check="false" hint-text="" autocomplete="given-name" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml index b4ec861aee..fe7bcb3294 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml @@ -59,7 +59,8 @@ spell-check="false" hint-text="" autocomplete="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="@customField.Mandatory" /> } } diff --git a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/Password.cshtml b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/Password.cshtml index 605ba9160d..7b89b8f83a 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/Password.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/Password.cshtml @@ -34,7 +34,8 @@ spell-check="false" autocomplete="" hint-text="Password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="false" /> Back diff --git a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/PersonalInformation.cshtml index af696d84ae..8a34d1cf10 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/PersonalInformation.cshtml @@ -35,7 +35,8 @@ spell-check="false" hint-text="" autocomplete="given-name" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="false"/> diff --git a/DigitalLearningSolutions.Web/Views/ResetPassword/Index.cshtml b/DigitalLearningSolutions.Web/Views/ResetPassword/Index.cshtml index 055fe4130c..29ad530909 100644 --- a/DigitalLearningSolutions.Web/Views/ResetPassword/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/ResetPassword/Index.cshtml @@ -33,7 +33,8 @@ spell-check="false" hint-text="Your new password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." autocomplete="new-password" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/SetPassword/Index.cshtml b/DigitalLearningSolutions.Web/Views/SetPassword/Index.cshtml index 76b3e4ab3c..4652cc5fd5 100644 --- a/DigitalLearningSolutions.Web/Views/SetPassword/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/SetPassword/Index.cshtml @@ -33,7 +33,8 @@ spell-check="false" hint-text="Your new password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." autocomplete="new-password" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true"/> diff --git a/DigitalLearningSolutions.Web/Views/Shared/Components/TextInput/Default.cshtml b/DigitalLearningSolutions.Web/Views/Shared/Components/TextInput/Default.cshtml index 5aeca9c0ea..6ab537d313 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/Components/TextInput/Default.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/Components/TextInput/Default.cshtml @@ -40,6 +40,7 @@ type="@Model.Type" spellcheck="@Model.SpellCheck" autocomplete="@Model.Autocomplete" - aria-invalid="@(Model.HasError ? "true" : null)" - aria-describedby="@(describedBy!= "" ? @describedBy : null)" /> + aria-invalid="@(Model.HasError ? "true" : null )" + aria-describedby="@(describedBy!= "" ? @describedBy : null)" + aria-required="@(Model.Required ? "true" : "false" )" /> diff --git a/DigitalLearningSolutions.Web/Views/Shared/_EditRegistrationNumber.cshtml b/DigitalLearningSolutions.Web/Views/Shared/_EditRegistrationNumber.cshtml index 576819e38a..dafa8a2298 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/_EditRegistrationNumber.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/_EditRegistrationNumber.cshtml @@ -74,7 +74,8 @@ spell-check="false" hint-text="" autocomplete="off" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/Supervisor/MyStaffList.cshtml b/DigitalLearningSolutions.Web/Views/Supervisor/MyStaffList.cshtml index 90701a07ab..9f2f07833b 100644 --- a/DigitalLearningSolutions.Web/Views/Supervisor/MyStaffList.cshtml +++ b/DigitalLearningSolutions.Web/Views/Supervisor/MyStaffList.cshtml @@ -86,7 +86,8 @@ spell-check="false" hint-text="Provide the work email address of a member of staff to add to your supervision list." autocomplete="email" - css-class="nhsuk-input" /> + css-class="nhsuk-input" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetails.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetails.cshtml index 9ef1fee00f..dd5cd645b2 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetails.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/EditCentreWebsiteDetails.cshtml @@ -31,7 +31,8 @@ populate-with-current-value="true" type="text" spell-check="false" autocomplete="" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="false" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="false" /> + css-class="nhsuk-u-width-one-half" + required="false" /> + css-class="nhsuk-u-width-one-half" + required="false" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/EditRegistrationPrompt.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/EditRegistrationPrompt.cshtml index 5dbd4608d1..054b8c1eb0 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/EditRegistrationPrompt.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/EditRegistrationPrompt.cshtml @@ -60,7 +60,8 @@ spell-check="true" autocomplete="" hint-text="" - css-class="nhsuk-u-width-full" /> + css-class="nhsuk-u-width-full" + required="false" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml index e24c9176c2..1deeed109e 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml @@ -49,7 +49,8 @@ spell-check="true" autocomplete="" hint-text="" - css-class="nhsuk-u-width-full" /> + css-class="nhsuk-u-width-full" + required="false" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml index 728b444916..c79f9698c5 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml @@ -44,7 +44,8 @@ spell-check="true" autocomplete="" hint-text="" - css-class="nhsuk-u-width-full" /> + css-class="nhsuk-u-width-full" + required="false" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml index 03a25fdd29..f2e789661e 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml @@ -23,6 +23,7 @@ spell-check="true" autocomplete="off" hint-text="" - css-class="nhsuk-u-width-three-quarters nhsuk-u-font-weight-normal" /> + css-class="nhsuk-u-width-three-quarters nhsuk-u-font-weight-normal" + required="false"/> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCoursePasswordAndEmail.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCoursePasswordAndEmail.cshtml index 58700f4af4..3f066e8034 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCoursePasswordAndEmail.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCoursePasswordAndEmail.cshtml @@ -34,7 +34,8 @@ spell-check="false" autocomplete="off" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> @@ -57,7 +58,8 @@ spell-check="false" autocomplete="off" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/AddDelegateGroup.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/AddDelegateGroup.cshtml index 1375abd23d..2cc02eafbb 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/AddDelegateGroup.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/AddDelegateGroup.cshtml @@ -31,7 +31,8 @@ spell-check="true" hint-text="" autocomplete="" - css-class="nhsuk-u-width-two-thirds" /> + css-class="nhsuk-u-width-two-thirds" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditDelegateCourseAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditDelegateCourseAdminField.cshtml index 33dff16097..0988a9119d 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditDelegateCourseAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditDelegateCourseAdminField.cshtml @@ -64,7 +64,8 @@ spell-check="true" autocomplete="" hint-text="Answer must be 100 characters or fewer." - css-class="nhsuk-u-width-full" /> + css-class="nhsuk-u-width-full" + required="false" /> } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml index d352854f2b..3956d4b55c 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml @@ -43,7 +43,8 @@ spell-check="false" autocomplete="given-name" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="true" /> + css-class="nhsuk-u-width-one-half" + required="false" /> @@ -102,7 +106,8 @@ spell-check="false" autocomplete="" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="@customField.Mandatory" /> } } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml index ab627ffa1a..f9e35311e4 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml @@ -28,7 +28,8 @@ spell-check="false" autocomplete="off" hint-text="Password should have a minimum of 8 characters with at least 1 letter, 1 number and 1 symbol." - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="true" /> From 9ab206a8d05abaac75d12ae32a2605a469689746 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Mon, 12 Sep 2022 13:58:35 +0100 Subject: [PATCH 02/12] DLSV2-548 Adds required to text-input vc model Populates aria-required attribute for select vc Dynamically adds "(optional)" to label if not required --- .../ViewComponents/SelectListViewComponent.cs | 6 ++++-- .../Common/ViewComponents/SelectListViewModel.cs | 7 +++++-- .../Views/MyAccount/EditDetails.cshtml | 2 ++ .../Views/Register/LearnerInformation.cshtml | 2 ++ .../Views/Register/PersonalInformation.cshtml | 1 + .../Views/RegisterAdmin/LearnerInformation.cshtml | 1 + .../RegisterDelegateByCentre/LearnerInformation.cshtml | 2 ++ .../Views/Shared/Components/SelectList/Default.cshtml | 3 ++- .../Centre/Administrator/EditAdminRoles.cshtml | 1 + .../AddRegistrationPromptSelectPrompt.cshtml | 1 + .../Views/TrackingSystem/Centre/Ranking/Index.cshtml | 2 ++ .../Views/TrackingSystem/Centre/Reports/EditFilters.cshtml | 2 ++ .../Centre/Reports/_EditCourseCategoryFilters.cshtml | 3 +++ .../CourseSetup/AdminFields/AddAdminField.cshtml | 1 + .../CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml | 1 + .../Delegates/DelegateGroups/GenerateGroups.cshtml | 1 + .../Delegates/DelegateProgress/EditSupervisor.cshtml | 1 + .../TrackingSystem/Delegates/EditDelegate/Index.cshtml | 2 ++ .../Delegates/GroupCourses/AddCourseToGroup.cshtml | 3 ++- .../TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml | 1 + 20 files changed, 37 insertions(+), 6 deletions(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs index 2ff75323c7..cb0f86eb16 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs @@ -15,7 +15,8 @@ public IViewComponentResult Invoke( IEnumerable selectListOptions, string? hintText, string? cssClass, - bool? deselectable + bool? deselectable, + bool? required ) { var model = ViewData.Model; @@ -36,7 +37,8 @@ public IViewComponentResult Invoke( string.IsNullOrEmpty(hintText) ? null : hintText, errorMessage, hasError, - deselectable ?? false + deselectable ?? false, + required ?? false ); return View(selectListViewModel); } diff --git a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs index 39f86a278d..d274e75a43 100644 --- a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs @@ -17,13 +17,14 @@ public SelectListViewModel string? hintText = null, string? errorMessage = null, bool hasError = false, - bool deselectable = false + bool deselectable = false, + bool required = false ) { Id = id; Class = cssClass; Name = name; - Label = label; + Label = (!required && !label.EndsWith("(optional)") ? label + " (optional)" : label); Value = value; DefaultOption = defaultOption; SelectListOptions = selectListOptions; @@ -31,6 +32,7 @@ public SelectListViewModel ErrorMessage = errorMessage; HasError = hasError; Deselectable = deselectable; + Required = required; } public string Id { get; set; } @@ -44,5 +46,6 @@ public SelectListViewModel public string? ErrorMessage { get; set; } public bool HasError { get; set; } public bool Deselectable { get; set; } + public bool Required { get; set; } } } diff --git a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml index 275f818e2d..a18e9ece4b 100644 --- a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml +++ b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml @@ -92,6 +92,7 @@ value="@Model.JobGroupId.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" select-list-options="@Model.JobGroups" /> @@ -104,6 +105,7 @@ value="@customField.Answer" hint-text="" deselectable="@(!customField.Mandatory)" + required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" select-list-options="@customField.Options" /> diff --git a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml index cdc342e695..a7c7eb5336 100644 --- a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml @@ -32,6 +32,7 @@ value="@Model.JobGroup?.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" select-list-options="@Model.JobGroupOptions" /> @@ -45,6 +46,7 @@ value="@customField.Answer" hint-text="" deselectable="@(!customField.Mandatory)" + required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" select-list-options="@customField.Options" /> diff --git a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml index dc6d086c3e..4888eef425 100644 --- a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml @@ -41,6 +41,7 @@ value="@Model.Centre?.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-full" default-option="Select a centre" select-list-options="@Model.CentreOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml index fee8387f1e..53ecccfd5f 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml @@ -21,6 +21,7 @@ value="@Model.JobGroup?.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" select-list-options="@Model.JobGroupOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml index fe7bcb3294..ff2e60fa07 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml @@ -35,6 +35,7 @@ value="@Model.JobGroup?.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" select-list-options="@Model.JobGroupOptions" /> @@ -48,6 +49,7 @@ value="@customField.Answer" hint-text="" deselectable="@(!customField.Mandatory)" + required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" select-list-options="@customField.Options" /> diff --git a/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml b/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml index 10495970b4..b929e8927d 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml @@ -35,7 +35,8 @@ value="@(Model.Value != null ? Model.Value : null)" asp-items="Model.SelectListOptions" aria-describedby="@(describedBy!= "" ? @describedBy : null)" - aria-invalid="@(Model.HasError ? "true" : null)"> + aria-invalid="@(Model.HasError ? "true" : null)" + aria-required="@(Model.Required ? "true" : "false" )"> @if (Model.DefaultOption != null) { diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml index 0918d59c8f..bbd7546ce1 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml @@ -55,6 +55,7 @@ value="@Model.LearningCategory.ToString()" hint-text="Limits the permissions of the administrator to view and manage courses in a particular category." deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="" select-list-options="@Model.LearningCategories" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml index 57cf573bc8..febe181873 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml @@ -20,6 +20,7 @@ value="@Model.CustomPromptId?.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a prompt name" select-list-options="@ViewBag.CustomPromptNameOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml index 2f72c8ace7..5d40cf1c06 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml @@ -28,6 +28,7 @@ value="@Model.RegionId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-full" default-option="All" select-list-options="@Model.RegionOptions" /> @@ -38,6 +39,7 @@ value="@Model.Period?.Id.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-full" default-option="@null" select-list-options="@Model.PeriodOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml index de4cc02a5b..680914376b 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml @@ -34,6 +34,7 @@ value="@Model.JobGroupId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="All" select-list-options="@Model.JobGroupOptions" /> @@ -58,6 +59,7 @@ value="@reportIntervalValue.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="" select-list-options="@Model.ReportIntervalOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml index 7302b550fd..4e6337a4d1 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml @@ -37,6 +37,7 @@ value="@Model.CustomisationId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="All" select-list-options="@Model.CustomisationOptions" /> @@ -62,6 +63,7 @@ value="@Model.CourseCategoryId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="All" select-list-options="@Model.CourseCategoryOptions" /> @@ -76,6 +78,7 @@ value="@Model.CustomisationId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="All" select-list-options="@Model.CustomisationOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml index 1deeed109e..87e94943cf 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml @@ -24,6 +24,7 @@ value="@Model.AdminFieldId.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a field name" select-list-options="@ViewBag.AdminFieldNameOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml index 265791820f..03028eb230 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml @@ -31,6 +31,7 @@ value="@Model.RefreshToCustomisationId.ToString()" hint-text="Which course should the learner be enrolled on when auto-refreshing?" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a course" select-list-options="@Model.CourseOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml index a6a10b3637..0bb5d175a2 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml @@ -24,6 +24,7 @@ value="@Model.RegistrationFieldOptionId.ToString()" hint-text="This is the delegate registration field that the group generation will be based on." deselectable="false" + required="true" css-class="nhsuk-u-width-full nhsuk-u-margin-bottom-2" default-option="Select a registration field" select-list-options="@Model.RegistrationFieldOptions" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml index 666f285232..c1da61ba2f 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml @@ -34,6 +34,7 @@ value="@Model.SupervisorId.ToString()" hint-text="" deselectable="true" + required="false" css-class="nhsuk-u-width-one-half" default-option="No supervisor" select-list-options="@Model.Supervisors" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml index 3956d4b55c..9b3d7d3859 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml @@ -84,6 +84,7 @@ value="@Model.JobGroupId.ToString()" hint-text="" deselectable="false" + required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" select-list-options="@Model.JobGroups" /> @@ -95,6 +96,7 @@ value="@customField.Answer" hint-text="" deselectable="@(!customField.Mandatory)" + required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" select-list-options="@customField.Options" /> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml index 436eefc105..037b79daaa 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml @@ -33,7 +33,8 @@ deselectable="true" css-class="nhsuk-u-width-one-half" default-option="No supervisor" - select-list-options="@Model.Supervisors" /> + select-list-options="@Model.Supervisors" + required="false"/> From f64b01780b0c8e34a5c0d0fe3de47b59204a72df Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Mon, 12 Sep 2022 15:14:08 +0100 Subject: [PATCH 03/12] DLSV2-548 Adds required to numeric-input vc model Dynamically adds aria-required attribute and (optional) label append when appropriate --- .../ViewComponents/NumericInputViewComponent.cs | 6 ++++-- .../Common/ViewComponents/NumericInputViewModel.cs | 7 +++++-- .../Shared/Components/NumericInput/Default.cshtml | 3 ++- .../ManageCourse/EditAutoRefreshOptions.cshtml | 3 ++- .../ManageCourse/EditLearningPathwayDefaults.cshtml | 10 ++++++---- .../Shared/_OtherCompletionCriteriaInputs.cshtml | 6 ++++-- .../Delegates/GroupCourses/AddCourseToGroup.cshtml | 3 ++- 7 files changed, 25 insertions(+), 13 deletions(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/NumericInputViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/NumericInputViewComponent.cs index 1703bc9752..2a4e652577 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/NumericInputViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/NumericInputViewComponent.cs @@ -12,7 +12,8 @@ public IViewComponentResult Invoke( bool populateWithCurrentValue, string type, string hintText, - string cssClass + string cssClass, + bool required ) { var model = ViewData.Model; @@ -31,7 +32,8 @@ string cssClass type, errorMessages, string.IsNullOrEmpty(cssClass) ? null : cssClass, - string.IsNullOrEmpty(hintText) ? null : hintText + string.IsNullOrEmpty(hintText) ? null : hintText, + required ); return View(numericInputViewModel); } diff --git a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/NumericInputViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/NumericInputViewModel.cs index 257a0b5682..37e105ac8e 100644 --- a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/NumericInputViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/NumericInputViewModel.cs @@ -15,7 +15,8 @@ public NumericInputViewModel( string type, IEnumerable errorMessages, string? cssClass = null, - string? hintText = null + string? hintText = null, + bool required = false ) { var errorMessageList = errorMessages.ToList(); @@ -23,12 +24,13 @@ public NumericInputViewModel( Id = id; Class = cssClass; Name = name; - Label = label; + Label = (!required && !label.EndsWith("(optional)") ? label + " (optional)" : label); Value = value; Type = type; HintText = hintText; ErrorMessages = errorMessageList; HasError = errorMessageList.Any(); + Required = required; } public string Id { get; set; } @@ -39,5 +41,6 @@ public NumericInputViewModel( public string Type { get; set; } public string? HintText { get; set; } public IEnumerable ErrorMessages { get; set; } + public bool Required { get; set; } } } diff --git a/DigitalLearningSolutions.Web/Views/Shared/Components/NumericInput/Default.cshtml b/DigitalLearningSolutions.Web/Views/Shared/Components/NumericInput/Default.cshtml index 91ecf9f654..ee1393d745 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/Components/NumericInput/Default.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/Components/NumericInput/Default.cshtml @@ -41,5 +41,6 @@ pattern="[0-9]*" inputmode="numeric" aria-invalid="@(Model.HasError ? "true" : null)" - aria-describedby="@(describedBy!= "" ? @describedBy : null)" /> + aria-describedby="@(describedBy!= "" ? @describedBy : null)" + aria-required="@(Model.Required ? "true" : "false" )"/> diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml index 03028eb230..976661afbc 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml @@ -41,7 +41,8 @@ populate-with-current-value="true" type="text" hint-text="How many months prior to expiry of the previous course should the learner be enrolled on the refresher course?" - css-class="nhsuk-input--width-10" /> + css-class="nhsuk-input--width-10" + required="false"/> + css-class="nhsuk-input--width-10" + required="false"/> + css-class="nhsuk-input--width-10 nhsuk-u-margin-bottom-2" + required="false" /> + css-class="nhsuk-input--width-10 nhsuk-u-margin-bottom-2" + required="false" /> @if (Model.DiagAssess) { + css-class="nhsuk-input--width-10 nhsuk-u-margin-bottom-2" + required="false"/> } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml index 037b79daaa..809280b4a3 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml @@ -41,7 +41,8 @@ populate-with-current-value="true" type="text" hint-text="" - css-class="nhsuk-u-width-one-half" /> + css-class="nhsuk-u-width-one-half" + required="false"/> Back From 437029e6fb7383c0bd2035b8d40f1ce0bcc86c62 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Mon, 12 Sep 2022 15:26:46 +0100 Subject: [PATCH 04/12] DLSV2-548 Consolidates required and deselectable properties in select list VC Deselectable was always the inverse of Required so it has been removed in favour of the more meaningful Required property. --- .../ViewComponents/SelectListViewComponent.cs | 6 ++---- .../ViewModels/Common/ViewComponents/SelectListViewModel.cs | 3 --- .../Views/MyAccount/EditDetails.cshtml | 2 -- .../Views/Register/LearnerInformation.cshtml | 2 -- .../Views/Register/PersonalInformation.cshtml | 1 - .../Views/RegisterAdmin/LearnerInformation.cshtml | 1 - .../RegisterDelegateByCentre/LearnerInformation.cshtml | 2 -- .../Views/Shared/Components/SelectList/Default.cshtml | 2 +- .../Centre/Administrator/EditAdminRoles.cshtml | 1 - .../AddRegistrationPromptSelectPrompt.cshtml | 1 - .../Views/TrackingSystem/Centre/Ranking/Index.cshtml | 2 -- .../Views/TrackingSystem/Centre/Reports/EditFilters.cshtml | 2 -- .../Centre/Reports/_EditCourseCategoryFilters.cshtml | 3 --- .../CourseSetup/AdminFields/AddAdminField.cshtml | 1 - .../CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml | 1 - .../Delegates/DelegateGroups/GenerateGroups.cshtml | 1 - .../Delegates/DelegateProgress/EditSupervisor.cshtml | 1 - .../TrackingSystem/Delegates/EditDelegate/Index.cshtml | 2 -- .../Delegates/GroupCourses/AddCourseToGroup.cshtml | 1 - .../TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml | 1 - 20 files changed, 3 insertions(+), 33 deletions(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs index cb0f86eb16..b4eb19cb8d 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/SelectListViewComponent.cs @@ -15,8 +15,7 @@ public IViewComponentResult Invoke( IEnumerable selectListOptions, string? hintText, string? cssClass, - bool? deselectable, - bool? required + bool required ) { var model = ViewData.Model; @@ -37,8 +36,7 @@ public IViewComponentResult Invoke( string.IsNullOrEmpty(hintText) ? null : hintText, errorMessage, hasError, - deselectable ?? false, - required ?? false + required ); return View(selectListViewModel); } diff --git a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs index d274e75a43..de287ed817 100644 --- a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/SelectListViewModel.cs @@ -17,7 +17,6 @@ public SelectListViewModel string? hintText = null, string? errorMessage = null, bool hasError = false, - bool deselectable = false, bool required = false ) { @@ -31,7 +30,6 @@ public SelectListViewModel HintText = hintText; ErrorMessage = errorMessage; HasError = hasError; - Deselectable = deselectable; Required = required; } @@ -45,7 +43,6 @@ public SelectListViewModel public string? HintText { get; set; } public string? ErrorMessage { get; set; } public bool HasError { get; set; } - public bool Deselectable { get; set; } public bool Required { get; set; } } } diff --git a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml index a18e9ece4b..1e35e7fcc0 100644 --- a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml +++ b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml @@ -91,7 +91,6 @@ label="Job group" value="@Model.JobGroupId.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" @@ -104,7 +103,6 @@ label="@(customField.Prompt + (customField.Mandatory ? "" : " (optional)"))" value="@customField.Answer" hint-text="" - deselectable="@(!customField.Mandatory)" required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" diff --git a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml index a7c7eb5336..1fc25d28cc 100644 --- a/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/LearnerInformation.cshtml @@ -31,7 +31,6 @@ label="Job Group" value="@Model.JobGroup?.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" @@ -45,7 +44,6 @@ label="@(customField.Prompt + (customField.Mandatory ? "" : " (optional)"))" value="@customField.Answer" hint-text="" - deselectable="@(!customField.Mandatory)" required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" diff --git a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml index 4888eef425..1d5a284258 100644 --- a/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/Register/PersonalInformation.cshtml @@ -40,7 +40,6 @@ label="Centre" value="@Model.Centre?.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-full" default-option="Select a centre" diff --git a/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml index 53ecccfd5f..b82d4b6e85 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterAdmin/LearnerInformation.cshtml @@ -20,7 +20,6 @@ label="Job Group" value="@Model.JobGroup?.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" diff --git a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml index ff2e60fa07..0ab49f8760 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterDelegateByCentre/LearnerInformation.cshtml @@ -34,7 +34,6 @@ label="Job Group" value="@Model.JobGroup?.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" @@ -48,7 +47,6 @@ label="@(customField.Prompt + (customField.Mandatory ? "" : " (optional)"))" value="@customField.Answer" hint-text="" - deselectable="@(!customField.Mandatory)" required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" diff --git a/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml b/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml index b929e8927d..9af76022ca 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/Components/SelectList/Default.cshtml @@ -39,7 +39,7 @@ aria-required="@(Model.Required ? "true" : "false" )"> @if (Model.DefaultOption != null) { - + } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml index bbd7546ce1..c427660bad 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml @@ -54,7 +54,6 @@ label="Learning category" value="@Model.LearningCategory.ToString()" hint-text="Limits the permissions of the administrator to view and manage courses in a particular category." - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml index febe181873..61ec953324 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptSelectPrompt.cshtml @@ -19,7 +19,6 @@ label="Prompt name" value="@Model.CustomPromptId?.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a prompt name" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml index 5d40cf1c06..9ae9733aea 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Ranking/Index.cshtml @@ -27,7 +27,6 @@ label="Region" value="@Model.RegionId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-full" default-option="All" @@ -38,7 +37,6 @@ label="Period" value="@Model.Period?.Id.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-full" default-option="@null" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml index 680914376b..fa28e27cc1 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml @@ -33,7 +33,6 @@ label="Choose job group filter" value="@Model.JobGroupId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="All" @@ -58,7 +57,6 @@ label="Report by" value="@reportIntervalValue.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml index 4e6337a4d1..2464aadf4d 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/_EditCourseCategoryFilters.cshtml @@ -36,7 +36,6 @@ label="Choose a course" value="@Model.CustomisationId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="All" @@ -62,7 +61,6 @@ label="Choose course category from the list below" value="@Model.CourseCategoryId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="All" @@ -77,7 +75,6 @@ label="Choose a course filter" value="@Model.CustomisationId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="All" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml index 87e94943cf..d674418b1a 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml @@ -23,7 +23,6 @@ label="Field name" value="@Model.AdminFieldId.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a field name" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml index 976661afbc..2f16c41054 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/ManageCourse/EditAutoRefreshOptions.cshtml @@ -30,7 +30,6 @@ label="Course to refresh to" value="@Model.RefreshToCustomisationId.ToString()" hint-text="Which course should the learner be enrolled on when auto-refreshing?" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a course" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml index 0bb5d175a2..3191294b9b 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/GenerateGroups.cshtml @@ -23,7 +23,6 @@ label="Registration field" value="@Model.RegistrationFieldOptionId.ToString()" hint-text="This is the delegate registration field that the group generation will be based on." - deselectable="false" required="true" css-class="nhsuk-u-width-full nhsuk-u-margin-bottom-2" default-option="Select a registration field" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml index c1da61ba2f..a1321937b7 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml @@ -33,7 +33,6 @@ label="Supervisor" value="@Model.SupervisorId.ToString()" hint-text="" - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="No supervisor" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml index 9b3d7d3859..a00f8021b7 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/EditDelegate/Index.cshtml @@ -83,7 +83,6 @@ label="Job group" value="@Model.JobGroupId.ToString()" hint-text="" - deselectable="false" required="true" css-class="nhsuk-u-width-one-half" default-option="Select a job group" @@ -95,7 +94,6 @@ label="@(customField.Prompt + (customField.Mandatory ? "" : " (optional)"))" value="@customField.Answer" hint-text="" - deselectable="@(!customField.Mandatory)" required="@(customField.Mandatory)" css-class="nhsuk-u-width-one-half" default-option="Select a @customField.Prompt.ToLower()" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml index 809280b4a3..dec9b51894 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/GroupCourses/AddCourseToGroup.cshtml @@ -30,7 +30,6 @@ label="Supervisor" value="@Model.SupervisorId.ToString()" hint-text="" - deselectable="true" css-class="nhsuk-u-width-one-half" default-option="No supervisor" select-list-options="@Model.Supervisors" diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml index 238beb3bd6..636e89f90f 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml @@ -64,7 +64,6 @@ label="Learning category" value="@Model.LearningCategory.ToString()" hint-text="Limits the permissions of the administrator to view and manage courses in a particular category." - deselectable="true" required="false" css-class="nhsuk-u-width-one-half" default-option="" From 33402a040ed403ac94944418be32d196aa546541 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Mon, 12 Sep 2022 17:07:16 +0100 Subject: [PATCH 05/12] DLSV2-548 Adds required to radios vc model --- .../ViewComponents/RadiosViewComponent.cs | 3 ++- .../ViewModels/Common/ViewComponents/RadiosViewModel.cs | 7 +++++-- .../Views/Shared/Components/Radios/Default.cshtml | 2 +- .../Centre/Administrator/EditAdminRoles.cshtml | 3 ++- .../TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs index 7f8250485f..4c001ab2a0 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs @@ -13,7 +13,8 @@ public IViewComponentResult Invoke( string label, IEnumerable radios, bool populateWithCurrentValues, - string? hintText + string? hintText, + bool required ) { var radiosList = radios.Select( diff --git a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/RadiosViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/RadiosViewModel.cs index 757b9d93d8..274cbcba10 100644 --- a/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/RadiosViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/Common/ViewComponents/RadiosViewModel.cs @@ -8,13 +8,15 @@ public RadiosViewModel( string aspFor, string label, string? hintText, - IEnumerable radios + IEnumerable radios, + bool required ) { AspFor = aspFor; - Label = label; + Label = (!required && !label.EndsWith("(optional)") ? label + " (optional)" : label); HintText = hintText; Radios = radios; + Required = required; } public string AspFor { get; set; } @@ -24,5 +26,6 @@ IEnumerable radios public string? HintText { get; set; } public IEnumerable Radios { get; set; } + public bool Required { get; set; } } } diff --git a/DigitalLearningSolutions.Web/Views/Shared/Components/Radios/Default.cshtml b/DigitalLearningSolutions.Web/Views/Shared/Components/Radios/Default.cshtml index 9ff78f8482..38bc820ee9 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/Components/Radios/Default.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/Components/Radios/Default.cshtml @@ -17,7 +17,7 @@ } -
+
@foreach (var (radio, index) in Model.Radios.Select((r, i) => (r, i))) { var radioId = $"{radio.Value}-{index}";
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml index c427660bad..c34692538c 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml @@ -45,7 +45,8 @@ label="Please select a content manager role for this user." populate-with-current-values="true" radios="@Model.Radios" - hint-text="" /> + hint-text="" + required="true"/>

Learning category

diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml index 636e89f90f..896af2d10d 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/PromoteToAdmin/Index.cshtml @@ -55,7 +55,8 @@ label="Please select a content manager role for this user." populate-with-current-values="true" radios="@Model.Radios" - hint-text="" /> + hint-text="" + required="true" />

Learning category

From d03d34a693320fe407037770c79c3d9d76ed7f6f Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Wed, 14 Sep 2022 08:24:52 +0100 Subject: [PATCH 06/12] DLSV2-548 Adds aria-hidden="true" attribute to all hidden inputs Because we can't remove them as per CyberDuck accessibility suggestions --- .../Frameworks/Developer/EditCustomFlag.cshtml | 2 +- .../Frameworks/Developer/ImportCompetencies.cshtml | 2 +- .../Views/Frameworks/Developer/SubmitReview.cshtml | 2 +- .../Views/Frameworks/Shared/_CommentCard.cshtml | 2 +- .../Views/LearningContent/Index.cshtml | 2 +- .../MarkActionPlanResourceAsComplete.cshtml | 8 ++++---- .../Current/SetCompleteByDate.cshtml | 10 +++++----- .../RecommendedLearning/RecommendedLearning.cshtml | 4 ++-- .../SelfAssessments/AddSupervisor.cshtml | 6 +++--- .../SelfAssessmentCompetency.cshtml | 2 +- .../SelfAssessments/SetSupervisorRole.cshtml | 6 +++--- .../SelfAssessments/VerificationPickResults.cshtml | 4 ++-- .../Views/Login/Index.cshtml | 2 +- .../Views/MyAccount/EditDetails.cshtml | 4 ++-- .../Views/Register/PersonalInformation.cshtml | 4 ++-- .../Views/RegisterAdmin/PersonalInformation.cshtml | 2 +- .../PersonalInformation.cshtml | 2 +- .../Components/CurrentFilters/Default.cshtml | 12 ++++++------ .../Configurations/_SortAndFilter.cshtml | 2 +- .../Views/Shared/SearchablePage/_Filters.cshtml | 14 +++++++------- .../SearchablePage/_ItemsPerPageSelect.cshtml | 10 +++++----- .../Views/Shared/SearchablePage/_Search.cshtml | 10 +++++----- .../_SearchSortFilterInputsForPagination.cshtml | 12 ++++++------ .../Views/Shared/SearchablePage/_Sort.cshtml | 8 ++++---- .../Views/Shared/_EditRegistrationNumber.cshtml | 2 +- .../Views/Supervisor/MyStaffList.cshtml | 4 ++-- .../Supervisor/SignOffProfileAssessment.cshtml | 2 +- .../Views/Support/Faqs/Faqs.cshtml | 4 ++-- .../Administrator/DeactivateOrDeleteAdmin.cshtml | 6 +++--- .../Centre/Administrator/EditAdminRoles.cshtml | 4 ++-- .../Centre/Configuration/EditCentreDetails.cshtml | 4 ++-- .../AddRegistrationPromptConfigureAnswers.cshtml | 4 ++-- .../BulkRegistrationPromptAnswers.cshtml | 4 ++-- .../EditRegistrationPrompt.cshtml | 6 +++--- .../RemoveRegistrationPrompt.cshtml | 4 ++-- .../Centre/Reports/EditFilters.cshtml | 2 +- .../Reports/_EditCourseCategoryFilters.cshtml | 2 +- .../Centre/SystemNotifications/Index.cshtml | 2 +- .../AddNewCentreCourse/SelectCourse.cshtml | 6 +++--- .../AddNewCentreCourse/SetCourseContent.cshtml | 6 +++--- .../AddNewCentreCourse/SetCourseOptions.cshtml | 2 +- .../AddNewCentreCourse/SetSectionContent.cshtml | 2 +- .../AddNewCentreCourse/_CategoryTopicFilter.cshtml | 4 ++-- .../CourseSetup/AdminFields/AddAdminField.cshtml | 2 +- .../CourseSetup/AdminFields/EditAdminField.cshtml | 6 +++--- .../AdminFields/RemoveAdminField.cshtml | 4 ++-- .../_EditSectionContentFormInputs.cshtml | 4 ++-- .../CourseContent/_EditSectionDiagnostic.cshtml | 4 ++-- .../Shared/_EditCourseCompletionCriteria.cshtml | 4 ++-- .../CourseSetup/Shared/_EditCourseName.cshtml | 4 ++-- .../CourseSetup/_CentreCourseCard.cshtml | 2 +- .../DelegateApprovals/DelegateRejectionPage.cshtml | 2 +- .../_unapprovedDelegateExpandable.cshtml | 2 +- .../DelegateCourses/_CentreCourseCard.cshtml | 2 +- .../DelegateGroups/ConfirmDeleteGroup.cshtml | 8 ++++---- .../DelegateGroups/EditDescription.cshtml | 4 ++-- .../Delegates/DelegateGroups/EditGroupName.cshtml | 2 +- .../ConfirmRemoveFromCourse.cshtml | 12 ++++++------ .../DelegateProgress/EditCompleteByDate.cshtml | 12 ++++++------ .../DelegateProgress/EditCompletionDate.cshtml | 12 ++++++------ .../EditDelegateCourseAdminField.cshtml | 8 ++++---- .../DelegateProgress/EditSupervisor.cshtml | 8 ++++---- .../Delegates/GroupCourses/AddCourseToGroup.cshtml | 4 ++-- .../AddCourseToGroupSelectCourse.cshtml | 4 ++-- .../GroupCourses/RemoveGroupCourse.cshtml | 8 ++++---- .../GroupDelegates/RemoveGroupDelegate.cshtml | 8 ++++---- .../GroupDelegates/_AddGroupDelegateCard.cshtml | 2 +- .../Delegates/PromoteToAdmin/Index.cshtml | 2 +- .../Delegates/SetDelegatePassword/Index.cshtml | 8 ++++---- 69 files changed, 170 insertions(+), 170 deletions(-) diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml index cf0a4cbebf..3864e2df33 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml @@ -60,5 +60,5 @@ Cancel
- + diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml index a979047a94..47685bf918 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml @@ -50,7 +50,7 @@

- + diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml index 35a2b4d583..230d2f1cd2 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml @@ -34,7 +34,7 @@ - +
diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml index d0c4b80e6c..ee1a35c678 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml @@ -74,7 +74,7 @@ - +
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml index c34692538c..6f91de1725 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml @@ -33,8 +33,8 @@
- - + +
- +
@@ -70,7 +70,7 @@
- +
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptConfigureAnswers.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptConfigureAnswers.cshtml index e709ae49c8..978eb6c81c 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptConfigureAnswers.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/AddRegistrationPromptConfigureAnswers.cshtml @@ -21,8 +21,8 @@
- - + + @if (string.IsNullOrEmpty(Model.OptionsString)) { diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml index d3dd58e8d7..4653f050c6 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml @@ -16,8 +16,8 @@ - - + +
- - - + + + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/RemoveRegistrationPrompt.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/RemoveRegistrationPrompt.cshtml index 5650a833f4..1533be46e8 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/RemoveRegistrationPrompt.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/RemoveRegistrationPrompt.cshtml @@ -50,8 +50,8 @@
- - + + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml index fa28e27cc1..28c68d6ab6 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Reports/EditFilters.cshtml @@ -27,7 +27,7 @@

Edit report filters

- + } else { - + - + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SelectCourse.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SelectCourse.cshtml index 6bfde1b49a..fe2957baeb 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SelectCourse.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SelectCourse.cshtml @@ -26,9 +26,9 @@ }
- - - + + +
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SetCourseContent.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SetCourseContent.cshtml index 22d4395977..de026ab6d7 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SetCourseContent.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/SetCourseContent.cshtml @@ -52,9 +52,9 @@
@foreach (var (sectionModel, sectionIndex) in Model.AvailableSections.Select((s, i) => (s, i))) { - - - + + +
@ViewData["Title"] - + - + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/_CategoryTopicFilter.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/_CategoryTopicFilter.cshtml index e507a6f23e..4cb43864a9 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/_CategoryTopicFilter.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AddNewCentreCourse/_CategoryTopicFilter.cshtml @@ -12,9 +12,9 @@ @if (Model.ActionParameterName == "topicFilterString") { - + } else { - + }
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml index d674418b1a..a34d9631d2 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/AddAdminField.cshtml @@ -32,7 +32,7 @@
- + @if (string.IsNullOrEmpty(Model.OptionsString)) { diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml index c79f9698c5..3b5b94b12b 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/EditAdminField.cshtml @@ -23,9 +23,9 @@
- - - + + + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/RemoveAdminField.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/RemoveAdminField.cshtml index f5cc81ea0b..dee0abaee8 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/RemoveAdminField.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/AdminFields/RemoveAdminField.cshtml @@ -52,8 +52,8 @@
- - + + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionContentFormInputs.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionContentFormInputs.cshtml index 87ce38f10e..6f2af2ebf2 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionContentFormInputs.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionContentFormInputs.cshtml @@ -7,8 +7,8 @@
- - + +
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionDiagnostic.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionDiagnostic.cshtml index 3e780fa1b7..c80440d674 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionDiagnostic.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/CourseContent/_EditSectionDiagnostic.cshtml @@ -23,8 +23,8 @@
@foreach (var (tutorial, tutIndex) in Model.Tutorials.Select((t, i) => (t, i))) { - - + +
- + +

Completion criteria diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml index f2e789661e..745d7a0a78 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/Shared/_EditCourseName.cshtml @@ -1,8 +1,8 @@ @using DigitalLearningSolutions.Web.ViewModels.TrackingSystem.CourseSetup.CourseDetails @model EditCourseDetailsFormData - - + +
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/_CentreCourseCard.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/_CentreCourseCard.cshtml index d6f68eb97d..5a871656e6 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/_CentreCourseCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/CourseSetup/_CentreCourseCard.cshtml @@ -14,7 +14,7 @@ - + @if (Model.HasAdminFields) { } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/DelegateRejectionPage.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/DelegateRejectionPage.cshtml index 8494cf02fe..b84cdc1a1d 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/DelegateRejectionPage.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/DelegateRejectionPage.cshtml @@ -47,7 +47,7 @@
- + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/_unapprovedDelegateExpandable.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/_unapprovedDelegateExpandable.cshtml index 488df432fd..3e2cd4f093 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/_unapprovedDelegateExpandable.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateApprovals/_unapprovedDelegateExpandable.cshtml @@ -50,7 +50,7 @@
- + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateCourses/_CentreCourseCard.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateCourses/_CentreCourseCard.cshtml index d27862da63..7d5d51a66c 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateCourses/_CentreCourseCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateCourses/_CentreCourseCard.cshtml @@ -14,7 +14,7 @@ - + @if (Model.HasAdminFields) { } diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/ConfirmDeleteGroup.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/ConfirmDeleteGroup.cshtml index 19e6c9dd4c..4567a8d0bb 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/ConfirmDeleteGroup.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/ConfirmDeleteGroup.cshtml @@ -22,10 +22,10 @@
- - - - + + + +

This group has @Model.DelegateCount delegate@(DisplayStringHelper.GetPluralitySuffix(Model.DelegateCount)) diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditDescription.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditDescription.cshtml index 7841b136f2..aa145d0051 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditDescription.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditDescription.cshtml @@ -26,8 +26,8 @@ character-count="1000" /> - - + +

diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditGroupName.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditGroupName.cshtml index 0ada1369b1..b3abe12459 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditGroupName.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateGroups/EditGroupName.cshtml @@ -15,7 +15,7 @@

Edit group name

- + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - + + + + @if (Model.Options.Count > 0) {
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml index a1321937b7..9285df4ea9 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/DelegateProgress/EditSupervisor.cshtml @@ -25,10 +25,10 @@ - - - - + + + + @title

- - + + - - + + @if (Model.NoDataFound) {
- +
- + @Model.FullName
diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml index f9e35311e4..eedf119599 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Delegates/SetDelegatePassword/Index.cshtml @@ -17,10 +17,10 @@ - - - - + + + + Date: Wed, 14 Sep 2022 08:33:11 +0100 Subject: [PATCH 07/12] Adds missing param to view component view model instantiation --- .../ViewComponents/RadiosViewComponent.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs b/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs index 4c001ab2a0..940cdffb22 100644 --- a/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs +++ b/DigitalLearningSolutions.Web/ViewComponents/RadiosViewComponent.cs @@ -30,7 +30,8 @@ bool required aspFor, label, string.IsNullOrEmpty(hintText) ? null : hintText, - radiosList + radiosList, + required ); return View(viewModel); From b0c8ade8722b276a4144aa3305e3fde0571ca8c8 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Wed, 14 Sep 2022 08:41:05 +0100 Subject: [PATCH 08/12] DLSV2-548 Adds standard hint text to radio questions and aria label to clear buttons --- .../SelfAssessments/_RadioQuestion.cshtml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/_RadioQuestion.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/_RadioQuestion.cshtml index befa86fd1f..41198ba944 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/_RadioQuestion.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/_RadioQuestion.cshtml @@ -2,12 +2,16 @@ @model AssessmentQuestion

@Model.Question

+
@if (Model.ScoringInstructions != null) { -
- @(Html.Raw(Model.ScoringInstructions)) -
+ +

@(Html.Raw(Model.ScoringInstructions))

+ + } +

Please pick one answer.

+
@foreach (var levelDescriptor in Model.LevelDescriptors) { @@ -27,7 +31,7 @@ }
- Clear selection From eb48c7ab33518ed469c9d406746ae8c8d6bdc407 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Wed, 14 Sep 2022 08:54:56 +0100 Subject: [PATCH 09/12] DLSV2-548 Adds aria-labels to buttons on the resource signposting page --- .../_SearchableRecommendedResourceCard.cshtml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/RecommendedLearning/_SearchableRecommendedResourceCard.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/RecommendedLearning/_SearchableRecommendedResourceCard.cshtml index 72a75eee80..566ef49385 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/RecommendedLearning/_SearchableRecommendedResourceCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/RecommendedLearning/_SearchableRecommendedResourceCard.cshtml @@ -44,6 +44,7 @@ From edb94b66fbc207c8ea4a37421ba371f5a95557b4 Mon Sep 17 00:00:00 2001 From: kevwhitt-hee Date: Wed, 14 Sep 2022 08:56:12 +0100 Subject: [PATCH 10/12] Removes aria-hidden="true" from hidden inputs because they must not be specified on them --- .../Frameworks/Developer/EditCustomFlag.cshtml | 2 +- .../Frameworks/Developer/ImportCompetencies.cshtml | 2 +- .../Views/Frameworks/Developer/SubmitReview.cshtml | 2 +- .../Views/Frameworks/Shared/_CommentCard.cshtml | 2 +- .../Views/LearningContent/Index.cshtml | 2 +- .../MarkActionPlanResourceAsComplete.cshtml | 8 ++++---- .../Current/SetCompleteByDate.cshtml | 10 +++++----- .../RecommendedLearning/RecommendedLearning.cshtml | 4 ++-- .../SelfAssessments/AddSupervisor.cshtml | 6 +++--- .../SelfAssessmentCompetency.cshtml | 2 +- .../SelfAssessments/SetSupervisorRole.cshtml | 6 +++--- .../SelfAssessments/VerificationPickResults.cshtml | 4 ++-- .../Views/Login/Index.cshtml | 2 +- .../Views/MyAccount/EditDetails.cshtml | 4 ++-- .../Views/Register/PersonalInformation.cshtml | 4 ++-- .../Views/RegisterAdmin/PersonalInformation.cshtml | 2 +- .../PersonalInformation.cshtml | 2 +- .../Components/CurrentFilters/Default.cshtml | 12 ++++++------ .../Configurations/_SortAndFilter.cshtml | 2 +- .../Views/Shared/SearchablePage/_Filters.cshtml | 14 +++++++------- .../SearchablePage/_ItemsPerPageSelect.cshtml | 10 +++++----- .../Views/Shared/SearchablePage/_Search.cshtml | 10 +++++----- .../_SearchSortFilterInputsForPagination.cshtml | 12 ++++++------ .../Views/Shared/SearchablePage/_Sort.cshtml | 8 ++++---- .../Views/Shared/_EditRegistrationNumber.cshtml | 2 +- .../Supervisor/SignOffProfileAssessment.cshtml | 2 +- .../Administrator/DeactivateOrDeleteAdmin.cshtml | 6 +++--- .../Centre/Administrator/EditAdminRoles.cshtml | 4 ++-- .../AddRegistrationPromptConfigureAnswers.cshtml | 4 ++-- .../BulkRegistrationPromptAnswers.cshtml | 4 ++-- .../EditRegistrationPrompt.cshtml | 6 +++--- .../Centre/Reports/EditFilters.cshtml | 2 +- .../Reports/_EditCourseCategoryFilters.cshtml | 2 +- .../Centre/SystemNotifications/Index.cshtml | 2 +- .../AddNewCentreCourse/SelectCourse.cshtml | 6 +++--- .../AddNewCentreCourse/SetCourseContent.cshtml | 6 +++--- .../AddNewCentreCourse/SetCourseOptions.cshtml | 2 +- .../AddNewCentreCourse/SetSectionContent.cshtml | 2 +- .../AddNewCentreCourse/_CategoryTopicFilter.cshtml | 4 ++-- .../CourseSetup/AdminFields/AddAdminField.cshtml | 2 +- .../CourseSetup/AdminFields/EditAdminField.cshtml | 6 +++--- .../AdminFields/RemoveAdminField.cshtml | 4 ++-- .../_EditSectionContentFormInputs.cshtml | 4 ++-- .../CourseContent/_EditSectionDiagnostic.cshtml | 4 ++-- .../Shared/_EditCourseCompletionCriteria.cshtml | 4 ++-- .../CourseSetup/Shared/_EditCourseName.cshtml | 4 ++-- .../CourseSetup/_CentreCourseCard.cshtml | 2 +- .../DelegateApprovals/DelegateRejectionPage.cshtml | 2 +- .../_unapprovedDelegateExpandable.cshtml | 2 +- .../DelegateCourses/_CentreCourseCard.cshtml | 2 +- .../DelegateGroups/ConfirmDeleteGroup.cshtml | 8 ++++---- .../DelegateGroups/EditDescription.cshtml | 4 ++-- .../Delegates/DelegateGroups/EditGroupName.cshtml | 2 +- .../ConfirmRemoveFromCourse.cshtml | 12 ++++++------ .../DelegateProgress/EditCompleteByDate.cshtml | 12 ++++++------ .../DelegateProgress/EditCompletionDate.cshtml | 12 ++++++------ .../EditDelegateCourseAdminField.cshtml | 8 ++++---- .../DelegateProgress/EditSupervisor.cshtml | 8 ++++---- .../Delegates/GroupCourses/AddCourseToGroup.cshtml | 4 ++-- .../AddCourseToGroupSelectCourse.cshtml | 4 ++-- .../GroupCourses/RemoveGroupCourse.cshtml | 8 ++++---- .../GroupDelegates/RemoveGroupDelegate.cshtml | 8 ++++---- .../GroupDelegates/_AddGroupDelegateCard.cshtml | 2 +- .../Delegates/PromoteToAdmin/Index.cshtml | 2 +- .../Delegates/SetDelegatePassword/Index.cshtml | 8 ++++---- 65 files changed, 162 insertions(+), 162 deletions(-) diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml index 3864e2df33..cf0a4cbebf 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/EditCustomFlag.cshtml @@ -60,5 +60,5 @@ Cancel
- + diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml index 47685bf918..a979047a94 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/ImportCompetencies.cshtml @@ -50,7 +50,7 @@

- + diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml index 230d2f1cd2..35a2b4d583 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Developer/SubmitReview.cshtml @@ -34,7 +34,7 @@ - +
diff --git a/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml b/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml index ee1a35c678..d0c4b80e6c 100644 --- a/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/Frameworks/Shared/_CommentCard.cshtml @@ -74,7 +74,7 @@ - +
- + @if (Model.JavascriptSearchSortFilterPaginateEnabled) { @section scripts { diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/Current/MarkActionPlanResourceAsComplete.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/Current/MarkActionPlanResourceAsComplete.cshtml index ad9e5657ca..5103ffbf06 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/Current/MarkActionPlanResourceAsComplete.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/Current/MarkActionPlanResourceAsComplete.cshtml @@ -30,10 +30,10 @@ }
- - - - + + + + - - - + + + @if (Equals(Model.Type, LearningItemType.Course)) { - + } @if (Equals(Model.Type, LearningItemType.Resource)) { - + } - - + + @if (Model.NoDataFound) { diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/AddSupervisor.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/AddSupervisor.cshtml index dc41fe2cfb..d962ca36a3 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/AddSupervisor.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/AddSupervisor.cshtml @@ -41,9 +41,9 @@ - - - + + +

Choose a supervisor diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SelfAssessmentCompetency.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SelfAssessmentCompetency.cshtml index 62ca1a85e1..062a821072 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SelfAssessmentCompetency.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SelfAssessmentCompetency.cshtml @@ -91,7 +91,7 @@ } } - +
Question @Model.CompetencyNumber of @Model.TotalNumberOfCompetencies
diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SetSupervisorRole.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SetSupervisorRole.cshtml index 0b1bef9845..a343befdd8 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SetSupervisorRole.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/SetSupervisorRole.cshtml @@ -36,9 +36,9 @@ Choose a role for this supervisor - - - + + +
@foreach (var role in Model.SelfAssessmentSupervisorRoles) { diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/VerificationPickResults.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/VerificationPickResults.cshtml index 09240ead29..82e7fb18f8 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/VerificationPickResults.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/SelfAssessments/VerificationPickResults.cshtml @@ -104,8 +104,8 @@ } - - + +
diff --git a/DigitalLearningSolutions.Web/Views/Login/Index.cshtml b/DigitalLearningSolutions.Web/Views/Login/Index.cshtml index b65f54c5ac..31d14de10b 100644 --- a/DigitalLearningSolutions.Web/Views/Login/Index.cshtml +++ b/DigitalLearningSolutions.Web/Views/Login/Index.cshtml @@ -14,7 +14,7 @@ } - +

Log in

diff --git a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml index 999d57de18..1e35e7fcc0 100644 --- a/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml +++ b/DigitalLearningSolutions.Web/Views/MyAccount/EditDetails.cshtml @@ -83,7 +83,7 @@
@if (Model.IsDelegateUser) { - +

- + } else { diff --git a/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml b/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml index 77e14e948a..239f198c42 100644 --- a/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml +++ b/DigitalLearningSolutions.Web/Views/RegisterAdmin/PersonalInformation.cshtml @@ -21,7 +21,7 @@ Please enter your personal details to start the registration process for an admin account at @Model.CentreName.

- +
Please enter delegate's personal details to start the registration process.

- +
- - - - - + + + + + @foreach (var (key, value) in Model.RouteData) { - + }
diff --git a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/Configurations/_SortAndFilter.cshtml b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/Configurations/_SortAndFilter.cshtml index c87a673de9..3543cfc146 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/Configurations/_SortAndFilter.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/Configurations/_SortAndFilter.cshtml @@ -1,7 +1,7 @@ @using DigitalLearningSolutions.Web.ViewModels.Common.SearchablePage @model IBaseSearchablePageViewModel - + diff --git a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Filters.cshtml b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Filters.cshtml index 8d7117625b..fe036a8fee 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Filters.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Filters.cshtml @@ -3,7 +3,7 @@
- + - - - - + + + + + @foreach (var (key, value) in Model.RouteData) { - + }
- - + + + @if (Model.FilterEnabled) { - + } @foreach (var (key, value) in Model.RouteData) { - + }
diff --git a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Search.cshtml b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Search.cshtml index 0329460d26..cb2d96358f 100644 --- a/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Search.cshtml +++ b/DigitalLearningSolutions.Web/Views/Shared/SearchablePage/_Search.cshtml @@ -3,14 +3,14 @@ @if (Model.FilterEnabled) { - + } @foreach (var (key, value) in Model.RouteData) { - + } - - - + + +

- + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/DeactivateOrDeleteAdmin.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/DeactivateOrDeleteAdmin.cshtml index a42b129ba9..10774fb244 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/DeactivateOrDeleteAdmin.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/DeactivateOrDeleteAdmin.cshtml @@ -27,9 +27,9 @@ label="I am sure that I wish to deactivate this account. I understand that if the user has never logged in, their admin account will be deleted." hint-text="" />
- - - + + + diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml index 6f91de1725..c34692538c 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Administrator/EditAdminRoles.cshtml @@ -33,8 +33,8 @@
- - + +
- - + + @if (string.IsNullOrEmpty(Model.OptionsString)) { diff --git a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml index 4653f050c6..d3dd58e8d7 100644 --- a/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml +++ b/DigitalLearningSolutions.Web/Views/TrackingSystem/Centre/Configuration/RegistrationPrompts/BulkRegistrationPromptAnswers.cshtml @@ -16,8 +16,8 @@ - - + +