Skip to content

Commit 46858ef

Browse files
committed
docs: remove developer documentation link
Signed-off-by: Arsalan Ul Haq Sohni <[email protected]>
1 parent 1b06f80 commit 46858ef

File tree

3 files changed

+2
-138
lines changed

3 files changed

+2
-138
lines changed

apps/settings/lib/Controller/AppSettingsController.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
use OCP\Files\SimpleFS\ISimpleFile;
3737
use OCP\Files\SimpleFS\ISimpleFolder;
3838
use OCP\Http\Client\IClientService;
39-
use OCP\IAppConfig;
4039
use OCP\IConfig;
4140
use OCP\IGroup;
4241
use OCP\IGroupManager;
@@ -77,7 +76,6 @@ public function __construct(
7776
private IInitialState $initialState,
7877
private AppDiscoverFetcher $discoverFetcher,
7978
private IClientService $clientService,
80-
private IAppConfig $appConfig,
8179
) {
8280
parent::__construct($appName, $request);
8381
$this->appData = $appDataFactory->get('appstore');
@@ -94,12 +92,6 @@ public function viewApps(): TemplateResponse {
9492

9593
$this->initialState->provideInitialState('appstoreEnabled', $this->config->getSystemValueBool('appstoreenabled', true));
9694
$this->initialState->provideInitialState('appstoreBundles', $this->getBundles());
97-
98-
// Conditionally set developer docs link based on configuration
99-
$displayDocumentationLink = $this->appConfig->getValueBool('settings', 'display_documentation_link', true);
100-
$developerDocsUrl = $displayDocumentationLink ? $this->urlGenerator->linkToDocs('developer-manual') : '';
101-
$this->initialState->provideInitialState('appstoreDeveloperDocs', $developerDocsUrl);
102-
10395
$this->initialState->provideInitialState('appstoreUpdateCount', count($this->getAppsWithUpdates()));
10496

10597
if ($this->appManager->isEnabledForAnyone('app_api')) {

apps/settings/src/views/AppStoreNavigation.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@
100100
</NcAppNavigationItem>
101101
</template>
102102

103-
<NcAppNavigationItem
104-
v-if="developerDocsUrl"
105-
id="app-developer-docs"
106-
:name="t('settings', 'Developer documentation ↗')"
107-
:href="developerDocsUrl" />
108103
</template>
109104
</NcAppNavigation>
110105
</template>
@@ -124,7 +119,6 @@ import APPSTORE_CATEGORY_ICONS from '../constants/AppstoreCategoryIcons.ts'
124119
import { useAppsStore } from '../store/apps-store.ts'
125120
126121
const appstoreEnabled = loadState<boolean>('settings', 'appstoreEnabled', true)
127-
const developerDocsUrl = loadState<string>('settings', 'appstoreDeveloperDocs', '')
128122
129123
const store = useAppsStore()
130124
const categories = computed(() => store.categories)

apps/settings/tests/Controller/AppSettingsControllerTest.php

Lines changed: 2 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use OCP\AppFramework\Services\IInitialState;
2121
use OCP\Files\AppData\IAppDataFactory;
2222
use OCP\Http\Client\IClientService;
23-
use OCP\IAppConfig;
2423
use OCP\IConfig;
2524
use OCP\IL10N;
2625
use OCP\INavigationManager;
@@ -41,7 +40,6 @@ class AppSettingsControllerTest extends TestCase {
4140
private IRequest&MockObject $request;
4241
private IL10N&MockObject $l10n;
4342
private IConfig&MockObject $config;
44-
private IAppConfig&MockObject $appConfig;
4543
private INavigationManager&MockObject $navigationManager;
4644
private AppManager&MockObject $appManager;
4745
private CategoryFetcher&MockObject $categoryFetcher;
@@ -67,7 +65,6 @@ protected function setUp(): void {
6765
->method('t')
6866
->willReturnArgument(0);
6967
$this->config = $this->createMock(IConfig::class);
70-
$this->appConfig = $this->createMock(IAppConfig::class);
7168
$this->navigationManager = $this->createMock(INavigationManager::class);
7269
$this->appManager = $this->createMock(AppManager::class);
7370
$this->categoryFetcher = $this->createMock(CategoryFetcher::class);
@@ -99,7 +96,6 @@ protected function setUp(): void {
9996
$this->initialState,
10097
$this->discoverFetcher,
10198
$this->clientService,
102-
$this->appConfig,
10399
);
104100
}
105101

@@ -168,31 +164,14 @@ public function testViewApps(): void {
168164
->method('getSystemValueBool')
169165
->with('appstoreenabled', true)
170166
->willReturn(true);
171-
$this->appConfig
172-
->expects($this->once())
173-
->method('getValueBool')
174-
->with('settings', 'display_documentation_link', true)
175-
->willReturn(true);
176167
$this->navigationManager
177168
->expects($this->once())
178169
->method('setActiveEntry')
179170
->with('core_apps');
180171

181-
// Test that developer docs link is generated correctly
182-
$this->urlGenerator
183-
->expects($this->once())
184-
->method('linkToDocs')
185-
->with('developer-manual')
186-
->willReturn('https://docs.nextcloud.com/server/latest/developer_manual/');
187-
188172
$this->initialState
189173
->expects($this->exactly(4))
190-
->method('provideInitialState')
191-
->willReturnCallback(function ($key, $value) {
192-
if ($key === 'appstoreDeveloperDocs') {
193-
$this->assertEquals('https://docs.nextcloud.com/server/latest/developer_manual/', $value);
194-
}
195-
});
174+
->method('provideInitialState');
196175

197176
$policy = new ContentSecurityPolicy();
198177
$policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com');
@@ -218,31 +197,14 @@ public function testViewAppsAppstoreNotEnabled(): void {
218197
->method('getSystemValueBool')
219198
->with('appstoreenabled', true)
220199
->willReturn(false);
221-
$this->appConfig
222-
->expects($this->once())
223-
->method('getValueBool')
224-
->with('settings', 'display_documentation_link', true)
225-
->willReturn(true);
226200
$this->navigationManager
227201
->expects($this->once())
228202
->method('setActiveEntry')
229203
->with('core_apps');
230204

231-
// Test that developer docs link is still generated even when appstore is disabled
232-
$this->urlGenerator
233-
->expects($this->once())
234-
->method('linkToDocs')
235-
->with('developer-manual')
236-
->willReturn('https://docs.nextcloud.com/server/latest/developer_manual/');
237-
238205
$this->initialState
239206
->expects($this->exactly(4))
240-
->method('provideInitialState')
241-
->willReturnCallback(function ($key, $value) {
242-
if ($key === 'appstoreDeveloperDocs') {
243-
$this->assertEquals('https://docs.nextcloud.com/server/latest/developer_manual/', $value);
244-
}
245-
});
207+
->method('provideInitialState');
246208

247209
$policy = new ContentSecurityPolicy();
248210
$policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com');
@@ -257,88 +219,4 @@ public function testViewAppsAppstoreNotEnabled(): void {
257219

258220
$this->assertEquals($expected, $this->appSettingsController->viewApps());
259221
}
260-
261-
public function testDeveloperDocumentationLinkHiddenWhenConfigured(): void {
262-
$this->installer->expects($this->any())
263-
->method('isUpdateAvailable')
264-
->willReturn(false);
265-
$this->bundleFetcher->expects($this->once())->method('getBundles')->willReturn([]);
266-
$this->config
267-
->expects($this->once())
268-
->method('getSystemValueBool')
269-
->with('appstoreenabled', true)
270-
->willReturn(true);
271-
$this->appConfig
272-
->expects($this->once())
273-
->method('getValueBool')
274-
->with('settings', 'display_documentation_link', true)
275-
->willReturn(false);
276-
$this->navigationManager
277-
->expects($this->once())
278-
->method('setActiveEntry')
279-
->with('core_apps');
280-
281-
// When display_documentation_link is false, linkToDocs should not be called
282-
$this->urlGenerator
283-
->expects($this->never())
284-
->method('linkToDocs');
285-
286-
$providedStates = [];
287-
$this->initialState
288-
->expects($this->exactly(4))
289-
->method('provideInitialState')
290-
->willReturnCallback(function ($key, $value) use (&$providedStates) {
291-
$providedStates[$key] = $value;
292-
});
293-
294-
$this->appSettingsController->viewApps();
295-
296-
// Assert that the developer docs state was provided with an empty string
297-
$this->assertArrayHasKey('appstoreDeveloperDocs', $providedStates);
298-
$this->assertEquals('', $providedStates['appstoreDeveloperDocs']);
299-
}
300-
301-
public function testDeveloperDocumentationLinkShownByDefault(): void {
302-
$this->installer->expects($this->any())
303-
->method('isUpdateAvailable')
304-
->willReturn(false);
305-
$this->bundleFetcher->expects($this->once())->method('getBundles')->willReturn([]);
306-
$this->config
307-
->expects($this->once())
308-
->method('getSystemValueBool')
309-
->with('appstoreenabled', true)
310-
->willReturn(true);
311-
$this->appConfig
312-
->expects($this->once())
313-
->method('getValueBool')
314-
->with('settings', 'display_documentation_link', true)
315-
->willReturn(true);
316-
$this->navigationManager
317-
->expects($this->once())
318-
->method('setActiveEntry')
319-
->with('core_apps');
320-
321-
$developerDocsUrl = 'https://docs.nextcloud.com/server/latest/developer_manual/';
322-
323-
// When display_documentation_link is true (default), linkToDocs should be called
324-
$this->urlGenerator
325-
->expects($this->once())
326-
->method('linkToDocs')
327-
->with('developer-manual')
328-
->willReturn($developerDocsUrl);
329-
330-
$providedStates = [];
331-
$this->initialState
332-
->expects($this->exactly(4))
333-
->method('provideInitialState')
334-
->willReturnCallback(function ($key, $value) use (&$providedStates) {
335-
$providedStates[$key] = $value;
336-
});
337-
338-
$this->appSettingsController->viewApps();
339-
340-
// Assert that the developer docs state was provided with the correct URL
341-
$this->assertArrayHasKey('appstoreDeveloperDocs', $providedStates);
342-
$this->assertEquals($developerDocsUrl, $providedStates['appstoreDeveloperDocs']);
343-
}
344222
}

0 commit comments

Comments
 (0)