Skip to content

Allow case_assignments to be unassigned#343

Merged
compwron merged 2 commits into
masterfrom
casa-case-unassign
Jun 14, 2020
Merged

Allow case_assignments to be unassigned#343
compwron merged 2 commits into
masterfrom
casa-case-unassign

Conversation

@maebeale
Copy link
Copy Markdown
Collaborator

@maebeale maebeale commented Jun 14, 2020

What github issue is this PR for, if any?

Resolves #20 (Also related to number 230)

What changed, and why?

  • Added unassign endpoint
  • Includes redirect to volunteer if unassigning from Volunteer edit
  • Added Status column to index

Notes

  • Would really prefer not to have to add get and patch routes. Any advice here?

How will this affect user permissions?

  • Admin permissions: Admins can unassign (remove) a Volunteer from a CasaCase

How is this tested? (please write tests!) 💖💪

Help, please!

Screenshots please :)

Screen Shot 2020-06-14 at 2 48 18 PM

Copy link
Copy Markdown
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

This looks like a good step forward! 💖
I hope that eventually we will add a /features test for this functionality but it will be easier as part of / after https://github.com/rubyforgood/casa/pull/344/files :)

</td>
<td>
<% if assignment.is_active? %>
<% if assignment.is_active? && current_user.role == "casa_admin" || assignment.volunteer.supervisor == current_user %>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

volunteer.supervisor should be volunteer&.supervisor because not all volunteers will have supervisors

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@compwron i'm pretty sure that the & in this case is only verifying that the volunteer is present, so if the volunteer doesn't have a supervisor volunteer.supervisor will be nil

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

pretty sure the & would be needed if not all assignments have volunteers (but the assignment has a belongs_to that validates volunteer is present)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

makes sense :)

@compwron compwron merged commit 28db10f into master Jun 14, 2020
@compwron compwron deleted the casa-case-unassign branch June 14, 2020 19:50
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.

supervisor can remove (unassign) volunteer from case

2 participants