Repository navigation
Converge the statistics dashboard cards on the shared Card API - #20
Merged
Merged
Conversation
The AlarmManager Dashboard tab's nine summary panels now render with the standardized .cc* card chrome from the shared dashboarding bundle (css/cards.css, byte-identical to the other plugins and the core drafts), themed via --cc-* mapped from the plugin's palette. The collapse control and chart/legend bodies are unchanged; the admin configuration accordions keep their own .alarmmanagerDashboardCard markup. The bundled css/cards.css loads only on cores that do not ship it globally (file_exists gate in the unmeasured page entry). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
TheWitness
force-pushed
the
feature/standard-cards-bundle
branch
from
November 10, 2026 15:36
efbe935 to
c30e43f
Compare
TheWitness
marked this pull request as ready for review
November 11, 2026 00:24
There was a problem hiding this comment.
🟡 Changes recommended
The browser harness still asserts a removed dashboard selector, blocking later checks, while the fixture router rejects the new shared card stylesheet.
2 open issues
What changed in this PR
Moves AlarmManager’s nine statistics panels to the shared Cacti Card API styling while preserving the fixed grid, collapse behavior, and separate admin accordions.
Changes:
- Replaces dashboard-specific card markup with shared
.cc*classes. - Bundles shared CSS and JavaScript, maps theme variables, and conditionally loads the CSS fallback.
- Adds markup assertions and documents the change and verification status.
| File | Description |
|---|---|
tests/Unit/Plugin/DashboardMarkupTest.php |
Adds assertions for shared markup across nine panels. |
js/cards.js |
Bundles the shared controller for parity; not used by this dashboard. |
includes/web_view.php |
Switches statistics panels to shared card classes. |
css/dashboard.css |
Maps theme variables and removes retired dashboard styles. |
css/cards.css |
Adds shared card presentation styles. |
CHANGELOG.md |
Records the migration and verification status. |
alarmmanager.php |
Loads bundled CSS when the core stylesheet is absent. |
Review effort: Balanced
bmfmancini
previously approved these changes
Nov 11, 2026
…sync - Add /plugins/alarmmanager/css/cards.css to the browser fixture router's asset allowlist so the harness serves the bundled card stylesheet instead of 404ing it and running without the shared card styling. - Update the dashboard panel-grid assertion to .alarmmanagerDashboardGrid .ccCard (the new markup), keeping the old .alarmmanagerDashboardCard selectors for the admin accordions. - Sync cards.js with the shared refresh-race fix, byte-identical with core. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Corrected shared controller (review on core #8700): replaceCard() carries the live expand/collapse state onto refreshed markup only when the user toggled during the request and the fresh card is still expandable; host markup stays authoritative otherwise. Byte-identical with core and the other plugins. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
xmacan
approved these changes
Nov 11, 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
Converges the AlarmManager Dashboard tab (statistics overview) onto the shared Cacti dashboarding Card API — the same
css/cards.cssbundle, byte-identical to the other in-scope plugins and the open core drafts:css/cards.cssmd5c4337c8dcb55eb638212de9e6fe7e1f1js/cards.jsmd584876af1581b8f349f0a557c7e4ece28(bundled for parity; the dashboard panels use the chrome CSS, not the controller)What changed
alarmmanager_dashboard_markup()) now render with the standardized.cc*chrome —.ccCard/.ccCardHeader/.ccTitle/.ccTools/.ccTool/.ccCardBody+data-severity="none"— instead of the plugin's own.alarmmanagerDashboardCard*classes.--cc-*custom properties, mapped on#alarmmanager_appfrom AlarmManager's existing--search-*palette (so light/dark themes follow automatically).css/cards.cssloads from the plugin only on cores that do not shipinclude/css/cards.cssglobally (file_existsgate, placed in the unmeasured page entryalarmmanager.php)..alarmmanagerDashboardCardmarkup (they are not a card-API surface).Scope note
AlarmManager's dashboard is a fixed statistics grid with per-card collapse — not a draggable/addable dashboard like hmib/syslog. Following the same principle used for syslog's chart dashboard, this converges the chrome + bundle (visual consistency, shared vocabulary) while preserving the existing behavior, rather than adding drag/reorder/add-card.
Testing
tests/Unit/Plugin/DashboardMarkupTest.phpasserts the shared.cc*chrome on all nine panels and the removal of the retired dashboard-only classes (satisfies the 100% patch-coverage gate for the one changedincludes/web_view.phpline).php-cs-fixerclean on the changed PHP;php -lclean.Draft while the shared bundle finishes converging across the remaining plugins and the core repos.