Skip to content

Conversation

@Stef-Rousset
Copy link
Collaborator

@Stef-Rousset Stef-Rousset commented Jan 2, 2026

🎩 Description

This PR adds different features:

  • adds alignment information in comments for external proposals
  • adds a reference to comments, and adds the possibility to retrieve via the api a single comment with its reference (screenshot one)
  • adds the possibility to filter the external proposals added to the platform by container (cf screenshot two)

It also refactor the code by adding presenters to clean models, and removes migration files that creates the models.

Testing

If you are testing from an existing app, run in the console bundle exec rake railties:install:migrations, and then bundle exec rake db:migrate, and eventually bundle exec rake comments:add_reference

Testing the reference for comments:

  • to check in the console that all comments have a reference, you can run in your console Decidim::Comments::Comment.where(reference: nil), which should return an empty array []
  • run also Decidim::Comments::Comment.all.size and Decidim::Comments::Comment.where.not(reference: nil).size, which should both return the same result
  • you can check that the reference of a comment is well constructed. For that run Decidim::Organization.first.reference_prefix, run Decidim::Comments::Comment.first.created_at and note month and year of creation, and then run Decidim::Comments::Comment.first.reference, and check that the reference is like "organization prefix"-"COMM"-"year of creation"-"month of creation"-"id"
  • in the application, you can go to http://localhost:3000/api/v1/data/contributions. In a proposal that children, copy the reference of a comment, and then go to http://localhost:3000/api/v1/data/contributions/ref_of_the_comment, and see that the informations of comment are displayed (screenshot one).

Testing the container filter:

  • In the FO, go to an assembly with proposals, note its slug.
  • In your console, run Decidim::Assembly.where(slug: "your_assembly_slug").first.reference and copy the reference
  • As an admin, go to the proposals component of a participatory process, enable integrations and provide the url "http://localhost:3000?container=your_assembly_reference", and save (cf screenshot two)
  • in the FO, go to the proposals index of your process, and see that the external proposals displayed are the ones belonging to the assembly chosen.

Testing aligment:

  • As a user, go to the assembly you selected in testing the container filter, go to its proposals and add a comment with in favor alignment
  • As a user, go to the process which includes proposals of the assembly as external proposals, click on the external_proposal where you add a comment and see that the aligment information is displayed (screenshot three)

Tasks

  • Add specs

📷 Screenshots

ONE
Capture d’écran 2026-01-02 à 11 58 00

TWO
Capture d’écran 2026-01-02 à 11 55 51

THREE
Capture d’écran 2026-01-05 à 11 56 22

@Stef-Rousset Stef-Rousset marked this pull request as ready for review January 5, 2026 08:08
@Stef-Rousset Stef-Rousset marked this pull request as draft January 5, 2026 10:11
@Stef-Rousset Stef-Rousset marked this pull request as ready for review January 5, 2026 10:44
@Stef-Rousset Stef-Rousset merged commit 08576f9 into master Jan 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants