mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Pass more information through to plugin panels
This commit is contained in:
parent
163ecab44b
commit
d2385a43c9
@ -154,14 +154,6 @@ class PluginConfig(InvenTree.models.MetadataMixin, models.Model):
|
|||||||
warnings.warn('A reload was triggered', stacklevel=2)
|
warnings.warn('A reload was triggered', stacklevel=2)
|
||||||
registry.reload_plugins()
|
registry.reload_plugins()
|
||||||
|
|
||||||
# Update static files for this plugin
|
|
||||||
if self.active:
|
|
||||||
plugin.staticfiles.copy_plugin_static_files(
|
|
||||||
self.key, check_reload=False
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
plugin.staticfiles.clear_plugin_static_files(self.key)
|
|
||||||
|
|
||||||
@admin.display(boolean=True, description=_('Installed'))
|
@admin.display(boolean=True, description=_('Installed'))
|
||||||
def is_installed(self) -> bool:
|
def is_installed(self) -> bool:
|
||||||
"""Simple check to determine if this plugin is installed.
|
"""Simple check to determine if this plugin is installed.
|
||||||
|
@ -68,6 +68,7 @@ function BasePanelGroup({
|
|||||||
// Hook to load plugins for this panel
|
// Hook to load plugins for this panel
|
||||||
const pluginPanels = usePluginPanels({
|
const pluginPanels = usePluginPanels({
|
||||||
targetModel: targetModel,
|
targetModel: targetModel,
|
||||||
|
targetInstance: targetInstance,
|
||||||
targetId: targetId
|
targetId: targetId
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ export function usePluginPanels({
|
|||||||
};
|
};
|
||||||
}) ?? []
|
}) ?? []
|
||||||
);
|
);
|
||||||
}, [data]);
|
}, [data, targetId, targetModel, targetInstance]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
panels: panels
|
panels: panels
|
||||||
|
@ -1098,6 +1098,7 @@ export default function PartDetail() {
|
|||||||
<PanelGroup
|
<PanelGroup
|
||||||
pageKey="part"
|
pageKey="part"
|
||||||
panels={partPanels}
|
panels={partPanels}
|
||||||
|
targetInstance={part}
|
||||||
targetModel={ModelType.part}
|
targetModel={ModelType.part}
|
||||||
targetId={part.pk}
|
targetId={part.pk}
|
||||||
/>
|
/>
|
||||||
|
Loading…
Reference in New Issue
Block a user