Skip to content

feat(ui): global plugin overlay slot via Teleport (companion to OIA PR #181)#8602

Open
joseanesONMS wants to merge 1 commit into
OpenNMS:developfrom
joseanesONMS:feature/global-plugin-mount
Open

feat(ui): global plugin overlay slot via Teleport (companion to OIA PR #181)#8602
joseanesONMS wants to merge 1 commit into
OpenNMS:developfrom
joseanesONMS:feature/global-plugin-mount

Conversation

@joseanesONMS

@joseanesONMS joseanesONMS commented Jun 26, 2026

Copy link
Copy Markdown

Summary

  • Plugins that declare UIExtension.getGlobalModuleFileName() (new OIA default method, OIA PR #181) now get their module loaded and rendered in a <Teleport to="body"> at the root App level — visible on every page, not just under Plugins > menu.
  • A new GlobalPlugin.vue component handles the load using the same Container + externalComponent machinery already used by Plugin.vue.
  • The Plugin TypeScript type gets an optional globalModuleFileName field.

Changes

File What changed
ui/src/main/App.vue Import GlobalPlugin; compute globalPlugins; add <Teleport to="body">
ui/src/components/Plugin/GlobalPlugin.vue New — loads a plugin's global module via Container
ui/src/types/index.ts Add optional globalModuleFileName?: string to Plugin

Backward compatibility

  • Plugins without getGlobalModuleFileName() (i.e. all existing plugins) return null; the REST layer omits or nulls the field; the v-for filter skips them — zero behaviour change.
  • Old OpenNMS that does not serve the field: globalPlugins is always empty, <Teleport> renders nothing — no visual or functional regression.
  • No new REST endpoints; no schema migration; no OSGi changes.

Dependencies

Requires OIA PR #181 to be merged and a new OIA snapshot published before the globalModuleFileName field appears in /rest/plugins responses for plugins that use it.

First consumer

ALEC-302 — ALEC context-aware chatbot overlay.

🤖 Generated with Claude Code

…gets

Plugins that declare UIExtension.getGlobalModuleFileName() (new OIA default
method) now get their module loaded and rendered in a <Teleport to="body">
at the root App level, so the component is visible on every page — not just
under the Plugins > menu route.

Changes:
- App.vue: import GlobalPlugin; compute globalPlugins (plugins with a non-null
  globalModuleFileName); render them inside <Teleport to="body">
- GlobalPlugin.vue: new component that loads the global module via the existing
  Container + externalComponent machinery (same URL pattern as Plugin.vue)
- types/index.ts: add optional globalModuleFileName field to the Plugin type

Backward compatibility:
- Plugins that do not override getGlobalModuleFileName() return null; the REST
  layer omits or nulls the field; the v-for filter skips them — zero behaviour
  change for all existing plugins.
- Old OpenNMS that does not serve this field: globalPlugins is always empty,
  Teleport renders nothing — no visual or functional regression.

Relates-To: ALEC-302
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants