mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-27 14:16:02 +00:00
[UI] Plugin actions (#10720)
* Add backend code for custom actions * docs * Add sample action code * Fetch plugin features * Load plugins and call function * Support icons * Alert message * Update CHANGELOG.md * Rename action type * Update docs * pdated playwright tests
This commit is contained in:
@@ -49,6 +49,20 @@ class SampleUserInterfacePlugin(SettingsMixin, UserInterfaceMixin, InvenTreePlug
|
||||
},
|
||||
}
|
||||
|
||||
def get_ui_spotlight_actions(self, request, context, **kwargs):
|
||||
"""Return a list of custom actions to be injected into the UI spotlight."""
|
||||
return [
|
||||
{
|
||||
'key': 'sample-action',
|
||||
'title': 'Sample Action',
|
||||
'description': 'This is a sample action for the spotlight search',
|
||||
'icon': 'ti:search:outline',
|
||||
'source': self.plugin_static_file(
|
||||
'sample_action.js:performSampleAction'
|
||||
),
|
||||
}
|
||||
]
|
||||
|
||||
def get_ui_panels(self, request, context, **kwargs):
|
||||
"""Return a list of custom panels to be injected into the UI."""
|
||||
panels = []
|
||||
|
||||
Reference in New Issue
Block a user