Repository navigation
fix(intake-forms): render all formFields in the 1.13 list page (unblocks 44 AUT cases) - #30785
ShaileshParmar11 wants to merge 2 commits into
Conversation
The intake-forms list page on 1.13 requests only `owners,requiredFields` and iterates `record.requiredFields` -- the deprecated required-only compatibility view. IntakeForm.spec.ts creates a form with three formFields (one required) and asserts all three render, so only one badge appears and the assertion fails. The suite is describe.serial, so this takes out the whole file: 1 failed + 21 skipped per database, 44 cases across the two 1.13 AUT runs. The backend confirms only one field can ever appear here: IntakeFormUtil.toRequiredFields() filters on Boolean.TRUE.equals(field.getRequired()). The test's own preceding assertions -- formFields length 3, requiredFields length 1 -- pass, which pins the mechanism to the list page rather than the API. This hunk was part of the original 1.13 port b387b7f, was lost when that commit was reverted by 320c061, and is absent from both follow-ups: #30724 (backend) and #30726 (UI). It has never been restored -- `git log 320c061..origin/1.13 -- IntakeFormsPage.tsx` is empty. Request formFields alongside requiredFields, render through the existing getIntakeFormFields() helper (which prefers formFields and falls back to the deprecated view), and rename the column to reflect that all included fields are shown. Both prerequisites are already on 1.13: getIntakeFormFields in IntakeFormUtils.ts and label.field-plural in en-us.json. The patched file is now byte-identical to the same file on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
❌ UI Checkstyle Failed❌ ESLint + Prettier + Organise Imports (src)One or more source files have linting or formatting issues. ❌ Tailwind AuditHardcoded Tailwind values found. Use a design-system utility (run ❌ Antd + Less Deprecation GuardA new Affected filesat Function._resolveFilename (node:internal/modules/cjs/loader:1401:15) Fix locally (fast - only checks files changed in this branch): make ui-checkstyle-changed |
|
|
no longer needed |
Code Review ✅ ApprovedUpdates the 1.13 intake forms list page to request and render all form fields using the existing helper, resolving deterministic test failures on both MySQL and PostgreSQL. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |



Describe your changes:
IntakeForm.spec.tsfails deterministically on both 1.13 AUT runs (MySQL and PostgreSQL), 3/3 attempts:The suite is
describe.serial, so one assertion takes out the whole file: 1 failed + 21 skipped per database — 44 cases across the two 1.13 runs. It is the single largest source of non-executed tests in the current AUT reports.Root cause
The 1.13 list page requests only
owners,requiredFieldsand iteratesrecord.requiredFields, which is the deprecated required-only compatibility view. The test creates a form with threeformFields(one required) and asserts all three render asextension.<propertyName>. Only the required one is rendered, so the loop fails on the second.The backend confirms only one field can ever appear there —
IntakeFormUtil.toRequiredFields():And the test's own preceding assertions —
expect(body.formFields).toHaveLength(3)andexpect(body.requiredFields).toHaveLength(1)— pass. So the API is correct and the defect is confined to the list page.Why this is missing on 1.13 specifically
The hunk was in the original 1.13 port
b387b7f83b, was lost when that commit was reverted by320c061881, and is absent from both follow-ups that re-landed the work — #30724 (backend) and #30726 (UI). It fell through the split.It was also written as #30782 and closed unmerged. This is the third attempt; 2.0 and
mainhave had the fix since #30614.Fix
formFieldsalongsiderequiredFieldsso the preferred view is available.getIntakeFormFields(record)helper, which prefersformFieldsand falls back to the deprecatedrequiredFields— so pre-migration rows still render.label.required-fieldstolabel.field-plural, since all included fields are now shown.Both prerequisites already exist on 1.13 —
getIntakeFormFieldsinIntakeFormUtils.ts:25(landed via #30726) and"field-plural"inen-us.json:880— so this is self-contained.The patched file is now byte-identical to
IntakeFormsPage.tsxonmain, so there is no partial-port drift.Type of change:
Tests:
Not executed against a running 1.13 stack — I don't have one, so this is not empirically demonstrated end to end. Stating that plainly rather than implying otherwise.
What was checked:
IntakeFormsPage.tsxonmain(diffclean), so there is no partial-port drift.tscbefore/after on the same config: identical error profile, and this version reports fewer errors than the baseline. No new error class is introduced.getIntakeFormFields(IntakeFormUtils.ts:25) and"field-plural"(en-us.json:880).The decisive check for a reviewer with a 1.13 stack: run
IntakeForm.spec.ts. The failure is deterministic (3/3 attempts on both databases), so one green run settles it — the list row should render threeextension.<propertyName>badges instead of one, and the 21 downstream tests in the serial suite should execute instead of being skipped.Backward compatibility is covered by the helper's fallback — a form with only the legacy
requiredFieldspopulated still renders, marked required.🤖 Generated with Claude Code
Greptile Summary
This fix updates the intake-form list to retrieve and render every form field while retaining compatibility with legacy required-only records.
formFieldsin addition to owners and deprecatedrequiredFields.getIntakeFormFieldsto prefer the current representation and fall back to legacy data.Confidence Score: 5/5
The PR appears safe to merge, with the expanded field rendering aligned with the backend response and compatibility helper contracts.
The list API supports the requested formFields projection, and the selected helper correctly renders current fields while converting legacy requiredFields entries into required form fields.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Page[Intake forms list] -->|Request owners, formFields, requiredFields| API[Intake forms API] API --> Record[IntakeForm record] Record --> Helper[getIntakeFormFields] Helper -->|formFields present| Current[Use all current fields] Helper -->|legacy requiredFields only| Legacy[Convert entries to required fields] Current --> Badges[Render field badges] Legacy --> BadgesReviews (1): Last reviewed commit: "fix(intake-forms): render all formFields..." | Re-trigger Greptile
Context used: