Skip to content

fix(orders): status change AJAX feedback and destructive action confirmation (#98)#163

Open
b3lz3but wants to merge 1 commit intocaptainpragmatic:masterfrom
b3lz3but:fix/order-status-change-ux
Open

fix(orders): status change AJAX feedback and destructive action confirmation (#98)#163
b3lz3but wants to merge 1 commit intocaptainpragmatic:masterfrom
b3lz3but:fix/order-status-change-ux

Conversation

@b3lz3but
Copy link
Copy Markdown
Contributor

Summary

  • Error feedback: API error messages now display inline in the modal (red banner) instead of a generic alert(). The response JSON is parsed on both success and error HTTP statuses.
  • Destructive confirmation: Selecting "Cancelled" or "Failed" shows a type-to-confirm dialog. The submit button stays disabled until the user types the confirmation word (CANCEL or FAILED).
  • Success flow: Modal closes, success toast appears, page reloads after 600ms to reflect new status.

Closes #98

Test plan

  • All pre-commit hooks pass (DCO, template syntax, i18n)
  • CI: platform, portal, integration, DCO check workflows
  • Manual: test status change success flow (modal closes, toast, page refresh)
  • Manual: test status change error flow (error message in modal)
  • Manual: test destructive confirmation (cancelled/failed require typing)
  • Manual: test closing modal resets confirmation state

Generated with Claude Code

…rmation (captainpragmatic#98)

- Show API error messages inline in the modal instead of generic alert()
- Parse response JSON on both success and error HTTP statuses
- Add type-to-confirm dialog for destructive transitions (cancelled, failed)
- Disable submit button until confirmation word matches
- Close modal and show toast on success, display error in modal on failure
- Reset confirmation state when modal is closed

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Ciprian Radulescu <craps2003@gmail.com>
@b3lz3but
Copy link
Copy Markdown
Contributor Author

Changes

Error handling fix (Audit #5):

  • Previously: HTTP errors threw before parsing JSON, falling through to a generic alert(). The modal stayed open with no feedback.
  • Now: Response JSON is always parsed. Errors display inline in a red banner (#statusError) inside the modal with the actual API message.

Destructive confirmation (Audit #16):

  • All cancelled and failed <option> elements now have data-destructive="true"
  • Selecting a destructive option shows a type-to-confirm input ("Type CANCEL to confirm" / "Type FAILED to confirm")
  • Submit button is disabled until the confirmation word matches
  • Closing the modal resets confirmation state

No Python changes — template-only fix (1 file, ~80 lines net).

@mostlyvirtual requesting your review.

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.

feat(platform-orders): status change AJAX feedback + destructive action confirmation

1 participant