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

stregreport: Add all categories to overview #532

Merged
merged 15 commits into from
Jan 15, 2025

Conversation

krestenlaust
Copy link
Member

@krestenlaust krestenlaust commented Nov 30, 2024

The current implementation is very crude and hardcodes the product IDs.
Instead we should use the categories, and make it dynamic.

Fixes #514

I've also renamed the stregreport menu-entries to more reasonable names

Removed product IDs, and removed the wet HTML with templating.
@krestenlaust
Copy link
Member Author

krestenlaust commented Nov 30, 2024

The fixture doesn't have any transactions, so it can't easily be tested (Without me having to go through great amounts of pain)
Screenshot of the new screen, where a bunch of categories are grouped tightly together

You could argue that the styling should be updated. But then I might argue that this admin page is already still 10x more useful now, than it ever has been (Of course, I don't mind, not having to mess around with styling)

EDIT:
Also, this is really nice
billede

@krestenlaust krestenlaust marked this pull request as ready for review November 30, 2024 00:11
Copy link
Member

@Mast3rwaf1z Mast3rwaf1z left a comment

Choose a reason for hiding this comment

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

there's a few small questions, descide for yourself whether you want to fix any of them, but i don't think there's anything wrong with the current code

good change 👍

@krestenlaust krestenlaust marked this pull request as draft December 1, 2024 13:10
@krestenlaust krestenlaust marked this pull request as ready for review December 9, 2024 18:45
@krestenlaust
Copy link
Member Author

I've tried giving the report types new names to be more explanatory (I've also reordered them)

billede

billede

Copy link
Contributor

@patrickreiffenstein patrickreiffenstein 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

@krestenlaust krestenlaust removed this from the Start of Spring Semester 2025 milestone Jan 11, 2025
@Mast3rwaf1z
Copy link
Member

@krestenlaust i've just tried running it before my last review and code now, it seems the categories doesn't show properly for me using the testdata?
before:
Screenshot_20250113_182847
after:
Screenshot_20250113_182703

same testdata: testdata.json

@krestenlaust krestenlaust force-pushed the feat/report-add-all-categories branch from b5dfc45 to 735e9b1 Compare January 14, 2025 10:48
@krestenlaust
Copy link
Member Author

krestenlaust commented Jan 14, 2025

@krestenlaust i've just tried running it before my last review and code now, it seems the categories doesn't show properly for me using the testdata?

After bisecting, it turns out it was the 'pythonic' implementation that was faulty. I ended up simply reverting it, because it (to me) is actually harder to understand than the current imperative. Let me know what you think

I've implemented a test to prevent this sort of outfalling again

Copy link
Member

@Mast3rwaf1z Mast3rwaf1z left a comment

Choose a reason for hiding this comment

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

lgtm, works on my machine 👍

Copy link

codecov bot commented Jan 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.63%. Comparing base (2524a13) to head (0f9e602).
Report is 1 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next     #532      +/-   ##
==========================================
+ Coverage   80.67%   81.63%   +0.96%     
==========================================
  Files          40       40              
  Lines        3886     3899      +13     
  Branches      485      485              
==========================================
+ Hits         3135     3183      +48     
+ Misses        694      656      -38     
- Partials       57       60       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@krestenlaust krestenlaust merged commit acf6b47 into next Jan 15, 2025
6 checks passed
@krestenlaust krestenlaust deleted the feat/report-add-all-categories branch January 15, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Admin panel ranking (Købs- og forbrugsrangeringer) not showing all categories
3 participants