Skip to content

Fixed notification bell#102

Merged
HerrKanin merged 1 commit into
mainfrom
bugfix/notification_bell
Apr 23, 2026
Merged

Fixed notification bell#102
HerrKanin merged 1 commit into
mainfrom
bugfix/notification_bell

Conversation

@HerrKanin

@HerrKanin HerrKanin commented Apr 23, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

Release Notes

  • New Features
    • Added a notification dropdown menu to the dashboard with an unread badge indicator
    • Users can view recent notifications and click to navigate to the associated incident
    • Notifications are automatically marked as read upon interaction

@coderabbitai

coderabbitai Bot commented Apr 23, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Updated Spring Security to require authentication and extend CSRF ignoring for /notifications/** endpoints. Enhanced the dashboard with a notification dropdown UI component that fetches user notifications, renders them with read/unread states, and marks notifications as read when accessed.

Changes

Cohort / File(s) Summary
Spring Security Configuration
src/main/java/org/example/team6backend/config/SecurityConfig.java
Extended authorization rules to require authentication for "/notifications/**" alongside existing authenticated endpoints. Added "/notifications/**" to CSRF ignore list to complement existing ignored paths.
Dashboard Notifications UI
src/main/resources/static/dashboard.html
Added notification dropdown navbar component with unread badge indicator. Integrated notification fetching from /notifications/user endpoint during user load, rendering with read/unread styling. Implemented click handler to mark notification as read and navigate to associated incident detail view.

Sequence Diagram(s)

sequenceDiagram
    participant User as User (Browser)
    participant Dashboard as Dashboard.html
    participant Backend as Backend Server
    
    User->>Dashboard: Access dashboard
    Dashboard->>Backend: loadCurrentUser()
    Backend-->>Dashboard: User data (active status)
    
    Dashboard->>Backend: GET /notifications/user
    Backend-->>Dashboard: Notification list
    Dashboard->>Dashboard: Render notification dropdown with badge
    
    User->>Dashboard: Click notification item
    Dashboard->>Backend: PATCH /notifications/{id}/read
    Backend-->>Dashboard: Confirmation
    Dashboard->>Dashboard: Redirect to viewincident.html
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 Notifications flutter by,
With badges catching every eye,
Security walls keep threats at bay,
While dashboards show the light of day.
A hop, a click, and off we go,
To incidents we need to know!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Fixed notification bell' is vague and generic; while it references 'notification' which appears in the changes, it lacks specificity about what was fixed or what the actual changes accomplish. Consider a more descriptive title such as 'Add notification dropdown UI and authentication' or 'Implement notification bell with read status tracking' to better reflect the significant changes made.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/notification_bell

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 and usage tips.

@HerrKanin
HerrKanin merged commit 373bfd6 into main Apr 23, 2026
2 of 3 checks passed
@kristinaxm
kristinaxm deleted the bugfix/notification_bell branch April 23, 2026 17:30
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.

1 participant