Skip to content

Conversation

@tatheerf02
Copy link
Contributor

@tatheerf02 tatheerf02 commented Nov 9, 2024

Resolves #4520

Description

Display another row at the bottom of the storage locations index that aggregates the total inventory quantity and dollar value across all locations, taking into account any filters applied.

Type of change

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

How Has This Been Tested?

Added a new system test that ensures the row is displayed on the index with the correct total values.

Updates existing tests to account for the new row in the table

Screenshots

📸 Storage locations index (no filters) image
📸 Storage locations index (with filters) image

@tatheerf02 tatheerf02 force-pushed the 4520-storage-locations-totals branch 2 times, most recently from 751fa34 to a46bd92 Compare November 10, 2024 17:13
Comment on lines 106 to 109
within "tbody tr:last-child" do
expect(page).to have_content(100) # The expected total inventory
expect(page).to have_content("$100.00") # The expected total fair market value
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there a better way to test the totals show up as expected without writing a system test?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes! You can look at some other request tests to see how it parses the rendered body and checks for elements.

@tatheerf02 tatheerf02 marked this pull request as ready for review November 10, 2024 17:21
@cielf cielf requested review from cielf and dorner November 12, 2024 15:57
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.

Hey @tatheerf02 -- I'm noticing that the totals are not aligned with the inventory and fair market value -- I expect that the values for each storage location are not right-aligned as they should be.

Can you take care of that? It fits here, but I can put it to a new issue if need be.

@tatheerf02
Copy link
Contributor Author

Hey @tatheerf02 -- I'm noticing that the totals are not aligned with the inventory and fair market value -- I expect that the values for each storage location are not right-aligned as they should be.

Can you take care of that? It fits here, but I can put it to a new issue if need be.

Hey @cielf! Sorry I'm a lil confused, I see that all column values are currently left-aligned, and the grand totals follow that pattern. Are you suggesting they should all be right-aligned instead? Thanks!

@cielf
Copy link
Collaborator

cielf commented Nov 13, 2024

Hey @cielf! Sorry I'm a lil confused, I see that all column values are currently left-aligned, and the grand totals follow that pattern. Are you suggesting they should all be right-aligned instead? Thanks!

@tatheerf02 Yup -- that's exactly what I'm suggesting. Thank you.

@tatheerf02 tatheerf02 force-pushed the 4520-storage-locations-totals branch from 6e3b75b to 7ae8045 Compare November 19, 2024 02:39
@tatheerf02
Copy link
Contributor Author

@cielf How do you feel about something like this? I right-aligned the titles for those columns as well so they wouldn't look mismatched
image

@cielf
Copy link
Collaborator

cielf commented Nov 20, 2024

Looks very good to me! @dorner -- Do you have any technical concerns?

Comment on lines 106 to 109
within "tbody tr:last-child" do
expect(page).to have_content(100) # The expected total inventory
expect(page).to have_content("$100.00") # The expected total fair market value
end
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes! You can look at some other request tests to see how it parses the rendered body and checks for elements.

@tatheerf02 tatheerf02 force-pushed the 4520-storage-locations-totals branch 2 times, most recently from d566b3c to 3e68ef4 Compare December 11, 2024 02:55
@tatheerf02 tatheerf02 force-pushed the 4520-storage-locations-totals branch from c925380 to 786b006 Compare January 13, 2025 01:20
@tatheerf02 tatheerf02 requested a review from dorner January 13, 2025 02:07
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.

Looks good!

@dorner dorner merged commit 1c9182e into rubyforgood:main Jan 16, 2025
11 checks passed
@github-actions
Copy link
Contributor

@tatheerf02: Your PR Add row for grand totals to storage locations index view is part of today's Human Essentials production release: 2025.01.19.
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.

Add totals for inventory and FMV to storage locations index page.

3 participants