Fix app navigation controller to return an array
This is required to not break compatibility with existing consumers of that endpoint like the apps management or the client Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
8e81bc7895
commit
4c773891d7
|
@ -55,7 +55,7 @@ class NavigationController extends OCSController {
|
||||||
if ($absolute) {
|
if ($absolute) {
|
||||||
$navigation = $this->rewriteToAbsoluteUrls($navigation);
|
$navigation = $this->rewriteToAbsoluteUrls($navigation);
|
||||||
}
|
}
|
||||||
|
$navigation = array_values($navigation);
|
||||||
$etag = $this->generateETag($navigation);
|
$etag = $this->generateETag($navigation);
|
||||||
if ($this->request->getHeader('If-None-Match') === $etag) {
|
if ($this->request->getHeader('If-None-Match') === $etag) {
|
||||||
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
|
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
|
||||||
|
@ -77,6 +77,7 @@ class NavigationController extends OCSController {
|
||||||
if ($absolute) {
|
if ($absolute) {
|
||||||
$navigation = $this->rewriteToAbsoluteUrls($navigation);
|
$navigation = $this->rewriteToAbsoluteUrls($navigation);
|
||||||
}
|
}
|
||||||
|
$navigation = array_values($navigation);
|
||||||
$etag = $this->generateETag($navigation);
|
$etag = $this->generateETag($navigation);
|
||||||
if ($this->request->getHeader('If-None-Match') === $etag) {
|
if ($this->request->getHeader('If-None-Match') === $etag) {
|
||||||
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
|
return new DataResponse([], Http::STATUS_NOT_MODIFIED);
|
||||||
|
|
|
@ -6,7 +6,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
|
||||||
if(response.ocs.meta.status === 'ok') {
|
if(response.ocs.meta.status === 'ok') {
|
||||||
var addedApps = {};
|
var addedApps = {};
|
||||||
var navEntries = response.ocs.data;
|
var navEntries = response.ocs.data;
|
||||||
var container = $('#navigation #apps');
|
var container = $('#navigation #apps ul');
|
||||||
|
|
||||||
// remove disabled apps
|
// remove disabled apps
|
||||||
for (var i = 0; i < navEntries.length; i++) {
|
for (var i = 0; i < navEntries.length; i++) {
|
||||||
|
|
|
@ -69,7 +69,7 @@ class NavigationControllerTest extends TestCase {
|
||||||
$this->navigationManager->expects($this->once())
|
$this->navigationManager->expects($this->once())
|
||||||
->method('getAll')
|
->method('getAll')
|
||||||
->with('link')
|
->with('link')
|
||||||
->willReturn([ ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ]);
|
->willReturn(['files' => ['id' => 'files', 'href' => '/index.php/apps/files', 'icon' => 'icon' ] ]);
|
||||||
if ($absolute) {
|
if ($absolute) {
|
||||||
$this->urlGenerator->expects($this->any())
|
$this->urlGenerator->expects($this->any())
|
||||||
->method('getBaseURL')
|
->method('getBaseURL')
|
||||||
|
@ -102,7 +102,7 @@ class NavigationControllerTest extends TestCase {
|
||||||
$this->navigationManager->expects($this->once())
|
$this->navigationManager->expects($this->once())
|
||||||
->method('getAll')
|
->method('getAll')
|
||||||
->with('settings')
|
->with('settings')
|
||||||
->willReturn([ ['id' => 'settings', 'href' => '/index.php/settings/user', 'icon' => '/core/img/settings.svg'] ]);
|
->willReturn(['settings' => ['id' => 'settings', 'href' => '/index.php/settings/user', 'icon' => '/core/img/settings.svg'] ]);
|
||||||
if ($absolute) {
|
if ($absolute) {
|
||||||
$this->urlGenerator->expects($this->any())
|
$this->urlGenerator->expects($this->any())
|
||||||
->method('getBaseURL')
|
->method('getBaseURL')
|
||||||
|
|
Loading…
Reference in New Issue