feat(ui): warn when SPA-vs-backend major version drifts#7
Open
cnewkirk wants to merge 1 commit into
Open
Conversation
Fetches /opennms/rest/info at startup, compares the backend major version
against UI_COMPATIBLE_API ('35'), and renders a fixed yellow banner if they
differ. Banner is client-side only and dismissible via an × button.
This was referenced Apr 29, 2026
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.
Summary
On SPA boot, fetches
/opennms/rest/infoand compares the backend's major version against aUI_COMPATIBLE_APIconstant baked into the build. If they don't match, renders a fixed yellow banner at the bottom of the screen with a dismiss button. Does not block use — just informs the user that the UI was built for a different OpenNMS major and some features may not work correctly.What changes
ui/src/main/main.ts: top-levelawait checkApiCompatibility()runs once at boot; the resulting message (ornull) is provided via Vue'sinjectAPI.ui/src/main/App.vue: injects the value, wraps it in arefso the dismiss button can clear it, renders the banner when set.var(--p-yellow-500, #eab308)— picks up PrimeVue's theme color when available, falls back to a hardcoded yellow otherwise.Why ship this with versioning
A versioned UI (#6) makes it possible to install a SPA built for OpenNMS 35.x onto a 36.x backend. That's a useful escape valve, but users need a visible signal that they're in that state. This banner is the cheapest possible signal — pure client-side, no backend changes, dismissible.
Test plan
yarn buildsucceeds againstdevelopUI_COMPATIBLE_APIto'34', rebuild, reload — banner appears with version-mismatch message; dismiss button hides itRelationship to other PRs in this series