Use `EmptyState(Bar)` classes where applicable

This commit is contained in:
Yonas Habteab 2023-09-13 10:34:14 +02:00 committed by Johannes Meyer
parent 13569a34b7
commit 821a6812ae
4 changed files with 6 additions and 10 deletions

View File

@ -11,7 +11,7 @@ use Icinga\Application\MigrationManager;
use Icinga\Forms\MigrationForm;
use ipl\I18n\Translation;
use ipl\Web\Common\BaseItemList;
use ipl\Web\Widget\EmptyState;
use ipl\Web\Widget\EmptyStateBar;
class MigrationList extends BaseItemList
{
@ -127,7 +127,7 @@ class MigrationList extends BaseItemList
if ($this->isEmpty()) {
$this->setTag('div');
$this->addHtml(new EmptyState(t('No items found.')));
$this->addHtml(new EmptyStateBar(t('No items found.')));
}
}
}

View File

@ -13,6 +13,7 @@ use ipl\Html\HtmlString;
use ipl\Html\Text;
use ipl\I18n\Translation;
use ipl\Web\Common\BaseListItem;
use ipl\Web\Widget\EmptyState;
use ipl\Web\Widget\Icon;
class MigrationListItem extends BaseListItem
@ -67,8 +68,7 @@ class MigrationListItem extends BaseListItem
if ($this->item->getDescription()) {
$caption->addHtml(Text::create($this->item->getDescription()));
} else {
$caption->getAttributes()->add('class', 'empty-state');
$caption->addHtml(Text::create($this->translate('No description provided.')));
$caption->addHtml(new EmptyState(Text::create($this->translate('No description provided.'))));
}
}

View File

@ -17,6 +17,7 @@ use ipl\Html\Text;
use ipl\I18n\Translation;
use ipl\Web\Common\BaseListItem;
use ipl\Web\Url;
use ipl\Web\Widget\EmptyState;
use ipl\Web\Widget\Icon;
use ipl\Web\Widget\Link;
use LogicException;
@ -74,8 +75,7 @@ class MigrationListItemMinimal extends BaseListItem
if ($migration->getDescription()) {
$caption->addHtml(Text::create($migration->getDescription()));
} else {
$caption->getAttributes()->add('class', 'empty-state');
$caption->addHtml(Text::create($this->translate('No description provided.')));
$caption->addHtml(new EmptyState(Text::create($this->translate('No description provided.'))));
}
$scriptPath = $migration->getScriptPath();

View File

@ -25,10 +25,6 @@
color: @state-critical;
}
.caption.empty-state {
color: @gray-semilight;
}
span.version {
color: @text-color;
}