Skip to content

[PUI] pricing tab - #6985

Merged
SchrodingersGat merged 49 commits into
inventree:masterfrom
SchrodingersGat:pui-pricing-tab
Apr 15, 2024
Merged

SchrodingersGat merged 49 commits into
inventree:masterfrom
SchrodingersGat:pui-pricing-tab

Conversation

@SchrodingersGat

@SchrodingersGat SchrodingersGat commented Apr 9, 2024 •

Copy link
Copy Markdown
Member

Future Work

Ideas for improvements after this is merged:

  • click on a line in the overview and jump to the matching accordion (that should also open)
  • The data is displayed as decimal, not in local currency formatting. Can that be changed?
  • use a colour scheme generator like CUI - those red and green colours especially are a bit difficult for colour-blind users
  • if iv. is implemented as a donut: a switch to render about and percental rendering
  • improve rendering of tooltip label data
  • Improve rendering of legend label data

@SchrodingersGat SchrodingersGat added pricing Pricing functionality User Interface Related to the frontend / User Interface labels Apr 9, 2024
@SchrodingersGat SchrodingersGat added this to the 0.15.0 milestone Apr 9, 2024
@netlify

netlify Bot commented Apr 9, 2024 •

Copy link
Copy Markdown

✅ Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 5829619
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/661d35debe30e30008e6f5e6
😎 Deploy Preview https://deploy-preview-6985--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 100 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@codecov

codecov Bot commented Apr 9, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 58.94737% with 117 lines in your changes are missing coverage. Please review.

Project coverage is 83.42%. Comparing base (36c0080) to head (5829619).

Files Patch % Lines
...rontend/src/pages/part/pricing/BomPricingPanel.tsx 17.24% 24 Missing ⚠️
...nd/src/pages/part/pricing/PurchaseHistoryPanel.tsx 40.00% 14 Missing and 1 partial ⚠️
...end/src/pages/part/pricing/VariantPricingPanel.tsx 17.64% 14 Missing ⚠️
...rontend/src/pages/part/pricing/PriceBreakPanel.tsx 63.33% 10 Missing and 1 partial ⚠️
...ontend/src/pages/part/pricing/SaleHistoryPanel.tsx 21.42% 11 Missing ⚠️
.../src/tables/purchasing/SupplierPriceBreakTable.tsx 71.79% 8 Missing and 3 partials ⚠️
src/frontend/src/defaults/formatters.tsx 27.27% 7 Missing and 1 partial ⚠️
src/backend/InvenTree/order/api.py 72.72% 6 Missing ⚠️
...nd/src/pages/part/pricing/PricingOverviewPanel.tsx 78.94% 4 Missing ⚠️
src/frontend/src/tables/ColumnRenderers.tsx 0.00% 4 Missing ⚠️
... and 6 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6985      +/-   ##
==========================================
- Coverage   83.53%   83.42%   -0.11%     
==========================================
  Files        1027     1038      +11     
  Lines       45217    45472     +255     
  Branches     1191     1238      +47     
==========================================
+ Hits        37771    37935     +164     
- Misses       7209     7279      +70     
- Partials      237      258      +21     
Flag Coverage Δ
pui 58.12% <53.75%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@matmair @wolffam LMK what you think. I quite like the recharts library, once this is merged, I will work on scheduling and stocktake panels with the same charts

@wolffam

wolffam commented Apr 11, 2024

Copy link
Copy Markdown
Contributor

@matmair @wolffam LMK what you think. I quite like the recharts library, once this is merged, I will work on scheduling and stocktake panels with the same charts

tagging @wolflu05 instead ;)

@matmair

matmair commented Apr 11, 2024 •

Copy link
Copy Markdown
Member

Very nice overall @SchrodingersGat; I noticed a few things:

    1. If pricing is not available it feels redundant to be able to open it. We could simply disable the "empty" accordion and add a tooltip
    1. It would be nice if it would be possible to click on a line in the overview and jump to the matching accordion (that should also open)
    1. there is a lot of empty space here, could the table and graph be the same height?
      grafik
    1. on my real-world data the BOM section is not very helpful because there are 20+ items and only a few are rendered - could we switch back to a donut again?
      grafik
    1. There seems to be horizontal padding in the accordion tabs. Can that be removed/reduced?
      grafik
      grafik
    1. The data is displayed as decimal, not in local currency formatting. Can that be changed?
    1. At initial loading you shortly see all possible pricing ranges - they then disappear. Could that be changed to first show nothing and then render applicable elements?

Ideas for future iterations:

  • use a colour scheme generator like CUI - those red and green colours especially are a bit difficult for colour-blind users
  • if iv. is implemented as a donut: a switch to render about and percental rendering
  • hover cards for BOM items to show min max pricing in the different categories, maybe history

@matmair matmair left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

return null;
}

value = parseFloat(value.toString());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question: Is there a way to only convert the value if it is not a number? Seems redundant to do it this way but not sure how much overhead this creates

Comment thread src/frontend/src/functions/urls.tsx Resolved

@wolflu05 wolflu05 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks awesome. So we now use and plan to use the recharts lib in the future even if we may update to mantine@v7 where mantine ships with its own chart lib?
After a quick review everything looks good after @matmair 's points are resolved.

@SchrodingersGat

Copy link
Copy Markdown
Member Author

@wolflu05 as far as I can tell, mantine uses recharts internally, which is why I chose it for the upgrade path

@SchrodingersGat
SchrodingersGat merged commit d3a2ece into inventree:master Apr 15, 2024
@SchrodingersGat
SchrodingersGat deleted the pui-pricing-tab branch April 15, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api Relates to the API enhancement This is an suggested enhancement or new feature pricing Pricing functionality refactor User Interface Related to the frontend / User Interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants