Remove duplication from stats presenters#11551
Merged
Conversation
With the refactor, the method with the collection in the case of conferences is being change from `highlighted` to `collections`, so we also change the specs accordingly.
e4cfad6 to
1b8c760
Compare
alecslupu
suggested changes
Sep 5, 2023
Contributor
alecslupu
left a comment
There was a problem hiding this comment.
This is a great change, but i would go one step further to simplify. Also, it would be great to have some consistency while using endless methods. What do you think?
decidim-assemblies/app/presenters/decidim/assemblies/assembly_stats_presenter.rb
Show resolved
Hide resolved
decidim-conferences/app/presenters/decidim/conferences/conference_stats_presenter.rb
Show resolved
Hide resolved
decidim-elections/app/presenters/decidim/votings/voting_stats_presenter.rb
Show resolved
Hide resolved
...sses/app/presenters/decidim/participatory_processes/participatory_process_stats_presenter.rb
Show resolved
Hide resolved
* Remove unecessary method * Implement endless methods * Make them private
Member
Author
|
@alecslupu ready to another review |
alecslupu
suggested changes
Sep 5, 2023
Contributor
alecslupu
left a comment
There was a problem hiding this comment.
@andreslucena I have seen something else that could be improved, that i have missed the first time.
Also, i guess we need to have a look in ParticipatoryProcessGroupStatsPresenter as well, since we have some duplicated methods ( collection, component_stats )
andreslucena
commented
Sep 5, 2023
andreslucena
commented
Sep 5, 2023
Suggested by code review Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
entantoencuanto
added a commit
that referenced
this pull request
Sep 8, 2023
…gn-staging * fix/activities-block-follow-button: (27 commits) Add tests to follow button in processes and assemblies landing page Add follow button to participatory spaces last activities content block Remove duplication from participatory spaces publications controllers (#11549) Fix the a11y tool icons with redesign (#11175) Remove duplication from amendments events specs (#11553) Remove duplication from elections' user roles forms (#11548) Update Node.js from v16.13.0 to v18.17.1 (#11564) Remove duplication from stats presenters (#11551) Fix Bootsnap configuration (#11483) Remove duplication for add questions specs examples (#11559) Remove duplication from invites queries (#11552) Fix typos and copy-paste errors from comments and examples (#11536) Fix conference venues meetings visibility (#11542) Add recognition to BrowserStack in the README (#11546) Remove unused view hook for `:upcoming_meeting_for_card` (#11543) Remove unused dependency: `wicked` (#11150) Clean-up initiatives signature URLs and methods (#11545) Refactor initiative signing wizard (#10731) Fix Permissions screen on budgets throw errors (#11532) Redesign: read more literal (#11516) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎩 What? Why?
CodeClimate found that the stats presenters were duplicated. This PR refactors them so they're no longer duplicated.
📌 Related Issues
Testing
All the CI should be green
📷 Screenshots
From Codeclimate:
Mind that the link will expire in a couple of weeks.
Also it's mentioning two locations but I found a couple more locations.