Skip to content

Commit 2e0dab2

Browse files
authored
Ensure compatiblity with Icinga/ipl-web#258 (#312)
2 parents 9c518a8 + 52993b3 commit 2e0dab2

File tree

7 files changed

+14
-37
lines changed

7 files changed

+14
-37
lines changed

doc/02-Installation.md.d/From-Source.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Make sure you use `notifications` as the module name. The following requirements
1313
or [PostgreSQL](https://www.php.net/manual/en/ref.pdo-pgsql.php) PDO PHP libraries
1414
- [Icinga Notifications](https://github.com/Icinga/icinga-notifications)
1515
- [Icinga Web](https://github.com/Icinga/icingaweb2) (≥2.9)
16-
- [Icinga PHP Library (ipl)](https://github.com/Icinga/icinga-php-library) (≥0.14.0)
16+
- [Icinga PHP Library (ipl)](https://github.com/Icinga/icinga-php-library) (≥0.15.0)
1717
- [Icinga PHP Thirdparty](https://github.com/Icinga/icinga-php-thirdparty) (≥0.12.0)
1818

1919
<!-- {% include "02-Installation.md" %} -->

library/Notifications/Widget/EventSourceBadge.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Icinga\Module\Notifications\Model\Source;
88
use ipl\Html\BaseHtmlElement;
99
use ipl\Html\Html;
10+
use ipl\Web\Widget\Ball;
1011

1112
class EventSourceBadge extends BaseHtmlElement
1213
{
@@ -39,7 +40,9 @@ protected function assemble()
3940
->getAttributes()
4041
->add('title', $title);
4142

42-
$this->add((new SourceIcon(SourceIcon::SIZE_LARGE))->addHtml($this->source->getIcon()));
43+
$this->addHtml((new Ball(Ball::SIZE_LARGE))
44+
->addAttributes(['class' => 'source-icon'])
45+
->addHtml($this->source->getIcon()));
4346
$this->add(Html::tag('span', ['class' => 'name'], $this->source->name ?? $this->source->type));
4447
}
4548
}

library/Notifications/Widget/ItemList/EventListItem.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
use Icinga\Module\Notifications\Model\Incident;
1010
use Icinga\Module\Notifications\Model\Objects;
1111
use Icinga\Module\Notifications\Model\Source;
12-
use Icinga\Module\Notifications\Widget\SourceIcon;
1312
use InvalidArgumentException;
1413
use ipl\Html\BaseHtmlElement;
1514
use ipl\Html\Html;
1615
use ipl\Html\HtmlElement;
1716
use ipl\Web\Common\BaseListItem;
17+
use ipl\Web\Widget\Ball;
1818
use ipl\Web\Widget\Link;
1919
use ipl\Web\Widget\TimeAgo;
2020

@@ -108,7 +108,9 @@ protected function assembleHeader(BaseHtmlElement $header): void
108108
$object = $this->item->object;
109109
/** @var Source $source */
110110
$source = $object->source;
111-
$content[] = (new SourceIcon(SourceIcon::SIZE_BIG))->addHtml($source->getIcon());
111+
$content[] = (new Ball(Ball::SIZE_BIG))
112+
->addAttributes(['class' => 'source-icon'])
113+
->addHtml($source->getIcon());
112114
}
113115

114116
$content[] = new TimeAgo($this->item->time->getTimestamp());

library/Notifications/Widget/ItemList/IncidentListItem.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
use Icinga\Module\Notifications\Model\Incident;
1010
use Icinga\Module\Notifications\Model\Objects;
1111
use Icinga\Module\Notifications\Model\Source;
12-
use Icinga\Module\Notifications\Widget\SourceIcon;
1312
use ipl\Html\Attributes;
1413
use ipl\Html\BaseHtmlElement;
1514
use ipl\Html\FormattedString;
1615
use ipl\Html\Html;
1716
use ipl\Html\HtmlElement;
1817
use ipl\I18n\Translation;
1918
use ipl\Web\Common\BaseListItem;
19+
use ipl\Web\Widget\Ball;
2020
use ipl\Web\Widget\Icon;
2121
use ipl\Web\Widget\Link;
2222
use ipl\Web\Widget\TimeAgo;
@@ -85,7 +85,9 @@ protected function assembleHeader(BaseHtmlElement $header): void
8585

8686
/** @var Source $source */
8787
$source = $this->item->object->source;
88-
$meta->addHtml((new SourceIcon(SourceIcon::SIZE_BIG))->addHtml($source->getIcon()));
88+
$meta->addHtml((new Ball(Ball::SIZE_BIG))
89+
->addAttributes(['class' => 'source-icon'])
90+
->addHtml($source->getIcon()));
8991

9092
if ($this->item->recovered_at !== null) {
9193
$meta->addHtml(FormattedString::create(

library/Notifications/Widget/SourceIcon.php

Lines changed: 0 additions & 29 deletions
This file was deleted.

module.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Module: notifications
22
Version: 0.1.0
33
Requires:
4-
Libraries: icinga-php-library (>=0.14.0), icinga-php-thirdparty (>=0.12.0)
4+
Libraries: icinga-php-library (>=0.15.0), icinga-php-thirdparty (>=0.12.0)
55
Description: Icinga Notifications Web
66
Manage incidents and who gets notified about them how and when

public/css/common.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
}
3030

3131
.source-icon {
32-
.ball();
3332
.ball-solid(@gray-light);
3433

3534
color: @text-color;

0 commit comments

Comments
 (0)