mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
BranchedObjectHint: allow no object (create)
This commit is contained in:
parent
b35b6b84cc
commit
1fbb4d93b6
@ -15,7 +15,7 @@ class BranchedObjectHint extends HtmlDocument
|
||||
{
|
||||
use TranslationHelper;
|
||||
|
||||
public function __construct(Branch $branch, Auth $auth, BranchedObject $object)
|
||||
public function __construct(Branch $branch, Auth $auth, BranchedObject $object = null)
|
||||
{
|
||||
if (! $branch->isBranch()) {
|
||||
return;
|
||||
@ -29,6 +29,13 @@ class BranchedObjectHint extends HtmlDocument
|
||||
$label = $name;
|
||||
}
|
||||
$link = $hook->linkToBranch($branch, $auth, $label);
|
||||
if ($object === null) {
|
||||
$this->add(Hint::info(Html::sprintf($this->translate(
|
||||
'This object will be created in %s. It will not be part of any deployment'
|
||||
. ' unless being merged'
|
||||
), $link)));
|
||||
return;
|
||||
}
|
||||
|
||||
if (! $object->hasBeenTouchedByBranch()) {
|
||||
$this->add(Hint::info(Html::sprintf($this->translate(
|
||||
|
Loading…
x
Reference in New Issue
Block a user