]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(activity): regroup Files and spltit sharing activity 46942/head
authorskjnldsv <skjnldsv@protonmail.com>
Thu, 1 Aug 2024 07:28:26 +0000 (09:28 +0200)
committerJohn Molakvoæ <skjnldsv@users.noreply.github.com>
Thu, 1 Aug 2024 09:03:24 +0000 (11:03 +0200)
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
apps/comments/lib/Activity/Setting.php
apps/files_sharing/lib/Activity/Settings/ShareActivitySettings.php
apps/systemtags/lib/Activity/Setting.php
lib/private/Activity/ActivitySettingsAdapter.php

index cc7c47784ac6e2cb91147fa091e95701bd0c0e47..9315aedc1044116ea03cc979c1073845f2a80801 100644 (file)
@@ -5,10 +5,10 @@
  */
 namespace OCA\Comments\Activity;
 
-use OCP\Activity\ISetting;
+use OCP\Activity\ActivitySettings;
 use OCP\IL10N;
 
-class Setting implements ISetting {
+class Setting extends ActivitySettings {
        public function __construct(
                protected IL10N $l,
        ) {
@@ -22,6 +22,14 @@ class Setting implements ISetting {
                return $this->l->t('<strong>Comments</strong> for files');
        }
 
+       public function getGroupIdentifier() {
+               return 'files';
+       }
+
+       public function getGroupName() {
+               return $this->l->t('Files');
+       }
+
        public function getPriority(): int {
                return 50;
        }
index 5a46a5cbd0262e169790e9c64eaf5fcc8b8f69af..e8547324f244e734b6c5fed665ec9a7378ee3e16 100644 (file)
@@ -23,10 +23,10 @@ abstract class ShareActivitySettings extends ActivitySettings {
        }
 
        public function getGroupIdentifier() {
-               return 'files';
+               return 'sharing';
        }
 
        public function getGroupName() {
-               return $this->l->t('Files');
+               return $this->l->t('Sharing');
        }
 }
index 92e9ee66392483fff0d4a36d459285abaa32092a..5f03d348235fca65e7e673f312c03ba50491755c 100644 (file)
@@ -5,19 +5,11 @@
  */
 namespace OCA\SystemTags\Activity;
 
-use OCP\Activity\ISetting;
+use OCP\Activity\ActivitySettings;
 use OCP\IL10N;
 
-class Setting implements ISetting {
-
-       /** @var IL10N */
-       protected $l;
-
-       /**
-        * @param IL10N $l
-        */
-       public function __construct(IL10N $l) {
-               $this->l = $l;
+class Setting extends ActivitySettings {
+       public function __construct(protected IL10N $l) {
        }
 
        /**
@@ -36,6 +28,22 @@ class Setting implements ISetting {
                return $this->l->t('<strong>System tags</strong> for a file have been modified');
        }
 
+       /**
+        * @return string Lowercase a-z and underscore only group identifier
+        * @since 20.0.0
+        */
+       public function getGroupIdentifier() {
+               return 'files';
+       }
+
+       /**
+        * @return string A translated string for the settings group
+        * @since 20.0.0
+        */
+       public function getGroupName() {
+               return $this->l->t('Files');
+       }
+
        /**
         * @return int whether the filter should be rather on the top or bottom of
         * the admin section. The filters are arranged in ascending order of the
index bc0e60c1acb3709a47c814266cab3f31a36ec0ff..5579685ccb82f87bdd27ff78e18f599da67a9bab 100644 (file)
@@ -17,12 +17,10 @@ use OCP\IL10N;
  * class based one
  */
 class ActivitySettingsAdapter extends ActivitySettings {
-       private $oldSettings;
-       private $l10n;
-
-       public function __construct(ISetting $oldSettings, IL10N $l10n) {
-               $this->oldSettings = $oldSettings;
-               $this->l10n = $l10n;
+       public function __construct(
+               private ISetting $oldSettings,
+               private IL10N $l10n
+       ) {
        }
 
        public function getIdentifier() {