InvenTree
InvenTree copied to clipboard
feat(backend): add guides / tipps endpoint
Adds models, API endpoints and frontend components to show tipps / guides in the frontend dependenant on various conditions
TODO
- [x] add collection mechanism
- [ ] add data model to calculate is_applicable based on types
- [ ] performance test
- [x] frontend: add state
- [x] add hook
- [x] add exported tipp component that only takes an id or slag
- [ ] add plugin dev docs
Required for #2907 and #2284 Follow up to #7995
Deploy Preview for inventree-web-pui-preview ready!
| Name | Link |
|---|---|
| Latest commit | 8cbe841942c5066e4acc7e4ef75ea2a0a9cfbde1 |
| Latest deploy log | https://app.netlify.com/projects/inventree-web-pui-preview/deploys/6931cf8c18f6e30008c58533 |
| Deploy Preview | https://deploy-preview-10715--inventree-web-pui-preview.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
Lighthouse |
1 paths audited Performance: 93 (no change from production) Accessibility: 81 (no change from production) Best Practices: 100 (no change from production) SEO: 78 (no change from production) PWA: - View the detailed breakdown and full score reports |
To edit notification comments on pull requests, go to your Netlify project configuration.
Codecov Report
:x: Patch coverage is 98.92857% with 3 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 84.03%. Comparing base (fa0d892) to head (8cbe841).
:x: Your project check has failed because the head coverage (85.29%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files
@@ Coverage Diff @@
## master #10715 +/- ##
==========================================
- Coverage 88.17% 84.03% -4.14%
==========================================
Files 1289 1297 +8
Lines 58046 63663 +5617
Branches 1973 1997 +24
==========================================
+ Hits 51181 53499 +2318
- Misses 6374 9667 +3293
- Partials 491 497 +6
| Flag | Coverage Ξ | |
|---|---|---|
| backend | 89.52% <98.92%> (+0.05%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Components | Coverage Ξ | |
|---|---|---|
| Backend Apps | 85.29% <98.90%> (-6.74%) |
:arrow_down: |
| Backend General | 93.12% <ΓΈ> (-0.36%) |
:arrow_down: |
| Frontend | 70.40% <ΓΈ> (-0.48%) |
:arrow_down: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
@matmair given the work required on this still, I'm bumping to 1.2.0 release
@SchrodingersGat ready for review; still working out a few lines for the contrib docs but done otherwise
@matmair can you provide some more context here, perhaps some examples of what these guides might look like?
And, do we need to add any documentation around this?
@SchrodingersGat I have moved guides to the next PRs
This PR lays the backend/frontend foundation for tipp / guide handling. There are new models to handle general tipps/guides and how/when they were executed; The PR also includes the generic frontend components to handle displaying the tipps/guides depending on the current user and their past states.
Guides are defined in the backend: https://github.com/inventree/InvenTree/pull/10715/files#diff-ec1ac5d58de4ea84666496443c657a0cb179543082041f546473b658b7707024R135-R146
Calling a tipp in the frontend is pretty simple https://github.com/inventree/InvenTree/pull/10715/files#diff-88417f7a022d6803b42e9a9694fe74faa20f8aa857efa39c8df73d769e4abd50R36
Tipps still look the same as previously
Just curious, what is the usecase of defining them on the backend rather than hardcoding them into the frontend? Can that be used by plugins?
Are they still translated and actually show the correct language the user has selected?
