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

Dashboard! #3788

Merged
merged 175 commits into from
May 12, 2024
Merged

Dashboard! #3788

merged 175 commits into from
May 12, 2024

Conversation

awwaiid
Copy link
Collaborator

@awwaiid awwaiid commented Jul 29, 2023

This is an epic feature branch that moves more historic-reporting-oriented blocks off of the dashboard and adds some action-oriented blocks in. We'll review and merge it as a slate!

Benabik and others added 11 commits July 28, 2023 15:28
Removes the highly duplicated nested card divs and card-tools.

Results in the same HTML (modulo whitespace)
Has slightly different layout than the others, so required some
changes to the partial.
Fixes #3736
These changes include:
- Removing Purchase Summary card from user's dashboard
- Adds new purchase summary page & item in navigation
- Changes to updated card styling/formatting
- Adds a shared date filter card partial in shared directory
- Adds a shared card partial for use throughout in the shared directory
Lists the pending and started requests right on the main page so that
the user has an idea of what they need to work on now.

resolves #3669
A huge list of outstanding requests starts to overwhelm the page and
make other things hard to find.  Show 25 and a link that says how
many other requests there are.
The +/- collapse doesn't work with the layout of the table cards.
Instead, those cards had a remove button.
Restore remove button to dashboard cards
@scooter-dangle scooter-dangle added the Ruby for Good 2023 DC Created for Ruby for Good 2023 DC label Jul 29, 2023
awwaiid and others added 17 commits July 29, 2023 16:10
… (#3793)

* Remove old "Distributions by County" button

* Add Distribution by County report to sidebar

* Make reports menu visible to non-admin users
…ed-donations-3733

 Conflicts:
	app/views/layouts/_lte_sidebar.html.erb
Not sure how these got into this branch specifically, but ok.
Fixes #3736
These changes include:
Needed to change the dashboard to not contain any information about the purchases summary - this has now been moved to the new purchases summary page within the nav bar under `reporting and auditing`. Filtering has also been added to said page, and filter partials and the card have been added to a shared area for ease of access and consistency. Page tests added for new content.
fixed weird spacing issue, removed duplicate file
Fixed small issue in render - duplicate partial now removed
…rm-dash

Move purchase from dashboard to standalone report [#3736]
@cielf
Copy link
Collaborator

cielf commented Apr 19, 2024

Pre-existing problem noted -- if you have everything expanding, you can't scroll all the way to the bottom of the l.h.m.

@cielf
Copy link
Collaborator

cielf commented Apr 19, 2024

@awwaiid -- This is being a little picky, but could we change the order of the l.h.m?-- within each of Distribution, Donation, Purchases, I like the Summary at the top, but there's not really any rhyme or reason to the rest --- can we get them in alpha order?

else
controller_path
end
(name.include?(controller_path) || name.include?(controller_path + '/' + action_name)) ? 'active' : controller_path
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dorner not only "could" this mess us up, upon clicking through every menu entry it was in fact messing things up. This switches to look at the whole path or the path+action.

@cielf
Copy link
Collaborator

cielf commented Apr 28, 2024

I'm still waiting for the event sourced version before running the next round of tests.

@awwaiid
Copy link
Collaborator Author

awwaiid commented Apr 29, 2024

I had to do some fixes for the low-inventory report, both to the report and to the specs, so that it can work with events.

I also manually tested how the extracted summary reports work with Event mode and verified that it has no affect. I locally manually reset an entire org's InventoryItems to a small/fixed qty that doesn't match their event snapshot, and then flipped them back and forth between event-mode and old-mode, and verified each report that way. @cielf this is ready for another manual test if you're up for it!

@awwaiid awwaiid requested a review from dorner April 29, 2024 16:38
inventory = InventoryAggregate.inventory_for(organization.id)

items = {}
inventory.storage_locations.values.each do |storage_location|
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dorner this is the adaptation of the SQL query -> an in-memory rollup. Is there a preferred way to do this? I tested it on moms-for-moms, which has quite a few items, and it is fast with our dataset.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@awwaiid take a look at View::Inventory. There are a lot of extra methods in there that you should be able to use to clean this up.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated to use View::Inventory!

@cielf
Copy link
Collaborator

cielf commented Apr 29, 2024

Great! I'm at the end of my hours for today, but this is a high priority for me tomorrow.

@cielf
Copy link
Collaborator

cielf commented Apr 30, 2024

Here's my current take. The low inventory matches up to the history, as does the itemized distribution report (spot checked on prod data for each). It turns out that it doesn't match up to the storage location report -- it looks like we're showing 0 if we have negative inventory there (which we never should actually have). That's a discussion to have about the storage location report? I'm good with pushing this forward if @dorner is. [Honestly, I'd love to be able to say "Dashboard is in the next release" in the stakeholder meeting tomorrow.]

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.

We're super close!

else
controller_path
end
(name.include?(controller_path) || name.include?(controller_path + '/' + action_name.to_s)) ? 'active' : controller_path
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this can be done more cleanly by using params[:controller] and (if necessary) params[:action]. We shouldn't be doing any kind of string munging of the path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. It might look similar, but now you can specify the controller name and optionally the action name.

inventory = InventoryAggregate.inventory_for(organization.id)

items = {}
inventory.storage_locations.values.each do |storage_location|
Copy link
Collaborator

Choose a reason for hiding this comment

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

@awwaiid take a look at View::Inventory. There are a lot of extra methods in there that you should be able to use to clean this up.

@awwaiid awwaiid requested a review from dorner May 12, 2024 12:49
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.

I am good with this!

@dorner
Copy link
Collaborator

dorner commented May 12, 2024

Some specs failing though :(

awwaiid added 2 commits May 12, 2024 10:11
 Conflicts:
	spec/system/admin/users_system_spec.rb
	spec/system/dashboard_system_spec.rb
@awwaiid awwaiid merged commit 2df842f into main May 12, 2024
38 checks passed
@awwaiid awwaiid deleted the dashboard branch May 12, 2024 16:47
@cielf
Copy link
Collaborator

cielf commented May 12, 2024

Hurrah!!!

Copy link
Contributor

@awwaiid: Your PR Dashboard! is part of today's Human Essentials production release: 2024.05.26.
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
BLOCKER This issue blocks others and should be prioritized 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.

9 participants