diff --git a/src/backend/InvenTree/plugin/samples/integration/user_interface_sample.py b/src/backend/InvenTree/plugin/samples/integration/user_interface_sample.py index 856a73a474..1642342130 100644 --- a/src/backend/InvenTree/plugin/samples/integration/user_interface_sample.py +++ b/src/backend/InvenTree/plugin/samples/integration/user_interface_sample.py @@ -30,6 +30,12 @@ class SampleUserInterfacePlugin(SettingsMixin, UserInterfaceMixin, InvenTreePlug 'default': False, 'validator': bool, }, + 'ENABLE_BROKEN_PANELS': { + 'name': _('Enable Broken Panels'), + 'description': _('Enable broken panels for testing'), + 'default': True, + 'validator': bool, + }, } def get_custom_panels(self, instance_type: str, instance_id: int, request): @@ -60,6 +66,14 @@ class SampleUserInterfacePlugin(SettingsMixin, UserInterfaceMixin, InvenTreePlug 'content': content, }) + # A broken panel which tries to load a non-existent JS file + if self.get_setting('ENABLE_BROKEN_PANElS'): + panels.append({ + 'name': 'broken_panel', + 'label': 'Broken Panel', + 'source': '/this/does/not/exist.js', + }) + # Next, add a custom panel which will appear on the 'part' page # Note that this content is rendered from a template file, # using the django templating system