From d2385a43c95def4065b968656bd247bb99ced62b Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 13 Aug 2024 09:18:08 +0000 Subject: [PATCH] Pass more information through to plugin panels --- src/backend/InvenTree/plugin/models.py | 8 -------- src/frontend/src/components/nav/PanelGroup.tsx | 1 + src/frontend/src/hooks/UsePluginPanels.tsx | 2 +- src/frontend/src/pages/part/PartDetail.tsx | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/backend/InvenTree/plugin/models.py b/src/backend/InvenTree/plugin/models.py index 6f679c213b..4989f56af2 100644 --- a/src/backend/InvenTree/plugin/models.py +++ b/src/backend/InvenTree/plugin/models.py @@ -154,14 +154,6 @@ class PluginConfig(InvenTree.models.MetadataMixin, models.Model): warnings.warn('A reload was triggered', stacklevel=2) 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')) def is_installed(self) -> bool: """Simple check to determine if this plugin is installed. diff --git a/src/frontend/src/components/nav/PanelGroup.tsx b/src/frontend/src/components/nav/PanelGroup.tsx index 87d316f7b7..720cbc4ded 100644 --- a/src/frontend/src/components/nav/PanelGroup.tsx +++ b/src/frontend/src/components/nav/PanelGroup.tsx @@ -68,6 +68,7 @@ function BasePanelGroup({ // Hook to load plugins for this panel const pluginPanels = usePluginPanels({ targetModel: targetModel, + targetInstance: targetInstance, targetId: targetId }); diff --git a/src/frontend/src/hooks/UsePluginPanels.tsx b/src/frontend/src/hooks/UsePluginPanels.tsx index 6181b3b205..de34be1f7c 100644 --- a/src/frontend/src/hooks/UsePluginPanels.tsx +++ b/src/frontend/src/hooks/UsePluginPanels.tsx @@ -78,7 +78,7 @@ export function usePluginPanels({ }; }) ?? [] ); - }, [data]); + }, [data, targetId, targetModel, targetInstance]); return { panels: panels diff --git a/src/frontend/src/pages/part/PartDetail.tsx b/src/frontend/src/pages/part/PartDetail.tsx index 8aea064092..4c0d5c2699 100644 --- a/src/frontend/src/pages/part/PartDetail.tsx +++ b/src/frontend/src/pages/part/PartDetail.tsx @@ -1098,6 +1098,7 @@ export default function PartDetail() {