https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42189

--- Comment #40 from Paul Derscheid <[email protected]> ---
Created attachment 198926
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198926&action=edit
Bug 42189: Add widget registry for plugin-provided dashboard widgets

- Add widget-registry.ts with shared window.__kohaWidgetRegistry Map
- registerWidget() validates entries and dispatches a DOM CustomEvent
  so ModuleDashboard can discover widgets registered after mount
- getRegisteredWidgets() returns markRaw-wrapped components for a given
  module, with defineAsyncComponent support for lazy loading
- ModuleDashboard accepts a module prop and discovers plugin widgets via
  onMounted catch-up + koha:widget-registered event listener
- Home.vue passes module="erm" to ModuleDashboard

To test:
- Build with yarn js:build, verify .esm.js bundles are produced
- Verify ERM, Preservation, Acquisitions, Admin > Record sources, and
  SIP2 pages load without errors
- Install the test plugin (test-widgetdemo-0.1.0.kpz)
- Navigate to ERM home, plugin widget should appear on the dashboard
- Click the counter button, verify reactivity works (shared Vue)
- Open Widget Picker, plugin widget should be listed with Add/Remove
- Remove and re-add the widget, verify it works
- Refresh the page, verify widget position is restored from localStorage
- Verify the widget renders with WidgetWrapper chrome (header, drag
  handle, settings menu) matching core widgets

Signed-off-by: Clemens Tubach <[email protected]>
Signed-off-by: Thomas Klausner <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to