-
-
Notifications
You must be signed in to change notification settings - Fork 799
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
UI plugins custom features #8137
UI plugins custom features #8137
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 #8137 +/- ##
==========================================
+ Coverage 84.12% 84.44% +0.31%
==========================================
Files 1154 1160 +6
Lines 51831 52087 +256
Branches 1851 1869 +18
==========================================
+ Hits 43605 43984 +379
+ Misses 8015 7885 -130
- Partials 211 218 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Very interesting, I like the approach @wolflu05! |
…emplate preview area ui plugins
This is ready for review now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; There seems to be no coverage on usePluginUIFeature
, getPluginTemplateEditor
, getPluginTemplatePreview
and most changes on TemplateTable.tsx
reported on codecov - is that an issue with reporting or are these changes not tested?
@matmair I was wondering about that too, but all of that code should normally be covered by my added playwright test. That's why I actually made the effort to activate the sample plugin and ensure the sample template editor is shown when doing template editing. And also make sure that passing the code back and forth between the editors works. But I have no idea why codecov does not display that. Maybe you can help me here? |
I see the test but Istanbul is not reporting any coverage - maybe the code sections are not reached because of incremental rendering/loading? |
Yeah, the template editors are not rendered on the initial component render, as first the data from the server has to be loaded, but that shouldn't cause any problems, as that's how we do it everywhere? But what's interesting though is if you look at the history of the codecov comment, the previous comment actually hasn't contained the missing tsx files, only the python file. |
@matmair Maybe that's the same problem like mxschmitt/playwright-test-coverage#22, but unfortunately there is no response on that issue . I guess you have used that template to build the coverage system? |
This is indeed very curious; do you think it is realistic that we could fix it ourselves or do we have to just ignore it for now? |
Not sure, I have no idea what's going on there, I even cannot get coverage to work locally. |
@matmair can we merge this pr now, as the lines are actually be covered by the tests? Then you also have something to test coverage with your new approach. |
I would prefer if we figure this out before, coverage of PUI, in general, is very slacking. We can go ahead and merge but than I would expect an issue to keep track of this. |
As said before, I have absolutely no clue on this, why it's not counted. I have never done frontend coverage in any other project, so I'm no help here. @SchrodingersGat do you have any idea here? |
@SchrodingersGat would you mind taking a review at this, so we can merge this? You can activate the sample ui plugin or install the inventree-template-editor-plugin for testing. |
@SchrodingersGat @matmair the coverage issue has been resolved. It was caused by |
@wolflu05 thanks for your work here, it is looking very promising! Hopefully we can have some fully integrated plugins working soon to test it out with |
This PR enhances the UI mixin (which currently only can provide panels) with the capability to also integrate in lots of different other parts of the UI via a generic system. E.g. table actions, row actions, custom navigation entries, ... Currently only custom template editors and previews can be provided.
I'm currently working on this label template drag and drop editor plugin: https://github.com/wolflu05/inventree-template-editor-plugin and have released the first version now. Feel free to test it.
TODO
ref
out of the getFeature functions as parameter and instead provided them if necessary via the renderContext, and also have the ability to specify the return type to make the system more generic for other usecases (e.g. only return a list of navigation entries, ...)