Skip to content

Commit

Permalink
fix: resolve JM's review
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Oct 29, 2024
1 parent d659e81 commit 4ef7e33
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 17 deletions.
6 changes: 3 additions & 3 deletions library/Icingadb/Common/StateBadges.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ protected function getStateInt(string $state): int
/**
* Get the badge URL
*
* @return Url
* @return ?Url
*/
public function getUrl(): Url
public function getUrl(): ?Url
{
return $this->url;
}
Expand All @@ -117,7 +117,7 @@ public function setUrl(Url $url): self
*
* @return Link
*/
public function createLink($content, Filter\Rule $filter = null): Link
protected function createLink($content, Filter\Rule $filter = null): Link
{
$url = clone $this->getUrl();

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.0 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.1 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Check failure on line 122 in library/Icingadb/Common/StateBadges.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.4 on ubuntu-latest

Cannot clone ipl\Web\Url|null.

Expand Down
14 changes: 5 additions & 9 deletions library/Icingadb/Model/Behavior/HasProblematicParent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function rewriteColumn($column, ?string $relation = null): ?AliasedExpres

$resolver = $this->query->getResolver();
if ($relation !== null) {
$serviceTableAlias = str_replace('.', '_', $relation);
$column = $serviceTableAlias . "_$column";
$serviceTableAlias = $resolver->getAlias($resolver->resolveRelation($relation)->getTarget());
$column = $resolver->qualifyColumnAlias($column, $serviceTableAlias);

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.2 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.3 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.3 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.0 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 8.1 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.2 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.

Check failure on line 41 in library/Icingadb/Model/Behavior/HasProblematicParent.php

View workflow job for this annotation

GitHub Actions / phpstan / Static analysis with phpstan and php 7.4 on ubuntu-latest

Parameter #1 $alias of method ipl\Orm\Resolver::qualifyColumnAlias() expects string, mixed given.
} else {
$serviceTableAlias = $resolver->getAlias($this->query->getModel());
}
Expand All @@ -48,18 +48,14 @@ public function rewriteColumn($column, ?string $relation = null): ?AliasedExpres
->setDb($this->query->getDb())
->setModel($subQueryModel)
->columns([new Expression('1')])
->with([
'from',
'to',
'dependency'
])
->utilize('from')
->limit(1)
->filter(Filter::any(
Filter::equal('to.redundancy_group.state.failed', 'y'),
Filter::equal('dependency.state.failed', 'y')
));

$subQueryResolver = $subQuery->getResolver();
$subQueryResolver = $subQuery->getResolver()->setAliasPrefix('hpp_');
$subQueryTarget = $subQueryResolver->resolveRelation($subQueryModel->getTableName() . '.from')->getTarget();
$targetForeignKey = $subQueryResolver->qualifyColumn(
'service_id',
Expand Down Expand Up @@ -90,7 +86,7 @@ public function rewriteColumnDefinition(ColumnDefinition $def, string $relation)
{
}

public function rewriteCondition(Filter\Condition $condition, $relation = null): void
public function rewriteCondition(Filter\Condition $condition, $relation = null)
{
$column = substr($condition->getColumn(), strlen($relation ?? ''));

Expand Down
3 changes: 1 addition & 2 deletions library/Icingadb/Widget/DependencyNodeStatistics.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Icinga\Module\Icingadb\Widget;

use Icinga\Chart\Donut;
use Icinga\Module\Dependencies\Model\DependencyNodeSummary;
use Icinga\Module\Icingadb\Model\RedundancyGroupSummary;
use Icinga\Module\Icingadb\Widget\Detail\ObjectStatistics;
use ipl\Html\Text;
Expand All @@ -17,7 +16,7 @@
*/
class DependencyNodeStatistics extends ObjectStatistics
{
/** @var RedundancyGroupSummary|DependencyNodeSummary Dependency node summary*/
/** @var RedundancyGroupSummary Dependency node summary*/
protected $summary;

public function __construct($summary)
Expand Down
5 changes: 2 additions & 3 deletions public/css/list/redundancy-group-list-item.less
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.redundancy-group-list-item {
.caption {
.object-statistics {
justify-content: end;
}
display: flex;
justify-content: end;
}
}

0 comments on commit 4ef7e33

Please sign in to comment.