Skip to content

Commit 5bbf229

Browse files
susnuxbackportbot[bot]
authored andcommitted
fix(appstore): do not set wrong app as active
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 959c001 commit 5bbf229

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
@@ -16,7 +16,6 @@
1616
use OCP\AppFramework\Services\IInitialState;
1717
use OCP\IConfig;
1818
use OCP\IL10N;
19-
use OCP\INavigationManager;
2019
use OCP\IRequest;
2120
use OCP\IURLGenerator;
2221
use PHPUnit\Framework\MockObject\MockObject;
@@ -30,8 +29,6 @@ final class PageControllerTest extends TestCase {
3029

3130
private IConfig&MockObject $config;
3231

33-
private INavigationManager&MockObject $navigationManager;
34-
3532
private IAppManager&MockObject $appManager;
3633

3734
private BundleFetcher&MockObject $bundleFetcher;
@@ -54,7 +51,6 @@ protected function setUp(): void {
5451
->method('t')
5552
->willReturnArgument(0);
5653
$this->config = $this->createMock(IConfig::class);
57-
$this->navigationManager = $this->createMock(INavigationManager::class);
5854
$this->appManager = $this->createMock(IAppManager::class);
5955
$this->bundleFetcher = $this->createMock(BundleFetcher::class);
6056
$this->installer = $this->createMock(Installer::class);
@@ -70,7 +66,6 @@ protected function setUp(): void {
7066
$this->urlGenerator,
7167
$this->initialState,
7268
$this->bundleFetcher,
73-
$this->navigationManager,
7469
);
7570
}
7671

@@ -84,10 +79,6 @@ public function testViewApps(): void {
8479
->method('getSystemValueBool')
8580
->with('appstoreenabled', true)
8681
->willReturn(true);
87-
$this->navigationManager
88-
->expects($this->once())
89-
->method('setActiveEntry')
90-
->with('core_apps');
9182

9283
$this->initialState
9384
->expects($this->exactly(4))
@@ -117,10 +108,6 @@ public function testViewAppsAppstoreNotEnabled(): void {
117108
->method('getSystemValueBool')
118109
->with('appstoreenabled', true)
119110
->willReturn(false);
120-
$this->navigationManager
121-
->expects($this->once())
122-
->method('setActiveEntry')
123-
->with('core_apps');
124111

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

0 commit comments

Comments
 (0)