Skip to content

Fix comments newsletter participant ids#7046

Merged
oriolgual merged 6 commits intodevelopfrom
fix/newsletter_participant_ids
Jan 14, 2021
Merged

Fix comments newsletter participant ids#7046
oriolgual merged 6 commits intodevelopfrom
fix/newsletter_participant_ids

Conversation

@Leusev
Copy link
Copy Markdown
Contributor

@Leusev Leusev commented Dec 18, 2020

🎩 What? Why?

At present, the Decidim::Comments::Comment's method newsletter_participant_ids isn't filtering correctly by sent space's param, so when recovering all Decidim::User's ids, instead doing it by participatory space it's doing it by all organization's spaces.

def self.newsletter_participant_ids(space)

image

This PR fix that to filter by method's space param received.

📌 Related Issues

Testing

Describe the best way to test or validate your PR.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing

♥️ Thank you!

Copy link
Copy Markdown
Contributor Author

@Leusev Leusev left a comment

Choose a reason for hiding this comment

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

Well done @tramuntanal , great work! 😄

@Leusev Leusev marked this pull request as ready for review January 8, 2021 09:04
@tramuntanal
Copy link
Copy Markdown
Contributor

Hi @decidim/core this PR is ready for review

@oriolgual oriolgual merged commit 953d86f into develop Jan 14, 2021
@oriolgual oriolgual deleted the fix/newsletter_participant_ids branch January 14, 2021 09:13
tramuntanal added a commit that referenced this pull request Jan 20, 2021
* Fix comments newsletter participant ids

* Introduce Commentable.user_commentators_ids_in(resource)

* More performant query for Order newsletter participants

* Refactor, compute commentators in #newsletter_participant_ids(component)

Instead of iterating components twice in NewsletterRecipients#participant_ids
one for participants and one for commentators

* Rubocopify

* Rubocopify core module

Co-authored-by: Oliver Valls <199462+tramuntanal@users.noreply.github.com>
@mrcasals mrcasals added module: admin type: fix PRs that implement a fix for a bug labels Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: admin type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants