-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Fix showing not visible proposals in process home page #3175
Conversation
@decidim/lot-core and @deivid-rodriguez can you take a look on specs to check if is possible to write it in a better way? I would appreciate it very much. |
@rbngzlv Good job. The specs look perfectly readable to me! One thing I think could be improved is those magic numbers: the hardcoded number of hightlighted proposals the view hooks display. If we extract those numbers to a class methods, constant, config_accessors or whatever, we can mock those methods in the spec, making it more readable, removing the need for the comments, and making the spec resilient to a change in the magic number. |
This is just what I was asking, how to improve the magic numbers. Thanks @deivid-rodriguez! |
d9a8b5f
to
a926973
Compare
a926973
to
651c2bf
Compare
651c2bf
to
68d91a8
Compare
@decidim/lot-core this PR fixing a bug is ready to be reviewed and merged. Once merged I'll do a backport to |
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.
Couple of minor comments, but looks good to me otherwise!
CHANGELOG.md
Outdated
@@ -10,6 +10,8 @@ controller or added a new module you need to rename `feature` to `component`. | |||
|
|||
**Added**: | |||
|
|||
- **decidim-proposals**: Fix view hooks returning proposals that should not be shown [\#3175](https://github.com/decidim/decidim/pull/3175) |
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.
This should go to the bug fixes section.
let!(:proposals) { create_list(:proposal, highlighted_proposals + 2, component: component) } | ||
|
||
it "shows the amount of proposals configured" do | ||
visit resource_locator(participatory_process).path |
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.
Isn't the participatory_process_group_path
where you want to go here?
Thanks for the review @deivid-rodriguez, your comments are totally true. Fixed! |
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.
Looks good to me!
# Public Setting that defines how many proposals will be shown in the | ||
# process_group_highlighted_elements view hook | ||
config_accessor :process_group_highlighted_proposals_limit do | ||
3 |
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.
These two new settings have different values, is this intended?
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.
Yes! It is intended.
🎩 What? Why?
The detail of the process shows all the proposals of that process. It doesn't filter if the proposals are draft, moderated or withdrawn.
📌 Related Issues
📌 Related PR
0.10-stable
: [Backport] Fix showing not visible proposals in process home page #3199📋 Subtasks
CHANGELOG
entry📷 Screenshots (optional)