Skip to content

Commit 290d1ef

Browse files
committed
fix(appstore): do not set wrong app as active
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent e609d11 commit 290d1ef

2 files changed

Lines changed: 0 additions & 17 deletions

File tree

apps/appstore/lib/Controller/PageController.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use OCP\AppFramework\Services\IInitialState;
2424
use OCP\IConfig;
2525
use OCP\IL10N;
26-
use OCP\INavigationManager;
2726
use OCP\IRequest;
2827
use OCP\IURLGenerator;
2928
use OCP\Server;
@@ -41,7 +40,6 @@ public function __construct(
4140
private readonly IURLGenerator $urlGenerator,
4241
private readonly IInitialState $initialState,
4342
private readonly BundleFetcher $bundleFetcher,
44-
private readonly INavigationManager $navigationManager,
4543
) {
4644
parent::__construct(Application::APP_ID, $request);
4745
}
@@ -51,8 +49,6 @@ public function __construct(
5149
#[FrontpageRoute(verb: 'GET', url: '/settings/apps/{category}', defaults: ['category' => ''], root: '')]
5250
#[FrontpageRoute(verb: 'GET', url: '/settings/apps/{category}/{id}', defaults: ['category' => '', 'id' => ''], root: '')]
5351
public function viewApps(): TemplateResponse {
54-
$this->navigationManager->setActiveEntry('core_apps');
55-
5652
$this->initialState->provideInitialState('appstoreEnabled', $this->config->getSystemValueBool('appstoreenabled', true));
5753
$this->initialState->provideInitialState('appstoreBundles', $this->getBundles());
5854
$this->initialState->provideInitialState('appstoreDeveloperDocs', $this->urlGenerator->linkToDocs('developer-manual'));

apps/appstore/tests/Controller/PageControllerTest.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use OCP\AppFramework\Services\IInitialState;
1818
use OCP\IConfig;
1919
use OCP\IL10N;
20-
use OCP\INavigationManager;
2120
use OCP\IRequest;
2221
use OCP\IURLGenerator;
2322
use PHPUnit\Framework\MockObject\MockObject;
@@ -31,8 +30,6 @@ final class PageControllerTest extends TestCase {
3130

3231
private IConfig&MockObject $config;
3332

34-
private INavigationManager&MockObject $navigationManager;
35-
3633
private IAppManager&MockObject $appManager;
3734

3835
private BundleFetcher&MockObject $bundleFetcher;
@@ -55,7 +52,6 @@ protected function setUp(): void {
5552
->method('t')
5653
->willReturnArgument(0);
5754
$this->config = $this->createMock(IConfig::class);
58-
$this->navigationManager = $this->createMock(INavigationManager::class);
5955
$this->appManager = $this->createMock(IAppManager::class);
6056
$this->bundleFetcher = $this->createMock(BundleFetcher::class);
6157
$this->installer = $this->createMock(Installer::class);
@@ -71,7 +67,6 @@ protected function setUp(): void {
7167
$this->urlGenerator,
7268
$this->initialState,
7369
$this->bundleFetcher,
74-
$this->navigationManager,
7570
);
7671
}
7772

@@ -85,10 +80,6 @@ public function testViewApps(): void {
8580
->method('getSystemValueBool')
8681
->with('appstoreenabled', true)
8782
->willReturn(true);
88-
$this->navigationManager
89-
->expects($this->once())
90-
->method('setActiveEntry')
91-
->with('core_apps');
9283

9384
$this->initialState
9485
->expects($this->exactly(4))
@@ -118,10 +109,6 @@ public function testViewAppsAppstoreNotEnabled(): void {
118109
->method('getSystemValueBool')
119110
->with('appstoreenabled', true)
120111
->willReturn(false);
121-
$this->navigationManager
122-
->expects($this->once())
123-
->method('setActiveEntry')
124-
->with('core_apps');
125112

126113
$this->initialState
127114
->expects($this->exactly(4))

0 commit comments

Comments
 (0)