Skip to content
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

Improve child functionality by allowing multiple items to be requested #4495

Merged
merged 2 commits into from
Jul 11, 2024

Conversation

elasticspoon
Copy link
Collaborator

@elasticspoon elasticspoon commented Jul 4, 2024

Resolves #3797

Description

Most of the work for this PR was already done in #4126. But essentially we create a HABTM relationship between children and items.

I changed the front end selection behavior to use a select2 dropdown.
image

Added an additional system test to ensure that we can create a child with multiple requested items correctly.

Future PRs

  • add inline editing of requestable items
  • drop the item_needed_diaperid column

Type of change

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • New system spec added
  • modified existing system, model and request specs

Screenshots

image
image
image
image

@elasticspoon elasticspoon force-pushed the feat/improve-child-functionality branch 2 times, most recently from c946944 to c3deca5 Compare July 4, 2024 19:01
@elasticspoon elasticspoon changed the title wip Improve child functionality by allowing multiple items to be requested Jul 4, 2024
@elasticspoon elasticspoon force-pushed the feat/improve-child-functionality branch 2 times, most recently from 8c2530d to 505df58 Compare July 4, 2024 22:28
@elasticspoon elasticspoon force-pushed the feat/improve-child-functionality branch from 505df58 to 9ae4c06 Compare July 4, 2024 22:42
@elasticspoon elasticspoon marked this pull request as ready for review July 4, 2024 22:42
@elasticspoon elasticspoon requested review from dorner and cielf July 4, 2024 22:42
@dorner
Copy link
Collaborator

dorner commented Jul 5, 2024

I'm good with this technically - @cielf over to you!

@cielf
Copy link
Collaborator

cielf commented Jul 5, 2024

Probably be later in the weekend / possibly Monday before I get to it, I'm afraid.

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

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

Thanks for this! My first pass indicated things look pretty good, except for ...
1/ This sequence fails...
bin/setup
bin/start
sign in as [email protected]
select 'Children' from the l.h.m.
View Child Details on the first item on the list
observe -- it has an item needed
Edit Child Details
-- I expect that item to appear in the Items Requested field. It does not.

2/ "Item needed" on the child view should also now be Item(s) needed
3/ Out of scope for this, but we need to do some work on the child export too, I see. (will add something to the inbox to review and make better)

fix seen to ensure only requestable items seeded
fix item to items
@elasticspoon
Copy link
Collaborator Author

@cielf fixed.

FYI it was a seed issue rather than a code issue. The seed was adding items that were not actually requestable so the dropdown would not display them.

But that does beg the question if that is a corner case that we should consider? If a child had items it was requesting then the partner got rid of them. I feel like the odds of a partner removing items is low?

@elasticspoon elasticspoon requested a review from cielf July 10, 2024 14:14
@cielf
Copy link
Collaborator

cielf commented Jul 11, 2024

Are you saying that the seed was adding a needed item to the child that was also an item that the partner wasn't allowed to see? (Bad seed, then, indeed).

As for the likelihood of items being removed -- children age out of the smaller sizes of diapers and into bigger ones, so I would expect that the same child would have evolving needs over time.

And a bank might take items off the list that they offer, if they don't have a steady supply of them. So there's definitely an edge case there... But/and that's an existing edge case, right? So technically out of scope for this PR. I'll put a note in our copious todo list to figure out what should happen (should, for example, the partner get a notification if the bank removes something one of their children needs?)

@cielf cielf merged commit b2e2a8d into main Jul 11, 2024
38 checks passed
@cielf cielf deleted the feat/improve-child-functionality branch July 11, 2024 17:56
Copy link
Contributor

@elasticspoon: Your PR Improve child functionality by allowing multiple items to be requested is part of today's Human Essentials production release: 2024.07.21.
Thank you very much for your contribution!

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.

Improving the child functionality
3 participants