Skip to content

Improve vote flow#7682

Merged
mrcasals merged 11 commits intodevelopfrom
refactor/improve-vote-flow
Mar 26, 2021
Merged

Improve vote flow#7682
mrcasals merged 11 commits intodevelopfrom
refactor/improve-vote-flow

Conversation

@leio10
Copy link
Copy Markdown
Contributor

@leio10 leio10 commented Mar 23, 2021

🎩 What? Why?

This PR prepares the vote process to use census authentication when used inside a votings space. To do it, it splits the voting process in two parts:

  • All the voting booth steps and the encryption step are rendered with the new template for the vote. The vote casting action is done with a regular post to the create page, including only the encrypted vote.
  • The second part is the wait to see the casted vote in the BB, which is done in the show template for the vote.

This new way to implement the process (before it was done completely on the new page, using an AJAX call to cast the vote), makes it simple and will help when we replace the use of the current_user with the data from the census, to implement #7118.

Also, this PR allow users to continue the waiting to the BB step when they leave the page before completing the process. The module will simply redirect them to the show page when there is any pending vote to be confirmed.

Finally, this PR modify the verify page to be able to create an URL with the hash included.

📌 Related Issues

Testing

Describe the best way to test or validate your PR.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

Please add screenshots of the changes you're proposing
Description

♥️ Thank you!

@leio10 leio10 changed the base branch from develop to chore/upgrade-decidim-bulletin-board-to-0.15.2 March 23, 2021 09:08
@leio10 leio10 self-assigned this Mar 23, 2021
@leio10 leio10 added project: e-voting Barcelona City Council contract module: elections labels Mar 23, 2021
@leio10 leio10 force-pushed the refactor/improve-vote-flow branch from 7168487 to 4beb818 Compare March 23, 2021 17:50
@leio10 leio10 requested review from agustibr, beagleknight, orlera and slickepinne and removed request for agustibr March 24, 2021 09:10
slickepinne
slickepinne previously approved these changes Mar 24, 2021
Copy link
Copy Markdown
Contributor

@slickepinne slickepinne left a comment

Choose a reason for hiding this comment

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

Great work! I just some small comments. 😊

{
"trailingComma": true
}
"trailingComma": "none"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙏

@@ -0,0 +1,16 @@
/* eslint-disable no-console */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we don't need this since we don't use console, right?

document.body.removeChild(link);
},
onAuditComplete() {
console.log("AUDIT COMPLETED");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Sorry, I know this doesn't come from you but seeing it like this, I wouldn't write this log statement in uppercase. Since all the other log statements are written "normally" as well. 😄

@@ -0,0 +1,81 @@
/* eslint-disable no-console */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Again, no need to disable this. 😊

@@ -0,0 +1,59 @@
/* eslint-disable no-console */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same here.

</p>
</div>

<%= link_to :elections, class: "button" do %>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you check the indentation here?

<%= t("decidim.elections.votes.verify.form.vote_identifier") %>

<input type="text" class="vote-identifier" name="vote-identifier" data-value="qw12Sf35vVb556Hfvh7qw12Sf35vVb556Hfvh7">
<input type="text" class="vote-identifier" name="vote-identifier" value="<%= params[:vote_id].gsub("_","") %>">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🙏

orlera
orlera previously approved these changes Mar 24, 2021
Base automatically changed from chore/upgrade-decidim-bulletin-board-to-0.15.2 to develop March 24, 2021 15:35
@mrcasals mrcasals dismissed stale reviews from orlera and slickepinne March 24, 2021 15:35

The base branch was changed.

@leio10 leio10 force-pushed the refactor/improve-vote-flow branch from aa089cb to e3576ff Compare March 24, 2021 15:43
beagleknight
beagleknight previously approved these changes Mar 25, 2021
Copy link
Copy Markdown
Contributor

@beagleknight beagleknight left a comment

Choose a reason for hiding this comment

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

LGTM 👍

beagleknight
beagleknight previously approved these changes Mar 25, 2021
@leio10
Copy link
Copy Markdown
Contributor Author

leio10 commented Mar 26, 2021

@decidim/mantainers this is ready to be reviewed.

mrcasals
mrcasals previously approved these changes Mar 26, 2021
@mrcasals
Copy link
Copy Markdown
Contributor

@leio10 some conflicts arose, sorry about that. Could you check them, please?

@leio10 leio10 dismissed stale reviews from mrcasals and beagleknight via 07a8b25 March 26, 2021 13:25
@leio10 leio10 force-pushed the refactor/improve-vote-flow branch from 00660fe to 07a8b25 Compare March 26, 2021 13:25
@mrcasals mrcasals merged commit 8d3aef3 into develop Mar 26, 2021
@mrcasals mrcasals deleted the refactor/improve-vote-flow branch March 26, 2021 13:37
@agustibr agustibr mentioned this pull request Mar 26, 2021
12 tasks
entantoencuanto added a commit that referenced this pull request Mar 31, 2021
* develop: (26 commits)
  Fix trustees admin menu (#7772)
  Do not modify the controller class in the controller tests that render views (#7755)
  Add HTML escaping to the expectations as the strings are escaped (#7760)
  Add automated accessibility audit + HTML validation to CI pipeline (#7751)
  fix(elections): js assets manifest (#7759)
  Add admin missing translations (#7702)
  Add Conferences and Admin missing translations (#7653)
  New Crowdin updates (#7735)
  Improve vote flow (#7682)
  Strip the <p> tags from inside the heading elements (#7732)
  Fix the date cell spec failing randomly close to day changes (#7703)
  Change the timeline date color for accessible color contrast against its background (#7750)
  Remove the opacity from process upcoming/past/all filters for accessible contrast (#7749)
  Fix color contrast against the sidebar navigation background (#7748)
  Validate the HTML for the account page (#7747)
  Fix report modal form accessibility (#7746)
  Accessibility fixes for conversations (#7745)
  Add a landmark ARIA role to the cookie banner (#7738)
  Fix HTML validation on standalone content page (#7744)
  Add aria-label to the area filter on participatory space pages (#7743)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: elections project: e-voting Barcelona City Council contract

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants