diff --git a/library/Notifications/Widget/ItemList/IncidentHistoryListItem.php b/library/Notifications/Widget/ItemList/IncidentHistoryListItem.php index d3560efb..72506c82 100644 --- a/library/Notifications/Widget/ItemList/IncidentHistoryListItem.php +++ b/library/Notifications/Widget/ItemList/IncidentHistoryListItem.php @@ -29,7 +29,7 @@ class IncidentHistoryListItem extends BaseListItem protected function assembleVisual(BaseHtmlElement $visual): void { - if ($this->item->type === 'incident_severity_changed' || $this->item->type === 'source_severity_changed') { + if ($this->item->type === 'incident_severity_changed' || $this->item->type === 'opened') { $content = new Icon($this->getIncidentEventIcon(), ['class' => 'severity-' . $this->item->new_severity]); } else { $content = new Icon($this->getIncidentEventIcon(), ['class' => 'type-' . $this->item->type]); @@ -48,7 +48,7 @@ protected function assembleVisual(BaseHtmlElement $visual): void protected function assembleTitle(BaseHtmlElement $title): void { - if ($this->item->type === 'source_severity_changed') { + if ($this->item->type === 'opened' || $this->item->type == 'incident_severity_changed') { $event = $this->item->event; $this->getAttributes() ->set('data-action-item', true); @@ -88,7 +88,7 @@ protected function assembleHeader(BaseHtmlElement $header): void } $header->addHtml($this->createCaption()); - if ($this->item->type === 'source_severity_changed') { + if ($this->item->type === 'opened' || $this->item->type === 'incident_severity_changed') { $header->add((new SourceIcon(SourceIcon::SIZE_BIG))->addHtml($this->item->event->object->source->getIcon())); } @@ -99,9 +99,7 @@ protected function getIncidentEventIcon(): string { switch ($this->item->type) { case 'opened': - return Icons::OPENED; case 'incident_severity_changed': - case 'source_severity_changed': return $this->getSeverityIcon(); case 'recipient_role_changed': return $this->getRoleIcon(); @@ -159,7 +157,10 @@ protected function buildMessage(): string { switch ($this->item->type) { case 'opened': - $message = t('Opened this incident'); + $message = sprintf( + t('Incident opened at severity %s'), + Event::mapSeverity($this->item->new_severity) + ); break; case 'closed': $message = t('All sources recovered, incident closed'); @@ -187,14 +188,6 @@ protected function buildMessage(): string ); } break; - case 'source_severity_changed': - $message = sprintf( - t('Source %s reported a severity change from %s to %s'), - $this->item->event->object->source->name, - Event::mapSeverity($this->item->old_severity), - Event::mapSeverity($this->item->new_severity) - ); - break; case 'incident_severity_changed': $message = sprintf( t('Incident severity changed from %s to %s'),