Skip to content

Requirement Revision Viewer

opencode edited this page Sep 12, 2026 · 2 revisions

Requirement Revision Viewer — Modernized screen

Modernization of the legacy Requirement Revision / Version read-only viewer — GitHub issue #1435.

The legacy screen (lib/requirements/reqViewRevision.php) is a read-only popup showing an immutable snapshot of a requirement VERSION or a requirement REVISION (resolved from a nodes_hierarchy item_id), reached via the openReqRevisionWindow() helper in gui/javascript/testlink_library.js (requirement revision logs, version-compare navigation). It was the last standalone legacy requirements screen with no Dashio replacement, and it HTTP 500'd in the dashio theme (missing displayReqCoverageRO.inc.tpl, issue #1427) — the modern screen closes that breakage too.

URL: gui/templates/requirements/reqRevisionView.html?item_id=<version-or-revision-node-id> BFF API: api/reqrevision/index.php?action=revision&item_id=<id>[&show_req_spec_title=1] Rights: mgt_view_req on the OWNING test project (modern parity — the legacy controller gated the SESSION project only).

Version snapshot

What it does

Feature Legacy behavior Modern implementation
Entry point openReqRevisionWindow(item_id) → reqViewRevision.php?item_id= popup openReqRevisionWindow() (testlink_library.js) and $actions->reqRevisionView (common.php) open reqRevisionView.html?item_id=
Node resolution get_available_node_types() — requirement_version (8) / requirement_revision (10) BFF resolves the same node kinds (tree_mgr), then get_version() / get_revision()
Attributes req doc id, title, version/revision, type/status labels, scope, author, timestamps, frozen flag same fields in an Overview card (id chip, vN/rN badges, type/status/frozen badges)
Spec context spec title + doc id (optional show_req_spec_title) REQUIREMENT SPEC row + owning test project in the header
Coverage getActiveForReqVersion() linked TCs table link list as a DataTable (tc external id, name → TC viewer popup, version); expected-coverage % vs actual (33.33% (1/3)), obsolescence * marker
Custom fields get_linked_cfields(null, item_id, tid) populated design CF values Custom Fields card with date/datetime formatting
Direct link — Direct link toolbar button → /linkto.php?item=req&id=<req_doc_id> with one-click Copy + toast
Print legacy print helpers Print → printReq.html?req_id=&req_version_id=&req_revision=&tproject_id= (revision-aware)
Open requirement — Open requirement → reqView.html?id=&version_id=&tproject_id= popup
Locale PHP $g_lang client-side TLi18n, keys under rrv.* (32 keys × 10 bundles)

REST API Reference

Session-authenticated JSON (bffSameOriginGuard + CSRF proof, safe GET).

GET ?action=revision&item_id=<version|revision node id>[&show_req_spec_title=1]

Returns the snapshot: node_kind, tproject_id/tproject_name, req_id, req_doc_id, req_spec_title/req_spec_doc_id, title, version, revision, version_id, revision_id, status_code/status_label, type/type_label, scope, is_open, expected_coverage, author, modifier, creation_ts, modification_ts, expected_coverage_mgmt, cf_values (object), coverage (array of tcase_id, tcversion_id, tcase_name, tc_external_id, tc_version, is_obsolete), coverage_qty, coverage_pct, grants.req_mgmt.

Error conditions

  • Missing/invalid session → 401.
  • Non-GET verb → 405.
  • Missing/invalid item_id → 400.
  • Unknown node / not a requirement version-revision node → 404.
  • No mgt_view_req on the owning project → 403.

Legacy parity notes

  • 1:1 port of initialize_gui(): node-kind switch, get_version() / get_revision(), getActiveForReqVersion() coverage, get_linked_cfields() with node-id access key.
  • Revision rows keep req_version_id → coverage/cfields are queried against the same underlying req_version_id the legacy screen used.
  • Frozen = is_open == 0 → Yes badge (legacy is_open semantics).
  • Expected-coverage % only shown when req_cfg->expected_coverage_management is enabled (legacy gate).

Screenshots

Revision snapshot with custom fields

Coverage DataTable with linked test case

Română locale render

Test suite

Suite #1435 — 20/20 PASS, recorded in tmp/TLU_Test_Cases.md (fixtures: tmp/fixtures_rcmp.php + tmp/fixtures_1435.php).

Event Viewer

No new Error/Warning rows generated by the BFF or screen flows (events table clean); console shows only the DataTables search-input a11y hint, no JS errors.

Clone this wiki locally