Refactor initiative signing wizard#10731
Conversation
56506a4 to
0f1680a
Compare
0f1680a to
2636912
Compare
2636912 to
c74c137
Compare
af9a49d to
faab3e9
Compare
|
@Crashillo or @entantoencuanto could you have a look on this PR ? |
…itiative_signatures
…itiative_signatures
…itiative_signatures
f15986a to
fb5a740
Compare
|
I'm giving a first look with the Product hat before doing a code review. I have to say that this one is really difficult to review, because I can't make it work with the current code (aka the one from For instance, I can't do the SMS check flow, as when I do it I have an error with redirections and cookies: cookies-initiatives-2023-08-24_08.15.19.mp4And if I disable the SMS checkbox in the Initiative Type settings page, then I have an alert saying that I can't sign: Saying that, I tried it with this PR and seems like it works much better 🥳 A couple of errors/things that I've found. Feel free to move them to another issue if you think it's out of the scope of this, as I understand that the problem could be on other related components (such as 1. The SMS flow seems like it isn't show correctly (too much padding):This is in Firefox 115.0 2. After signing there's a missing string interpolation(Ignore the alert, as that's related to the next one 😄) 3. Missing authorization stepIf I have the following settings in the Initiative Type: And I don't have the "Identity documents" verification method in my participant account: Then this step isn't shown, and it allows me to arrive to the Finish screen with an alert that says "The data provided to sign the initiative is not valid" As far as I remember, this should be an step during the signing flow (or it should say to me something that I need to have this verification in my participant account). I'm not 100% sure on this one, as I can't check it out with the current code ( Just to be sure I tried it with others authorizations (Example authorization for instance) and I have the same behavior. |
4. Authorization without SMS doesn't work[This is actually happening too in the current code ( If I have an Initiative Type configured with the "Example authorization": And there's an initiative associated, when I go to sign I have an error message: It doesn't matter if I'm authorized with this verification method in the participant account or not, as the error message is always the same. In the JS console and Rails logs I see an 422 error (422 Unprocessable Entity) JS Console
Rails log
|
|
@andreslucena , thanks for reviewing this. I will have an assessment and see if the mentioned issues are falling in the scope of this PR or not. |
|
Defining a new initiative scope with only one global scope, made me successfully sign the document. When trying using the "Collect participant personal data on signature" i have faced some issues. I have added my "identity documents" authorization, but when I went to sign the initiative with same document number i was unable. for some reason, i could not pass the collect data form, as there was a validation error on the document number. |
|
@andreslucena Considering your input on this feature, i would say that we can start the Code review. The rest of the issues are not related to this PR, so we may start extracting them in separate tickets. My analysis may not be 100% accurate, as i do not have enough experience with either initiatives or verifications module. Most likely, we could have a more accurate answer whether the issues found are related to this refactor, or redesign or is just legacy, if we are going to test those scenarios in 0.27 release. |
@alecslupu I was testing this, is about the layout's grid, and I found a quick solution. I'll add a commit here. |
I can confirm that this is fixed indeed. Thanks @Crashillo!
I still see it. I also don't see any new commits from you. Maybe you forgot to push?
Yes, that was it. Once I checked the "Collect participant personal data on signature" it shows the form and it works as it should. Thanks for your help!
I think that the happy path for this personal data collection to work is to use it with the "Example authorization". At least with that one I was able to make it work (adding the same data in the authorization and in the data collection form). I can confirm that it isn't working with the "Identity documents" authorization So, as all my feedback with the Product hat is finished, I think I can start with the code review. Can you first check out the string interpolation thing @alecslupu so we're sure that all the code is pushed? Thanks |
…ecidim into refactor/initiative_signatures
|
@andreslucena , the string interpolation is fixed by 2969617 |
andreslucena
left a comment
There was a problem hiding this comment.
I finished the code review. Congratulations, it's a clean read 👍🏽
I can only find two things, but I think that the both of these are minimal, and I actually can find arguments for the reasoning on not doing them 😅
I'll share them just so we can be on the same page, and you decide if you want to do them or ignore them. I'm fine with both of these options.
- Consistency with
CreateInitiativeController
On #10727, we've made a similar change to that controller. On that one, we named the methods that introduced changes in the DB with the "store_" prefix, and now we're using the prefix "update_". I actually prefer "update" as that's the Rails terminology, but I found it weird to not use the same words on both of these controllers.
Saying that, I can live with having these couple methods named different, as both of the words are clear on what they are doing.
- Routes path
The final routes are ugly as we're saying "initiative" two times (i.e. fill_personal_data_initiative_initiative_signatures_path). I think it'd be better to just have fill_personal_data_initiative_signatures_path`.
Saying that, I understand that this actually made automatically by Rails, and it's respecting the InitiativeSignatureController, so I'd said that instead of just changing the route we should change the controller and related wording to just Signature. Also related with this we have the InitiativeVote model that doesn't exist in the UI because according to the regulation an Initiative has signatures. So yeah, both of these problems are completely out of the scope of this PR, and deserver their own issues.
As I mentioned at the beginning, I'm OK with merging this PR as-is, just wanted your opinion on the first point (if we want to make it consistent on the update/store naming)
Both changes are being implemented in #11545 |
Great! I'll merge this one, so we can keep moving then 👍🏽 |
* develop: 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) Fix 'download your data' when there are comments on budgets (#11531)
…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) ...










🎩 What? Why?
This aims to refactor the initiative signatures controller, so that it would not use the Wicked::Wizard gem anymore. After #10727, the wicked wizard is being used only by this controller, and makes sense to preserve the functionality while changing the underlying library.
📌 Related Issues
Link your PR to an issue
Testing