Skip to content

admin-ui: surface preset save field errors inline - #95

Merged
bashrusakh merged 1 commit into
mainfrom
issue-89-clever-dingo
Oct 19, 2026
Merged

bashrusakh merged 1 commit into
mainfrom
issue-89-clever-dingo

Conversation

@bashrusakh

Copy link
Copy Markdown
Owner

Fixes #89

Summary

Preset saves in the Custom Client dialog now surface server validation field errors the same way build-record creation does, instead of showing only Request failed with status code 400.

  • saveCurrentAsPreset snapshots the submitted fields and routes rejected custom_preset/create responses through the existing reportCreateBuildFailure → applyServerFieldErrors pipeline, so pass_approve_mode/incompatible renders as the localized inline error with focus, scroll, and ARIA.
  • custom_preset/create sets useServerErrorMessage: true, so the toast shows the server envelope message rather than the raw axios text.
  • Raw axios errors are no longer logged from this path (they can carry custom_json/permanent_password and the api-token header).

Scope is UI-only; the backend already returns the required data.fields envelope.

Validation

  • node --test tests/custom-client-validation.test.mjs — 72/72 pass
  • npm run build — pass
  • git diff --check — clean
  • Independent review — pass; two low non-blocking test-coverage notes (the wrapper/useServerErrorMessage assertion is source-level, and the inline/ARIA path is behaviorally tested).

Manual verification

  1. Hard-refresh /admin/ (cached index.html).
  2. Custom Client → enable Hide Connection Management → approve mode “Password and click” → Save as preset.
  3. Expect the localized inline error on the approve-mode field (not a raw 400 toast as sole feedback).
  4. Set approve mode to “Password” and save again → success.

@bashrusakh bashrusakh added the bug Something isn't working label Oct 19, 2026
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e929d4d8-1de0-4f46-bf18-ef29d78abae1
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@bashrusakh
bashrusakh marked this pull request as ready for review October 19, 2026 01:02
@bashrusakh
bashrusakh merged commit 6ae6c43 into main Oct 19, 2026
11 checks passed
@bashrusakh
bashrusakh deleted the issue-89-clever-dingo branch October 19, 2026 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save-as-preset shows raw 'Request failed with status code 400' instead of the inline pass_approve_mode error for incompatible Hide Connection Management

1 participant