Skip to content

Enhance severity icons - #499

Merged
sukhwinder33445 merged 2 commits into
mainfrom
enhance-severity-icons
Jul 15, 2026
Merged

Enhance severity icons#499
sukhwinder33445 merged 2 commits into
mainfrom
enhance-severity-icons

Conversation

@sukhwinder33445

@sukhwinder33445 sukhwinder33445 commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Introduces a Severity backed enum that centralises all severity logic — backing values, translated labels, and icons — in one place, replacing scattered string constants in Icons and inline match expressions in the renderers. Wires up EnumCast on Incident and IncidentHistory so the severity column is hydrated directly as a Severity instance, turning raw string comparisons like $item->severity === 'ok' into type-safe $item->severity === Severity::OK. Also updates the SEVERITY_OK icon from heart to circle-check for visual consistency with the other severity levels.

resolves #479
require Icinga/ipl-orm#162

@sukhwinder33445
sukhwinder33445 requested a review from Copilot June 17, 2026 14:37
@sukhwinder33445 sukhwinder33445 self-assigned this Jun 17, 2026
@cla-bot cla-bot Bot added the cla/signed CLA is signed by all contributors of a PR label Jun 17, 2026

This comment was marked as resolved.

This comment was marked as resolved.

@sukhwinder33445
sukhwinder33445 requested a review from nilmerg June 18, 2026 13:17
Comment thread library/Notifications/Common/Severity.php Outdated
Comment thread library/Notifications/Common/Severity.php Outdated
Comment thread library/Notifications/Model/Behavior/SeverityCast.php Outdated
Comment thread library/Notifications/View/IncidentHistoryRenderer.php Outdated
Comment thread library/Notifications/View/IncidentRenderer.php
@sukhwinder33445
sukhwinder33445 force-pushed the enhance-severity-icons branch 2 times, most recently from 11b1168 to a8e02f5 Compare June 24, 2026 19:05
@sukhwinder33445
sukhwinder33445 requested a review from Copilot June 24, 2026 19:10

This comment was marked as resolved.

@sukhwinder33445
sukhwinder33445 force-pushed the enhance-severity-icons branch 2 times, most recently from 1c9a0d7 to f5279e7 Compare June 25, 2026 07:00
@sukhwinder33445
sukhwinder33445 requested a review from Copilot June 25, 2026 07:01

This comment was marked as resolved.

@sukhwinder33445
sukhwinder33445 force-pushed the enhance-severity-icons branch 3 times, most recently from d20b25f to 5948efc Compare June 25, 2026 08:43
@sukhwinder33445
sukhwinder33445 requested a review from nilmerg June 25, 2026 08:52
nilmerg
nilmerg previously approved these changes Jun 26, 2026

@nilmerg nilmerg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please rebase

@sukhwinder33445
sukhwinder33445 force-pushed the enhance-severity-icons branch from 5948efc to 0f0c798 Compare June 26, 2026 09:51
- Extend the severity icon condition to support more severity types.
- Replace the single-use method with a direct match expression.
- Add a title attribute to the icons.
`Icons`:Replace unused icon `heart` with `circle-check` (already in use)
Severity logic (icons, labels, values) was scattered across `Icons.php`,
`IncidentRenderer`, `IncidentHistoryRenderer`, and `EscalationCondition`
as hardcoded strings and match expressions. A new `Severity` enum
consolidates this, and a `EnumCast` ipl-orm behavior automatically
converts DB strings to typed enum values, replacing all string
comparisons with type-safe enum references.
@sukhwinder33445
sukhwinder33445 force-pushed the enhance-severity-icons branch from 0f0c798 to 6cd5b5b Compare July 15, 2026 19:36
@sukhwinder33445
sukhwinder33445 merged commit 322cb60 into main Jul 15, 2026
13 checks passed
@sukhwinder33445
sukhwinder33445 deleted the enhance-severity-icons branch July 15, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla/signed CLA is signed by all contributors of a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extend severity icon set and enhance visualization

3 participants