[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:
Oliver
2025-10-31 09:41:32 +11:00
committed by GitHub
parent 8d1f7f39b4
commit 16a753bf59
9 changed files with 168 additions and 21 deletions
@@ -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 = []