Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Reworks the election creation process. Now the create election page shows a list of election templates to choose from that are tied to the different voter authentication/access options. Still needs styling and wordsmithing. Clicking one will now create the election and direct the voter to the admin page where the user can edit the election and save in steps.
The election details section will be open automatically the first time you go to the page so its clear it needs to be filled out.
The race section now shows a list of races and a green add button. Adding or editing a race will open a pop up dialog window with the race form. Saving will push the update to the server. There is now an option to delete races as well.
For candidates, before we had a list of text fields for candidate names that users could edit with an additional text field for adding new candidates. Now, existing candidates are shown in a box with their name, edit and delete buttons. I felt like this made it feel more locked in maybe? Curious on feedback on that. Also added arrow keys to rearrange the candidates but still thinking of better ways of implementing that.
Settings option works the same as above. I didn't include the edit voter authentication settings in this PR, felt it was getting to big already.
Some other notes:
I moved some of the related components into their own folders. I also broke up some components into parts so they could be reused easily. For example the election details form now has a form component, a hook for handling all the form logic, and an inline form and pop up dialog form that ingest those to use them in different ways. I did this so if we still wanted a set up wizard it could easily use those components.
I changed the candidates and race IDs to be UUIDs. I still need to test that that didn't break anything.
Some styling and responsivity still needs work.
Screenshots / Videos (frontend only)
https://youtu.be/8KxPmN02DW8
Related Issues