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

4397 - Add Request units to item new/edit #4418

Merged

Conversation

sean-dickinson
Copy link
Collaborator

@sean-dickinson sean-dickinson commented Jun 1, 2024

Resolves #4397

Description

  • Adds the ability to assign request units to an item when creating and editing the item
  • Adds the custom request units column on the items list, only for organizations that have custom units defined
  • Currently if you edit an item we are clearing out the list of units and the recreating the join records from the updated selection. However there is the potential for this to make the de-normalization on the ItemUnit model less useful. If we need to keep units around that the organization has deleted or changed, we may need to reconsider this approach as I'm currently relying on the unit id's and just copying over the name based on the ids that are selected from the form.
  • I maybe could have considered using accepts_nested_attributes for, but given the "syncing" that I needed to do I decided to use a more explicit path initially.

Type of change

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

How Has This Been Tested?

  • I've added tests for this functionality in the controller and request files and have tested it locally to ensure it is working correctly. Note that everything is behind the feature flag :enable_packs

Screenshots

Screenshot 2024-06-01 at 12 41 19 PM

@sean-dickinson sean-dickinson changed the title WIP: 4397 - Add Request units to item new/edit 4397 - Add Request units to item new/edit Jun 1, 2024
This reverts commit 1d980f5.
@cielf
Copy link
Collaborator

cielf commented Jun 1, 2024

Passes initial light testing, fwiw.

Copy link
Collaborator

@awwaiid awwaiid left a comment

Choose a reason for hiding this comment

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

Some minor changes!

@sean-dickinson sean-dickinson requested a review from awwaiid June 1, 2024 21:34
@awwaiid
Copy link
Collaborator

awwaiid commented Jun 2, 2024

@sean-dickinson real fail over in the system specs (log)

Copy link
Collaborator

@awwaiid awwaiid left a comment

Choose a reason for hiding this comment

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

Great! Nice and safe behind the Flipper and looks good!

@awwaiid awwaiid merged commit 2ea0394 into rubyforgood:main Jun 2, 2024
19 checks passed
@awwaiid awwaiid added this to the Request Units (Packs) milestone Jul 21, 2024
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.

[PACKS] #2 Add reporting units to items
3 participants