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

Anonymous proposals for registered users #17

Merged
merged 14 commits into from
Apr 23, 2024

Conversation

entantoencuanto
Copy link
Member

@entantoencuanto entantoencuanto commented Jan 30, 2024

Fixes PopulateTools/issues#1894

This PR adds the following changes to the anonymous proposals feature:

Test the feature in https://decidim-dev-27.populate.tools/processes/new-process/f/14/ and select a municipality scope for the proposal, some bug is preventing the creation of proposals in the proposals components of the other participatory process (something related with the absence of a scope in the space)

Screencast.from.31-01-24.19.05.29.webm

@entantoencuanto entantoencuanto marked this pull request as ready for review January 31, 2024 18:13
@simonaszilinskas
Copy link

Hello! Thank you very much for the work. I identified some issues and showed the first ones in this loom: https://www.loom.com/share/b8b7d6a679fe46b49f387e3b57ab190d?sid=31d662a8-68a4-4a26-8e46-d366ba9d08bb

@entantoencuanto
Copy link
Member Author

Oh, I'm sorry, I added a bug in the process of integration with simple proposals and Decidim awesome and actually the error comes from the other PR in process. I've fixed the bug there, but I'm going to deploy again the application with the changes introduced by this PR (those changes don't include the simple proposals feature activation, so you will see the standard proposal creation flow with multiple steps)

Sorry for the inconveniences, can you check again, please?

@simonaszilinskas
Copy link

image

Hello, thank you for the fast reaction. Now I don't have access to the anonymous group anymore :( let me know when I can test it out again. Thanks!

@entantoencuanto
Copy link
Member Author

With which user are you trying to create anonymous proposals? Maybe the issue is with the component configuration. With admin@example.org I have access to the "Anonymous user" option https://decidim-dev-27.populate.tools/processes/wear-exaggerate/f/3/proposals/new (there is no select if the user is not signed in because then the proposal can be only created anonymously)

There may be other problem related with the standard behavior of the application. If a user has an existing draft proposal the new proposal redirects him to the draft edition instead of the new form.

I have added also a rule to prevent changing a proposal from anonymous to having an author and vice versa once the proposal is created, so currently the only step where a signed in user can select between anonymous and the rest of identities for proposal authorship is in the new step.

@simonaszilinskas
Copy link

simonaszilinskas commented Feb 6, 2024

Thanks for the response @entantoencuanto !

Here is the screenshot of the current situation: the user is signed in and the anonymous group option isn't there.

image

Intended situation:
As a signed-in user, when creating a proposal in a component with anonymous proposals activated, I want to have the option "Anonymous" in the "Create proposal as..." selector, so that I can submit anonymous proposals even when signed-in.

@entantoencuanto
Copy link
Member Author

In the screenshot you show me the proposal has been created but not yet published. I added the condition to not allow the user to change the authorship of the proposal between anonymous or not once created, because with the changes of this PR an anonymous proposal can be edited by any signed in user (while the proposal is editable), so an anonymous proposal could be appropriated by a user knowing its edit URL in this phase.

I can make changes to allow users to change authorship at any moment while the proposal can be edited but preventing the change from anonymous to authored and vice versa if the proposal has already been published.

Or do you prefer to allow changes in authorship type at any moment if the proposal is editable?

@simonaszilinskas
Copy link

I think it is very good to allow users to change authorship at any moment while the proposal can be edited but preventing the change from anonymous to authored and vice versa if the proposal has already been published knowing that if we allow the edit post publishing someone else could change authorship (that we don't want).

…lity

Adaptation to other proposals modules
@entantoencuanto
Copy link
Member Author

Hi @simonaszilinskas , I have added the changes we had talked about:

  • While the proposal is editable and has not yet been published the user can change the authorship, including the user, their groups or anonymous.
  • After publishing, if the proposal remains editable the user can edit it but cannot change from anonymous to user/group or vice versa. If the proposal has an author the user can switch between the user or their groups (if any), but the anonymous option is not yet available and if the proposal is anonymous there is no "Create proposal as" select available in the form

@larsUE larsUE mentioned this pull request Feb 8, 2024
8 tasks
@simonaszilinskas
Copy link

Perfect, thank you @entantoencuanto ! Is the latest version available on your staging platform?

@entantoencuanto
Copy link
Member Author

Yes, you can check the changes here: https://decidim-dev-27.populate.tools/processes/wear-exaggerate/f/3/proposals/new

For the moment the module is installed alone without simple proposals and decidim awesome, if the review is OK we can check it with the other installed

@entantoencuanto
Copy link
Member Author

Hi @simonaszilinskas I have installed in the staging application the simple proposal and the adapted awesome (from https://github.com/octree-gva/decidim-module-decidim_awesome) modules to check the compatibility

@simonaszilinskas
Copy link

Decidim.Anonymous.proposals.test.mp4

Hello @entantoencuanto thank you very much, it looks great! just two considerations present in the video:

  • 00:43 - the banner to log in or sign up to assign to an account is not present. If that's not too hard of an add, it would be good to have it there;
  • 00:54 - server issue

The rest seems good from my perspective. I will write the test cases and then send it to the rest of our team to review, but it looks good

@entantoencuanto
Copy link
Member Author

Hi, I have added a fix to avoid the server error (I thought it was a Decidim installation error but it was actually a bug in the module) and changes to include the announcement banner in the edit_draft/complete page for not signed in users

The changes are deployed in the staging application: https://decidim-dev-27.populate.tools/processes/wear-exaggerate/f/3/proposals/new

@furilo
Copy link
Member

furilo commented Mar 5, 2024

@simonaszilinskas are you OK with this? Anything missing?

@simonaszilinskas
Copy link

From a product perspective yes. From a code perspective, I am waiting for a technical review from our devs. Thank you!

@simonaszilinskas
Copy link

Hi @entantoencuanto , thank you for all the great work on this module! There's just one more enhancement I believe would further strengthen the robustness of the feature:

For proposals submitted anonymously, I suggest disabling the edit functionality entirely for all anonymous proposals, even for the original author. This would mean that editing would just be allowed for non-anonymous proposals. This ensures that once a proposal is published anonymously, nobody, and especially people that didn't create it, can modify it.

Also, would it be possible to set up email sending or the letter_opener on the test platform? This will allow us to properly review and verify the exports related to anonymous proposals.

@furilo
Copy link
Member

furilo commented Mar 13, 2024

Hi @simonaszilinskas - Edu is off a few days because of personal matters. Give us some time until he is back. Thanks!

@entantoencuanto
Copy link
Member Author

Hi, @simonaszilinskas, do you mean to disable the edition of anonymous proposals after its publication or even also after its creation? I can include a restriction

About the letter_opener configuration I'm researching the way

@simonaszilinskas
Copy link

Hi, @simonaszilinskas, do you mean to disable the edition of anonymous proposals after its publication or even also after its creation? I can include a restriction

About the letter_opener configuration I'm researching the way

Hi @entantoencuanto , could you please elaborate a bit more on the first question - I'm not sure I understood it. I think the crucial need is not to have cases where other people other than the creator of a proposal can edit a proposal. This is currently the case for anonymous proposals.

@entantoencuanto
Copy link
Member Author

entantoencuanto commented Mar 22, 2024

The creation of an anonymous proposal has 3 phases:

  • The initial step when the user is in the page with the form to create a new proposal. At this stage the proposal does not exist yet and only the user can edit the proposal and create it by submitting the form.
  • After submitting the form the proposal is created as draft. The draft proposal is not shown in the lists of proposals but can be edited if the user knows the URL.
  • Finally the proposal can be published and there is a setting in the proposal component which allows the user to edit the proposals after its creation. This configuration can be disabled so once the proposal is published nobody can edit a proposal.
    Screenshot from 2024-03-22 19-17-00

So the application can prevent the edition of anonymous proposals once published without any additional change introduced by the module. Or we should prevent the edition of anonymous proposals regardless the component settings and the draft or published state of the proposals? (to get this some additional changes has to be included by the module)

@simonaszilinskas
Copy link

Thanks for the super clear comment. I think the draft state is a very minor risk, but once published, anonymous proposals should not be editable if someone else can see them in the list and can edit them. Ideally, the "normal" proposals should still follow the editability setting you mention.

@entantoencuanto
Copy link
Member Author

Hi, I have added a change to prevent the edition of proposals once published. The changes can be checked at https://decidim-dev-27.populate.tools/processes/wear-exaggerate/f/3/proposals/

@simonaszilinskas
Copy link

Thank you @entantoencuanto ! looks great !

@entantoencuanto
Copy link
Member Author

Hi, @simonaszilinskas, I have prepared a small branch to install this module in your app. Please, could you provide me access to the repository to create a PR?. The branch used compatible with the 0.27 Decidim release is the one used in this PR: anonymous_proposals_for_registered_users.

The PR basically adds the dependency into the Gemfile. The next steps to make work the module are:

  1. Run the decidim_anonymous_proposals:generate_anonymous_group task to create an anonymous group to associate the proposals with
  2. Set the DEFACE_ENABLED environment variable as true to allow the module to ovewrite the forms and create new proposal button
  3. Enable the feature in a proposals component of the application

@simonaszilinskas
Copy link

@entantoencuanto could you just share the link to the fork you made for the PR ? I'm waiting for the approval of our team to grand access for the PR

@entantoencuanto
Copy link
Member Author

PR created OpenSourcePolitics/decidim-app#517

@entantoencuanto entantoencuanto merged commit d67ddd2 into main Apr 23, 2024
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.

None yet

4 participants