-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Add bulk assignment of volunteers to supervisor #5144
Conversation
0d72870
to
123423d
Compare
@jamgar Thank you for your work on this—it looks fantastic! I'm really looking forward to seeing it in action. I just have a small request: could you please update the text in the modal to match the following:
Thank you so much for your help! |
@FireLemons I can take another look, but the rspec were failing in main as I tested in that branch to compare. |
@jamgar could you merge or rebase in the main branch? |
I think I found the issue with the test 😊 I am fixing now and will rebase. |
4b37087
to
1ec68e1
Compare
I tried again on a chromium browser(earlier test was on firefox) on a different computer. Got the same result |
@FireLemons can we merge this yet or no? :) @jamgar anything you need help with? |
c0c47f1
to
8e68617
Compare
It still looks the same on my machine after a database reset and fresh asset build. I'll try again on a different computer in a while |
Could you write a system test for this feature? It will simulate a user using the website and might help you verify your feature. |
Co-authored-by: James Garcia <[email protected]> add datatable checkboxes to volunteer#index view for bulk assignment add system test for volunteers/index
6078721
to
9f6b4b3
Compare
it "sets that association to active" do | ||
valid_parameters = { | ||
supervisor_volunteer: {supervisor_id: supervisor.id, volunteer_ids: [volunteer_1.id, volunteer_2.id, volunteer_3.id]} | ||
} | ||
sign_in(admin) | ||
|
||
expect { | ||
post bulk_assignment_supervisor_volunteers_url, params: valid_parameters, headers: {HTTP_REFERER: supervisors_path.to_s} | ||
}.to change(SupervisorVolunteer, :count).by(2) # bc 1 already exists, we are creating 2 new ones | ||
expect(response).to redirect_to volunteers_path | ||
|
||
association.reload | ||
expect(association.is_active?).to be(true) |
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.
This looks like 2 tests. Generally we'd split into 2.
- Expect to add for new ones
- Expect to make active for inactive ones
major redesign
response to test issues and code climate
@compwron Can I get your eyes on this review? It's just a code climate issue failing. |
|
@@ -318,17 +480,5 @@ | |||
expect(input_search.value).to eq("") | |||
end | |||
end | |||
|
|||
context "when timed out" do |
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.
Do not delete this test.
It looks like it's getting very close! some yarn lint, and maybe some test failures? They miiight be flakes, but I'm not sure. |
@schoork can you make some magic happen so we can get this merged? 😎 |
@@ -119,7 +119,7 @@ def no_attempt_for_two_weeks | |||
if volunteer.supervisor.active? && | |||
volunteer.case_assignments.any? { |assignment| assignment.active? } && | |||
(volunteer.case_contacts.none? || | |||
volunteer.case_contacts.maximum(:occurred_at) < (Time.zone.now - 14.days)) |
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.
Since occurred_at
is not required for a draft, if a user has only drafts with occurred_at
set to nil, this creates a NoMethodError
.
Ugh... |
Thanks for the push @bcastillo32 |
@FireLemons @littleforest or @compwron - is this good to go for this week's release? :) |
@@ -263,6 +263,7 @@ | |||
end | |||
|
|||
find("[data-select-all-target='checkboxAll']").click | |||
sleep(1) |
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.
this is not a good fix and makes tests slow. Let's TODO remove this. @bcastillo32 can you open a ticket to clean this up?
@@ -3994,7 +3994,7 @@ joi@^17.11.0: | |||
"@sideway/formula" "^3.0.1" | |||
"@sideway/pinpoint" "^2.0.0" | |||
|
|||
jquery@>=1.7, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.4: | |||
jquery@>=1.7, "jquery@>=3.4.0 <4.0.0", jquery@^3.7.1: |
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.
nice to upgrade :)
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.
let's merge! this will be great to get into prod :)
styling and controller updates
Add request test for bulk assignment
add datatable checkboxes to volunteer#index view for bulk assignment update styles for volunteer#index table
What github issue is this PR for, if any?
Resolves #2523
What changed, and why?
Added multi select checkboxes to Volunteers#index
How will this affect user permissions?
How is this tested? (please write tests!) 💖💪
Created request specs for the bulk assign and unassign
Screenshots please :)
Feelings gif (optional)
What gif best describes your feeling working on this issue? https://giphy.com/
How to embed:

Feedback please? (optional)
We are very interested in your feedback! Please give us some :) https://forms.gle/1D5ACNgTs2u9gSdh9