2
0
mirror of https://github.com/inventree/InvenTree.git synced 2026-06-12 03:28:37 +00:00
Commit Graph

19 Commits

Author SHA1 Message Date
Matthias Mair 3d527eb392 feat(frontend): add hotkey registration function and hotkey helper modal (#12128)
* add new hotkey registration interface and hotkey modal

* fix import

* add printing hotkey

* add todo

* add hotkey for barcode scanning

* register spotlight shortcut key

* sort keys

* render nicer overview

* fix props

* expose for plugins

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-06-09 13:05:52 +10:00
Oliver 20309146aa [plugin] HMR lib hooks (#12108)
* Expose HMR plugin

* Expose function for localizing a plugin component

* Update npm version

* better docs

* Plugin provides i18n instance

* Expose HMR plugin on different path

* Bump version (again)

* Ensure HMR plugin is properly built

* Bump (again)

* Specify callback function

* Bump package version

* Improved docstrings

* Stricter type hinting
2026-06-07 23:56:26 +10:00
Xhivo 2e4bf3739f Add HMR and React Fast Refresh support (#12060)
* Add HMR and React Fast Refresh support

* Run pre-commit hooks

* Fix 'hmrSetModule' module loading

The incoming module needs to include the URL from which it was loaded,
so that it's possible to enforce only loading modules imported from the same
pathname as the current module.

* Add error handling and improvements

- Add error handling to `useRemotePlugin` and simplify `RemoteComponent`
- Improve HMR to use a registry instead of a single global callback.
  This should now handle two legacy plugin entry points being used at
  the same time via RemoteComponent.

* Update docs

* Update CHANGELOG

* Remove use of LanguageContext from RemoteComponent

LanguageContext should not be necessary here, as it's provided in
ThemeContext, which is used in InvenTree's frontend entry.

* Fix incorrect import.meta.hot access

* Update Playwright test to match UI text changes

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2026-06-05 23:21:12 +10:00
Oliver 9f78e994c2 [UI] Mantine 9 (#11947)
* Update mantine deps

* Get it to compile

* Update QueryCount widgets

- use new RollingNumber component

* Table updates

- Remove "hack" for column ordering

* "Fix" the column pinning bug (maybe?)

* Fix ColumnRenderers.tsx

* Fix login code for playwright

* Remove hashing requirement

* Fix build tests

* More fixes

* More test fixes

* Fix playwright test for dashboard item

* Update frontend version

* Update changelog

* Reduce query repeats

* More playwright fixes

* Further playwright fixes

* Fix for useFilterSet hook

* Fix unique key error

* Fix rendering issues when opening edit forms

* reduce console errors

* Fix unique key issues in search drawer

* Update frontend CHANGELOG.md

* More form tweaks

---------

Co-authored-by: Matthias Mair <code@mjmair.com>
2026-05-17 19:26:37 +10:00
Matthias Mair 34a9f1e10c feat(frontend): expose inline render helpers (#11917)
* expose RenderInlineModel

* expose Thumbnail

* add changelog / lib entry

* move thumbnail back; use context

* move to context

* reduce diff

* add better type

* reduce diff more
2026-05-12 13:46:58 +10:00
Matthias Mair 61eb5e8d0f frontend: more exposing for plugins (#11897)
* expose EditApiForm in context

* expose renderRemoteInstance in context

* expose useInstance in context

* export DetailDrawerComponent, useLocalLibState

* fix import/type

* add changelog entry
2026-05-09 23:14:36 +10:00
Matthias Mair 6f56d44287 feat(frontend): lib make Detaildrawer available (#11827)
* feat(frontend): lib make Detaildrawer available

Co-authored-by: Copilot <copilot@github.com>

* move StylishText to lib

Co-authored-by: Copilot <copilot@github.com>

* add changelog entry

Co-authored-by: Copilot <copilot@github.com>

* fix import path

---------

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 14:49:43 +10:00
Oliver 1e968a533d Bump UI to 0.11.2 (#11738)
- Expose additional type hints
2026-04-13 22:26:33 +10:00
Oliver 23f43ffd33 [plugin] Render tables (#11733)
* Move useFilterSet state to the @lib

* Refactor useTable hook into @lib

* Refactor string helper functions

* Refactor constructFormUrl func

* Refactor Boundary component

* Refactor StoredTableState

* More refactoring

* Refactor CopyButton and CopyableCell

* Pass table render func to plugins

* Provide internal wrapper function, while allowing the "api" and "navigate" functions to be provided by the caller

* Adds <InvenTreeTable /> component which is exposed to plugins

* Update frontend versioning

* Update docs

* Handle condition where UI does not provide table rendering function

* Move queryFilters out of custom state

* Fix exported type

* Extract searchParams

- Cannot be used outside of router component
- Only provide when the table is generated internally

* Bump UI version

* Fix for right-click context menu

- Function needs to be defined with the context menu provider
2026-04-13 20:36:29 +10:00
Oliver cc77d1d5e6 [UI] Pass custom fields through to the importer session (#11688)
* [UI] Pass custom fields through to the importer session

* Support custom model rendering within the data import wizard

* Update CHANGELOG.md

* Update UI version
2026-04-08 23:50:16 +10:00
Oliver 437dddc75f [UI] Import context (#11685)
* Refactor ImporterDrawer

- Use a single, globally accessible object
- Provide global state management

* Expose global importer state to the plugin interface

* Improve registration of data import serializers

* Update frontend version / docs

* Bump API version
2026-04-08 06:01:00 +10:00
Oliver 6830ba5efe [API] Monitor task (#11527)
* Enhance docstring

* Return the ID of an offloaded task

* Add API endpoint for background task detail

* Add UI hook for monitoring background task  progress

* Handle queued tasks (not yet started)

* Improve UX

* Update frontend lib version

* Bump API version

* Fix notification

* Simplify UI interface

* Implement internal hook

* Fix API path sequence

* Add unit tests for task detail endpoint

* Refactor code into reusable model

* Explicit operation_id for API endpoints

* Further refactoring

* Use 200 response code

- axios does not like 202, simplify it

* Return task response for validation of part BOM

* Fix schema

* Cleanup

* Run background worker during playwright tests

- For full e2e integration testing

* Improve hooks and unit testing

* Rename custom hooks to meet react naming requirements
2026-03-15 14:11:22 +11:00
Oliver c292e807b9 Enhance MonitorDataOutput (#11458)
* Enhance MonitorDataOutput

- Optionally pass QueryClient
- Required when running outside of <ApiContext />

* Fix default base URL if not specified

* Remove "allow_null" from Mantine props

* Bump lib version to 0.8.2

* Bump CHANGELOG.md
2026-03-12 12:22:16 +11:00
Oliver 948818bc78 Expose monitorDataOutput hook to plugin library (#11453)
- Allow plugins to process data outputs
2026-03-03 15:10:03 +11:00
Oliver c2ade84872 Plugin stock forms (#10584)
* Expose stock adjustment forms to plugins

* Update changelog

* Expand type exports

* Update CHANGELOG.md
2025-10-15 09:08:38 +11:00
Oliver 564fcc42f2 Bump frontend lib version (#10219)
- Ref: https://github.com/inventree/InvenTree/pull/10202/
2025-08-25 16:02:01 +10:00
Oliver 0e0abf2d75 [plugin] Library updates (#10070)
* Expose lingui modules to plugins

* Add i18n object to plugin context

* Expose form types

* Update package.json requirements

* Externalize react and mantine when building @inventreedb/ui components

* Externalize lingui packages too

* Extern <AddItemButton />
2025-07-25 01:23:34 +10:00
Oliver b571e9e2d1 UI changelog (#10008) 2025-07-11 22:33:41 +10:00
Oliver 5e7e258289 [Plugin] Plugin context (#9439)
* Pass more stuff to window

* Expose form functions to plugin context

* Breaking: Render plugin component in context tree

- Required due to createRoot function
- Adds necessary context providers

* Fix context

* Provide MantineThemeContext

* Bundle mantine/core

* Hack for useNavigate within ApiForm

- Errors out if called within plugin context
- Workaround to catch the error

* Update build cmd

* Define config for building "Library" mode

* Update package.json

* Add basic index file

* Factor out ApiEndpoints

* factor out ModelType

* Factor out role enums

* Further refactoring

* More refactoring

* Cleanup

* Expose apiUrl function

* Add instance data to plugin context type def

* Tweaks for loading plugin components

- LanguageContext must be on the inside

* Tweak StylishText

* Externalize notifications system

* Update lingui config

* Add functions for checking plugin interface version

* Extract package version at build time

* Enhance version checking

* Revert variable name change

* Public package

* Add README.md

* adjust packge name

* Adjust name to include org

* Update project files

* Add basic changelog info

* Refactoring to expose URL functions

* Refactor navigation functions

* Update package and README

* Improve navigateToLink function

* Refactor stylish text

- Move into ./lib
- Do not require user state

* Revert changes

- StylishText throws error in plugin
- Low priority, can work out later

* expose function to refresh page index

* Provide RemoteComponent with a method to reload itself

* Bump version

* Cleanup tests

* Prevent duplicate --emptyOutDir arg

* Tweak playwright tests

* Expose role and permission enums

* Fix imports

* Updated docs

* Fix spelling, typos, etc

* Include more package version information

* Expose more version context

* Cleanup

* Probably don't need hooks

* Fix links

* Docs updates

* Fix links
2025-04-16 00:30:34 +10:00