From 053dafb872bf70bff354696d96c3524eed00c32b Mon Sep 17 00:00:00 2001 From: raviks789 Date: Wed, 15 May 2024 13:59:32 +0200 Subject: [PATCH] EventRuleConfigForm: Modify the HTML structure of filter wrapper and escalations --- application/forms/EventRuleConfigForm.php | 11 ++++++----- library/Notifications/Widget/ItemList/Escalations.php | 9 +-------- public/css/event-rule-config.less | 1 + 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/application/forms/EventRuleConfigForm.php b/application/forms/EventRuleConfigForm.php index 10afe329c..654de5c46 100644 --- a/application/forms/EventRuleConfigForm.php +++ b/application/forms/EventRuleConfigForm.php @@ -221,15 +221,16 @@ protected function assemble(): void $this->getElement('zero-condition-escalation')->setValue($zeroConditionEscalation); $this->addHtml( - (new HtmlElement('ul', Attributes::create(['class' => 'filter-wrapper']))) + (new HtmlElement('div', Attributes::create(['class' => 'filter-wrapper']))) ->addHtml( - new HtmlElement('li', null, (new FlowLine())->getRightArrow()), - new HtmlElement('li', null, $configFilter), - new HtmlElement('li', null, (new FlowLine())->getHorizontalLine()) + (new FlowLine())->getRightArrow(), + $configFilter, + (new FlowLine())->getHorizontalLine() ) ); - $this->add(new Escalations($escalations, $addEscalationButton)); + $escalationWrapper = (new HtmlElement('div'))->addHtml(new Escalations($escalations), $addEscalationButton); + $this->addHtml($escalationWrapper); } /** diff --git a/library/Notifications/Widget/ItemList/Escalations.php b/library/Notifications/Widget/ItemList/Escalations.php index 145070a39..c24f7ded7 100644 --- a/library/Notifications/Widget/ItemList/Escalations.php +++ b/library/Notifications/Widget/ItemList/Escalations.php @@ -5,7 +5,6 @@ namespace Icinga\Module\Notifications\Widget\ItemList; use ipl\Html\BaseHtmlElement; -use ipl\Html\FormElement\SubmitButtonElement; class Escalations extends BaseHtmlElement { @@ -16,24 +15,18 @@ class Escalations extends BaseHtmlElement /** @var Escalation[] Escalation list items */ protected $escalations; - /** @var SubmitButtonElement Escalation add button */ - protected $addButton; - /** * Create the escalations list * * @param Escalation[] $escalations - * @param SubmitButtonElement $addButton */ - public function __construct(array $escalations, SubmitButtonElement $addButton) + public function __construct(array $escalations) { $this->escalations = $escalations; - $this->addButton = $addButton; } protected function assemble(): void { $this->addHtml(...$this->escalations); - $this->addHtml($this->addButton); } } diff --git a/public/css/event-rule-config.less b/public/css/event-rule-config.less index a631d708c..ea63ce3e4 100644 --- a/public/css/event-rule-config.less +++ b/public/css/event-rule-config.less @@ -116,6 +116,7 @@ .config-filter { align-self: flex-start; + padding-top: 0.5em; } .search-controls {