AP-042 Incident Oversight page - #559
Open
pratigya245 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the Incident Oversight page to the Admin Panel — a list/detail view for guard-submitted incidents with severity and status filters, and admin-driven status updates.
What's included
getIncidents,getIncident,updateIncident/incidentsand/incidents/:idScope note
The ticket assumed the incidents backend wasn't ready and called for a mock-data-first approach with a follow-up wiring task. Since the backend was already live (full CRUD + severity/status/date filters, RBAC-gated), I skipped mocking and wired directly to the real API — so this covers both the "Mock data" and "Wire incidents API" checklist items in one pass.
Bug found + fixed
While testing, admin/employer/guard all hit "Insufficient permissions" on incident endpoints. Root cause:
seedRoles.js's DB-seeded Role permissions were never updated when the incident feature was added, even thoughrbac.js's in-code fallback list already includedincident:*permissions for these roles. Fixed by adding the missing permissions toseedRoles.jsforadmin,employer, andguard.Evidence
Checklist