Skip to content

NMS-16118: Structured Node List Page: handle query params#8535

Open
synqotik wants to merge 9 commits into
release-36.xfrom
jira/NMS-16118-structured-node-page-handle-query-params
Open

NMS-16118: Structured Node List Page: handle query params#8535
synqotik wants to merge 9 commits into
release-36.xfrom
jira/NMS-16118-structured-node-page-handle-query-params

Conversation

@synqotik
Copy link
Copy Markdown
Contributor

@synqotik synqotik commented May 26, 2026

We are replacing the legacy JSP Node List (element/nodeList.htm) page with a new Vue UI page, currently known as the Structured Node List page.

One final thing we've needed to do is to make sure links from other pages back to the node list page will work correctly with the new page. Those links can contains query string filter parameters to filter the node list.

We previously did work to handle some of these. This PR does the rest of the work to handle all of them. Some work in the Nodes v2 Rest API was also needed to handle some cases which were not fully handled by the FIQL -> Criteria processing.

Once this PR is merged, a 2nd PR will be done which actually relinks all existing links to the legacy node list page to the new Vue page, and will also remove the legacy page.

We handle the category1/category2 filtering from the Surveillance View. The filter will be union within category sets, then intersection between category sets. I.e.:

(category1Item || category1Item || category1Item) && (category2Item || category2Item || category2Item)

The UI has been updated to allow an optional 2nd category. If needed we could add more category sets.

Added full support for monitored service filtering, including accepting different query params and adding to the UI filters.

Fixed various issues re case-insensitive filtering and various other things.

External References

@synqotik synqotik force-pushed the jira/NMS-16118-structured-node-page-handle-query-params branch from b79c18e to 7119117 Compare May 26, 2026 15:58
@synqotik synqotik requested a review from Copilot May 26, 2026 18:18
@synqotik synqotik requested review from Copilot and removed request for Copilot May 26, 2026 18:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the new Vue Structured Node List page to handle the full set of legacy element/nodeList.htm query-string parameters so links from other pages will continue to filter correctly after the legacy JSP is removed. It also adds the matching REST v2 Node API support (search property + criteria behavior) needed for the new FIQL clauses to work.

Changes:

  • Adds parsers for legacy query params (category1/2, foreignsource, mib2Parm*, snmpParm*, maclike/snmpphysaddr, monitoredService) and incorporates them into the node filter, with sys/SNMP match-type honored in FIQL generation.
  • Defers applying URL query filters in Nodes.vue until categories and monitoring locations are loaded, via a pendingRouteQuery ref and a watcher.
  • Backend: adds snmpInterface.physAddr search property/behavior and a custom serviceType.name criteria behavior (SQL subselect over ipinterface/ifservices/service) on the Node REST v2 endpoint.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
ui/src/components/Nodes/hooks/queryStringParser.ts New parsers for category1/2, lowercase foreignsource, mib2Parm, snmpParm, maclike, monitoredService.
ui/src/components/Nodes/hooks/useNodeQuery.ts Wires new parsers into filter build; adds wildcard handling for SNMP/sys match types; emits snmpInterface.physAddr and serviceType.name FIQL clauses.
ui/src/containers/Nodes.vue Defers query-filter application until categories/locations are loaded.
ui/src/types/index.ts Adds optional physAddr, sysMatchType, selectedService fields.
ui/src/components/Nodes/utils.ts Renames "Location" column label to "Monitoring Location".
ui/tests/components/Nodes/hooks/*.test.ts Tests for new parsers, match-type wildcards, physAddr, selectedService, tracked properties.
opennms-webapp-rest/.../NodeRestService.java Registers NODE_SERVICE_TYPE_BEHAVIORS under serviceType.
opennms-webapp-rest/.../SearchProperties.java Adds snmpInterface.physAddr and serviceType.name search properties.
opennms-webapp-rest/.../CriteriaBehaviors.java Adds physAddr STRING behavior and SQL-subselect behavior for serviceType.name filtering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@synqotik synqotik marked this pull request as ready for review May 26, 2026 19:04
@cgorantla cgorantla changed the title NSM-16118: Structured Node List Page: handle query params NMS-16118: Structured Node List Page: handle query params May 26, 2026
christianpape
christianpape previously approved these changes May 27, 2026
Copy link
Copy Markdown
Contributor

@christianpape christianpape left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but my Javascript/Typescript skills are pretty limited.

@synqotik synqotik marked this pull request as draft May 27, 2026 20:33
@synqotik
Copy link
Copy Markdown
Contributor Author

Converting to draft, fixing a few things and testing.

@synqotik synqotik force-pushed the jira/NMS-16118-structured-node-page-handle-query-params branch 2 times, most recently from 8736133 to 414c858 Compare May 28, 2026 17:55
synqotik added 2 commits May 28, 2026 21:49
- parseCategories: handles category1/category2 as arrays (vue-router repeats
  params as arrays for multi-value). Two groups produce union-within-group and
  intersection-between-groups FIQL instead of a flat intersection.
- buildCategoryQuery: new grouped mode builds (A,B);(Q,R) when selectedCategories2
  is present; single-group path unchanged.
- NodeQueryFilter: adds optional selectedCategories2 field.
- FilterTypeEnum: adds Category2 for chip removal in NodesTable.
- nodeStructureStore: adds selectedCategories2 ref, updateSelectedCategories2,
  removeCategory2; clears group2 on clearAllFiltersAndSelections; restores from
  preferences.
- NodeAdvancedFiltersDrawer: add/delete icon buttons to show/hide a second
  'Additional Categories' autocomplete wired to selectedCategories2.
- NodesTable: adds chips for selectedCategories2 with remove support.
…behaviors

Without this flag, CriteriaBuilderSearchVisitor applies a Hibernate property
restriction (e.g. like("snmpInterface.ifAlias", ...)) after the SQL subquery
BeforeVisit runs. Since NodeRestService never joins the snmpInterface alias
(getCriteriaBuilder has that call commented out), Hibernate throws
QueryException: could not resolve property: snmpInterface for both exact and
wildcard SNMP string field queries.

Fix mirrors serviceTypeName in CriteriaBehaviors.java which uses the same
SQL subquery pattern with setSkipPropertyByDefault(true).
@synqotik synqotik force-pushed the jira/NMS-16118-structured-node-page-handle-query-params branch from 414c858 to eaa74dd Compare May 29, 2026 01:49
synqotik added 2 commits May 29, 2026 14:05
…ve search

MAC addresses stored uppercase (SNMP4J OctetString.toHexString()), ifAlias/ifName/ifDescr
stored in original case. Using case-sensitive LIKE caused MAC searches to never match and
SNMP string filter searches to miss records that differed only in case (regression from
legacy DefaultNodeListService which used Restrictions.ilike).

Fix: use ilike in all SNMP string subselects for both EQUALS and NOT_EQUALS conditions.
ilike without wildcards is semantically equivalent to case-insensitive =.

Add regression tests using DatabasePopulator's seeded SNMP interfaces
(physAddr=34E45604BB69, ifAlias='Initial ifAlias value') to verify lowercase
wildcard searches find the uppercase/mixed-case stored values.
@synqotik synqotik force-pushed the jira/NMS-16118-structured-node-page-handle-query-params branch from e01695d to 4a2e663 Compare May 29, 2026 18:06
@synqotik synqotik marked this pull request as ready for review May 29, 2026 21:19
@synqotik synqotik requested a review from christianpape May 29, 2026 21:20
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.

3 participants