Merge pull request #50688 from nextcloud/backport/50666/stable31

[stable31] feat(theming): allow to disable standalone windows
pull/50710/head v31.0.0rc3
John Molakvoæ 1 year ago committed by GitHub
commit 7646b6b2b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      apps/theming/lib/Controller/ThemingController.php
  2. 17
      apps/theming/tests/Controller/ThemingControllerTest.php
  3. 8
      config/config.sample.php

@ -481,7 +481,7 @@ class ThemingController extends Controller {
'sizes' => '16x16'
]
],
'display' => 'standalone'
'display' => $this->config->getSystemValueBool('theming.standalone_window.enabled', true) ? 'standalone' : 'browser'
];
$response = new JSONResponse($responseJS);
$response->cacheFor(3600);

@ -713,7 +713,15 @@ class ThemingControllerTest extends TestCase {
@$this->assertEquals($expected, $this->themingController->getImage('background'));
}
public function testGetManifest(): void {
public static function dataGetManifest(): array {
return [
[true],
[false],
];
}
/** @dataProvider dataGetManifest */
public function testGetManifest(bool $standalone): void {
$this->config
->expects($this->once())
->method('getAppValue')
@ -734,6 +742,11 @@ class ThemingControllerTest extends TestCase {
['theming.Icon.getTouchIcon', ['app' => 'core'], 'touchicon'],
['theming.Icon.getFavicon', ['app' => 'core'], 'favicon'],
]);
$this->config
->expects($this->once())
->method('getSystemValueBool')
->with('theming.standalone_window.enabled', true)
->willReturn($standalone);
$response = new JSONResponse([
'name' => 'Nextcloud',
'start_url' => 'localhost',
@ -750,7 +763,7 @@ class ThemingControllerTest extends TestCase {
'sizes' => '16x16'
]
],
'display' => 'standalone',
'display' => $standalone ? 'standalone' : 'browser',
'short_name' => 'Nextcloud',
'theme_color' => null,
'background_color' => null,

@ -2129,6 +2129,14 @@ $CONFIG = [
*/
'enforce_theme' => '',
/**
* This setting allows to disable the PWA functionality that allows browsers to open web applications in dedicated windows.
*
* Defaults to ``true``
*/
'theming.standalone_window.enabled' => true,
/**
* The default cipher for encrypting files. Currently supported are:
* - AES-256-CTR

Loading…
Cancel
Save