rubyforgood/casa

Bug: Case Contact Contact Type Selection

elasticspoon opened this issue · 4 comments

Can create contact types on a case contact that should not be allowed on it.

Steps:
Volunteer manages cases A and B.
Case A => Restrict contact types to just Casa
Case B => Restrict contact types to just Judge.

As volunteer go to page for Case A, create new case contact.
Available cases will be A and B with only A selected.
Available contact types will be Casa and Judge.

Select Judge, complete form.

Case contact now has a contact type if should have been restricted from having.
If you go to edit page for that case contact the contact type will not appear but it is on the record.

CaseContact.find(case_id).contact_types will include Judge.

https://www.loom.com/share/434f152958a5440c8bce9830c4c6f3b9?sid=bdf91748-7e24-4c47-9b71-098b8c91a83d

Possible Solutions / Considerations

  • volunteers are not super tech savy, if you use a validation they might miss that it happened and just leave the page incomplete, ideally we want to make this as easy for them as possible
  • a solution that filters down the available topics based on selected cases using Javascript seems like the best choice

Can I grab this?

This seems pretty complex cause you're not going to want to break the existing behavior if the form allows you to select both.

probably js
make sure to write tests!