Repository navigation
[PUI] Dashboard refactor - #8278
Conversation
- Complete transfer of files into new structure
✅ 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 #8278 +/- ##
==========================================
- Coverage 84.51% 84.35% -0.17%
==========================================
Files 1169 1170 +1
Lines 53208 53460 +252
Branches 1978 1996 +18
==========================================
+ Hits 44969 45096 +127
- Misses 7725 7847 +122
- Partials 514 517 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
…Tree into dashboard-refactor
| responseOptions: { | ||
| key: string; | ||
| title: string; | ||
| icon: InvenTreeIconType; | ||
| }; | ||
| responseOptions: PluginUIFeature; |
There was a problem hiding this comment.
@SchrodingersGat sorry, I only had a chance now to review this properly.
The idea here was, that each different feature can respond with some different options (which are defined in the "options" dict key provided by the get_ui_features function on the plugin class). That's why I build a TS generic type. Where each feature gets its base things defined (feature_type, requestContext, responseOptions, ...). I already defined them for TemplateEditorUIFeature (and TemplatePreviewUIFeature) here. (Your dashboard things are missing) Then some generic type helpers can be used where needed to type things. This becomes pretty handy, when we publish the inventree-ui npm package. UI feature developers then can just do something like this and the types of all available contexts, also specific for that feature get inferred:
import { PluginUIGetFeatureType, TemplateEditorUIFeature } from '@inventree/ui';
export const getFeature: PluginUIGetFeatureType<TemplateEditorUIFeature> = (params) => {
//
};You now only changed the responseOptions for the template editor feature to some "generic" options (Same in the plugin definition. It's not really clear now what are custom options specific to that feature and what are mandatory things like source. From my two examples this may be not really clear, because they both contained the same options, but I was planning, that other features may need to have different options. E.g. not all features need a description or icon. How do you want to move forward with this now, especially with inventree 1.0?
There was a problem hiding this comment.
@wolflu05 i"m happy to look at expanding the typing system as part our efforts towards 1.0 :)

This PR presents a major refactor of the "dashboard" feature in PUI, bringing it closer towards a release state.
We were already using react-grid-layout for the new dashboard - this PR moves the implementation forward, adding new features, refactoring, etc
Related Issues
Main Goals
Screenshots