diff --git a/library/Icingadb/Common/CaptionDisabled.php b/library/Icingadb/Common/CaptionDisabled.php deleted file mode 100644 index 2cee178b..00000000 --- a/library/Icingadb/Common/CaptionDisabled.php +++ /dev/null @@ -1,31 +0,0 @@ -captionDisabled; - } - - /** - * @param bool $captionDisabled - * - * @return $this - */ - public function setCaptionDisabled(bool $captionDisabled = true): self - { - $this->captionDisabled = $captionDisabled; - - return $this; - } -} diff --git a/library/Icingadb/Common/ListItemCommonLayout.php b/library/Icingadb/Common/ListItemCommonLayout.php deleted file mode 100644 index 5a11be30..00000000 --- a/library/Icingadb/Common/ListItemCommonLayout.php +++ /dev/null @@ -1,26 +0,0 @@ -addHtml($this->createTitle()); - $header->add($this->createTimestamp()); - } - - protected function assembleMain(BaseHtmlElement $main): void - { - $main->addHtml($this->createHeader()); - if (!$this->isCaptionDisabled()) { - $main->addHtml($this->createCaption()); - } - } -} diff --git a/library/Icingadb/Common/ListItemDetailedLayout.php b/library/Icingadb/Common/ListItemDetailedLayout.php deleted file mode 100644 index 23aa0179..00000000 --- a/library/Icingadb/Common/ListItemDetailedLayout.php +++ /dev/null @@ -1,23 +0,0 @@ -add($this->createTitle()); - $header->add($this->createTimestamp()); - } - - protected function assembleMain(BaseHtmlElement $main): void - { - $main->add($this->createHeader()); - $main->add($this->createCaption()); - $main->add($this->createFooter()); - } -} diff --git a/library/Icingadb/Common/ListItemMinimalLayout.php b/library/Icingadb/Common/ListItemMinimalLayout.php deleted file mode 100644 index 3cdf3a9e..00000000 --- a/library/Icingadb/Common/ListItemMinimalLayout.php +++ /dev/null @@ -1,26 +0,0 @@ -add($this->createTitle()); - if (! $this->isCaptionDisabled()) { - $header->add($this->createCaption()); - } - $header->add($this->createTimestamp()); - } - - protected function assembleMain(BaseHtmlElement $main): void - { - $main->add($this->createHeader()); - } -} diff --git a/library/Icingadb/Common/NoSubjectLink.php b/library/Icingadb/Common/NoSubjectLink.php deleted file mode 100644 index 76c9a84d..00000000 --- a/library/Icingadb/Common/NoSubjectLink.php +++ /dev/null @@ -1,35 +0,0 @@ -noSubjectLink = $state; - - return $this; - } - - /** - * Get whether a list item's subject should be a link - * - * @return bool - */ - public function getNoSubjectLink(): bool - { - return $this->noSubjectLink; - } -} diff --git a/library/Icingadb/Common/ObjectLinkDisabled.php b/library/Icingadb/Common/ObjectLinkDisabled.php deleted file mode 100644 index ca8283f5..00000000 --- a/library/Icingadb/Common/ObjectLinkDisabled.php +++ /dev/null @@ -1,35 +0,0 @@ -objectLinkDisabled = $state; - - return $this; - } - - /** - * Get whether list items should render host and service links - * - * @return bool - */ - public function getObjectLinkDisabled(): bool - { - return $this->objectLinkDisabled; - } -} diff --git a/library/Icingadb/Common/ViewMode.php b/library/Icingadb/Common/ViewMode.php deleted file mode 100644 index 841f28b1..00000000 --- a/library/Icingadb/Common/ViewMode.php +++ /dev/null @@ -1,35 +0,0 @@ -viewMode; - } - - /** - * Set the view mode - * - * @param string $viewMode - * - * @return $this - */ - public function setViewMode(string $viewMode): self - { - $this->viewMode = $viewMode; - - return $this; - } -} diff --git a/library/Icingadb/View/EventRenderer.php b/library/Icingadb/View/EventRenderer.php index e0b7951f..3a3225c5 100644 --- a/library/Icingadb/View/EventRenderer.php +++ b/library/Icingadb/View/EventRenderer.php @@ -287,14 +287,10 @@ class EventRenderer implements ItemRenderer $title->addHtml(new Link($subjectLabel, Links::event($item), ['class' => 'subject'])); } - if ($item->object_type === 'host') { - if (isset($item->host->id)) { - $link = $this->createHostLink($item->host, true); - } - } else { - if (isset($item->host->id, $item->service->id)) { - $link = $this->createServiceLink($item->service, $item->host, true); - } + if ($item->object_type === 'host' && isset($item->host->id)) { + $link = $this->createHostLink($item->host, true); + } elseif (isset($item->host->id, $item->service->id)) { + $link = $this->createServiceLink($item->service, $item->host, true); } $title->addHtml(Text::create(' ')); @@ -308,6 +304,7 @@ class EventRenderer implements ItemRenderer if ($item->event_type === 'notification') { $item->notification->host = $item->host; $item->notification->service = $item->service; + $this->notificationRenderer->assembleCaption($item->notification, $caption, $layout); return; diff --git a/library/Icingadb/View/HostgroupGridRenderer.php b/library/Icingadb/View/HostgroupGridRenderer.php index 50743ee2..55d1bd7a 100644 --- a/library/Icingadb/View/HostgroupGridRenderer.php +++ b/library/Icingadb/View/HostgroupGridRenderer.php @@ -34,7 +34,6 @@ class HostgroupGridRenderer implements ItemRenderer $url = Url::fromPath('icingadb/hosts'); $urlFilter = Filter::all(Filter::equal('hostgroup.name', $item->name)); - if ($item->hosts_down_unhandled > 0) { $urlFilter->add(Filter::equal('host.state.soft_state', 1)) ->add(Filter::equal('host.state.is_handled', 'n')) diff --git a/library/Icingadb/View/UserRenderer.php b/library/Icingadb/View/UserRenderer.php index c2a11e82..6eb64d3c 100644 --- a/library/Icingadb/View/UserRenderer.php +++ b/library/Icingadb/View/UserRenderer.php @@ -10,15 +10,12 @@ use ipl\Html\Attributes; use ipl\Html\HtmlDocument; use ipl\Html\HtmlElement; use ipl\Html\Text; -use ipl\I18n\Translation; use ipl\Web\Common\ItemRenderer; use ipl\Web\Widget\Link; /** @implements ItemRenderer */ class UserRenderer implements ItemRenderer { - use Translation; - public function assembleAttributes($item, Attributes $attributes, string $layout): void { $attributes->get('class')->addValue('user'); diff --git a/library/Icingadb/View/UsergroupRenderer.php b/library/Icingadb/View/UsergroupRenderer.php index b6e92976..da29e5ac 100644 --- a/library/Icingadb/View/UsergroupRenderer.php +++ b/library/Icingadb/View/UsergroupRenderer.php @@ -10,15 +10,12 @@ use ipl\Html\Attributes; use ipl\Html\HtmlDocument; use ipl\Html\HtmlElement; use ipl\Html\Text; -use ipl\I18n\Translation; use ipl\Web\Common\ItemRenderer; use ipl\Web\Widget\Link; /** @implements ItemRenderer */ class UsergroupRenderer implements ItemRenderer { - use Translation; - public function assembleAttributes($item, Attributes $attributes, string $layout): void { $attributes->get('class')->addValue('user-group'); diff --git a/public/css/common.less b/public/css/common.less index ef4341d5..291b79e7 100644 --- a/public/css/common.less +++ b/public/css/common.less @@ -109,24 +109,6 @@ div.show-more { margin-bottom: 0; } - .item-list { - width: 100%; - - .list-item .main { - border-top: none; - } - - .list-item .visual { - margin-top: 0; - } - - .list-item .visual, - .list-item .main { - padding-bottom: .25em; - padding-top: .25em; - } - } - .search-controls .continue-with { margin-right: -.5em; margin-left: .5em; @@ -341,7 +323,6 @@ form[name="form_confirm_removal"] { margin-left: .28125em; // calculated   width; } - &.default-layout .title .affected-objects, // TODO: Drop once the new list-item layout is used everywhere .default-item-layout .title .affected-objects { margin-left: 0; } diff --git a/public/css/list/item-list.less b/public/css/list/item-list.less index e19326ec..61fa9bb8 100644 --- a/public/css/list/item-list.less +++ b/public/css/list/item-list.less @@ -53,65 +53,6 @@ } } -.item-list.minimal, // TODO: Remove this once the new list-item layout is used everywhere -.item-list.minimal-item-layout { - > .empty-state { - padding: .25em; - } -} - -.item-list.minimal { - // TODO: Can be entirely dropped once the new list-item layout is used everywhere - .list-item { - header { - max-width: 100%; - } - - .title { - p { - display: inline; - - & + p { - margin-left: .417em; - } - } - } - - .caption { - flex: 1 1 auto; - height: 1.5em; - margin-right: 1em; - width: 0; - - .line-clamp("reset"); - } - - .caption, - .caption .plugin-output { - .text-ellipsis(); - } - } -} - -.item-list.detailed .list-item { - // TODO: Can be entirely dropped once the new list-item layout is used everywhere - .title { - word-break: break-word; - -webkit-hyphens: auto; - -ms-hyphens: auto; - hyphens: auto; - } - - .caption { - display: block; - height: auto; - max-height: 7.5em; /* 5 lines */ - position: relative; - - .line-clamp(4) - } -} - .item-list { .icon-image { width: 3em; @@ -129,7 +70,6 @@ } } - &.minimal, // TODO: Remove this once the new list-item layout is used everywhere &.minimal-item-layout { .icon-image { height: 2em; @@ -139,19 +79,6 @@ } } -// TODO: Can be simplified (`.controls .list-item`) once the only list-items in controls are those in the multi select views -.controls .item-list:not(.detailed):not(.minimal) .list-item { - .plugin-output { //TODO: why ?? multiselect items has bigger gap now - //seems dead code, remove it when cleaning up - line-height: 1.5 - } - - .caption { - height: 2.5em; - } -} - -.controls .item-list.minimal .icon-image, // TODO: Remove this once the new list-item layout is used everywhere .controls .minimal-item-layout .icon-image { margin-top: 0; } diff --git a/public/css/widget/comment-popup.less b/public/css/widget/comment-popup.less index 43a7306e..e361981d 100644 --- a/public/css/widget/comment-popup.less +++ b/public/css/widget/comment-popup.less @@ -75,9 +75,3 @@ ul.item-list li:last-child:not(:first-child) { } } } - -.comment-popup .main .caption { - // This is necessary to limit the visible comment lines - // because the popup is shown in detailed list mode only - height: 3em; -}