Skip to content

Commit

Permalink
EventRuleConfigForm: Modify the HTML structure of filter wrapper and …
Browse files Browse the repository at this point in the history
…escalations
  • Loading branch information
raviks789 committed May 15, 2024
1 parent 8cb8eae commit 3dae615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
11 changes: 6 additions & 5 deletions application/forms/EventRuleConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
9 changes: 1 addition & 8 deletions library/Notifications/Widget/ItemList/Escalations.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Icinga\Module\Notifications\Widget\ItemList;

use ipl\Html\BaseHtmlElement;
use ipl\Html\FormElement\SubmitButtonElement;

class Escalations extends BaseHtmlElement
{
Expand All @@ -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);
}
}

0 comments on commit 3dae615

Please sign in to comment.