Repository navigation
fix(intake-forms): show all formFields in list page, not just deprecated requiredFields - #30782
anuj-kumary wants to merge 4 commits into
Conversation
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
…ted requiredFields IntakeFormsPage was fetching and rendering `requiredFields` (the deprecated compatibility view) instead of the canonical `formFields` array. This caused the Playwright test to fail because it expected all three included fields (two optional, one required) to be visible in the table — but only the single required field was rendered. Switch to `getIntakeFormFields(record)` which prefers `formFields` and falls back to `requiredFields` for backwards compatibility. Also request `formFields` in the API call alongside `requiredFields` so the data is present.
3712549 to
95e0156
Compare
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
| } | ||
| const list = await listRes.json(); | ||
| const forms = (list.data ?? []) as Array<{ id: string; entityType: string }>; | ||
| for (const form of forms) { | ||
| if (form.entityType === entityType) { | ||
| await api.delete( |
There was a problem hiding this comment.
Cleanup deletes unrelated intake forms
If the test environment already contains a domain intake form created by another fixture or suite, ensureNoIntakeForm hard-deletes it during both setup and teardown, causing order-dependent failures and lost shared test configuration. Cleanup should track and remove only the resource owned by this test.
| {getIntakeFormFields(record).length === 0 ? ( | ||
| <Typography className="tw:text-tertiary" size="text-sm"> | ||
| {t('label.none')} | ||
| </Typography> | ||
| ) : ( | ||
| (record.requiredFields ?? []).map((rf) => ( | ||
| getIntakeFormFields(record).map((field) => ( | ||
| <Badge | ||
| color={ | ||
| rf.fieldKind === FieldKind.CustomProperty | ||
| field.fieldKind === FieldKind.CustomProperty | ||
| ? 'gray' | ||
| : 'brand' | ||
| } | ||
| key={rf.fieldPath} | ||
| key={field.fieldPath} | ||
| size="sm" | ||
| type="pill-color"> |
There was a problem hiding this comment.
💡 Quality: Column header still labeled 'Required Fields' but shows all fields
The column cell now renders every field via getIntakeFormFields(record) (required and optional), but the column header on line 187 still uses t('label.required-fields') ("Required Fields"), which is misleading to users. The PR description states the intent to rename this to label.field-plural; the change appears to have been reverted/omitted in this commit. Update the header key to label.field-plural (or another neutral label) so it accurately reflects that optional fields are shown too.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 resolved / 2 findingsUpdates the intake form list page to request and display all formFields rather than only deprecated requiredFields, accompanied by new Playwright coverage. Consider updating the column header label from 'Required Fields' to better reflect that all fields are now shown. 💡 Edge Case: Required timeInterval no longer validates the 'end' valueThe 'end' Form.Item lost its Re-apply the required rule to the 'end' field so a required interval needs both bounds.💡 Quality: Column header still labeled 'Required Fields' but shows all fields📄 openmetadata-ui/src/main/resources/ui/src/pages/IntakeForms/IntakeFormsPage.tsx:187 📄 openmetadata-ui/src/main/resources/ui/src/pages/IntakeForms/IntakeFormsPage.tsx:275-289 The column cell now renders every field via getIntakeFormFields(record) (required and optional), but the column header on line 187 still uses t('label.required-fields') ("Required Fields"), which is misleading to users. The PR description states the intent to rename this to label.field-plural; the change appears to have been reverted/omitted in this commit. Update the header key to label.field-plural (or another neutral label) so it accurately reflects that optional fields are shown too. 🤖 Prompt for agentsOptionsDisplay: 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 |
Why
The Playwright test at
e2e/Pages/IntakeForm.spec.tswas failing because the list page only displayed fields fromrequiredFields(the deprecated compatibility view), but the test expected all threeformFieldsto be visible in the DOM — including the two optional ones.Root cause
IntakeFormsPage.tsxwas:owners,requiredFieldsfrom the API (noformFields)record.requiredFields ?? []which only contains fields whererequired: trueThe test creates a form with 3
formFields(1 required, 2 optional) and asserts all three show asextension.<propertyName>in the table. Only 1 was rendered → assertion on index 1 failed → entire serial suite cascaded.Fix
formFieldsalongsiderequiredFields:fields: 'owners,formFields,requiredFields'getIntakeFormFields(record)(already inIntakeFormUtils.ts) which prefersformFieldsand falls back to the deprecatedrequiredFieldsfor backward compatlabel.required-fields→label.field-pluralto reflect that all included fields (required and optional) are shownThe collate-ui vendored copy already had this correct implementation; this PR ports it back to the OSS source.
Test plan
IntakeForm.spec.tsE2E suite passes — all threeextension.<propertyName>badges render in the list rowSummary by Gitar
formFieldsrather than only deprecatedrequiredFields{columns, rows}structureThis will update automatically on new commits.
Greptile Summary
The PR expands the intake-form list to display current form fields, corrects custom-property table and entity-reference serialization, and adjusts intake-form editor layout and validation.
formFieldswhile retaining the deprecatedrequiredFieldsfallback.idby allowing index-keyed grid rows without an injected identifier.{columns, rows}form and unwraps single entity-reference picker arrays.Confidence Score: 4/5
The production changes appear safe to merge, with a non-blocking test-isolation issue in the new Playwright suite.
The runtime changes align field retrieval and serialization with their actual API and widget shapes; the remaining concern is that the new test broadly deletes unrelated domain intake-form state.
Files Needing Attention: openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/IntakeFormCustomPropertyFields.spec.ts
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart LR Form[Intake form fields] --> Domain[Domain creation form] Domain --> Widgets[Custom-property widgets] Widgets --> Serialize[serializeExtensionValue] Serialize --> Payload[Domain extension payload] Payload --> API[Domain REST API] ListAPI[Intake forms API] --> Effective[getIntakeFormFields] Effective --> List[Intake forms list badges]Reviews (1): Last reviewed commit: "fix(intake-forms): show all formFields i..." | Re-trigger Greptile
Context used: