Skip to content

Fixes 34633: show map fields in agent forms as aligned key = value rows - #35698

Merged
Khairajani merged 12 commits into
mainfrom
dbt-catalog-mapping-map-field-ui
Oct 21, 2026
Merged

Khairajani merged 12 commits into
mainfrom
dbt-catalog-mapping-map-field-ui

Conversation

@Khairajani

@Khairajani Khairajani commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Describe your changes:

Fixes #34633

Map fields in the agent and service forms (for example the dbt agent's Catalog Mapping) looked broken:

  • each value input repeated its key as a label above itself, which pushed it out of line with the key input.

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 Value default: 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 shared FormBuilderV1 widgets 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 formatAdditionalProperties cleanup that service and app forms already run on save. Before, an untouched Catalog Mapping row was saved as newKey: "New Value".

Screenshots (dbt agent → Catalog Mapping, after clicking +)

Before
map-field-before

After
add-button-after

Type of change:

  • Bug fix

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

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with a non-blocking add-button alignment issue for list-valued map entries.

Findings

  1. P2 List add buttons move left ▶

Summary

Map values now hide repeated labels and use their keys as accessible names.

  • Map rows keep their keys and values in one aligned row.
  • Agent saves leave untouched map rows out.

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

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".
@Khairajani Khairajani added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Oct 19, 2026
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.
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 79%
78.96% (127804/161839) 65.3% (44774/68561) 68.32% (25593/37455)

@anuj-kumary anuj-kumary left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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:

  1. Yes/no map values still show the key as a label. FormBuilderV1 uses CoreBooleanField for yes/no values, which sets its own label (schema.title ?? getFormDisplayLabel(name)) and skips getWidgetLabel. So a yes/no value in a map still repeats its key above the toggle. The same ADDITIONAL_PROPERTY_FLAG check would fix it.
  2. 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.
  3. Other forms still start new rows with New Value. translateString={translateFormString} is only set on FormBuilderV1 and IngestionWorkflowForm. Other RJSF forms still pre-fill new rows with New Value. Consider setting it on every form that uses map fields.
  4. The dbt Catalog Mapping form still saves an untouched row. IngestionWorkflowForm doesn't call formatFormDataForSubmit, so a row added and left blank is saved as newKey: '' (previously newKey: '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 = (

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.

@Khairajani Khairajani Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@Khairajani

Khairajani commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks @anuj-kumary! Fixed all four:

  1. Yes/no map values no longer repeat the key.
  2. Same for list and object values.
  3. No longer applies, since the empty default is gone.
  4. The dbt form now drops untouched rows on save, like the service forms do.

Each one has a test.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ UI Checkstyle passed — lint findings in changed files

🔍 ESLint findings in this PR's files — 0 error(s), 1 warning(s)

Errors block the build. Warnings do not yet — they are rules whose backlog is still
being worked down, listed so this PR does not add to it. See docs/ui-code-quality-gate.md.

0 error(s), 1 warning(s) across 1 changed file(s).

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-changed

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.
@Khairajani
Khairajani enabled auto-merge October 19, 2026 10:13
@Khairajani
Khairajani added this pull request to the merge queue Oct 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-10-19T12:57:35Z)

Blocked the queue: playwright-summary

Failed Playwright tests:

  • Flow/ConnectionConfigLayout.spec.ts › should keep advanced fields aligned

@Khairajani
Khairajani added this pull request to the merge queue Oct 19, 2026
@Khairajani
Khairajani removed this pull request from the merge queue due to a manual request Oct 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-19T19:18:22Z)

The entry left the queue before it was built, so no checks ran against it.

@Khairajani
Khairajani enabled auto-merge October 21, 2026 07:15
@Khairajani
Khairajani requested a review from a team as a code owner October 21, 2026 07:15
@gitar-bot

gitar-bot Bot commented Oct 21, 2026

Copy link
Copy Markdown
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

📄 openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilderV1/widgets/coreWidgetUtils.ts:32-36 📄 openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilderV1/widgets/CoreInputWidget.tsx:83 📄 openmetadata-ui/src/main/resources/ui/src/components/common/FormBuilderV1/templates/CoreWrapIfAdditionalTemplate.tsx:47-53
getWidgetLabel now returns undefined for every widget whose schema has ADDITIONAL_PROPERTY_FLAG. That leaves map value inputs (Input, Checkbox, Date, Password, Radio, Select, TextArea) with no label and no aria-label. CoreWrapIfAdditionalTemplate only wraps them with a key <Input> that has a placeholder and a bare = span, and neither is linked to the value control. Screen-reader users now hear an unnamed text field for every Catalog Mapping value. The frontend-a11y rule says every control needs an accessible name and that aria-label is the right tool when there is no visible label. Keep the visual label hidden, but give the value control a name. For example, return the key as an aria name (aria-label={label} or t('label.value-for', { key })) when the additional-property flag is set. Also give the key input an aria-label of t('label.key'), because a placeholder is not a label.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

Comment on lines +30 to +38
{!isMapEntry && (
<Typography
as="label"
className="tw:text-primary"
size="text-sm"
weight="medium">
{title}
</Typography>
)}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 List add buttons move left

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!

@sonarqubecloud

Copy link
Copy Markdown

@Khairajani
Khairajani added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit c87c846 Oct 21, 2026
80 checks passed
@Khairajani
Khairajani deleted the dbt-catalog-mapping-map-field-ui branch October 21, 2026 09:41
Khairajani added a commit that referenced this pull request Oct 22, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dbt: BigQuery tables not linked when manifest database is a Trino catalog alias

3 participants