Skip to content

Commit

Permalink
Make headers non-clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
jhoxhaa committed Oct 4, 2024
1 parent 450a834 commit 5ea6b56
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion application/controllers/DaemonsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Daemon Set not found'));
}

$this->addControl(new DaemonSetList([$daemonSet]));
$this->addControl((new DaemonSetList([$daemonSet]))->setActionList(false));

$this->addContent(new DaemonSetDetail($daemonSet));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/DeploymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Deployment not found'));
}

$this->addControl(new DeploymentList([$deployment]));
$this->addControl((new DeploymentList([$deployment]))->setActionList(false));

$this->addContent(new DeploymentDetail($deployment));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/JobController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Job not found'));
}

$this->addControl(new JobList([$job]));
$this->addControl((new JobList([$job]))->setActionList(false));

$this->addContent(new JobDetail($job));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/NodeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Node not found'));
}

$this->addControl(new NodeList([$node]));
$this->addControl((new NodeList([$node]))->setActionList(false));

$this->addContent(new NodeDetail($node));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/PodController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Pod not found'));
}

$this->addControl(new PodList([$pod]));
$this->addControl((new PodList([$pod]))->setActionList(false));

$this->addContent(new PodDetail($pod));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/ReplicasetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Replica Set not found'));
}

$this->addControl(new ReplicaSetList([$replicaSet]));
$this->addControl((new ReplicaSetList([$replicaSet]))->setActionList(false));

$this->addContent(new ReplicaSetDetail($replicaSet));
}
Expand Down
2 changes: 1 addition & 1 deletion application/controllers/StatefulsetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function indexAction(): void
$this->httpNotFound($this->translate('Stateful Set not found'));
}

$this->addControl(new StatefulSetList([$statefulSet]));
$this->addControl((new StatefulSetList([$statefulSet]))->setActionList(false));

$this->addContent(new StatefulSetDetail($statefulSet));
}
Expand Down
20 changes: 15 additions & 5 deletions library/Kubernetes/Common/BaseItemList.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ abstract class BaseItemList extends BaseHtmlElement
use BaseFilter;
use Translation;

protected bool $actionList = true;

protected iterable $query;

protected array $baseAttributes = [
'class' => 'item-list action-list',
'class' => 'item-list',
'data-base-target' => '_next',
'data-pdfexport-page-breaks-at' => '.list-item'
];

protected iterable $query;

protected $tag = 'ul';

public function __construct(iterable $query)
Expand All @@ -35,6 +37,13 @@ public function __construct(iterable $query)
$this->init();
}

public function setActionList(bool $actionList): static
{
$this->actionList = $actionList;

return $this;
}

/**
* Initialize the item list
* If you want to adjust the item list after construction, override this method.
Expand All @@ -45,12 +54,13 @@ protected function init(): void

protected function assemble(): void
{
$detailUrlAdded = false;
$detailUrlAdded = ! $this->actionList;
$itemClass = $this->getItemClass();

$this->addAttributes($this->baseAttributes);
foreach ($this->query as $item) {
if (! $detailUrlAdded) {
$this->addAttributes($this->baseAttributes + [
$this->addAttributes(['class' => 'action-list'] + [
'data-icinga-detail-url' => Url::fromPath(
'kubernetes/' . str_replace('_', '-', $item->getTableAlias())
)
Expand Down

0 comments on commit 5ea6b56

Please sign in to comment.