Skip to content

Conversation

Zhao-Andy
Copy link
Contributor

@Zhao-Andy Zhao-Andy commented Jan 18, 2019

What type of PR is this? (check all applicable)

  • Feature

Description

This allows authors to mute notifications from their articles.

Resolves #234, partially.

WIP:

  • add mute email notifications as well

Wasn't sure how to write a test for muting email notifications.

Screenshots

Example of mute notifications for articles in your dashboard

Added to documentation?

  • no documentation needed

[optional] What gif best describes this PR or how it makes you feel?

LeBlonde James puts a finger over his mouth and says "Shh..."

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jan 18, 2019
Copy link
Contributor Author

@Zhao-Andy Zhao-Andy left a comment

Choose a reason for hiding this comment

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

Left two comments that I was unsure about.

def send_new_comment_notifications(notifiable)
user_ids = notifiable.ancestors.map(&:user_id).to_set
user_ids.add(notifiable.commentable.user.id) if user_ids.empty?
user_ids = notifiable.ancestors.select(:receive_notifications, :user_id).select(&:receive_notifications).pluck(:user_id).to_set
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might be an overkill "faster" query.

@Zhao-Andy Zhao-Andy changed the title Mute notifications for your own article WIP Mute notifications for your own article Jan 18, 2019
@pr-triage pr-triage bot removed the PR: unreviewed bot applied label for PR's with no review label Jan 18, 2019
@Zhao-Andy Zhao-Andy changed the title WIP Mute notifications for your own article Mute notifications for your own article Jan 21, 2019
@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Jan 21, 2019
Copy link
Contributor

@benhalpern benhalpern left a comment

Choose a reason for hiding this comment

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

Looks good overall. Good clean implementation. There were some changes related to HTTP stuff that need to happen before it should be accepted.

@pr-triage pr-triage bot added PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 21, 2019
@pr-triage pr-triage bot added PR: unreviewed bot applied label for PR's with no review and removed PR: reviewed-changes-requested bot applied label for PR's where reviewer requests changes labels Jan 21, 2019
@Zhao-Andy
Copy link
Contributor Author

Zhao-Andy commented Jan 21, 2019

Have to fix some tests first for the email notification part.

@Zhao-Andy Zhao-Andy requested a review from benhalpern January 22, 2019 00:31
Copy link
Contributor

@benhalpern benhalpern left a comment

Choose a reason for hiding this comment

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

Okay. I think this is solid enough.

Ideally the endpoint is idempotent, meaning if there are multiple requests (like a user clicks twice) that it returns the same result.

But it's not the end of the world and could be patched in the future.

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Jan 22, 2019
@benhalpern benhalpern merged commit 9f6d001 into forem:master Jan 22, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged bot applied label for PR's that are merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants