-
Notifications
You must be signed in to change notification settings - Fork 433
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
Multiple notification filters #16101
Multiple notification filters #16101
Conversation
940baf4
to
eb0b97a
Compare
813b9f2
to
5e12679
Compare
b555a0d
to
21c4027
Compare
1fcf0fc
to
805dad8
Compare
37f545e
to
dc969a2
Compare
047556e
to
998aac8
Compare
5ac4349
to
9f3f45e
Compare
78efd5f
to
8815369
Compare
src/api/app/controllers/webui/users/notifications_controller.rb
Outdated
Show resolved
Hide resolved
src/api/app/controllers/webui/users/notifications_controller.rb
Outdated
Show resolved
Hide resolved
src/api/app/controllers/webui/users/notifications_controller.rb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the feedback from others, I caught the following:
- Text in the spec
- Confusing behaviour of the counters (mentioned in a previous comment).
src/api/spec/controllers/webui/users/notifications_controller_spec.rb
Outdated
Show resolved
Hide resolved
Yeah, that sounds like a bug |
Adapt the cleanup job using a scope
When we mark notifications as read or unread we get the authenticity_token and several other parameters. When using strong parameters, we have to explicitly permit them otheriwise the form is never going to work. By namespacing the notification params, we can just forget about those other params.
Only when one of the two status is selected [Read|Unread]. In case of both, the multiselection is disabled: it would be tricky to select multiple notifications with different status and mark them "Read" or "Unread" with no real criteria to decide.
8b707b5
to
d2954bd
Compare
This will be the foundation where we'll build a better openSUSE#16101. We decouple the read/unread status of a notification from it's type (which notifiable it associated to).
This will be the foundation where we'll build a better openSUSE#16101. We decouple the read/unread status of a notification from it's type (which notifiable it associated to).
This will be the foundation where we'll build a better openSUSE#16101. We decouple the read/unread status of a notification from it's type (which notifiable it associated to).
This will be the foundation where we'll build a better openSUSE#16101. We decouple the read/unread status of a notification from it's type (which notifiable it associated to).
Superseded by #16183 |
What's changed?
Before, there was a list of links, where every link was loading a different subset of notifications based on a query string parameter
type=....
. It was possible to load one type of notifications at a time.I.e.:
After, there are a list of filter options (the same amount of before), but now they are checkboxes, part of a form that can be submitted by an
Apply
button; this submit loads a subset of notifications filtered by the criteria of the checkboxes selection, this time as a multiple flavors selection based onstatus/type/project/group
at the same time combining them with anAND
among the filter group, and with anOR
among the internal filter group option.I.e.:
Note
By default, if no filter is selected at all, it returns the list of
Unread
notifications only and it automatically check theUnread
filter checkbox. It is intended to be so because at first, the user wants to read the Unread notifications only. Just in case the user selects theRead
filter checkbox and applies the filter, then the read notifications will be rendered too.Note 2
Now that potentially both Read and Unread notifications are selected and rendered, when that scenario happens, the notification action bar that contains the select all checkbox and Mark all as read|unread button is not visible, due to the risk of misunderstanding: it would not be a mark as but it would be a toggler of the state of each selected notification, which is seldom the desired behavior for a multiple selection.
Before
After