Skip to content

Notification system 🚨#50

Merged
tarekio merged 127 commits intomainfrom
notification-system
Aug 11, 2025
Merged

Notification system 🚨#50
tarekio merged 127 commits intomainfrom
notification-system

Conversation

@cango91
Copy link
Contributor

@cango91 cango91 commented Jan 3, 2025

Jira Issue

Phase 1
Phase 2
Phase 3
Phase 4
Phase 5
Phase 6
Phase 7
Phase 8 (PENDING)
BYNT-1249
BYNT-1254
BYNT-1347
BYNT-1349

Description

[Brief description of changes]

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • New strings prepared for translations
  • Billing project label added
  • API Changes (if applicable)
  • Permissions checked
  • Endpoint tests added

Additional Notes

GET /admin/api/notifications return a paginated list of all notifications for the current user (descending by created date). Accepts page and per_page query parameters. A sample response looks like below

{
        "items": [],
        "currentPage": int,
        "perPage": int,
        "total": int,
        "hasMore": bool,
        "unreadCount": int
        "hasUnreadUrgentNotifications": bool
}

GET admin/api/notifications/unread/count: return the number of unread notifications for the current user. Will have only one field in JSON response unread_count
POST admin/api/notifications/<int:id>/read: mark the notification with id as read, if it belongs to the current user. Will return a message and the notification on success.

Notification Settings

GET /admin/api/configuration/ configuration response will now contain a dict keyed "NOTIFICATIONS" that is a mix of read-only and configurable items and fields.

"config":{
# ...
"NOTIFICATIONS" : {
    # Security notifications
    "LOGIN_NEW_IP": {
        "in_app_enabled": True,
        "email_enabled": True,
    },
    "PASSWORD_CHANGE": {
        "in_app_enabled": True,
        "email_enabled": True,
    },

in_app_locked and email_locked are read-only fields. Any modifications to these fields will be ignored, as well as any modifications to fields that are marked "locked". That is to say, you can omit the "LOGIN_NEW_IP" when PUTing the configuration, because all of its fields are read-only, it will be ignored by the backend completely and won't be actually persisted in the configuration file.

Some notifications will have a mix of locked and unlocked fields. Modifications made to the unlocked fields will be persisted, whereas any modifications to locked fields will be ignored. Any changes to in_app_locked or email_locked are also ignored.

Any notification configuration sent from the frontend is persisted as is (in config.json), but security-related ones get overridden at runtime when loading the settings.

Co-authored-by: cango91 <can.gologlu@gmail.com>
Co-authored-by: Daniel Apodaca <apodacaduron@gmail.com>
@cango91 cango91 added the enhancement New feature or request label Jan 3, 2025
@tarekio tarekio self-requested a review January 3, 2025 12:31
@apodacaduron
Copy link
Contributor

Lots of warnings when interacting with the new dialog. The dialog tabs are not functioning too so far.

@tarekio FYI this feedback was addressed in the other repo, so should be good now

@tarekio tarekio self-assigned this Aug 7, 2025
@tarekio tarekio requested a review from level09 August 8, 2025 12:48
@tarekio tarekio requested a review from level09 August 9, 2025 11:12
Copy link
Collaborator

@level09 level09 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good, Everything is fixed.

@tarekio tarekio merged commit 0b6f5f9 into main Aug 11, 2025
7 checks passed
@tarekio tarekio deleted the notification-system branch August 11, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants