Remove notification settings for groups and projects you were previously a member of

Summary

In /profile/notifications group and project notification list items include groups and projects that you were previously a member of.

Steps to reproduce

  1. Join a group or a project
  2. Leave a group or a project
  3. Go to /profile/notifications

What is the current bug behavior?

All the groups or projects that you have joined show up even if you have left the group or project.

What is the expected correct behavior?

Do not show group and project notification list items for groups and projects that you were previously a member of (but not anymore).

Output of checks

This bug happens on GitLab.com and during development using GDK.

Possible fixes

Create a new param for active group and project settings in (maybe some backend changes are required for this):

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/profiles/notifications_controller.rb#L4
  2. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/controllers/profiles/notifications_controller.rb#L5

Update loop through list items in:

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/profiles/notifications/show.html.haml#L48
  2. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/profiles/notifications/show.html.haml#L56

Also update group and project count in:

  1. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/profiles/notifications/show.html.haml#L45
  2. https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/views/profiles/notifications/show.html.haml#L51
Edited by George Tsiolis