Skip to content

Commit

Permalink
(Host/Service)groupController: Don't overwrite the (SearchBar/SearchE…
Browse files Browse the repository at this point in the history
…ditor) suggestionUrl

SuggestionUrl now uses the preserveParams as default params

ref: Icinga/ipl-web#233
  • Loading branch information
sukhwinder33445 committed Oct 21, 2024
1 parent 4806939 commit 0882dfe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
14 changes: 5 additions & 9 deletions application/controllers/HostgroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use ipl\Stdlib\Filter;
use ipl\Web\Control\LimitControl;
use ipl\Web\Control\SortControl;
use ipl\Web\Url;

class HostgroupController extends Controller
{
Expand Down Expand Up @@ -84,14 +83,7 @@ public function indexAction(): Generator
$sortControl->getSortParam(),
$viewModeSwitcher->getViewModeParam(),
'name'
])->setSuggestionUrl(Url::fromPath(
'icingadb/hostgroup/complete',
[
'name' => $this->hostgroupName,
'_disableLayout' => true,
'showCompact' => true
]
));
]);

if ($searchBar->hasBeenSent() && ! $searchBar->isValid()) {
if ($searchBar->hasBeenSubmitted()) {
Expand Down Expand Up @@ -156,6 +148,10 @@ public function searchEditorAction(): void
'name'
]);

if ($editor->getSuggestionUrl()) {
$editor->getSuggestionUrl()->addParams(['name' => $this->hostgroupName]);
}

$this->getDocument()->add($editor);
$this->setTitle(t('Adjust Filter'));
}
Expand Down
10 changes: 1 addition & 9 deletions application/controllers/ServicegroupController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use ipl\Stdlib\Filter;
use ipl\Web\Control\LimitControl;
use ipl\Web\Control\SortControl;
use ipl\Web\Url;

class ServicegroupController extends Controller
{
Expand Down Expand Up @@ -92,14 +91,7 @@ public function indexAction(): Generator
$sortControl->getSortParam(),
$viewModeSwitcher->getViewModeParam(),
'name'
])->setSuggestionUrl(Url::fromPath(
'icingadb/servicegroup/complete',
[
'name' => $this->servicegroupName,
'_disableLayout' => true,
'showCompact' => true
]
));
]);

if ($searchBar->hasBeenSent() && ! $searchBar->isValid()) {
if ($searchBar->hasBeenSubmitted()) {
Expand Down

0 comments on commit 0882dfe

Please sign in to comment.