Aman-Mittal opened a new pull request, #845:
URL: https://github.com/apache/fineract-backoffice-ui/pull/845

   Closes #793, apart from its third point, which has since been fixed 
independently: the repayment-start picker already shows a placeholder when 
unset, with a clear action, and the payload already omits the field. The two 
remaining points are what this changes.
   
   ## Thirteen required controls, none of them saying so
   
   Product, principal, both dates, term frequency and type, number of 
repayments, repayment every, frequency, interest rate, interest type, 
amortization and interest-calculation period all carry `required`. Not one 
rendered a marker, so on a twenty-control form every field looked optional. 
Marked with the same `required-marker` asterisk the client and journal-entry 
forms use.
   
   The client field is marked in `app-client-search` itself rather than here, 
so every form that embeds it gains the marker. Its accessible name comes from 
`aria-label` and does not change — that is what the e2e specs locate it by 
(`getByRole('textbox', { name: 'Client ID' })`).
   
   ## Save disabled itself and would not say why
   
   `COMPLETE_REQUIRED_FIELDS` — "Complete the required fields to continue" — is 
no use on this form: thirteen are required and the empty one is usually off 
screen. The hint beside Save now names them, and the button is described by it:
   
   ```
   Complete: Client ID, Principal, Interest Rate
   ```
   
   **Save also tests `loan().clientId` now.** `app-client-search` holds its own 
reactive control and never joins this `NgForm`, so the form read as *valid* 
with no client selected at all and the button enabled on it; the platform then 
refused the result. The hint names the client first for the same reason. This 
is the one behaviour change here beyond presentation, and it is why the 
loan-creating backend specs were run rather than trusted.
   
   ## On `aria-required`
   
   Not added. On `ion-select`, which renders as `role="button"`, 
`aria-required` is exactly the Ionic defect #514 is about, and adding it here 
would mean three more accessibility-baseline entries papering over it. The 
marker is visible and the Save button is described by the hint, which is what 
carries the information.
   
   ## Tests
   
   Written as invariants rather than counts, so they keep holding as the form 
changes:
   
   - every control the *rendered* form declares required must have a 
`.required-marker` in its `ion-item` — the test reads the controls out of the 
DOM, so a new required field with no marker fails
   - clearing any one required control must produce a hint naming exactly that 
field, which is what holds the label map and the template together: a field 
renamed without updating the map leaves the hint empty and fails, naming itself
   - Save stays out of reach with no client, and carries `aria-describedby`
   
   One finding worth passing on from writing those: `ion-button` hoists 
`aria-*` off the host onto its inner shadow-root button and removes it from the 
host, so `host.getAttribute('aria-describedby')` reads `null` on a binding that 
is working correctly. The assertion reads the shadow button. Same family as 
#514. Likewise, a bare `[required]` selector matches both the `ion-input` host 
and the native `input` Ionic renders inside it, returning each control twice 
with the inner one named `ion-input-153`.
   
   ## Checks
   
   - unit suite 321 files / 2744 tests green, 15 in the loan form's own spec
   - `loan-lifecycle.spec.ts` 5/5 against a real Fineract — loan creation 
through this form, with the new client guard in the path
   - `accessibility.spec.ts` 5/5; `lint` silent with `eslint-suppressions.json` 
unchanged; `format:check` clean on tracked files; `tsc` clean; `i18n:check` 
consistent with `fr` and `hi` carrying the new key
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to