diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2020-08-05 16:38:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-05 16:38:45 +0200 |
commit | 55473dd2eb042078b7fc5aef37e7b7fb614554fa (patch) | |
tree | a5880283c3c74264fbbabcad9e3b70de26f3ae20 /apps | |
parent | 79fc7e78b7de7ee7bc749294ac79de4566fb04e9 (diff) | |
parent | ea8f68bea6957ae459ff1ba6849b25354b3f0093 (diff) | |
download | nextcloud-server-55473dd2eb042078b7fc5aef37e7b7fb614554fa.tar.gz nextcloud-server-55473dd2eb042078b7fc5aef37e7b7fb614554fa.zip |
Merge pull request #22104 from nextcloud/enh/search/make-app-handle-the-order-logic
Make apps handle the order logic
Diffstat (limited to 'apps')
-rw-r--r-- | apps/comments/lib/Search/CommentsSearchProvider.php | 6 | ||||
-rw-r--r-- | apps/dav/lib/Search/ContactsSearchProvider.php | 7 | ||||
-rw-r--r-- | apps/dav/lib/Search/EventsSearchProvider.php | 5 | ||||
-rw-r--r-- | apps/dav/lib/Search/TasksSearchProvider.php | 5 | ||||
-rw-r--r-- | apps/files/lib/Search/FilesSearchProvider.php | 6 | ||||
-rw-r--r-- | apps/settings/lib/Search/SectionSearch.php | 5 |
6 files changed, 27 insertions, 7 deletions
diff --git a/apps/comments/lib/Search/CommentsSearchProvider.php b/apps/comments/lib/Search/CommentsSearchProvider.php index 3d503cf5c51..e6443c20a2f 100644 --- a/apps/comments/lib/Search/CommentsSearchProvider.php +++ b/apps/comments/lib/Search/CommentsSearchProvider.php @@ -77,7 +77,11 @@ class CommentsSearchProvider implements IProvider { /** * @inheritDoc */ - public function getOrder(): int { + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'files.View.index') { + // Files first + return 0; + } return 10; } diff --git a/apps/dav/lib/Search/ContactsSearchProvider.php b/apps/dav/lib/Search/ContactsSearchProvider.php index d87f87d7591..f97ba2cf634 100644 --- a/apps/dav/lib/Search/ContactsSearchProvider.php +++ b/apps/dav/lib/Search/ContactsSearchProvider.php @@ -96,8 +96,11 @@ class ContactsSearchProvider implements IProvider { /** * @inheritDoc */ - public function getOrder(): int { - return 7; + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'contacts.Page.index') { + return -1; + } + return 20; } /** diff --git a/apps/dav/lib/Search/EventsSearchProvider.php b/apps/dav/lib/Search/EventsSearchProvider.php index 6d264ae482e..619775aa193 100644 --- a/apps/dav/lib/Search/EventsSearchProvider.php +++ b/apps/dav/lib/Search/EventsSearchProvider.php @@ -82,7 +82,10 @@ class EventsSearchProvider extends ACalendarSearchProvider { /** * @inheritDoc */ - public function getOrder(): int { + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'calendar.View.index') { + return -1; + } return 10; } diff --git a/apps/dav/lib/Search/TasksSearchProvider.php b/apps/dav/lib/Search/TasksSearchProvider.php index 9a0a87eb5ab..adc1197aa18 100644 --- a/apps/dav/lib/Search/TasksSearchProvider.php +++ b/apps/dav/lib/Search/TasksSearchProvider.php @@ -74,7 +74,10 @@ class TasksSearchProvider extends ACalendarSearchProvider { /** * @inheritDoc */ - public function getOrder(): int { + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'tasks.Page.index') { + return -1; + } return 10; } diff --git a/apps/files/lib/Search/FilesSearchProvider.php b/apps/files/lib/Search/FilesSearchProvider.php index d0a4bf56624..e221dab0ab1 100644 --- a/apps/files/lib/Search/FilesSearchProvider.php +++ b/apps/files/lib/Search/FilesSearchProvider.php @@ -77,7 +77,11 @@ class FilesSearchProvider implements IProvider { /** * @inheritDoc */ - public function getOrder(): int { + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'files.View.index') { + // Before comments + return -5; + } return 5; } diff --git a/apps/settings/lib/Search/SectionSearch.php b/apps/settings/lib/Search/SectionSearch.php index 6e7b930046c..795b9f7e9f7 100644 --- a/apps/settings/lib/Search/SectionSearch.php +++ b/apps/settings/lib/Search/SectionSearch.php @@ -75,7 +75,10 @@ class SectionSearch implements IProvider { /** * @inheritDoc */ - public function getOrder(): int { + public function getOrder(string $route, array $routeParameters): int { + if ($route === 'settings.PersonalSettings.index' || $route === 'settings.AdminSettings.index') { + return -1; + } return 20; } |