Merge pull request #22120 from nextcloud/fix/search/ids-and-order

Fix search providers order and IDs
This commit is contained in:
Morris Jobke 2020-08-05 22:41:52 +02:00 committed by GitHub
commit 588b6fa35e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 11 deletions

View File

@ -83,7 +83,7 @@ class ContactsSearchProvider implements IProvider {
* @inheritDoc * @inheritDoc
*/ */
public function getId(): string { public function getId(): string {
return 'contacts-dav'; return 'contacts';
} }
/** /**
@ -100,7 +100,7 @@ class ContactsSearchProvider implements IProvider {
if ($route === 'contacts.Page.index') { if ($route === 'contacts.Page.index') {
return -1; return -1;
} }
return 20; return 25;
} }
/** /**

View File

@ -69,7 +69,7 @@ class EventsSearchProvider extends ACalendarSearchProvider {
* @inheritDoc * @inheritDoc
*/ */
public function getId(): string { public function getId(): string {
return 'calendar-dav'; return 'calendar';
} }
/** /**
@ -86,7 +86,7 @@ class EventsSearchProvider extends ACalendarSearchProvider {
if ($route === 'calendar.View.index') { if ($route === 'calendar.View.index') {
return -1; return -1;
} }
return 10; return 30;
} }
/** /**

View File

@ -61,7 +61,7 @@ class TasksSearchProvider extends ACalendarSearchProvider {
* @inheritDoc * @inheritDoc
*/ */
public function getId(): string { public function getId(): string {
return 'tasks-dav'; return 'tasks';
} }
/** /**
@ -78,7 +78,7 @@ class TasksSearchProvider extends ACalendarSearchProvider {
if ($route === 'tasks.Page.index') { if ($route === 'tasks.Page.index') {
return -1; return -1;
} }
return 10; return 35;
} }
/** /**

View File

@ -88,7 +88,7 @@ class ContactsSearchProviderTest extends TestCase {
} }
public function testGetId(): void { public function testGetId(): void {
$this->assertEquals('contacts-dav', $this->provider->getId()); $this->assertEquals('contacts', $this->provider->getId());
} }
public function testGetName(): void { public function testGetName(): void {

View File

@ -250,7 +250,7 @@ class EventsSearchProviderTest extends TestCase {
} }
public function testGetId(): void { public function testGetId(): void {
$this->assertEquals('calendar-dav', $this->provider->getId()); $this->assertEquals('calendar', $this->provider->getId());
} }
public function testGetName(): void { public function testGetName(): void {

View File

@ -134,7 +134,7 @@ class TasksSearchProviderTest extends TestCase {
} }
public function testGetId(): void { public function testGetId(): void {
$this->assertEquals('tasks-dav', $this->provider->getId()); $this->assertEquals('tasks', $this->provider->getId());
} }
public function testGetName(): void { public function testGetName(): void {

View File

@ -62,7 +62,7 @@ class SectionSearch implements IProvider {
* @inheritDoc * @inheritDoc
*/ */
public function getId(): string { public function getId(): string {
return 'settings_sections'; return 'settings';
} }
/** /**
@ -79,7 +79,8 @@ class SectionSearch implements IProvider {
if ($route === 'settings.PersonalSettings.index' || $route === 'settings.AdminSettings.index') { if ($route === 'settings.PersonalSettings.index' || $route === 'settings.AdminSettings.index') {
return -1; return -1;
} }
return 20; // At the very bottom
return 500;
} }
/** /**