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

Show units column and custom units in banks' request view #4539

Merged

Conversation

norrismei
Copy link
Contributor

@norrismei norrismei commented Jul 18, 2024

Resolves #4402

Description

Right now when a bank views a request, if custom units is enabled for the bank and there is an item with custom units (e.g. Packs) in the request, the custom unit does not show up next to quantity. This PR adds a units column if applicable and displays the custom unit for any items that have a request unit.

Type of change

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

How Has This Been Tested?

I created new tests for the behaviors I was expecting. I'm new to Rspec so feel free to point things out that can be improved. Are there any other tests that you feel should be included?

To manually test the change, I first signed in as a bank admin, navigated to the Requests, and clicked one to see in detail and verify there is no units column.

Then I pointed my browser to http://localhost:3000/flipper and logged in
userid: admin
password: password

I added the feature enable_packs and fully enabled it.

Back on the bank's view of the request, I refreshed the page and the Units (if applicable) column appeared, as well as the custom unit of Packs for Pads.

When I went back to Flipper and deleted the enable_packs feature and refreshed the bank's page, the Units (if applicable) column disappeared as expected.

Screenshots

Before change (no column)
Screen Shot 2024-07-18 at 8 08 05 PM

After change (column, plus custom unit)
Screen Shot 2024-07-16 at 9 43 42 AM

@norrismei norrismei marked this pull request as ready for review July 19, 2024 03:19
@norrismei norrismei changed the title WIP 4402 bank request view custom units Show units column and custom units in banks' request view Jul 19, 2024
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

Overall looks good - had one suggestion re the tests.

@cielf it's good for you to test out.

spec/requests/requests_requests_spec.rb Outdated Show resolved Hide resolved
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.

Looks good to me!

@norrismei norrismei requested a review from dorner July 20, 2024 09:42
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.

Looks great! We'll merge it after the deploy today probably.

@@ -65,6 +65,11 @@
<tr>
<th>Item</th>
<th>Quantity</th>
<% custom_units = Flipper.enabled?(:enable_packs) &&
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice way to do this, setting the custom_units to both indicate that the feature is enabled and that there is anything worth displaying.

@awwaiid awwaiid added this to the Request Units (Packs) milestone Jul 21, 2024
@norrismei
Copy link
Contributor Author

Question about requested changes: I made and pushed the change, hit the "Resolve conversation" button, and re-requested a review from @dorner. I noticed that the PR still says "Changes requested" and I was wondering is there anything else I have to do, something that I missed, or will that go away once Daniel reviews the PR?

Screen Shot 2024-07-25 at 10 32 55 AM

@cielf
Copy link
Collaborator

cielf commented Jul 25, 2024

I believe the changes requested stay up until that reviewer has ok'd them.

@dorner dorner merged commit d13ef01 into rubyforgood:main Jul 26, 2024
19 checks passed
@dorner
Copy link
Collaborator

dorner commented Jul 26, 2024

All good here, thanks!

@cielf
Copy link
Collaborator

cielf commented Aug 3, 2024

Ran into a problem with this one in staging testing. We can still put it to prod since we are not turning on the flag until we've done an end to end full test. It looks like the first instance of a particular item's item request in the list is determining how the units are displayed for all of that item's item requests. Have put in a proto-issue.

Copy link
Contributor

@norrismei: Your PR Show units column and custom units in banks' request view is part of today's Human Essentials production release: 2024.08.11.
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.

[PACKS] # 7 Show custom request units in banks' request view
4 participants