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

Remove show statistics boolean fields in assemblies and processes #13123

Merged
merged 12 commits into from
Jul 15, 2024

Conversation

alecslupu
Copy link
Contributor

@alecslupu alecslupu commented Jul 10, 2024

🎩 What? Why?

Since Decidim 0.28, we have 2 n ew content blocks that we can configure for assemblies and participatory process. If you enable those content blocks, you may get in a situation when you enable the content block, yet the stats to not be shown, as the admin needs to go in the edit assembly admin page, where you would need to enable Show statistics

Testing

  1. Login as admin on localhost, and navigate to admin panel
  2. On an existing assembly, edit the assembly and uncheck Show statistics, then save
  3. In the Landing page, admin make sure you have statistics content block enabled
  4. See the stats are not being displayed.
  5. in the content blocks disable stats, and in the admin enable show statistics
  6. See there are no stats displayed.
  7. Apply patch, and see the show statistics button is gone
  8. See the display control on this matter is being handled only by content block.

Additionally, on Processes you would have the show metrics checkbox that has been removed.

  1. Visit the participatory process admin page
  2. Uncheck show metrics & save the form
  3. Visit the Landing page area & enable the metrics content block
  4. Visit frontend Main page & see the metrics are being displayed.

📷 Screenshots

Please add screenshots of the changes you are proposing
Description

♥️ Thank you!

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request does not contain a valid label. Please add one of the following labels: ['type: feature', 'type: change', 'type: fix', 'type: removal', 'target: developer-experience', 'type: internal']

@alecslupu alecslupu added the type: fix PRs that implement a fix for a bug label Jul 10, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 10, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 11, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 11, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 11, 2024
@alecslupu alecslupu marked this pull request as ready for review July 11, 2024 09:23
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

I think I found more places, can you check them out please?

$ rg -l show_statistic decidim-{assemblies,participatory_processes}/{app/,config/locales/en.yml,lib/,spec/}
decidim-assemblies/config/locales/en.yml
decidim-participatory_processes/config/locales/en.yml
decidim-participatory_processes/spec/commands/update_participatory_process_spec.rb
decidim-assemblies/lib/decidim/assemblies/test/factories.rb
decidim-participatory_processes/lib/decidim/participatory_processes/test/factories.rb
decidim-assemblies/lib/decidim/api/assembly_type.rb
decidim-participatory_processes/lib/decidim/api/participatory_process_type.rb
decidim-assemblies/spec/commands/update_assembly_spec.rb
decidim-assemblies/spec/forms/assembly_form_spec.rb
decidim-assemblies/spec/system/homepage_content_blocks_spec.rb
decidim-assemblies/spec/system/assemblies_spec.rb
decidim-assemblies/app/presenters/decidim/assemblies/admin_log/assembly_presenter.rb
decidim-participatory_processes/app/serializers/decidim/participatory_processes/participatory_process_importer.rb
decidim-assemblies/spec/serializers/decidim/assemblies/assembly_serializer_spec.rb
decidim-participatory_processes/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb
decidim-assemblies/spec/types/assembly_type_spec.rb
decidim-assemblies/spec/types/integration_schema_spec.rb
decidim-participatory_processes/app/controllers/decidim/participatory_processes/participatory_processes_controller.rb
decidim-participatory_processes/spec/controllers/participatory_processes_controller_spec.rb
decidim-participatory_processes/spec/system/homepage_content_blocks_spec.rb
decidim-participatory_processes/spec/serializers/decidim/participatory_processes/participatory_process_importer_spec.rb
decidim-assemblies/app/serializers/decidim/assemblies/assembly_serializer.rb
decidim-assemblies/app/serializers/decidim/assemblies/assembly_importer.rb
$ rg -l show_metrics decidim-{assemblies,participatory_processes}/{app/,config/locales/en.yml,lib/,spec/}
decidim-participatory_processes/config/locales/en.yml
decidim-participatory_processes/spec/commands/update_participatory_process_spec.rb
decidim-participatory_processes/lib/decidim/participatory_processes/test/factories.rb
decidim-participatory_processes/lib/decidim/api/participatory_process_type.rb
decidim-participatory_processes/spec/serializers/decidim/participatory_processes/participatory_process_importer_spec.rb
decidim-participatory_processes/app/serializers/decidim/participatory_processes/participatory_process_importer.rb
decidim-participatory_processes/app/serializers/decidim/participatory_processes/participatory_process_serializer.rb

github-actions[bot]
github-actions bot previously approved these changes Jul 11, 2024
@andreslucena
Copy link
Member

The failing spec is related, can you check it out?

   expected no Exception, got #<StandardError: Field 'showStatistics' doesn't exist on type 'Assembly'> with backtrace: 

github-actions[bot]
github-actions bot previously approved these changes Jul 12, 2024
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

I found four other relevant files and I think we should be ready to merge:

./decidim-dev/lib/decidim/dev/assets/assemblies.json:    "show_statistics": false,
./decidim-dev/lib/decidim/dev/assets/participatory_processes_with_null.json:    "show_statistics": true,
./decidim-dev/lib/decidim/dev/assets/assemblies_with_null.json:    "show_statistics": false,
./decidim-dev/lib/decidim/dev/assets/participatory_processes.json:    "show_statistics": true,

Also I think this should be a type: removal so we don't backport it (as it's actually not doing any harm to have this extra field here), and also so if any implementer is in doubt it's much easier to find in the Changelog.

In #13119, I propose that we first let implementers know that these extra useless fields are deprecated so we can remove them in the next release (v0.30). Can you add these fields here?

## 2.4 Removal of useless fields

@alecslupu alecslupu added type: removal PRs that implement a removal of a functionality or code and removed type: fix PRs that implement a fix for a bug labels Jul 14, 2024
github-actions[bot]
github-actions bot previously approved these changes Jul 14, 2024
Copy link
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

I found one more place and I have a mini fix in the releases notes:

RELEASE_NOTES.md Outdated Show resolved Hide resolved
Co-authored-by: Andrés Pereira de Lucena <[email protected]>
@andreslucena andreslucena merged commit a17ba93 into develop Jul 15, 2024
111 checks passed
@andreslucena andreslucena deleted the chore/remove-show-statistics branch July 15, 2024 07:00
mllocs pushed a commit that referenced this pull request Jul 18, 2024
…3123)

* Remove show statistics in assemblies

* Remove show statistics in Participatory Process

* fix specs

* Remove show Metrics & clean up

* Cleanup

* Fix failing specs

* Apply review recommendations

* Apply review recommendation

* Update RELEASE_NOTES.md

Co-authored-by: Andrés Pereira de Lucena <[email protected]>

---------

Co-authored-by: Andrés Pereira de Lucena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants