-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Booth Assigment management #2087
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…actions and views
bertocq
force-pushed
the
poll_booth_management
branch
from
October 19, 2017 20:43
8112158
to
3dace17
Compare
MariaCheca
approved these changes
Oct 20, 2017
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -1,10 +1,16 @@ | |||
<%= render "/admin/poll/polls/poll_header" %> | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this extra space. Let the code make some friends! 😁
bertocq
force-pushed
the
poll_booth_management
branch
from
October 20, 2017 20:08
3dace17
to
9952893
Compare
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Where
Related Issues: #2034
What
We need to separate the listing of Booths assigned to a Poll from the Booth Assigment manage page:
On the Poll details we'll just list Booths assigned to it with a quick access button to Booth Assigment for that Poll. Without "Add booth" or "Remove booth" buttons
We need a new Admin > Polls > Booth Assignments menu that:
A - List all current or incoming Polls
B - Selection a Poll we can see all Booths with an "Assign" or "Unassign" ajax button (depending on the existance of a booth assigment for that booth & poll) that changes on click without full page render
How
Creating two new routes:
/admin/polls/booth_assignments
for list A/admin/polls/:id/booth_assignments/manage
for list BCreating views for each of them (copy&pasting code instead of trying to be smart on current existing views and having
action_name
andcontroller_name
conditions all aroundSwitching Admin::Poll::BoothAssignmentsController create and destroy methods to work with the ajax buttons to Assign & Unassign booths (creating/destroying a Booth Assigment object)
Creating a Poll::Booth method
assignment_on_poll(poll)
that returns the existing (or not) booth assignment between that Booth and the poll (checkWarning
section to understand decision before rage kicks in)Screenshots
No more screenshots, GIFs!
Tests
Switched from old to new way to manage booth assigments, plus added an scenario to correctly test new Booth Assigment menu poll & booth listing
Deployment
As usual
Warnings
Listing all booths and making a query for each an every one to check the existance of a booth-assigment with the curren poll is not nice with performance if there are a lot of Booths, heck its not even about performance I felt like 💩 doing it but... we agreed upon this solution to get this working ASAP
For me best solution would be to:
assigned_booths
unassigned_booths
@booths = ::Poll::Booth.all
atAdmin::Poll::BoothAssignmentsController#manage
PR's welcome to fix it if you have read this far!!