From ad8a502bd611c4be151cb825a2e53db90e32220c Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Wed, 1 Oct 2025 10:38:03 +0200 Subject: [PATCH 1/2] IONOS(admin-delegation): implement IDelegatedSettings for systemtags now this setting can be delegated per php occ admin-delegation:add OCA\\SystemTags\\Settings\\Admin Signed-off-by: Misha M.-Kupriyanov --- apps/systemtags/lib/Settings/Admin.php | 17 +++++++- apps/systemtags/tests/Settings/AdminTest.php | 42 ++++++++++++++++++-- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/apps/systemtags/lib/Settings/Admin.php b/apps/systemtags/lib/Settings/Admin.php index b032e6b769458..bb4736127866d 100644 --- a/apps/systemtags/lib/Settings/Admin.php +++ b/apps/systemtags/lib/Settings/Admin.php @@ -6,11 +6,16 @@ namespace OCA\SystemTags\Settings; use OCP\AppFramework\Http\TemplateResponse; -use OCP\Settings\ISettings; +use OCP\IL10N; +use OCP\Settings\IDelegatedSettings; use OCP\Util; -class Admin implements ISettings { +class Admin implements IDelegatedSettings { + public function __construct( + private IL10N $l10n, + ) { + } /** * @return TemplateResponse */ @@ -36,4 +41,12 @@ public function getSection() { public function getPriority() { return 70; } + + public function getName(): string { + return $this->l10n->t('Collaborative tags'); + } + + public function getAuthorizedAppConfig(): array { + return []; + } } diff --git a/apps/systemtags/tests/Settings/AdminTest.php b/apps/systemtags/tests/Settings/AdminTest.php index 78f19475fae97..db860789a3970 100644 --- a/apps/systemtags/tests/Settings/AdminTest.php +++ b/apps/systemtags/tests/Settings/AdminTest.php @@ -1,4 +1,7 @@ admin = new Admin(); + $this->l10n = $this->createMock(IL10N::class); + $this->admin = new Admin($this->l10n); } public function testGetForm(): void { @@ -31,4 +36,35 @@ public function testGetSection(): void { public function testGetPriority(): void { $this->assertSame(70, $this->admin->getPriority()); } + + public function testGetName(): void { + $translatedName = 'Collaborative tags'; + $this->l10n->expects($this->once()) + ->method('t') + ->with('Collaborative tags') + ->willReturn($translatedName); + + $this->assertSame($translatedName, $this->admin->getName()); + } + + public function testGetAuthorizedAppConfig(): void { + $this->assertEquals([], $this->admin->getAuthorizedAppConfig()); + $this->assertIsArray($this->admin->getAuthorizedAppConfig()); + } + + public function testImplementsIDelegatedSettings(): void { + $this->assertInstanceOf(\OCP\Settings\IDelegatedSettings::class, $this->admin); + $this->assertInstanceOf(\OCP\Settings\ISettings::class, $this->admin); + } + + public function testGetNameReturnsString(): void { + $this->l10n->expects($this->once()) + ->method('t') + ->with('Collaborative tags') + ->willReturn('Translated Name'); + + $name = $this->admin->getName(); + $this->assertIsString($name); + $this->assertNotEmpty($name); + } } From f51a08a20ea0b7637a40bd464090b3cade8224b4 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Mon, 13 Oct 2025 12:41:40 +0200 Subject: [PATCH 2/2] feat(configure.sh): add admin delegation class for system tags Signed-off-by: Misha M.-Kupriyanov --- IONOS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IONOS b/IONOS index 0d518e210b96e..20ef06e9e3e39 160000 --- a/IONOS +++ b/IONOS @@ -1 +1 @@ -Subproject commit 0d518e210b96e2796f0ae44ef89693efde70ad07 +Subproject commit 20ef06e9e3e39cede6c92c845dc8a275e32d9872