diff --git a/CHANGELOG.md b/CHANGELOG.md index 14edb03..c65bf20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ --- develop --- +* feature: Shorten the graph 'Add to QuickTree' action icon's title to "Add to Quicktree" so it reads cleanly as a label in the Cacti graph drilldown action menu * bug: Pass a boolean (not the integer 1) to api_plugin_register_hook()'s $enable argument so the hook registration stays type-correct under Cacti 1.3's strict bool type-hint (the int only coerces while the file lacks declare(strict_types=1)) * security: Move the graph 'Add to QuickTree' icon's inline `onClick='addQuickTree()'` handler into a delegated jQuery binding in `js/quicktree.js` (via a `quicktreeAddLink` class and `data-` attributes) and replace the confirmation pages' inline `onClick='cactiReturnTo()'` Cancel buttons with the CSP-safe `cactiReturnTo` class, so the pages no longer trip Cacti's Content-Security-Policy script-src-attr directive * dev: Replace the translation-template CI check that regenerated locales/po/cacti.pot and compared it with a diff-based gate (tests/bin/check-i18n-pot.php) requiring cacti.pot to be updated only when a pull request adds, removes, or modifies an i18n function call diff --git a/locales/po/cacti.pot b/locales/po/cacti.pot index f939d62..d48d6b6 100644 --- a/locales/po/cacti.pot +++ b/locales/po/cacti.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: Cacti \n" "Report-Msgid-Bugs-To: developers@cacti.net\n" -"POT-Creation-Date: 2026-09-28 16:07-0400\n" +"POT-Creation-Date: 2026-10-12 14:07-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Howard Jones >\n" "Language-Team: Howard Jones \n" @@ -205,7 +205,7 @@ msgid "Both Tab and Console Menu" msgstr "" #: setup.php -msgid "Add this graph to QuickTree" +msgid "Add to Quicktree" msgstr "" #: setup.php diff --git a/setup.php b/setup.php index abd4931..9d0049f 100644 --- a/setup.php +++ b/setup.php @@ -195,7 +195,7 @@ function quicktree_show_tab(): void { /** * Hook implementation for Cacti's 'graph_buttons'/'graph_buttons_thumbnails' - * filters. Prints an "Add this graph to QuickTree" icon/link for the + * filters. Prints an "Add to Quicktree" icon/link for the * current graph, when the user is authorized. Called by Cacti core via * api_plugin_hook('graph_buttons'/'graph_buttons_thumbnails', ...) while * rendering a graph's action buttons. @@ -216,7 +216,7 @@ function quicktree_graph_buttons($data): void { $local_graph_id = $data[1]['local_graph_id']; $rra_id = $data[1]['rra']; - print "
"; + print "
"; } } diff --git a/tests/Unit/QuicktreeGraphButtonsTest.php b/tests/Unit/QuicktreeGraphButtonsTest.php index 6a78ee7..44c8ae7 100644 --- a/tests/Unit/QuicktreeGraphButtonsTest.php +++ b/tests/Unit/QuicktreeGraphButtonsTest.php @@ -7,7 +7,7 @@ /* * Coverage for quicktree_graph_buttons(): the 'graph_buttons' hook prints an - * "Add this graph to QuickTree" glyph for the current graph, but only when + * "Add to Quicktree" glyph for the current graph, but only when * the user is authorized for the quicktree realm. */ @@ -29,6 +29,8 @@ expect($output)->toContain("data-local-graph-id='42'"); expect($output)->toContain("data-rra-id='7'"); + // This PR's behavior: the shortened visible action label. + expect($output)->toContain("title='Add to Quicktree'"); // The delegated click binding in js/quicktree.js keys off this class, so // its presence is what actually wires the glyph up once the inline // handler is gone.