Skip to content

Commit 3938052

Browse files
committed
fix(activity): regroup Files and spltit sharing activity
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
1 parent 8b238a2 commit 3938052

File tree

4 files changed

+35
-21
lines changed

4 files changed

+35
-21
lines changed

apps/comments/lib/Activity/Setting.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*/
66
namespace OCA\Comments\Activity;
77

8-
use OCP\Activity\ISetting;
8+
use OCP\Activity\ActivitySettings;
99
use OCP\IL10N;
1010

11-
class Setting implements ISetting {
11+
class Setting extends ActivitySettings {
1212
public function __construct(
1313
protected IL10N $l,
1414
) {
@@ -22,6 +22,14 @@ public function getName(): string {
2222
return $this->l->t('<strong>Comments</strong> for files');
2323
}
2424

25+
public function getGroupIdentifier() {
26+
return 'files';
27+
}
28+
29+
public function getGroupName() {
30+
return $this->l->t('Files');
31+
}
32+
2533
public function getPriority(): int {
2634
return 50;
2735
}

apps/files_sharing/lib/Activity/Settings/ShareActivitySettings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public function __construct(IL10N $l) {
2323
}
2424

2525
public function getGroupIdentifier() {
26-
return 'files';
26+
return 'sharing';
2727
}
2828

2929
public function getGroupName() {
30-
return $this->l->t('Files');
30+
return $this->l->t('Sharing');
3131
}
3232
}

apps/systemtags/lib/Activity/Setting.php

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,11 @@
55
*/
66
namespace OCA\SystemTags\Activity;
77

8-
use OCP\Activity\ISetting;
8+
use OCP\Activity\ActivitySettings;
99
use OCP\IL10N;
1010

11-
class Setting implements ISetting {
12-
13-
/** @var IL10N */
14-
protected $l;
15-
16-
/**
17-
* @param IL10N $l
18-
*/
19-
public function __construct(IL10N $l) {
20-
$this->l = $l;
11+
class Setting extends ActivitySettings {
12+
public function __construct(protected IL10N $l) {
2113
}
2214

2315
/**
@@ -36,6 +28,22 @@ public function getName() {
3628
return $this->l->t('<strong>System tags</strong> for a file have been modified');
3729
}
3830

31+
/**
32+
* @return string Lowercase a-z and underscore only group identifier
33+
* @since 20.0.0
34+
*/
35+
public function getGroupIdentifier() {
36+
return 'files';
37+
}
38+
39+
/**
40+
* @return string A translated string for the settings group
41+
* @since 20.0.0
42+
*/
43+
public function getGroupName() {
44+
return $this->l->t('Files');
45+
}
46+
3947
/**
4048
* @return int whether the filter should be rather on the top or bottom of
4149
* the admin section. The filters are arranged in ascending order of the

lib/private/Activity/ActivitySettingsAdapter.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717
* class based one
1818
*/
1919
class ActivitySettingsAdapter extends ActivitySettings {
20-
private $oldSettings;
21-
private $l10n;
22-
23-
public function __construct(ISetting $oldSettings, IL10N $l10n) {
24-
$this->oldSettings = $oldSettings;
25-
$this->l10n = $l10n;
20+
public function __construct(
21+
private ISetting $oldSettings,
22+
private IL10N $l10n
23+
) {
2624
}
2725

2826
public function getIdentifier() {

0 commit comments

Comments
 (0)