Skip to content

Standardize direct verification for one-time participation #13579

Merged
alecslupu merged 77 commits intodevelopfrom
feature/ephemeral-verifications
Jan 15, 2025
Merged

Standardize direct verification for one-time participation #13579
alecslupu merged 77 commits intodevelopfrom
feature/ephemeral-verifications

Conversation

@entantoencuanto
Copy link
Copy Markdown
Contributor

@entantoencuanto entantoencuanto commented Oct 24, 2024

🎩 What? Why?

This PR allows the creation of ephemeral users which can start a session and verify to be allowed to perform an action.

The PR uses the onboarding feature and defines a new type of ephemeral users which are only allowed to verify and once verified navigate to perform the action associated to the onboarding data.

WIP

📌 Related Issues

Link your PR to an issue

Testing

We have configured this component https://decidim-lot2.populate.tools/processes/branch-highway/f/6/budgets/1/projects with the Ephemeral Verification. You can verify yourself:

  • DNI: anything that finishes with X
  • Postal code: 05400
  • Scope: General scope

With this you will start the ephemeral session and can try almost everything.

📷 Screenshots

Please add screenshots of the changes you are proposing
Description

♥️ Thank you!

github-actions[bot]
github-actions bot previously approved these changes Oct 24, 2024
@entantoencuanto entantoencuanto force-pushed the feature/ephemeral-verifications branch from 1ddd265 to 2b08524 Compare October 25, 2024 09:26
@entantoencuanto entantoencuanto changed the title Standardize direct verification for one-time participation Standardize direct verification for one-time participation Oct 25, 2024
@entantoencuanto entantoencuanto force-pushed the feat/improve-registration-and-verification-flow branch from 6a77814 to f2a1585 Compare October 31, 2024 10:08
@entantoencuanto entantoencuanto force-pushed the feature/ephemeral-verifications branch 2 times, most recently from 41a31bf to f20e223 Compare November 6, 2024 11:33
@furilo
Copy link
Copy Markdown
Contributor

furilo commented Nov 7, 2024

@decidim/product @NilHomedes as we've talked this morning @entantoencuanto is finishing some details but the main things can be tested. Instructions:

We have configured this component https://decidim-lot2.populate.tools/processes/branch-highway/f/6/budgets/1/projects with the Ephemeral Verification. You can verify yourself:

  • DNI: anything that finishes with X
  • Postal code: 05400
  • Scope: General scope

With this you will start the ephemeral session and can try almost everything.

@NilHomedes
Copy link
Copy Markdown
Member

NilHomedes commented Nov 11, 2024

Hey @entantoencuanto, thanks for the work done 💯
Here is a first review:

Fixes for Participatory Budget component

  • On mobile, the “Vote budget” CTA should be sticky

Screenshot 2024-11-11 at 17-21-06 Lot 2 - 💻📲📱 Sprint 6 - Screens

  • Progress bar not working. As a participant, when I add a new project to the budget I expect to see the bar filled according to the amount of money.
  • On the budget cart: Add icon to "More information about the budget" or make it look like a clickable link.

Projects-for-Nou-Barris-Test-Site-for-Lot2

Verification form

  • Modify the text for 'Please verify your identity to proceed.” Instead of “We need to verify your identity…”.

Reference:

Screenshot 2024-11-11 at 16-43-01 Lot 2 - 💻📲📱 Sprint 6 - Screens(1)

  • Unify the double notification.

Captura de pantalla 2024-11-07 a las 16 38 03

reference:
Flow variant

Successful final screen

  • Fix “Succesfull screen” design. Implement the Figma design.
    Reference:
    Flow 1

  • Add the animation to the green check icon.

  • “Download your vote” and “Share your vote” CTA are not working

Budgets landing page

  • Cards design: The CTA should be in the same line of the budget amount.

How it is:
IMAGE 2024-11-11 16_51_14

Reference:
Screenshot 2024-11-11 at 17-19-02 Lot 2 - 💻📲📱 Sprint 6 - Screens(1)

  • The “Delete your vote” should be in blue, not in red. Also the icon.

Screenshot 2024-11-11 at 15-15-21 Budgets - Test Site for Lot2(1)

Focus mode layout

Reference:
Frame 427319662

Admin

  • When I enable permissions using ephemeral verification in a new component, the permissions are not being revoked. I can proceed without revoking them.

  • Bug: When I enable the Ephemeral authorization in Proposals component, then I get an error when accessing to a proposal.

    Screenshot 2024-11-11 at 16-25-31 Test Site for Lot2.png

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

Admin

* [ ]   When I enable permissions using ephemeral verification in a new component, the permissions are not being revoked. I can proceed without revoking them.

I think I misunderstood that part about admin. I thought it was enough to put a link to delete the authorizations. So if an ephemeral permission is enabled, all the pre-existing authorizations of the handler have to be automatically revoked?
Screenshot from 2024-11-12 10-24-08

* [ ]   Bug: When I enable the Ephemeral authorization in Proposals component, then I get an error when accessing to a proposal.

This is a previous bug of the dummy authorization handler (and the ephemeral dummy authorization handler inherits from it). If no scope is selected there are some exceptions in front. I've added a fix
Screenshot from 2024-11-12 10-16-44

@entantoencuanto entantoencuanto force-pushed the feature/ephemeral-verifications branch 2 times, most recently from 24b8120 to 2dbb881 Compare November 14, 2024 16:37
@NilHomedes
Copy link
Copy Markdown
Member

I think I misunderstood that part about admin. I thought it was enough to put a link to delete the authorizations. So if an ephemeral permission is enabled, all the pre-existing authorizations of the handler have to be automatically revoked?

Yes, that's it. We want to force the revocation of the authorizations, to prevent verification conflicts. But we must notify the admin.

This is a previous bug of the dummy authorization handler (and the ephemeral dummy authorization handler inherits from it). If no scope is selected there are some exceptions in front. I've added a fix

Oh yes, you're right. I always forgot that :/

@ent I will wait to review this again until the PR is ready. Ping me again when you want me to do that

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

I have a question about the behavior when ephemeral users recover the session in an edge case, @NilHomedes.

Currently if an ephemeral user is created with a verification, its session can be recovered accessing with a verification with the same unique_id. But the verification is not updated and the original metadata remains, that is, if it was not previously authorized, it will continue to not be. Is it correct or the metadata should be updated with the new values provided by the verification flow?

@NilHomedes
Copy link
Copy Markdown
Member

But the verification is not updated and the original metadata remains, that is, if it was not previously authorized, it will continue to not be.

I'm not understanding how it can be possible that an ephemeral user was not verified? As far as I understand, to create an ephemeral user it will be necessary to be verified. So this problem can not exist.

Is it correct or the metadata should be updated with the new values provided by the verification flow?

The metadata that are you referring to, what is exactly?

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

The authorization may have criteria to allow users perform the action.
Screenshot from 2024-11-15 12-18-43
In this case when a user verifies its metadata is the postal code and the scope. If this metadata does not meet the authorization criteria, the user will not be allowed to perform the action. I imagine a situation where the user changes district and the census service updates that information.

@NilHomedes
Copy link
Copy Markdown
Member

In this case when a user verifies its metadata is the postal code and the scope. If this metadata does not meet the authorization criteria, the user will not be allowed to perform the action. I imagine a situation where the user changes district and the census service updates that information.

I see, well in that case I would update the metadata. So, at the end, the participant maintains their verification and can participate.

We are thinking this feature to be implemented in short periods of time during a specific participatory process. Let's say during the two weeks of the voting phase. So, this district changes that you were mentioning, might not happen in a such a short period of time.

@furilo
Copy link
Copy Markdown
Contributor

furilo commented Nov 15, 2024

@NilHomedes

Add the animation to the green check icon.

How do you want this to be implemented? It's a little bit tricky (or I need ideas! :)

  • A GIF will produce a bad quality probably
  • For doing it with SVG, we'd need to first show one, then with CSS switch to another one. Maybe a little bit complex for the task.

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

* [ ]   Progress bar not working. As a participant, when I add a new project to the budget I expect to see the bar filled according to the amount of money.

About this point the color of the bar depends on a custom organization color which has been removed here. I'm going to use the default success color

@entantoencuanto entantoencuanto force-pushed the feature/ephemeral-verifications branch from 2c2e7b2 to ff96fde Compare November 15, 2024 17:22
@furilo
Copy link
Copy Markdown
Contributor

furilo commented Nov 18, 2024

@NilHomedes some of the review regarding design are preexisting things. For these kind of things, especially in a PR so big, it would be better to create new issues so the PR don't get delayed... We'll try to tackle them, but to have in mind for future times.

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

entantoencuanto commented Nov 18, 2024

On mobile, the “Vote budget” CTA should be sticky

I have been doing some research about this and from what I see this was implemented in this PR but the sticky behavior was reverted in other PR and currently is not available in develop. There is a reason for that change, so changing it again in this is PR I think will make it harder to track the potential conflict.

There is a comment about this specific change: #13127 (comment)

@NilHomedes
Copy link
Copy Markdown
Member

Hi @furilo and @entantoencuanto, answering your questions as follows:

How do you want this to be implemented? It's a little bit tricky (or I need ideas! :)
A GIF will produce a bad quality probably
For doing it with SVG, we'd need to first show one, then with CSS switch to another one. Maybe a little bit complex for the > task.

To be honest, I don't know. This is not my field of expertise. I'm open to proposals here ;)

@NilHomedes some of the review regarding design are preexisting things. For these kind of things, especially in a PR so big, it would be better to create new issues so the PR don't get delayed... We'll try to tackle them, but to have in mind for future times.

Which ones exactly? We can open specific PRs for those you think it might be better to treat it in another PR.

I have been doing some research about this and from what I see this was implemented in this #12891 but the sticky behavior was reverted in other #13127 and currently is not available in develop. There is a reason for that change, so changing it again in this is PR I think will make it harder to track the potential conflict.
There is a comment about this specific change: #13127 (comment)

You are right. We have spoken about it in the Product meeting. This issue is already reported, and will be tackle by mantainers: #13488

@furilo
Copy link
Copy Markdown
Contributor

furilo commented Nov 25, 2024

@NilHomedes regarding this:

How do you want this to be implemented? It's a little bit tricky (or I need ideas! :) A GIF will produce a bad quality probably. For doing it with SVG, we'd need to first show one, then with CSS switch to another one. Maybe a little bit complex for the task.

To be honest, I don't know. This is not my field of expertise. I'm open to proposals here ;)

We have been trying for an hour to do a pure CSS-SVG to do the animation. Making the exact thing on the Figma is really tricky. We propose a simpler alternative:

https://play.tailwindcss.com/QFzx7r0WEC?size=540x720

@NilHomedes
Copy link
Copy Markdown
Member

@furilo I don't like the fading. Maybe we would prefer something like this: https://codepen.io/kuvinod5/pen/WNvzazr

@entantoencuanto
Copy link
Copy Markdown
Contributor Author

@entantoencuanto could you sync with the latest develop branch ? You are 31 commits behind current develop, and i would like to make sure we do not break it upon merging.

37 / 56

Done, rebased onto develop

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
github-actions[bot]
github-actions bot previously approved these changes Dec 20, 2024
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

I have tried on local to configure a new ephemeral authorization, and i got an error when data is being submitted.

image

The below diff seems to fix the error.

diff --git a/decidim-admin/app/controllers/decidim/admin/component_permissions_controller.rb b/decidim-admin/app/controllers/decidim/admin/component_permissions_controller.rb
index 5f19729c40..2554f985bd 100644
--- a/decidim-admin/app/controllers/decidim/admin/component_permissions_controller.rb
+++ b/decidim-admin/app/controllers/decidim/admin/component_permissions_controller.rb
@@ -9,16 +9,14 @@ module Decidim
 
       def edit
         enforce_permission_to(:update, :component, component:)
-        @permissions_form = PermissionsForm.new(
-          permissions: permission_forms
-        )
+        @permissions_form = form(PermissionsForm).from_params(permissions: permission_forms)
 
         render template: "decidim/admin/resource_permissions/edit"
       end
 
       def update
         enforce_permission_to(:update, :component, component:)
-        @permissions_form = PermissionsForm.from_params(params)
+        @permissions_form = form(PermissionsForm).from_params(params)
 
         UpdateComponentPermissions.call(@permissions_form, component, resource) do
           on(:ok) do

50 / 56

@alecslupu
Copy link
Copy Markdown
Contributor

@entantoencuanto have you seen my comment ?

cc @furilo , @ferblape , @andreslucena

github-actions[bot]
github-actions bot previously approved these changes Jan 13, 2025
@entantoencuanto
Copy link
Copy Markdown
Contributor Author

Change added, @alecslupu, you are right, the form helper method provides the extra context necessary to obtain the current user

Copy link
Copy Markdown
Contributor

@alecslupu alecslupu left a comment

Choose a reason for hiding this comment

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

👍

@alecslupu alecslupu merged commit a087551 into develop Jan 15, 2025
@alecslupu alecslupu deleted the feature/ephemeral-verifications branch January 15, 2025 17:57
antopalidi pushed a commit to openpoke/decidim that referenced this pull request Feb 12, 2025
…3579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
andreslucena pushed a commit that referenced this pull request Mar 3, 2025
Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
entantoencuanto added a commit to AjuntamentdeBarcelona/decidim that referenced this pull request Apr 9, 2025
…3579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
entantoencuanto added a commit to AjuntamentdeBarcelona/decidim that referenced this pull request Apr 9, 2025
…3579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
entantoencuanto added a commit to AjuntamentdeBarcelona/decidim that referenced this pull request Apr 10, 2025
…3579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
entantoencuanto added a commit to AjuntamentdeBarcelona/decidim that referenced this pull request Apr 11, 2025
…3579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
fblupi added a commit to AjuntamentdeBarcelona/decidim that referenced this pull request May 8, 2025
…ows features (#46)

* Improve registration and verification flow (decidim#13295)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Maxim Colls <collsmaxim@gmail.com>

* Fix title on spec for the 'Create new proposal' page (decidim#14347)

* Fix title on spec for the 'Create new proposal' page

* Fix another spec

* Remove scopes_select_field from dummy authorization form

* Fix admin pipeline with `welcome_notification_body` spec error (decidim#14475)

* Standardize direct verification for one-time participation (decidim#13579)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>

* Fix title on spec for the 'Create new proposal' page (decidim#14347)

* Fix title on spec for the 'Create new proposal' page

* Fix another spec

* Remove scope from tests

* Make transferable authorization when duplicate user is ephemeral (decidim#13981)

* Implement share and download buttons in budget successful vote screen (decidim#14283)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* Extract success animation to a helper

* Fix HexaPDF dependency (decidim#13834)

* Fix HexaPDF dependency

* Fix Gemfile

* Remove reference to rqrcode

* Update decidim-generators lockfile

* Implement focus mode in the budget projects component (decidim#14512)

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>

* Allow customization of focus_mode_back_button text and path and use in projects index

* Define a setting in budgets component to enter in focus mode by default voting budgets

* Hide start voting button if voting is not available

* Hide voting progress box in project show if not in focus mode

* Consider focus mode settings in budgets lists cells

* Adapt tests

* Do not display vote text in budget list item cell if voting is not available

* Set authorization_redirect_path of project vote button to take into account focus mode

* Avoid duplication of button id

* Allow displaying close focus mode or ephemeral session on header with focus mode back button

* Adapt tests

* Add missing i18n strings from ca/es (#49)

* Use focus mode and Vote text regardless the allowed vote status

* Define budget order status view in focus mode

* Redirect to focus mode endpoints when component settings sets focus mode as default

* Fix linter offense

Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>

* Remove unused translations

* Fix tests

* Add new strings for the budgets voting phase

* Remove 'Download your vote' from the success page in Budgets

* Fix size in project's title

* Remove unused strings

* Change bold messages in the budget's voting explanation

* Change behavior of the minimum budget so it's minimum projects

* Redirect authorized vote button in projects index to the same page

* Exclude focus navigation links from exit focus warning modal behavior

* Normalize i18n on English locale and make consistent the other translations

* Fix budget detail with "You voted for this" string (decidim#14284)

* Adapt tests

* Add highlighted colors on the different states of the budgets' voting (#55)

* Add highlighted colors on the different states of the budgets' voting

* Improve the message in the finished budget voting

* Fix linter offense

* Remove share button and fix header close button (#56)

* Remove share button and center CTA

* Add title to success page

* Fix placing of the Cancel button in ephemeral/focus modes

* Remove unused strings from i18n-tasks

---------

Co-authored-by: Alexandru Emil Lupu <contact@alecslupu.ro>
Co-authored-by: Maxim Colls <collsmaxim@gmail.com>
Co-authored-by: Hugoren Martinako <aumpfbahn@gmail.com>
Co-authored-by: Andrés Pereira de Lucena <andreslucena@users.noreply.github.com>
Co-authored-by: Andrés Pereira de Lucena <andreslucena@gmail.com>
Co-authored-by: Francisco Bolívar <francisco.bolivar@nazaries.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Standardize direct verification for one-time participation

7 participants