Skip to content

Commit

Permalink
Change name HasRootProblem to HasProblematicParent
Browse files Browse the repository at this point in the history
  • Loading branch information
raviks789 committed Oct 15, 2024
1 parent 9d4a465 commit 2892bd0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion application/controllers/ServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function init()
$hostName = $this->params->getRequired('host.name');

$query = Service::on($this->getDb())
->withColumns(['has_root_problem'])
->withColumns(['has_problematic_parent'])
->with([
'state',
'icon_image',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
use ipl\Orm\Contract\QueryAwareBehavior;

/**
* Behavior to check if the object has a root problem
* Behavior to check if the service has a problematic parent
*/
class HasRootProblem implements RewriteColumnBehavior, QueryAwareBehavior
class HasProblematicParent implements RewriteColumnBehavior, QueryAwareBehavior
{
use Database;

Expand Down Expand Up @@ -79,7 +79,7 @@ public function rewriteColumn($column, ?string $relation = null): ?AliasedExpres

public function isSelectableColumn(string $name): bool
{
return $name === 'has_root_problem';
return $name === 'has_problematic_parent';
}

public function rewriteColumnDefinition(ColumnDefinition $def, string $relation): void
Expand Down
4 changes: 2 additions & 2 deletions library/Icingadb/Model/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Icinga\Module\Icingadb\Common\Auth;
use Icinga\Module\Icingadb\Model\Behavior\BoolCast;
use Icinga\Module\Icingadb\Model\Behavior\HasRootProblem;
use Icinga\Module\Icingadb\Model\Behavior\HasProblematicParent;
use Icinga\Module\Icingadb\Model\Behavior\ReRoute;
use ipl\Orm\Behavior\Binary;
use ipl\Orm\Behaviors;
Expand Down Expand Up @@ -196,7 +196,7 @@ public function createBehaviors(Behaviors $behaviors)
'command_endpoint_id'
]));

$behaviors->add(new HasRootProblem());
$behaviors->add(new HasProblematicParent());
}

public function createDefaults(Defaults $defaults)
Expand Down
2 changes: 1 addition & 1 deletion library/Icingadb/Widget/Detail/ObjectDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ protected function createRootProblems(): ?array
// host being down, only show its root problems if they exist.
if (
$this->object->state->is_reachable
|| ($this->object instanceof Service && ! $this->object->has_root_problem)
|| ($this->object instanceof Service && ! $this->object->has_problematic_parent)
) {
return null;
}
Expand Down

0 comments on commit 2892bd0

Please sign in to comment.