Repository navigation
Fixes 34633: show map fields in agent forms as aligned key = value rows - #35698
Conversation
A map entry's value widget repeated the entry's key as a label above itself, pushing it out of line with the key input, and RJSF filled every new entry with the text "New Value". Map values no longer take a label, new entries start empty, and the key input's placeholder reads "key".
With the value's visible label gone, screen readers announced an unnamed field. The value control is now named by its key, and the key input by "Key" rather than only a placeholder.
anuj-kumary
left a comment
There was a problem hiding this comment.
🟡 Non-blocking: a few map fields still behave the old way
None of these are regressions, but they're worth a follow-up so map fields behave the same everywhere:
- Yes/no map values still show the key as a label.
FormBuilderV1usesCoreBooleanFieldfor yes/no values, which sets its own label (schema.title ?? getFormDisplayLabel(name)) and skipsgetWidgetLabel. So a yes/no value in a map still repeats its key above the toggle. The sameADDITIONAL_PROPERTY_FLAGcheck would fix it. - Maps of lists or objects still show the key as a title. These go through the array and object templates, not the widgets this PR changed, so the key is repeated above the value.
- Other forms still start new rows with
New Value.translateString={translateFormString}is only set onFormBuilderV1andIngestionWorkflowForm. Other RJSF forms still pre-fill new rows withNew Value. Consider setting it on every form that uses map fields. - The dbt Catalog Mapping form still saves an untouched row.
IngestionWorkflowFormdoesn't callformatFormDataForSubmit, so a row added and left blank is saved asnewKey: ''(previouslynewKey: 'New Value'). It's junk either way, but the cleanup from the inline comment could be applied here too.
| }; | ||
|
|
||
| // RJSF fills a new map entry with the text "New Value"; start it empty instead. | ||
| export const translateFormString = ( |
There was a problem hiding this comment.
🔴 Regression: blank map rows are now saved on service and app forms
Starting new map rows empty ('') breaks an existing save-time cleanup. utils/JSONSchemaFormUtils.ts → formatAdditionalProperties removes rows the user added but never filled in, by matching RJSF's default text:
if (key.startsWith('newKey') && data === 'New Value') {
delete formData[key];
}The default is now '', so that check never matches and the blank row is saved as newKey: ''.
Affected: every form that saves through formatFormDataForSubmit, including ConnectionConfigForm, EmbeddedConnectionConfigForm, TestConnection, FiltersConfigForm, AppInstall, AppDetails, AppConfigForm and McpApplicationConfiguration.
Repro: open a database service → Edit connection → click + under Connection Arguments (or Connection Options) → leave the row blank → Save or Test Connection.
- Connection Arguments:
{ newKey: '' }is sent to the database driver as an extra argument, which will likely make test connection and ingestion fail. - Connection Options: adds a junk
?newKey=to the connection URL. - An empty string passes the schema (
type: string), so validation doesn't catch it.
Suggested fix: make the cleanup match the new default:
if (key.startsWith('newKey') && (data === '' || data === 'New Value')) {
delete formData[key];
}Please also add a case to JSONSchemaFormUtils.test.ts: a newKey: '' entry should be removed by formatFormDataForSubmit. The current tests only render the form and never save it, so they don't cover this.
There was a problem hiding this comment.
Good catch, thanks! I've reverted it, so new rows show New Value again and get cleaned up on save. Added a test for that too.
An empty default made an untouched row look finished, so service forms
saved {newKey: ''} into Connection Arguments and Connection Options.
Yes/no, list and object map values no longer repeat their key as a label or title. Agent forms now drop map rows that were added but never filled in, as service and app forms already do on save, and the cleanup is unit-tested.
|
Thanks @anuj-kumary! Fixed all four:
Each one has a test. |
Hiding the repeated key dropped the whole titled panel, and with it the description. Hide only the title.
|
| Count | Rule |
|---|---|
| 1 | openmetadata-imports/no-lower-layer-page-imports |
All findings
| Location | Rule | Message | |
|---|---|---|---|
| 🟡 | src/components/Settings/Services/Ingestion/IngestionWorkflowForm/IngestionWorkflowForm.tsx:47:1 |
openmetadata-imports/no-lower-layer-page-imports |
Pages are route-level composition modules. Move the shared implementation/type to a lower layer instead of importing a page from here. |
Fix locally (fast - only checks files changed in this branch):
make ui-checkstyle-changedThe add button was 28px and the remove buttons 36px, left-aligned in a 40px column, so their right edges were 4px apart. Both are now 36px and end at the same edge.
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ Approved 1 closed / 1 findings🟡 Medium risk · Applying map-row cleanup to agent submissions could discard legitimate entries that match RJSF's default key and value. Map fields in agent and service forms now show each entry as an aligned key = value row, with map values named by their key for screen readers and untouched new rows dropped on save. Resolved the issue where map value inputs lost their only accessible name. No open issues remain. ✅ 1 closed✅ Quality: Map value inputs lose their only accessible name
VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
| {!isMapEntry && ( | ||
| <Typography | ||
| as="label" | ||
| className="tw:text-primary" | ||
| size="text-sm" | ||
| weight="medium"> | ||
| {title} | ||
| </Typography> | ||
| )} |
There was a problem hiding this comment.
For array-valued map entries, hiding the title leaves the add button as the only child of a justify-between row. The button moves from the right edge to the left. This affects real fields such as owner maps whose values are lists.
Keep the button right-aligned when the title is hidden, for example with tw:ml-auto.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
…ws [2.0] (#35895) * Fixes 34633: show map fields in agent forms as aligned key = value rows (#35698) * Show map fields in agent forms as aligned key = value rows A map entry's value widget repeated the entry's key as a label above itself, pushing it out of line with the key input, and RJSF filled every new entry with the text "New Value". Map values no longer take a label, new entries start empty, and the key input's placeholder reads "key". * Give map entry inputs accessible names With the value's visible label gone, screen readers announced an unnamed field. The value control is now named by its key, and the key input by "Key" rather than only a placeholder. * Keep RJSF's "New Value" default for new map entries An empty default made an untouched row look finished, so service forms saved {newKey: ''} into Connection Arguments and Connection Options. * Keep map entries consistent and drop untouched rows from agent forms Yes/no, list and object map values no longer repeat their key as a label or title. Agent forms now drop map rows that were added but never filled in, as service and app forms already do on save, and the cleanup is unit-tested. * Keep the description of object-valued map entries Hiding the repeated key dropped the whole titled panel, and with it the description. Hide only the title. * Fix UI checkstyle: sort imports in IngestionWorkflowForm * Align the map add button with the remove buttons The add button was 28px and the remove buttons 36px, left-aligned in a 40px column, so their right edges were 4px apart. Both are now 36px and end at the same edge. * Expect the map key placeholder to read "key" in the connection layout spec * Check that the map add and remove buttons share a right edge --------- Co-authored-by: anuj-kumary <[email protected]> (cherry picked from commit c87c846) * Test map field fixes through what users get The toggle test now renders the real Toggle and checks its accessible name, and the dbt form test submits an untouched Catalog Mapping row and checks it is not saved. (cherry picked from commit a03184a) --------- Co-authored-by: anuj-kumary <[email protected]>



Describe your changes:
Fixes #34633
Map fields in the agent and service forms (for example the dbt agent's Catalog Mapping) looked broken:
Now map values have no visible label (the key is already the input beside them) and are named by their key for screen readers, and the key input's placeholder reads "key" instead of "option". New entries keep RJSF's
New Valuedefault: an empty default made an untouched row look finished, so it was saved as{newKey: ''}. Yes/no, list and object map values no longer repeat their key either. The fix is in the sharedFormBuilderV1widgets and templates, so every map field gets it.Agent forms (such as the dbt agent) now also drop map rows that were added but never filled in, using the same
formatAdditionalPropertiescleanup that service and app forms already run on save. Before, an untouched Catalog Mapping row was saved asnewKey: "New Value".Screenshots (dbt agent → Catalog Mapping, after clicking +)
Before

After

Type of change:
Tested: 618 UI tests across the form, template, widget, service and app suites pass. Each fix has a test that fails without it. In the running UI, saving the dbt agent after adding an untouched row no longer sends
catalogMapping/newKey.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge, with a non-blocking add-button alignment issue for list-valued map entries.Findings
Summary
Map values now hide repeated labels and use their keys as accessible names.
The ancestry check passed, but the target merge bases differed, so the full PR diff was reviewed as the changes since the last review. Both previous threads were unnumbered and were not reposted.
Reviews (10) · Last reviewed commit: "Merge branch 'main' into dbt-catalog-map..." · Reviewed by Greptile