Files
InvenTree/src/frontend
Syogo-SuganoyaandClaude Opus 5.5 1f51dfe64b [UI] Warn before closing the template editor with unsaved changes (#13280)
* Warn before closing the template editor with unsaved changes

- Allow DetailDrawer close actions to be intercepted (onBeforeClose)
- Track the saved template code in the TemplateEditor
- Ask for confirmation before discarding unsaved changes (drawer close / page unload)

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Treat a failed unsaved-changes check as unsaved

- Ask for confirmation if the editor code cannot be read
- Reject the plugin preview update if no handler is registered, so the template is not assumed to be saved

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

* Do not treat unavailable editor code as saved

An editor which is still initializing (e.g. a plugin editor) returns no
code yet. Fall back to the code which was last handed to the editor, and
ask for confirmation if the editor content is unknown.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Only mark the template as saved when the preview returns a promise

A preview handler which returns synchronously does not report whether the
template was actually stored, so keep the editor marked as unsaved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-16 18:30:33 +11:00
..
2026-11-12 11:14:01 +11:00
2025-04-16 00:30:34 +10:00
2025-04-16 00:30:34 +10:00
2025-04-16 00:30:34 +10:00
2025-04-16 00:30:34 +10:00
2026-06-30 00:44:25 +10:00

inventree-ui

User Interface (UI) elements for the InvenTree web interface.

Description

This package provides a public interface allowing plugins to hook into core UI functionality. In particular, it defines a set of interface types provided by the InvenTree user interface, to be used by a custom plugin to implement some custom UI feature.

This library is intended to be used for creating plugins - any other use is outside of its scope and is not supported.

Plugin Creator

This library is intended to be used with the InvenTree Plugin Creator. Read the documentation for the plugin creation tool for more information.

The plugin creation tool uses the types provided in this package at build time, but it is intended that most of the major packages are externalized - as these are provided as global objects by the core InvenTree UI code.

Installation

This should be installed as a part of the plugin creator tool. If you need to install it manually, e.g. using npm:

npm i @inventreedb/ui

Versioning

Each change to the plugin API will be described in the CHANGELOG file.