human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

5223 error message on nonvisible item request

Open Budmin opened this issue 3 months ago • 3 comments

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:

before

After:

after

Budmin avatar Sep 16 '25 05:09 Budmin

Functional Testing

  1. Log in as a parter ([email protected])
  2. Either find a child that already has items associated with them or add children with items needed
  3. Log in as an admin
  4. Go to Inventory > Items & Inventory
  5. Find one of the items that you added to a child and click Edit on that Item
  6. Deselect the checkbox 'Item is Visible to Partners?' so that the item is not visible
  7. Log back in as a partner
  8. Attempt to make a child request with one of the children who now has an invisible item
  9. 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 see 1 child, 2 children, etc image
image

@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 image

janeewheatley avatar Nov 13 '25 03:11 janeewheatley

@janeewheatley I'll take a look at this and get back to you shortly

Budmin avatar Nov 20 '25 03:11 Budmin

@janeewheatley I've pushed updates that makes the error message content more inline with what was expected.

Budmin avatar Nov 26 '25 06:11 Budmin