fix: nurse-doctor & dialog QA regressions from the zard/tailwind migration - #432
Conversation
…nd migration Fixes a batch of QA regressions found while running the migrated nurse and doctor flows against UAT: - workarea: keep visited steps mounted (hidden) instead of destroying them, so form state, option lists and dropdowns survive back/next navigation - cancer-history: re-derive child form groups on every parent-form change and guard the child components, fixing the null FormGroup crash and frozen Next button when the visit category is switched to Cancer Screening - diseaseconfirmation: derive isDoctor from the route so the nurse's checkboxes are enabled; z-checkbox honours [disabled] where mat-checkbox effectively did not - chief-complaints: enable Duration/Description as soon as a complaint is picked from the dropdown, not only on blur, so the dependent fields are usable - nurse.service: stop blanking the chief-complaint string on serialization so the doctor sees the complaint the nurse recorded - confirmation.service: make info alerts non-mask-closable so the blur/change that opens them cannot immediately dismiss them - history sub-forms: guard array initialisation so revisiting a step does not add duplicate rows or leave dropdowns dead (past, family, family-ncd, comorbidity, medication, other-vaccines) - visit-details: seed section visibility from the already-selected visit category on re-entry so sections do not vanish - workarea-validation: drop the mandatory-prescription gate that blocked submit - beneficiary-details: stack all fields in a single vertical column
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…andler SonarCloud flagged each clickable <z-step> (Web:MouseEventWithoutKeyboardEquivalentCheck, 11 reliability bugs) because it had (click) but no keyboard handler. Add tabindex="0" so the step (a role="listitem") is focusable and a (keydown.enter) that mirrors the click, so the stepper is operable by keyboard as well as mouse.
|



Summary
A batch of QA fixes for regressions found while running the migrated nurse & doctor
flows (Angular 20 standalone + Zard UI / Tailwind) against the UAT backend. Most are
migration side-effects — behaviour that Angular Material masked and Zard/Tailwind now
surfaces — plus a couple of genuine flow bugs and one layout tweak.
All changes are template/TS only; no dependency or config changes. Local-only files
(
proxy.conf.js) and theCommon-UIsubmodule are intentionally not included (seeOut of scope).
What & why
Step navigation loses state (systemic)
workarea— visited steps were*ngIf-gated, so leaving a step destroyed itscomponent and wiped form state, option lists and dropdowns. Steps are now kept mounted
and hidden (
isStepRendered+[hidden]), so Back/Next preserves everything.past-history,family-history,family-history-ncdscreening,comorbidity-concurrent-conditions,medication-history,other-vaccines) — guardFormArray initialisation so revisiting a step no longer duplicates rows or leaves
dropdowns dead.
visit-details— seed section visibility from the already-selected visit categoryon re-entry, so Chief Complaints / Investigations etc. don't disappear when navigating
back.
Change-detection crash → frozen "Next" (Cancer Screening)
cancer-history— switching the visit category to Cancer Screening could create thecomponent against a stale, non-cancer parent form, so
.get(...)returnednulland thechild forms stayed null forever, throwing
NG01052/Cannot read properties of nulland freezing change detection (Next stopped responding). Child form groups are now
re-derived on every parent-form change (guarded so a transient stale form can't null a
good reference), and the child components are
*ngIf-guarded so they never mount againsta null form.
Disabled/blocked controls
diseaseconfirmation—isDoctordefaulted totrueand was only ever re-set totrue, so the nurse's Disease Confirmation checkboxes were disabled. Material'smat-checkboxhid this by re-enabling from the form control;z-checkboxhonours[disabled]strictly.isDoctoris now derived from the route (attendant === 'doctor')— nurse can tick the boxes, doctor stays read-only.
chief-complaints— Duration/Description were enabled only on the input's(blur),which doesn't fire reliably when a complaint is picked via mousedown. They're now enabled
the moment a complaint is selected.
Data/flow correctness
nurse.service— the chief-complaint serializer blanked the complaint string, so thedoctor couldn't see what the nurse recorded. It now unwraps only the object form and
preserves the string.
workarea-validation— removed the mandatory-prescription gate that blocked submit.Dialog & layout polish
confirmation.service— infoalert()dialogs are no longer mask-closable. They'refrequently raised from
(blur)/(change)handlers, and the same pointer interaction thatopened them was landing on the backdrop and dismissing them within ~0.5s (Zard's
outsidePointerEventsfires for the opening event). They now stay open until OK/Escape.beneficiary-details— the details card stacks all fields in a single vertical column(dropped
sm:grid-cols-2).Testing
Ran the migrated build locally against the UAT backend and walked the nurse and doctor
flows: NCD screening / NCD care / Cancer Screening visit categories, step Back/Next,
chief complaint entry → doctor view, disease confirmation, BP validation alert, and the
beneficiary details dialog. Verified the reported symptoms are resolved and the console
cascade is gone.
Out of scope / follow-ups
Common-UI(location-information) andwill go through the submodule's own PR + pointer bump.
corrupted visit data rather than a code defect (fresh patients build all steps correctly);
will re-open with a console trace if it recurs on clean data.