Skip to content

feat(ui): add org.opennms.web.ui opt-in for next-generation UI#5

Open
cnewkirk wants to merge 4 commits into
developfrom
feat/ui-opt-in-gate
Open

feat(ui): add org.opennms.web.ui opt-in for next-generation UI#5
cnewkirk wants to merge 4 commits into
developfrom
feat/ui-opt-in-gate

Conversation

@cnewkirk

@cnewkirk cnewkirk commented Apr 29, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a single system property org.opennms.web.ui (default classic) that gates whether /opennms/ shows the legacy Vaadin frontPage or redirects to the redesigned Vue SPA at /ui/. The default is classic, so this PR is a zero-impact change for upgraders — admins must explicitly opt in.

What changes

  • FrontPageController checks the property ahead of the dashboard-role redirect; next short-circuits to redirect:/ui/.
  • index.jsp does the same in JSP form so the Jetty welcome-file path also opts in.
  • A ui.properties ships in etc/opennms.properties.d/ (commented-out) documenting the property.
  • A new bin/opennms-ui admin script (use classic|next, status) writes the property idempotently and prompts a restart — no manual file editing required.

How an admin uses it

$OPENNMS_HOME/bin/opennms-ui use next
$OPENNMS_HOME/bin/opennms restart

Or edit etc/opennms.properties.d/ui.properties directly. Either way, opt-out by bin/opennms-ui use classic and restart.

Test plan

  • mvn test -pl opennms-webapp -Dtest=FrontPageControllerTest — 5/5 passing (default → classic, next → /ui/, NEXT case-insensitive, classic property → not /ui/, next precedence over dashboard.redirect)
  • bin/opennms-ui smoke tests — status/use next/use classic/use bogus (idempotent writes, no duplicate lines, exits non-zero on bad input)
  • Builds clean against develop on JDK 21
  • Manual: with property unset, hit /opennms/ — expect classic; set to next, restart, hit again — expect Vue SPA at /ui/

Relationship to other PRs in this series

Toward a user-friendly opt-in/opt-out

This PR is the foundation: a single property + admin script. A natural follow-up is a small in-UI control (e.g. an admin-only toggle in the classic UI's settings) that writes the property and asks the admin to restart, eliminating the shell step entirely. That work is intentionally NOT in this PR to keep the gate mechanism reviewable in isolation.

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.

1 participant