UIExtension: add optional getGlobalModuleFileName() for persistent page-level overlays - #181
Closed
joseanesONMS wants to merge 1 commit into
Closed
Conversation
…plugin overlays Plugins that want to render a persistent overlay visible on every OpenNMS page (e.g. a chatbot widget, a notification rail) can now return a second Vue3 module file name from getGlobalModuleFileName(). The OpenNMS shell mounts this module via <Teleport to="body"> in the root App component so it is present regardless of the current route. The method is a Java default returning null, so: - All existing UIExtension implementations compile without changes. - Old OpenNMS versions that do not call the method simply never mount the global module — plugin functionality is fully preserved. - Plugins that do not want a global component need not override the method. Related: ALEC-302 (ALEC chatbot — first consumer of this hook)
|
Author
|
@mershad-manesh @marshallmassengill — updated the PR description. Please take a look when you get a chance. |
Contributor
|
Do we want to deliver this change into |
|
Seems reasonable to me. But see my comment on this PR. We may need to think about this a bit more. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



ALEC-302
Summary
Adds a single default method to the
UIExtensioninterface so that a plugin can register a second Vue3 module to be mounted globally (on every OpenNMS page), rather than only under its Plugins > menu route.getGlobalModuleFileName()— returns the ES-module file name for a global overlay component, ornull(default) if the plugin has none.Why
Some plugins need UI components that persist across page navigation — e.g. a floating chatbot widget, a notification rail, or a live status indicator. The current
UIExtensioncontract only supports a single module loaded at the plugin route; there is no way to inject a component at the application shell level without this hook.Backward compatibility
defaultreturningnull.globalModuleFileNamein the/rest/pluginsresponse and mounts it via<Teleport to="body">in the rootApp.vue, so it is visible on every page.Companion PRs
App.vue+GlobalPlugin.vue+ TypeScript type update