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

Add Item Inventory for Banks with many locations #3784

Conversation

ChaelCodes
Copy link
Contributor

@ChaelCodes ChaelCodes commented Jul 29, 2023

Resolves #3776

Description

Move to using an ExpandableTable from AdminLTE. The current table horizontally scrolls when there are too many locations configured for the organization. Instead, we'll show locations and quantities in a collapsible row when you click on the row. Also, add a link to the item, so they can access additional details about the item from the table.

Type of change

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

How Has This Been Tested?

  1. Log in as an org admin - org_admin1@example.com/password!
  2. Create many Locations with long names - /diaper_bank/storage_locations/new
  3. Go to the /diaper-bank/items page
  4. Select the "Item Inventory" tab
  5. Scroll to the Item Inventory table
  6. Click on a particular item - observe inventory in different locations, no locations with 0 inventory are listed

Screenshots

Screenshot of collapsed and expanded rows in the Item Inventory table

@scooter-dangle scooter-dangle added the Ruby for Good 2023 DC Created for Ruby for Good 2023 DC label Jul 29, 2023
@cielf
Copy link
Collaborator

cielf commented Jul 29, 2023

Hrm. @ChaelCodes Tried this with a copy of production data, and I'm not seeing the storage locations on Sylvia's Sisters
<img width="1509" alt="Screenshot 2023-07-29 at 11 29 40 AM" src="https://github.com/rubyforgood/human-essentials/assets/10157589/809e7198-880b-4594-b546-ce4c074944a3". Curious.

@cielf
Copy link
Collaborator

cielf commented Jul 29, 2023

Hrm. @ChaelCodes Tried this with a copy of production data, and I'm not seeing the storage locations on Sylvia's Sisters <img width="1509" alt="Screenshot 2023-07-29 at 11 29 40 AM" src="https://github.com/rubyforgood/human-essentials/assets/10157589/809e7198-880b-4594-b546-ce4c074944a3". Curious.

Oh -- I see -- you have to click to expand them. Hrm. If I didn't immediately see that, the banks won't either (likely). What can we do to make it more obvious? It might be enough to put a note in the header ("Click for location breakdown")

@cielf
Copy link
Collaborator

cielf commented Jul 29, 2023

Except, when I click, it's expanding, but then going to the Item Information screen. I'm using Chrome FWIW.

@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from a92bbb9 to 27d84ec Compare July 29, 2023 17:01
@ChaelCodes ChaelCodes changed the title Move to presenting storage locations in an ExpandableTable Add Item Inventory for Banks with many locations Jul 29, 2023
@ChaelCodes
Copy link
Contributor Author

Except, when I click, it's expanding, but then going to the Item Information screen. I'm using Chrome FWIW.

So, I made the item names link to the items! But I also made clicking the row anywhere expand it. Maybe if I add a little icon at the end of the row to clue them in that they can click the row? Clicking the icon would expand it, but they'd figure out they could technically click anywhere on the row.

@cielf
Copy link
Collaborator

cielf commented Jul 29, 2023

Except, when I click, it's expanding, but then going to the Item Information screen. I'm using Chrome FWIW.

So, I made the item names link to the items! But I also made clicking the row anywhere expand it. Maybe if I add a little icon at the end of the row to clue them in that they can click the row? Clicking the icon would expand it, but they'd figure out they could technically click anywhere on the row.

Yeah... Maybe putting an explicit "Expand" button would work. Maybe the size of the View/edit/print/reclaim buttons that you would see in the distribution index.

@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from 27d84ec to 30cca38 Compare July 29, 2023 19:11
@cielf
Copy link
Collaborator

cielf commented Jul 29, 2023

Hey @ChaelCodes -- this is me being cautious -- but I just realized you're using AdminLTE, and I know there was something about AdminLTE not being ready for bootstrap5 in the issue that's prompted Howard's work there -- can you touch base with him, if you haven't already?

@ChaelCodes
Copy link
Contributor Author

Hey @ChaelCodes -- this is me being cautious -- but I just realized you're using AdminLTE, and I know there was something about AdminLTE not being ready for bootstrap5 in the issue that's prompted Howard's work there -- can you touch base with him, if you haven't already?

I mentioned it to him, but I double-checked based on this comment. @h-m-m says it's okay because we're sticking with AdminLTE for now, and if we want to remove it, we'll have to do a whole site redesign, so it'll just be part of that larger effort.

So, I made the item names link to the items! But I also made clicking the row anywhere expand it. Maybe if I add a little icon at the end of the row to clue them in that they can click the row? Clicking the icon would expand it, but they'd figure out they could technically click anywhere on the row.

Yeah... Maybe putting an explicit "Expand" button would work. Maybe the size of the View/edit/print/reclaim buttons that you would see in the distribution index.

I saw this after implementing +/- icons. The whole row is still clickable, but this hints that it expands. I think we definitely need to provide a hint/clue. Does this look better?

expandable and collapsible tabs

@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from 04ff4c3 to 70f25b1 Compare July 29, 2023 19:50
@scooter-dangle
Copy link
Collaborator

This makes sense. I want to run this past the stakeholder who mentioned the issue to make sure she doesn't expect to lose value by no longer being able to look down across an entire column.

@ChaelCodes
Copy link
Contributor Author

This makes sense. I want to run this past the stakeholder who mentioned the issue to make sure she doesn't expect to lose value by no longer being able to look down across an entire column.

This is a good idea. We moved it into a separate tab - Item Inventory, to make sure that we didn't impact banks that can currently scan the whole column.

@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from 8ebb337 to 16f1e24 Compare July 29, 2023 20:22
The "Items, Quantity, and Location" table has a nasty horizontal scroll
if the bank has many locations, which can be common for banks that allow
volunteers to take inventory back to their residences to package into
kits. This is very unwieldly for them, but other banks with few
locations have a great scannable view of where their inventory is. We're
reproducing this table with the locations collapsed under a heading for
banks with many locations in a new tab to preserve the experience for
banks with few locations.

ExpandableTable from AdminLTE is being used to handle the expansion.
Location is being stored slightly differently in the query to make it
easier to access.
@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from 7904293 to d160974 Compare July 29, 2023 21:16
@ChaelCodes ChaelCodes marked this pull request as ready for review July 29, 2023 23:01
@scooter-dangle
Copy link
Collaborator

This is a good idea. We moved it into a separate tab - Item Inventory, to make sure that we didn't impact banks that can currently scan the whole column.

Nice…thanks!

Copy link
Collaborator

@scooter-dangle scooter-dangle left a comment

Choose a reason for hiding this comment

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

Great! Let's mergeroo!

@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch 4 times, most recently from 0c859f0 to df90cac Compare July 30, 2023 15:00
@ChaelCodes ChaelCodes force-pushed the 3776-horizontal-scroll-many-locations branch from df90cac to 8d274a9 Compare July 30, 2023 15:11
@scooter-dangle scooter-dangle merged commit 14dcb6a into rubyforgood:main Jul 30, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ruby for Good 2023 DC Created for Ruby for Good 2023 DC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Items, Quantity, and Location table scrolls horizontally with many residential locations
3 participants