Skip to content

[#13471] Add Mark All as Read button for notifications - #14419

Open
Eyablg-ops wants to merge 1 commit into
TEAMMATES:masterfrom
Eyablg-ops:feature/13471-mark-all-notifications-read
Open

Eyablg-ops wants to merge 1 commit into
TEAMMATES:masterfrom
Eyablg-ops:feature/13471-mark-all-notifications-read

Conversation

@Eyablg-ops

Copy link
Copy Markdown

Fixes #13471

What this PR does
Adds a "Mark All as Read" button on the user notifications page. Clicking it marks all unread notifications visible to the current user (GENERAL + account's roles) as read.

Backend

  • New POST /webapi/notifications/read/all endpoint (MarkAllNotificationsAsReadAction).
  • The action derives the relevant notification target users server-side from the current account's roles (GENERAL always, plus STUDENT/INSTRUCTOR when applicable), consistent with how notifications are shown.
  • NotificationsLogic.createReadNotificationsForAllVisible marks newly-read notifications batch-style, skipping ones already marked read, and returns the IDs marked (idempotent; avoids unique-constraint (accountId, notificationId)).

Frontend

  • NotificationService.markAllNotificationsAsRead() consumes the endpoint.
  • The notifications list adds a "Mark All as Read" button (disabled when there are no unread notifications or while a request is in flight); the returned read notification IDs are applied to the current tabs in place, so no refetch is needed.

Testing

  • Java: 3 new logic tests + 4 new action tests (MarkAllNotificationsAsReadActionTest); full backend component suite passes (1082 tests).
  • Frontend: new/extended unit tests for the button; checkstyle, PMD, SpotBugs, ESLint, and Prettier all clean.

This branch has not been deployed

No deployments
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.

Notifications page: mark all as read

1 participant