From 2e184ffa5450e1b5a2f82d8e1ee3a709e9367eeb Mon Sep 17 00:00:00 2001 From: wolflu05 <76838159+wolflu05@users.noreply.github.com> Date: Wed, 18 Sep 2024 13:27:29 +0200 Subject: [PATCH] add docs --- docs/docs/extend/plugins/ui.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/docs/docs/extend/plugins/ui.md b/docs/docs/extend/plugins/ui.md index ae350a209d..9c288b42f0 100644 --- a/docs/docs/extend/plugins/ui.md +++ b/docs/docs/extend/plugins/ui.md @@ -89,6 +89,38 @@ export function isPanelHidden(context) { } ``` +## Custom UI Functions + +User interface plugins can also provide additional user interface functions. These functions can be provided via the `get_ui_features` method: + +::: plugin.base.ui.mixins.UserInterfaceMixin.get_ui_features + options: + show_bases: False + show_root_heading: False + show_root_toc_entry: False + show_sources: True + summary: False + members: [] + +::: plugin.samples.integration.user_interface_sample.SampleUserInterfacePlugin.get_ui_features + options: + show_bases: False + show_root_heading: False + show_root_toc_entry: False + show_source: True + members: [] + + +Currently the following functions can be extended: + +### Template editors + +The `template_editor` feature type can be used to provide custom template editors. For an example see [`sample_template.js`](https://github.com/inventree/InvenTree/blob/master/src/backend/InvenTree/plugin/samples/static/plugin/sample_template.js). + +### Template previews + +The `template_preview` feature type can be used to provide custom template previews. For an example see [`sample_template.js`](https://github.com/inventree/InvenTree/blob/master/src/backend/InvenTree/plugin/samples/static/plugin/sample_template.js). + ## Sample Plugin A sample plugin which implements custom user interface functionality is provided in the InvenTree source code: