Skip to content
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

Show processes finishing today #7594

Conversation

tramuntanal
Copy link
Contributor

@tramuntanal tramuntanal commented Mar 12, 2021

🎩 What? Why?

Please describe your pull request.
ParticipatoryProcesses finishing on the current day (today) are not being listed in the public view.

This is a tricky bug because in some cases it seems the bug does not exist:

  • If there's only one process it is being rendered because the Search thinks there are no :active, :upcoming and :past, and finally queries for :all.
  • If there are many processes but all start today they are all rendered for the same reason as with one single event, the ParticipatoryProcesses#active? method. This is why the seeded processes in the development_app are still visible although the bug.

In fact there are two bugs affecting two places of theParticipatoryProcess class:

  • the ParticipatoryProcesses#active scope. Only the end_date constraint is wrong.
  • and the ParticipatoryProcesses#active? method. Both the start_date and the end_date ought also to consider the current date.

The counters in top of the listed cards are not affected by this bug.
The list of Highlighted processes is not affected by this bug.

📌 Related Issues

Link your PR to an issue

  • Related to #?
  • Fixes #?

Testing

Describe the best way to test or validate your PR.
If a participatory process finishes today I expect it to be listed as an active process.
Create a participatory process finishing today, and make sure there is at least another process not starting neither finishing today.

📋 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

The process finishing today (12/03/2021) is being rendered

image

♥️ Thank you!

@mrcasals mrcasals changed the title Fix Decidim::ParticipatoryProcess.active scope Show processes finishing today Mar 16, 2021
@mrcasals mrcasals merged commit ddb87a1 into decidim:develop Mar 16, 2021
@mrcasals mrcasals added module: participatory processes type: fix PRs that implement a fix for a bug labels Mar 16, 2021
@mrcasals
Copy link
Contributor

@tramuntanal thanks!

@tramuntanal tramuntanal deleted the fix/active_participatory_processes_scope branch March 17, 2021 08:05
@tramuntanal
Copy link
Contributor Author

Thanks @mrcasals , should I backport to 0.24?

@mrcasals
Copy link
Contributor

@tramuntanal that'd be great, yes, thanks!

tramuntanal added a commit to CodiTramuntana/decidim that referenced this pull request Mar 18, 2021
@tramuntanal tramuntanal mentioned this pull request Mar 18, 2021
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: participatory processes type: fix PRs that implement a fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants