mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Add a broken panel which tries to load a non-existent javascript file
This commit is contained in:
parent
2536cad8a3
commit
d02146a03e
@ -30,6 +30,12 @@ class SampleUserInterfacePlugin(SettingsMixin, UserInterfaceMixin, InvenTreePlug
|
|||||||
'default': False,
|
'default': False,
|
||||||
'validator': bool,
|
'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):
|
def get_custom_panels(self, instance_type: str, instance_id: int, request):
|
||||||
@ -60,6 +66,14 @@ class SampleUserInterfacePlugin(SettingsMixin, UserInterfaceMixin, InvenTreePlug
|
|||||||
'content': content,
|
'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
|
# Next, add a custom panel which will appear on the 'part' page
|
||||||
# Note that this content is rendered from a template file,
|
# Note that this content is rendered from a template file,
|
||||||
# using the django templating system
|
# using the django templating system
|
||||||
|
Loading…
Reference in New Issue
Block a user