From ab69fa2a5f61a7838c5cb25337cd3780faf40cd2 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 5 Nov 2019 12:15:32 +0100 Subject: [PATCH] Rename view mode 'compact' to 'minimal' --- application/controllers/HostController.php | 10 +++++----- application/controllers/ServiceController.php | 8 ++++---- library/Icingadb/Common/ListItemMinimalLayout.php | 2 +- library/Icingadb/Widget/HostList.php | 4 ++-- library/Icingadb/Widget/HostListItemMinimal.php | 6 +++--- library/Icingadb/Widget/ServiceList.php | 4 ++-- library/Icingadb/Widget/ServiceListItemMinimal.php | 6 +++--- library/Icingadb/Widget/ViewModeSwitcher.php | 2 +- public/css/lists.less | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index 24be5796..d8ef5f0e 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -56,7 +56,7 @@ class HostController extends Controller public function indexAction() { - $this->addControl((new HostList([$this->host]))->setViewMode('compact')); + $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $this->addControl(new QuickActions($this->host)); $this->addContent(new ObjectDetail($this->host)); @@ -66,7 +66,7 @@ class HostController extends Controller { $this->setTitle($this->translate('Comments')); - $this->addControl((new HostList([$this->host]))->setViewMode('compact')); + $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $comments = $this->host->comment; @@ -85,7 +85,7 @@ class HostController extends Controller { $this->setTitle($this->translate('Downtimes')); - $this->addControl((new HostList([$this->host]))->setViewMode('compact')); + $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $downtimes = $this->host->downtime; @@ -102,7 +102,7 @@ class HostController extends Controller public function historyAction() { - $this->addControl((new HostList([$this->host]))->setViewMode('compact')); + $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $db = $this->getDb(); @@ -135,7 +135,7 @@ class HostController extends Controller public function servicesAction() { - $this->addControl((new HostList([$this->host]))->setViewMode('compact')); + $this->addControl((new HostList([$this->host]))->setViewMode('minimal')); $db = $this->getDb(); diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 57251568..7835fb38 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -63,7 +63,7 @@ class ServiceController extends Controller public function indexAction() { - $this->addControl((new ServiceList([$this->service]))->setViewMode('compact')); + $this->addControl((new ServiceList([$this->service]))->setViewMode('minimal')); $this->addControl(new QuickActions($this->service)); $this->addContent(new ObjectDetail($this->service)); @@ -73,7 +73,7 @@ class ServiceController extends Controller { $this->setTitle($this->translate('Comments')); - $this->addControl((new ServiceList([$this->service]))->setViewMode('compact')); + $this->addControl((new ServiceList([$this->service]))->setViewMode('minimal')); $comments = $this->service->comment; @@ -92,7 +92,7 @@ class ServiceController extends Controller { $this->setTitle($this->translate('Downtimes')); - $this->addControl((new ServiceList([$this->service]))->setViewMode('compact')); + $this->addControl((new ServiceList([$this->service]))->setViewMode('minimal')); $downtimes = $this->service->downtime; @@ -109,7 +109,7 @@ class ServiceController extends Controller public function historyAction() { - $this->addControl((new ServiceList([$this->service]))->setViewMode('compact')); + $this->addControl((new ServiceList([$this->service]))->setViewMode('minimal')); $db = $this->getDb(); diff --git a/library/Icingadb/Common/ListItemMinimalLayout.php b/library/Icingadb/Common/ListItemMinimalLayout.php index f11ee131..48074e42 100644 --- a/library/Icingadb/Common/ListItemMinimalLayout.php +++ b/library/Icingadb/Common/ListItemMinimalLayout.php @@ -4,7 +4,7 @@ namespace Icinga\Module\Icingadb\Common; use ipl\Html\BaseHtmlElement; -trait ListItemCompactLayout +trait ListItemMinimalLayout { protected function assembleHeader(BaseHtmlElement $header) { diff --git a/library/Icingadb/Widget/HostList.php b/library/Icingadb/Widget/HostList.php index 8447879e..3e6ec7b5 100644 --- a/library/Icingadb/Widget/HostList.php +++ b/library/Icingadb/Widget/HostList.php @@ -11,8 +11,8 @@ class HostList extends StateList protected function getItemClass() { - if ($this->getViewMode() === 'compact') { - return HostListItemCompact::class; + if ($this->getViewMode() === 'minimal') { + return HostListItemMinimal::class; } return HostListItem::class; diff --git a/library/Icingadb/Widget/HostListItemMinimal.php b/library/Icingadb/Widget/HostListItemMinimal.php index fc90a99d..6be65b85 100644 --- a/library/Icingadb/Widget/HostListItemMinimal.php +++ b/library/Icingadb/Widget/HostListItemMinimal.php @@ -2,12 +2,12 @@ namespace Icinga\Module\Icingadb\Widget; -use Icinga\Module\Icingadb\Common\ListItemCompactLayout; +use Icinga\Module\Icingadb\Common\ListItemMinimalLayout; use ipl\Web\Widget\StateBall; -class HostListItemCompact extends BaseHostListItem +class HostListItemMinimal extends BaseHostListItem { - use ListItemCompactLayout; + use ListItemMinimalLayout; protected function getStateBallSize() { diff --git a/library/Icingadb/Widget/ServiceList.php b/library/Icingadb/Widget/ServiceList.php index 0e985c50..b622b456 100644 --- a/library/Icingadb/Widget/ServiceList.php +++ b/library/Icingadb/Widget/ServiceList.php @@ -8,8 +8,8 @@ class ServiceList extends StateList protected function getItemClass() { - if ($this->getViewMode() === 'compact') { - return ServiceListItemCompact::class; + if ($this->getViewMode() === 'minimal') { + return ServiceListItemMinimal::class; } return ServiceListItem::class; diff --git a/library/Icingadb/Widget/ServiceListItemMinimal.php b/library/Icingadb/Widget/ServiceListItemMinimal.php index 70b5ff7a..771f2f3a 100644 --- a/library/Icingadb/Widget/ServiceListItemMinimal.php +++ b/library/Icingadb/Widget/ServiceListItemMinimal.php @@ -2,12 +2,12 @@ namespace Icinga\Module\Icingadb\Widget; -use Icinga\Module\Icingadb\Common\ListItemCompactLayout; +use Icinga\Module\Icingadb\Common\ListItemMinimalLayout; use ipl\Web\Widget\StateBall; -class ServiceListItemCompact extends BaseServiceListItem +class ServiceListItemMinimal extends BaseServiceListItem { - use ListItemCompactLayout; + use ListItemMinimalLayout; protected function getStateBallSize() { diff --git a/library/Icingadb/Widget/ViewModeSwitcher.php b/library/Icingadb/Widget/ViewModeSwitcher.php index c446a043..5a8a5c74 100644 --- a/library/Icingadb/Widget/ViewModeSwitcher.php +++ b/library/Icingadb/Widget/ViewModeSwitcher.php @@ -14,7 +14,7 @@ class ViewModeSwitcher extends BaseHtmlElement /** @var array View mode-icon pairs */ public static $viewModes = [ - 'compact' => 'chat-empty', + 'minimal' => 'chat-empty', 'common' => 'th-list', 'detailed' => 'chat' ]; diff --git a/public/css/lists.less b/public/css/lists.less index 1a128599..97d4a699 100644 --- a/public/css/lists.less +++ b/public/css/lists.less @@ -104,7 +104,7 @@ } } -.compact .list-item { +.minimal .list-item { header { max-width: 100%; overflow: hidden;