Skip to content

Commit

Permalink
Do not use StateBadge to construct affected children indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Oct 16, 2024
1 parent 2012b29 commit 98fc692
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions library/Icingadb/Widget/ItemList/StateListItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
use Icinga\Module\Icingadb\Widget\CheckAttempt;
use Icinga\Module\Icingadb\Widget\IconImage;
use Icinga\Module\Icingadb\Widget\PluginOutputContainer;
use ipl\Html\Attributes;
use ipl\Html\HtmlElement;
use ipl\Web\Common\BaseListItem;
use ipl\Web\Widget\EmptyState;
use ipl\Web\Widget\StateBadge;
use ipl\Web\Widget\TimeSince;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
Expand Down Expand Up @@ -104,12 +104,15 @@ protected function assembleTitle(BaseHtmlElement $title): void

$icon = new Icon(Icons::UNREACHABLE);

$title->addHtml((new StateBadge([$icon, Text::create($total)], ''))
->addAttributes([
$title->addHtml(new HtmlElement(
'span',
Attributes::create([
'class' => 'affected-objects',
'title' => sprintf(t('Up to %s affected objects'), $total)
])
);
]),
$icon,
Text::create($total)
));
}
}

Expand Down
1 change: 1 addition & 0 deletions public/css/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -410,4 +410,5 @@ form[name="form_confirm_removal"] {
background-color: @state-critical;
color: @text-color-inverted;
padding: 0 0.25em;
.rounded-corners();
}

0 comments on commit 98fc692

Please sign in to comment.