Add ability to filter message recipients by activity#3325
Conversation
eemeli
left a comment
There was a problem hiding this comment.
Selecting "Hide whitespace" from the diff view options got rid of the indent noise.
| @@ -43,103 +46,188 @@ def messaging(request): | |||
| @require_POST | |||
| @transaction.atomic | |||
| def send_message(request): | |||
There was a problem hiding this comment.
This function seems to perform an excessive number of DB queries, but it's probably okay to leave this unoptimized given how rarely it'll be called.
There was a problem hiding this comment.
Forgot to mention that the queries are very slow, and might time out. I'll work on that before unlocking the ability to actually send email to the selected users (not to yourself).
|
Testing the functionality on stage, I'm getting a 503 response from trying to send a test notification. Is that intentional? |
|
I'm less concerned about the activity filters being shown, but right now it seems like activity filters are always going to be enabled. Even if number of translations min/max of 0/0 means any number of translations, the date filter is still restricted to within the last year. At the bare minimum can we include an enabled checkbox (with the default being unchecked)? |
The likelihood of someone wanting all 3 filters applied is low, the likelihood of someone forgetting to delete default values if they don't want a filter enabled is high. Testing it out, to actually delete the date from the box I have to: We could remove the defaults to keep everything empty, but I feel like clearly indicating whether an activity filter is enabled or not seems like a better UI |
You don't need to do that if the dates are not set by default. 🤣 But yes, the default browser date field seems to work the way you describe it...
I 100% agree this is not an ideal UX. But while I understand this feature is critical, it's also going to be used very rarely by very few people. And only after we start using it, we'll understand how it's going to be used. So my suggestion is to get it to a point where it’s functional and solves the main problem, and then we can circle back to it after we've collected some usage data and delivered other features. |
|
Alright, then the least bad option here would be to have no default values here then. I'll approve now to not block, but would like default values removed from dates. |
bcolsson
left a comment
There was a problem hiding this comment.
Approved (assuming defaults are removed from the From / To date filters.
This reverts commit fe6289b.
The input is validated as per the spec. We could add additional validation for cases where Maximum < Minimum or To < From, but I'd leave that for later. As you mention, in cases like this we'll not send a message to any users anyways, which is also a validation. |

Fix #3244.
This is a continuation of what was started in #3314. It implements the remaining bits of the Compose screen in the Messaging Center, namely Activity filters. As mentioned in #l10n-team last Friday, Activity filters are always visible, which is not what the spec says, but it’s simpler from the UX and codebase point of view.
The diff looks bigger than the changes actually are because of a dedent in Remove redundand condition and formatting of the HTML file in Update check-box and messaging styling. Hence, I suggest reviewing commit by commit.
Deployed to stage:
https://mozilla-pontoon-staging.herokuapp.com/messaging/