Skip to content

Commit

Permalink
IncidentHistoryListItem: Fix icon for rule_matched event
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Sep 14, 2023
1 parent 19fa458 commit fc59713
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/Notifications/Common/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ private function __construct()

public const NOTIFIED = 'paper-plane';

public const RULE_MATCHED = 'filter';
public const RULE_MATCHED = 'filter-check-circle';
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Icinga\Module\Notifications\Widget\SourceIcon;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
use ipl\Web\Widget\IcingaIcon;
use ipl\Web\Widget\Icon;
use ipl\Web\Widget\Link;
use ipl\Web\Widget\TimeAgo;
Expand All @@ -29,14 +30,16 @@ class IncidentHistoryListItem extends BaseListItem

protected function assembleVisual(BaseHtmlElement $visual): void
{
$incidentIcon = $this->getIncidentEventIcon();
if ($this->item->type === 'incident_severity_changed' || $this->item->type === 'source_severity_changed') {
$content = new Icon($this->getIncidentEventIcon(), ['class' => 'severity-' . $this->item->new_severity]);
$content = new Icon($incidentIcon, ['class' => 'severity-' . $this->item->new_severity]);
} elseif ($this->item->type === 'rule_matched') {
$content = new IcingaIcon($incidentIcon, ['class' => 'type-' . $this->item->type]);
} else {
$content = new Icon($this->getIncidentEventIcon(), ['class' => 'type-' . $this->item->type]);
$content = new Icon($incidentIcon, ['class' => 'type-' . $this->item->type]);

switch ($this->item->type) {
case 'closed':
case 'rule_matched':
case 'recipient_role_changed':
case 'notified':
$content->setStyle('fa-regular');
Expand Down

0 comments on commit fc59713

Please sign in to comment.