Repository navigation
PUI Plugin Panels - #7470
PUI Plugin Panels#7470
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7470 +/- ##
==========================================
+ Coverage 84.36% 84.39% +0.03%
==========================================
Files 1143 1149 +6
Lines 51218 51463 +245
Branches 1791 1808 +17
==========================================
+ Hits 43209 43434 +225
- Misses 7804 7823 +19
- Partials 205 206 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Thanks that you already started a draft for this long standing issue. I just want to add my thoughts about this now: I See two ways how developers could build PUI integrations: 1. They provide everything they need on thrown. E.g. they want to use react, they need to setup their own react spa, bundle it and ship the static files. Inventree PUI just loads embeds a specified entry html document.
To fix these disadvantages, I see two methods:
2. They export a
|
|
@wolflu05 some great ideas here. I think that whatever approach we choose:
|
|
@wolflu05 if you can provide a small POC for how we might load an entrypoint into a panel, that would be amazing. |
|
The questions is what approach we should use. For my first suggestion, it would be as easy use using: And for the second, I actually made a POC last year linked in my initial post. I also played a bit there with using the main react version + mantine to use in panels (commented out), but that doesn't worked well that way, as react was complaining, that the rendering react version is not the same instance as the one creating elements, but that might be an issue from me to that time. |
|
I would rather not use the first approach. I'll try to get your demo running when I have some time! |
|
I really like @wolflu05 second idea; to keep the UI consistent providing a default set of UI components would be nice |
|
Just one thought, maybe we can build the panel system in a way so that we later could also add those pages to the mobile app via a web view as an option (when plugin devs expose a panel, they could specify the target: web,mobile,...). |
2bb1c2c to
e8ae641
Compare
|
This looks very promising although some parts seem a bit brittle - is unit and e2e testing part of the scope for this PR? |
Some testing will definitely be added! What parts in particular do you think look brittle? |
- Especially around unit testing - Ensure all settings are generated - Do not auto-create settings during registry load
|
I apologize if this has been addressed elsewhere... but having trouble finding it if it is. I have a collection of CUI plugins (including panel plugins) that I've written and continue to maintain for my InvenTree instance. I use many "InvenTree builtins", like Is there a world where switching to PUI for the server and updating my plugins to also use PUI can be incremental for me? In other words, would it ever be possible for me to continue using my existing CUI plugins with PUI on the instance? |
|
@jacobfelknor this is a good point. I am going to write some documentation around panel plugin migration, before we force the switch. |
|
I think first we need to publish the inventree npm package with the set of components, so that we can migrate e.g. the old form framework (I have used this in a panel) to the new react form framework. And same with other things. |

This PR serves as a "proof of concept" as to how client-side data could be served by plugins, in the new react / platform interface.
In this instance, custom "panels" are loaded via the API, and rendered on the page based on what is delivered to the server.
Currently this only serves raw text - much more work would be required to render:
/static/and loaded dynamicallyRelated Issues
TODO
include a way to embed javascript / typescript code into the documentationFuture Work
Resources
Pinning some resources here for further reading: