Skip to content

ENG-3695: Surface integration save errors under form fields#8092

Merged
Kelsey-Ethyca merged 5 commits into
mainfrom
ENG-3695-surface-integration-form-errors
May 9, 2026
Merged

ENG-3695: Surface integration save errors under form fields#8092
Kelsey-Ethyca merged 5 commits into
mainfrom
ENG-3695-surface-integration-form-errors

Conversation

@Kelsey-Ethyca
Copy link
Copy Markdown
Contributor

@Kelsey-Ethyca Kelsey-Ethyca commented May 2, 2026

Ticket ENG-3695

Description Of Changes

When saving an integration, server-side validation errors from the secrets PATCH (e.g. BigQuery keyfile_creds JSON parse failures, Zendesk domain allowed-list checks) used to appear as a transient toast that disappeared too quickly to read. The toast also leaked operator-only guidance (FIDES__SECURITY__DOMAIN_VALIDATION_MODE advisory) into user-facing text.

This PR routes 422 detail entries to the offending form field via antd's form.setFields, so the error renders directly under the input with a cleaned, human-readable message. Toasts are preserved as the fallback for non-validation errors (network, 500s, unmapped 422s).

The fix covers all four places an integration can be created or updated:

  • System portal → Integrations tab (ConnectorParameters / ConnectorParametersForm)
  • Integrations page → Add/Edit (ConfigureIntegrationForm)
  • Existing Jira integration → Jira config tab (JiraConfigTab)

Two follow-ups were filed:

  • ENG-3696 (BE): populate loc for model-level secrets validators and split the env-var advisory off the user-facing message so the FE parser doesn't need regex/string-stripping.
  • ENG-3697 (FE): validate fields on blur instead of waiting for Save.

Code Changes

  • New helper clients/admin-ui/src/features/common/form/parseSecretsFieldErrors.ts (+ Jest test). Converts a 422 detail array into [{ name, errors }] for form.setFields. Uses loc[-1] when present, falls back to a for '<field>' regex on the message, gated on the field existing in the caller's knownFields. Strips the Value error, prefix and the env-var advisory tail. Configurable namePrefix (default ["secrets"], set to [] for forms whose fields are top-level).
  • ConnectorParameters.tsx: useConnectorForm.handleSubmit re-throws on parsed validation errors so the form can call setFields; non-mappable errors continue to toast.
  • ConnectorParametersForm.tsx: handleFinish catches and applies setFields, short-circuits the post-save mask/property-assignment logic on error.
  • ConfigureIntegrationForm.tsx: both error branches (the connection PATCH that bundles secrets in create flow, and the dedicated secrets PATCH) route to setFields first, fall back to existing toasts.
  • JiraConfigTab.tsx: handleSave catch routes to setFields against the four Jira secret fields (namePrefix: [] since they're top-level).

Steps to Confirm

  1. Go to a system → Integrations tab → add or edit a BigQuery integration. Paste not valid json into Keyfile creds → click Save. Expect: error appears under the Keyfile creds field; no toast.
  2. Same flow with a Zendesk integration → set Domain to sfesdfesk.com → click Save. Expect: error appears under the Domain field, env-var advisory stripped; no toast.
  3. Repeat (1) on the Integrations page (Add Integration → BigQuery). Expect: same behaviour.
  4. Repeat (2) on the Integrations page (Add Integration → Zendesk). Expect: same behaviour.
  5. Existing Jira integration → Jira config tab → trigger any field validation failure (e.g. clear out a required field via DOM and submit, or wait for ENG-3696 BE work for stronger server checks). Expect: field-level error.
  6. Sanity: leave a required field blank and tab out → existing on-blur required-field error still appears. Trigger a 500 or network error during save → toast still appears.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
    • Updates unreleased work already in Changelog, no new entry necessary
  • UX feedback:
    • All UX related changes have been reviewed by a designer
    • No UX review needed
  • Followup issues:
    • Followup issues created (ENG-3696, ENG-3697)
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

Server-side secrets validation previously bubbled up as a transient toast
that disappeared too quickly to read. Now 422 detail entries are mapped
to the offending form field (BigQuery's keyfile_creds, Zendesk's domain,
etc.) via parseSecretsFieldErrors and rendered under the field via antd
form.setFields. Toasts remain the fallback for non-validation errors.
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated (UTC)
fides-plus-nightly Ignored Ignored Preview May 9, 2026 7:20pm
fides-privacy-center Ignored Ignored May 9, 2026 7:20pm

Request Review

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Title Lines Statements Branches Functions
admin-ui Coverage: 8%
6.68% (3082/46073) 6.04% (1604/26541) 4.67% (636/13617)
fides-js Coverage: 78%
79.51% (2019/2539) 66.24% (1248/1884) 73.31% (349/476)
privacy-center Coverage: 85%
82.53% (364/441) 79.74% (189/237) 74.07% (60/81)

@Kelsey-Ethyca Kelsey-Ethyca marked this pull request as ready for review May 3, 2026 16:14
@Kelsey-Ethyca Kelsey-Ethyca requested a review from a team as a code owner May 3, 2026 16:14
@Kelsey-Ethyca Kelsey-Ethyca requested review from lucanovera and removed request for a team May 3, 2026 16:14
Copy link
Copy Markdown
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Nice UX improvement! Followed the steps and got the expected outcome. Code changes look good. Approved

@Kelsey-Ethyca Kelsey-Ethyca added this pull request to the merge queue May 7, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 7, 2026
@Kelsey-Ethyca Kelsey-Ethyca added this pull request to the merge queue May 8, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 8, 2026
@Kelsey-Ethyca Kelsey-Ethyca added this pull request to the merge queue May 9, 2026
@Kelsey-Ethyca Kelsey-Ethyca removed this pull request from the merge queue due to a manual request May 9, 2026
Why: orphaned import was tripping the workspace lint job (Clients-Unit)
on this PR, since main only runs lint when fides-js files change.
@Kelsey-Ethyca Kelsey-Ethyca enabled auto-merge May 9, 2026 19:21
@Kelsey-Ethyca Kelsey-Ethyca added this pull request to the merge queue May 9, 2026
Merged via the queue into main with commit 51dc721 May 9, 2026
51 checks passed
@Kelsey-Ethyca Kelsey-Ethyca deleted the ENG-3695-surface-integration-form-errors branch May 9, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants