Skip to content

fix(ui): trim input values and add deploy-success toast key - #31508

Merged
chirag-madlani merged 3 commits into
mainfrom
fix/collate-automation-deploy-toast
Aug 14, 2026
Merged

fix(ui): trim input values and add deploy-success toast key#31508
chirag-madlani merged 3 commits into
mainfrom
fix/collate-automation-deploy-toast

Conversation

@chirag-madlani

Copy link
Copy Markdown
Collaborator

Summary

Two small fixes that unblock the Collate AI Automation follow-up PR (open-metadata/openmetadata-collate fix/ai-automations-suite):

  • renderFieldElement — trim onChange values. Input, textarea, password, and search variants now call onChange?.(value.trim()) so leading/trailing whitespace can't leak into names, emails, connection URLs, or other identifiers. Four call sites, one line each.
  • New i18n key server.deploy-entity-success. {{entity}} deployed successfully. The Collate wizard's auto-deploy path renders it as a success toast; without the key the toast would show the raw key on every create/edit save. All 20 locales updated (English + 19 translations, not English-fallback placeholders).

Test plan

  • yarn i18n is idempotent after the edits (no new pushes)
  • Every non-en-us locale has a real translation (checked: grep "deployed successfully" src/locale/languages/*.json returns zero non-English hits)
  • CI green
  • Manual: type " admin " into a form field, blur, confirm the trimmed value is what the form submits

🤖 Generated with Claude Code

- render-field-element: trim onChange values for input, textarea, password
  and search fields so trailing/leading whitespace can't leak into names,
  emails, URLs, or other identifiers.
- Add `server.deploy-entity-success` locale key + translations for all
  20 locales; used downstream by the Collate automation wizard to signal
  that a create/edit auto-deploy succeeded.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 14, 2026 05:13
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Aug 14, 2026
@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 66%
66.77% (79685/119329) 51.16% (48598/94981) 52.11% (14547/27911)

@github-actions

github-actions Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit a6cf5ab2f6efe75f651811b68842cab774805b8e in Playwright run 31780401326, attempt 1.

✅ 160 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky

Performance

Blocking targets: ✅ met · Optimization targets: 🟡 in progress

Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting.

🕒 Full workflow signal wall (to summary) 51m 47s

⏱️ Max setup 3m 29s · max shard execution 12m 35s · max shard-job elapsed before upload 18m 34s · reporting 5s

🌐 207.12 requests/attempt · 2.03 app boots/UI scenario · 0.00% common-shard skew

Optimization targets still in progress:

  • Browser traffic was 207.12 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.03 per UI scenario (350 boots / 172 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
✅ Shard chromium-01 86 0 0 0 0 0
✅ Shard global-state-01 10 0 0 0 0 0
✅ Shard ingestion-01 33 0 0 0 0 0
✅ Shard ingestion-02 31 0 0 0 0 0

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

Copilot AI review requested due to automatic review settings August 14, 2026 06:03

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…nal onChange

Addresses PR #31508 review: the previous change trimmed only the
external `onChange?.(value.trim())` callback, but `field.onChange(value)`
still stored the untrimmed value into react-hook-form's state. Since
form submission reads RHF state (not the external prop), whitespace
was still leaking into the submitted names, emails, connection URLs,
etc — the stated goal wasn't achieved for the form path.

Now: on blur, if the current field value has surrounding whitespace,
write the trimmed value back to RHF state (and mirror it to the
external onChange). Trimming on blur (not on every keystroke) so the
user can type internal spaces mid-word without the input eating a
trailing space between typed tokens.

Applied uniformly to the four field types the prior commit touched:
Input (text), Password, Number, and Textarea (also covers Description).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings August 14, 2026 07:33

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sonarqubecloud

Copy link
Copy Markdown

@chirag-madlani
chirag-madlani added this pull request to the merge queue Aug 14, 2026
Merged via the queue into main with commit c39fd98 Aug 14, 2026
82 of 84 checks passed
@chirag-madlani
chirag-madlani deleted the fix/collate-automation-deploy-toast branch August 14, 2026 15:56
@gitar-bot

gitar-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Trims input values on blur to ensure the React Hook Form state receives cleaned data and adds the missing deploy-success i18n key across all locales, addressing the external onChange trimming finding. No remaining issues found.

✅ 1 resolved
Bug: Trim applied to external onChange only, not submitted form value

📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/form-field/render-field-element.tsx:205-206 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/form-field/render-field-element.tsx:229-230 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/form-field/render-field-element.tsx:252-253 📄 openmetadata-ui-core-components/src/main/resources/ui/src/components/application/form-field/render-field-element.tsx:276-277
The change trims only the optional external onChange prop callback (onChange?.(value.trim())) while field.onChange(value) still stores the untrimmed value into react-hook-form's state. Since form submission/persistence reads react-hook-form's field state (not the external prop), the whitespace still leaks into names, emails, connection URLs, and other identifiers — the stated goal is not achieved for the form path. Trim the value once and pass the trimmed value to both, e.g. const trimmed = value.trim(); field.onChange(trimmed); onChange?.(trimmed); — but note trimming on every keystroke prevents typing internal spaces from persisting a trailing space, so trimming in onBlur is usually safer than in onChange.

Options

Display: compact → Showing less information.

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

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.

4 participants