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

Refactor to accept multiquestion #204

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

selankon
Copy link
Collaborator

@selankon selankon commented Oct 10, 2024

This PR makes changes on the chakra components in order to be able of support multi processes pages (more than one process on the same page).

It doesn't introduce any breaking change on the logic of the components, it only splits and export some logic to be reused for the MultiProcess components.

This changes are used by vocdoni/ui-voting-page#10.

Some important inner changes

  • VoteButton logic is splitted to be reused for the MultiprocessVoteButton
  • Also exported the logic that calculates the Vote Ballot

For the Questions form:

  • Now the election questions form accepts a specific form id. But a generic DefaultElectionFormId is used
  • The questions form now stores the answers inside a Record<string, FieldValues> type, where string is the election id. On this way, we can have multiple elections/questions on the same form
  • Some styles must change with the package update because the form tag is not inside of the chakra component anymore

Copy link
Member

@elboletaire elboletaire left a comment

Choose a reason for hiding this comment

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

Some of the wrongly imported components (using the package name instead of relative routes) could explain the context issues you told me about.

Edit: also, the tests should be passing 🥲

@selankon selankon force-pushed the f/implement-multiprocess-questions branch from a3bfe99 to ef03ef0 Compare October 17, 2024 06:56
@elboletaire elboletaire marked this pull request as draft October 18, 2024 07:41
@elboletaire
Copy link
Member

Set as draft, since it's a WIP

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