UK-SBCoA / uniform-data-set-dotnet-web

.NET Core implementation of UDS with MVC and Razor Class UI Library
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Create A1a with simple validation attributes #132

Closed mlan225 closed 3 months ago

mlan225 commented 4 months ago

Resolves: #108 Resolves: #111 Resolves: #110

Add the A1a form and create stimulus.js validation for checkbox disables

Generic Validation

image

Custom validation

image image image

Form functionality

image image

Custom stimulus validation

image image

mlan225 commented 4 months ago

Card #108 Tasks

Create model and Implemented simple attributes and validation:

mlan225 commented 4 months ago

Moving on to form page model issue card to Resolve: #111

mlan225 commented 4 months ago

Card #111 Tasks

Create the page model with items and disable/enable behavior

mlan225 commented 4 months ago

Question for ya @ashleybot So there seems to be additional guidance in the form_a1a_ivp_questions_and vars.csv for the UDS4 A1a questions that are not present in the labels in the UDS4 A1a UDS4-IVP-Form-A1a-FinalProof.pdf PDF file. Are we taking the question labels from the PDF or the CSV instructions as what we want on the application?

The pdf form file

Screenshot 2024-02-15 at 3 53 43 PM

The csv instruction file

Screenshot 2024-02-15 at 3 53 38 PM

mlan225 commented 4 months ago

Card #110 Task

mlan225 commented 4 months ago

Ended up doing more work on the mappings than the layout, running into an issue with a base form cast to an A1a type in the page model

ashleybot commented 4 months ago

Examples

A1 has reusable examples of layout for questions with a series of radio buttons (and, optional other)

Vertical radio buttons

            <div class="@rowCSS">
                <label asp-for="A1.REASON"><span class="counter"></span><span class="counter invisible"></span> @Html.DisplayNameFor(model => model.A1.REASON)</label>
                <div class="mt-4 sm:col-span-2 sm:mt-0">
                    <div class="max-w-lg">
                        <p class="text-sm text-gray-500" asp-description-for="@Model.A1.REASON"></p>
                        <radio-button-group id="A1_REASON" for="A1.REASON" items="Model.ParticipationReasonsListItems"></radio-button-group>
                        <span class="mt-2 text-sm text-red-600" asp-validation-for="@Model.A1.REASON"></span>
                    </div>
                </div>
            </div>

Vertical radio buttons with input field for other

            <div class="@rowCSS">
                <label asp-for="A1.HISPOR" class="text-base font-semibold text-gray-900"><span class="counter"></span> @Html.DisplayNameFor(model => model.A1.HISPOR)</label>
                <div>
                    <p class="text-sm text-gray-500" asp-description-for="@Model.A1.HISPOR"></p>
                    <radio-button-group id="A1.HISPOR" for="@Model.A1.HISPOR" items="Model.OriginsListItems" ui-behaviors="Model.OriginsUIBehavior"></radio-button-group>
                    <span class="mt-2 text-sm text-red-600" asp-validation-for="@Model.A1.HISPOR"></span>
                </div>
                <div class="mt-4 space-y-4">
                    <p class="text-sm text-gray-500" asp-description-for="@Model.A1.HISPORX"></p>
                    <label asp-for="@Model.A1.HISPORX">@Html.DisplayNameFor(m => m.A1.HISPORX)</label>
                    <div class="mt-2">
                        <input asp-for="@Model.A1.HISPORX" disabled="disabled" />
                    </div>
                    <span class="mt-2 text-sm text-red-600" asp-validation-for="@Model.A1.HISPORX"></span>
                </div>
            </div>

B6 has examples of horizontal radio buttons for questions 15a-15c

Horizontal radio buttons using a table for horizontal layout

<table>
   ...
                <tr>
                    <td>
                        <label asp-for="B6.SATIS"><span class="counter"></span> @Html.DisplayNameFor(m => m.B6.SATIS)</label>
                        <p class="text-sm text-gray-500" asp-description-for="B6.SATIS"></p>
                        <span class="mt-2 text-sm text-red-600" asp-validation-for="B6.SATIS"></span>
                    </td>
                    <table-cell-radio-buttons id="B6_SATIS" for="@Model.B6.SATIS" items="Model.DisagreeIncreasesListItems"></table-cell-radio-buttons>
                </tr>
</table>
mlan225 commented 4 months ago

All features added will be adding screenshots for review guidance and fixing linter errors in the morning. As well as bringing up to date with main.

The issue with the A1 form view error, will update with main branch and if issue still persists, will cross check with main branch to see what on my PR is causing an issue

mlan225 commented 4 months ago

Will be squashing and merging when its ready to merge in 👍

mlan225 commented 3 months ago

Added regex number ranges and adjusted ladder question formatting

Range

Ladder question

Previously (no adjustments) image

XL screen width (with sizing adjustments) ladder

< XL screen width (with sizing adjustments) ladder small

ashleybot commented 3 months ago
ashleybot commented 3 months ago

@mlan225 Labels for the set of checkboxes in question 39 are different in the paper form (ie. my) and variables file (ie. your). Our views should match the paper form, but it's hard to determine which will be used here. I'll make a note for us to double check these again when NACC publishes the finalized forms.

Screen Shot 2024-03-12 at 10 57 34 AM