From a9b058fea771ad4f6986d32d9bb99022577eb5b4 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 12 Sep 2023 09:39:06 +0200 Subject: [PATCH 1/3] action-list.js: Only add footer for list in `.content` --- public/js/action-list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/js/action-list.js b/public/js/action-list.js index 5eaf0a4a..44738c25 100644 --- a/public/js/action-list.js +++ b/public/js/action-list.js @@ -719,7 +719,7 @@ } if (isTopLevelContainer) { - let footerList = list ?? container.querySelector('.action-list'); + let footerList = list ?? container.querySelector('.content > .action-list'); if (footerList) { _this.addSelectionCountToFooter(footerList); } From d73691017fb93ca023f04684edc1cc08ecdb9a73 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 12 Sep 2023 11:23:29 +0200 Subject: [PATCH 2/3] (Hosts/Services)Controller: Do not make object list in detail view controls an `.action-list` --- application/controllers/HostsController.php | 1 + application/controllers/ServicesController.php | 1 + 2 files changed, 2 insertions(+) diff --git a/application/controllers/HostsController.php b/application/controllers/HostsController.php index 36774b3c..fff7139a 100644 --- a/application/controllers/HostsController.php +++ b/application/controllers/HostsController.php @@ -168,6 +168,7 @@ class HostsController extends Controller $this->addControl( (new HostList($results)) ->setViewMode('minimal') + ->setDetailActionsDisabled() ); $this->addControl(new ShowMore( $results, diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index 69d02f39..c39f8b5d 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -184,6 +184,7 @@ class ServicesController extends Controller $this->addControl( (new ServiceList($results)) ->setViewMode('minimal') + ->setDetailActionsDisabled() ); $this->addControl(new ShowMore( $results, From 5c30e537652985a11733f0c9d9e8bc1fcbd65086 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Tue, 12 Sep 2023 11:32:21 +0200 Subject: [PATCH 3/3] DetailsActions: Only add `data-action-item` attr if list is an `.action-list` --- library/Icingadb/Common/DetailActions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/Icingadb/Common/DetailActions.php b/library/Icingadb/Common/DetailActions.php index bc62f48a..b182b1f2 100644 --- a/library/Icingadb/Common/DetailActions.php +++ b/library/Icingadb/Common/DetailActions.php @@ -133,7 +133,9 @@ trait DetailActions public function addDetailFilterAttribute(BaseHtmlElement $element, Filter\Rule $filter): self { $element->getAttributes() - ->set('data-action-item', true) + ->registerAttributeCallback('data-action-item', function () { + return ! $this->getDetailActionsDisabled(); + }) ->registerAttributeCallback('data-icinga-detail-filter', function () use ($filter) { return $this->getDetailActionsDisabled() ? null : QueryString::render($filter); });