Skip to content

Commit

Permalink
Use DetailActions in child classes of BaseItem(List/Table)
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed Sep 1, 2023
1 parent c3a1e0c commit 609b70f
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions library/Icingadb/Widget/ItemList/CommandTransportList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use ipl\Web\Common\BaseOrderedItemList;
use ipl\Web\Url;

class CommandTransportList extends BaseOrderedItemList
{
use DetailActions;

protected function init(): void
{
$this->getAttributes()->add('class', 'command-transport-list');
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/command-transport/show'));
}

Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemList/CommentList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\Links;
use Icinga\Module\Icingadb\Common\TicketLinks;
use Icinga\Module\Icingadb\Common\ViewMode;
Expand All @@ -20,6 +21,7 @@ class CommentList extends BaseItemList
use ObjectLinkDisabled;
use ViewMode;
use TicketLinks;
use DetailActions;

protected $defaultAttributes = ['class' => 'comment-list'];

Expand All @@ -38,6 +40,7 @@ protected function getItemClass(): string

protected function init(): void
{
$this->initializeDetailActions();
$this->setMultiselectUrl(Links::commentsDetails());
$this->setDetailUrl(Url::fromPath('icingadb/comment'));
}
Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemList/DowntimeList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\Links;
use Icinga\Module\Icingadb\Common\TicketLinks;
use Icinga\Module\Icingadb\Common\ViewMode;
Expand All @@ -20,6 +21,7 @@ class DowntimeList extends BaseItemList
use ObjectLinkDisabled;
use ViewMode;
use TicketLinks;
use DetailActions;

protected $defaultAttributes = ['class' => 'downtime-list'];

Expand All @@ -38,6 +40,7 @@ protected function getItemClass(): string

protected function init(): void
{
$this->initializeDetailActions();
$this->setMultiselectUrl(Links::downtimesDetails());
$this->setDetailUrl(Url::fromPath('icingadb/downtime'));
}
Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemList/HistoryList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\LoadMore;
use Icinga\Module\Icingadb\Common\TicketLinks;
use Icinga\Module\Icingadb\Common\ViewMode;
Expand All @@ -20,6 +21,7 @@ class HistoryList extends BaseItemList
use ViewMode;
use LoadMore;
use TicketLinks;
use DetailActions;

protected $defaultAttributes = ['class' => 'history-list'];

Expand All @@ -34,6 +36,7 @@ public function __construct(ResultSet $data)
protected function init(): void
{
$this->data = $this->getIterator($this->data);
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/event'));
}

Expand Down
1 change: 1 addition & 0 deletions library/Icingadb/Widget/ItemList/HostList.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ protected function getItemClass(): string

protected function init(): void
{
$this->initializeDetailActions();
$this->setMultiselectUrl(Links::hostsDetails());
$this->setDetailUrl(Url::fromPath('icingadb/host'));
}
Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemList/NotificationList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\LoadMore;
use Icinga\Module\Icingadb\Common\ViewMode;
use ipl\Orm\ResultSet;
Expand All @@ -18,6 +19,7 @@ class NotificationList extends BaseItemList
use NoSubjectLink;
use ViewMode;
use LoadMore;
use DetailActions;

protected $defaultAttributes = ['class' => 'notification-list'];

Expand All @@ -32,6 +34,7 @@ public function __construct(ResultSet $data)
protected function init(): void
{
$this->data = $this->getIterator($this->data);
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/event'));
}

Expand Down
1 change: 1 addition & 0 deletions library/Icingadb/Widget/ItemList/ServiceList.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ protected function getItemClass(): string

protected function init(): void
{
$this->initializeDetailActions();
$this->setMultiselectUrl(Links::servicesDetails());
$this->setDetailUrl(Url::fromPath('icingadb/service'));
}
Expand Down
2 changes: 2 additions & 0 deletions library/Icingadb/Widget/ItemList/StateList.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace Icinga\Module\Icingadb\Widget\ItemList;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\ViewMode;
use Icinga\Module\Icingadb\Redis\VolatileStateResults;
use ipl\Html\HtmlDocument;
Expand All @@ -15,6 +16,7 @@ abstract class StateList extends BaseItemList
{
use ViewMode;
use NoSubjectLink;
use DetailActions;

protected function assemble()
{
Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemTable/HostgroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@

namespace Icinga\Module\Icingadb\Widget\ItemTable;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\ViewMode;
use ipl\Web\Common\BaseItemTable;
use ipl\Web\Url;

class HostgroupTable extends BaseItemTable
{
use DetailActions;
use ViewMode;

protected $defaultAttributes = ['class' => 'hostgroup-table'];

protected function init(): void
{
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/hostgroup'));
}

Expand Down
3 changes: 3 additions & 0 deletions library/Icingadb/Widget/ItemTable/ServicegroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,21 @@

namespace Icinga\Module\Icingadb\Widget\ItemTable;

use Icinga\Module\Icingadb\Common\DetailActions;
use Icinga\Module\Icingadb\Common\ViewMode;
use ipl\Web\Common\BaseItemTable;
use ipl\Web\Url;

class ServicegroupTable extends BaseItemTable
{
use DetailActions;
use ViewMode;

protected $defaultAttributes = ['class' => 'servicegroup-table'];

protected function init(): void
{
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/servicegroup'));
}

Expand Down
4 changes: 4 additions & 0 deletions library/Icingadb/Widget/ItemTable/UserTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

namespace Icinga\Module\Icingadb\Widget\ItemTable;

use Icinga\Module\Icingadb\Common\DetailActions;
use ipl\Web\Common\BaseItemTable;
use ipl\Web\Url;

class UserTable extends BaseItemTable
{
use DetailActions;

protected $defaultAttributes = ['class' => 'user-table'];

protected function init(): void
{
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/user'));
}

Expand Down
4 changes: 4 additions & 0 deletions library/Icingadb/Widget/ItemTable/UsergroupTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@

namespace Icinga\Module\Icingadb\Widget\ItemTable;

use Icinga\Module\Icingadb\Common\DetailActions;
use ipl\Web\Common\BaseItemTable;
use ipl\Web\Url;

class UsergroupTable extends BaseItemTable
{
use DetailActions;

protected $defaultAttributes = ['class' => 'usergroup-table'];

protected function init(): void
{
$this->initializeDetailActions();
$this->setDetailUrl(Url::fromPath('icingadb/usergroup'));
}

Expand Down

0 comments on commit 609b70f

Please sign in to comment.