Skip to content

feat(myopencre): improve CSV import error handling in UI#683

Merged
northdpole merged 6 commits intoOWASP:mainfrom
PRAteek-singHWY:myopencre-csv-frontend-errors
Feb 27, 2026
Merged

feat(myopencre): improve CSV import error handling in UI#683
northdpole merged 6 commits intoOWASP:mainfrom
PRAteek-singHWY:myopencre-csv-frontend-errors

Conversation

@PRAteek-singHWY
Copy link
Contributor

@PRAteek-singHWY PRAteek-singHWY commented Dec 28, 2025

⚠️ This PR depends on:

Please review this PR after the above PR is merged.


Scope note (important)

The intended change in this PR is limited to:

  • application/frontend/src/pages/MyOpenCRE/MyOpenCRE.tsx

Any other file diffs shown by GitHub are inherited from branch history / stacking and are not part of the frontend error-handling change itself.

Please let me know if you’d prefer this rebased or split further.


Summary

Closes #584 (partial)

This PR improves the MyOpenCRE frontend experience by surfacing clear, structured feedback for CSV import results, directly reflecting backend validation responses.

The goal is to make CSV imports easier to understand and debug for users, without changing any backend logic.


What this PR does

Frontend error handling

  • Displays backend validation errors directly in the UI
  • Handles:
    • Empty CSV uploads
    • Invalid CRE format errors
    • Misaligned CSV columns
    • General validation failures
  • Row-level errors are rendered with clear, human-readable messages
    (row number + validation reason)

Success feedback

  • Displays a success message after import
  • Shows:
    • Number of new CREs added
    • Number of standards imported

UX improvements

  • Clears stale success/error messages when a new file is selected
  • Prevents ambiguous or misleading upload states
  • Keeps frontend behavior tightly aligned with backend responses

Screenshots

1. Empty CSV upload
image

2. Invalid CRE entry (bad_cre.csv)
image

3. Misaligned CSV columns (misaligned_columns.csv)
image

4. Successful import (valid.csv)
image

What is intentionally out of scope


Why this approach

The backend now returns clear, structured validation responses.
This PR ensures those responses are presented cleanly in the UI, making CSV imports:

  • Easier to debug
  • Less confusing for users
  • More production-ready without adding frontend-specific validation logic

Feedback welcome

If there are UX improvements, edge cases, or error formats that should be handled differently, I’d really appreciate guidance and am happy to iterate.

@PRAteek-singHWY PRAteek-singHWY force-pushed the myopencre-csv-frontend-errors branch from 717745e to 3c2e860 Compare February 27, 2026 13:55
@northdpole northdpole merged commit 4de782b into OWASP:main Feb 27, 2026
2 checks passed
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.

MyOpenCRE: create frontend

2 participants