mirror of
https://github.com/nextcloud/server.git
synced 2026-04-15 22:11:17 -04:00
feat(dav): hide search providers if their respective app is not activated
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
011390aacb
commit
2a4465dc1b
3 changed files with 15 additions and 12 deletions
|
|
@ -83,11 +83,12 @@ class ContactsSearchProvider implements IFilteringProvider {
|
|||
return $this->l10n->t('Contacts');
|
||||
}
|
||||
|
||||
public function getOrder(string $route, array $routeParameters): int {
|
||||
if ($route === 'contacts.Page.index') {
|
||||
return -1;
|
||||
public function getOrder(string $route, array $routeParameters): ?int {
|
||||
if ($this->appManager->isEnabledForUser('contacts')) {
|
||||
return $route === 'contacts.Page.index' ? -1 : 25;
|
||||
}
|
||||
return 25;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function search(IUser $user, ISearchQuery $query): SearchResult {
|
||||
|
|
|
|||
|
|
@ -89,11 +89,12 @@ class EventsSearchProvider extends ACalendarSearchProvider implements IFiltering
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getOrder(string $route, array $routeParameters): int {
|
||||
if ($route === 'calendar.View.index') {
|
||||
return -1;
|
||||
public function getOrder(string $route, array $routeParameters): ?int {
|
||||
if ($this->appManager->isEnabledForUser('calendar')) {
|
||||
return $route === 'calendar.View.index' ? -1 : 30;
|
||||
}
|
||||
return 30;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -77,11 +77,12 @@ class TasksSearchProvider extends ACalendarSearchProvider {
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getOrder(string $route, array $routeParameters): int {
|
||||
if ($route === 'tasks.Page.index') {
|
||||
return -1;
|
||||
public function getOrder(string $route, array $routeParameters): ?int {
|
||||
if ($this->appManager->isEnabledForUser('tasks')) {
|
||||
return $route === 'tasks.Page.index' ? -1 : 35;
|
||||
}
|
||||
return 35;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue