Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#8767] notifications: add fine-grained notification settings per user #6036

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

vellip
Copy link
Collaborator

@vellip vellip commented Feb 4, 2025

Describe your changes
This change adds the backend for more fine-grained notification settings. They are separated into:

  • notify fields, which are meant for email notifications, and
  • track fields, which are meant for activity-feed type (in-app) notifications

To not overflow the User model with a multitude of boolean fields a OneToOneField was used, pointing to User. It will be generated via signal, and if it does not exist still, on signup.

This PR also updates the frontend to allow for saving these values into the database and a cleaner frontend code.

Tasks

  • PR name contains story or task reference
  • Steps to recreate and test the changes
  • Documentation (docs and inline)
  • Tests (including n+1 and django_assert_num_queries where applicable)
  • Changelog

.map((n) => Object.keys(n.notifications).some((key) => notificationsState[key]))
}, [notificationsState, showRestricted])

return [
Copy link
Contributor

Choose a reason for hiding this comment

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

wonder if returning an object here would make life easier

@hom3mad3
Copy link
Contributor

@vellip since this is quite django heavy, i'll leave it for someone else to review and merge @goapunk @m4ra @partizipation

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.

2 participants