5223 error message on nonvisible item request
Resolves #5223
Description
The error message related to partners requesting Items where visible_to_partners is false now specifies which item and which children are causing the error.
NOTE: There is a small change unrelated to the specific issue. In the app/views/layouts/partners/application.html.erb file, there were two overlapping "X" icons to dismiss the error message. I've removed one of them so now there's just one icon.
Type of change
- Bug fix (This is really more of a UI/UX improvement, but this is the most fitting option)
- This change doesn't seem to affect any current documentation, and I don't think this warrants adding documentation related to this kind of error. However, I'm willing to address documentation concerns if there are any.
How Has This Been Tested?
I've added a test to the spec/requests/partners/family_requests_requests_spec.rb file that expects the format of the error message to include details about a non-visible item, and the child requesting it.
Screenshots
Before:
After:
Functional Testing
- Log in as a parter ([email protected])
- Either find a child that already has items associated with them or add children with items needed
- Log in as an admin
- Go to Inventory > Items & Inventory
- Find one of the items that you added to a child and click Edit on that Item
- Deselect the checkbox 'Item is Visible to Partners?' so that the item is not visible
- Log back in as a partner
- Attempt to make a child request with one of the children who now has an invisible item
- Notice the error below does not look like the example in the PR description. The failure seems to still be wrapped in
Request failed![]. Also, we do not see the specific children's names like we do in the example above. Instead, we see1 child, 2 children, etc
@Budmin Are you able to take a look at this?
As an aside, I will create another ticket that addresses the issue where when an item is invisible, we are still seeing commas in the Item Needed
@janeewheatley I'll take a look at this and get back to you shortly
@janeewheatley I've pushed updates that makes the error message content more inline with what was expected.