Skip to content

Commit

Permalink
fix(activity): regroup Files and spltit sharing activity
Browse files Browse the repository at this point in the history
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Aug 1, 2024
1 parent c52b7e5 commit 80231e6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
12 changes: 10 additions & 2 deletions apps/comments/lib/Activity/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
Expand All @@ -22,6 +22,14 @@ public function getName(): string {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public function __construct(IL10N $l) {
}

public function getGroupIdentifier() {
return 'files';
return 'sharing';
}

public function getGroupName() {
return $this->l->t('Files');
return $this->l->t('Sharing');
}
}
30 changes: 19 additions & 11 deletions apps/systemtags/lib/Activity/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
}

/**
Expand All @@ -36,6 +28,22 @@ public function getName() {
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
Expand Down
10 changes: 4 additions & 6 deletions lib/private/Activity/ActivitySettingsAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
* 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() {
Expand Down

0 comments on commit 80231e6

Please sign in to comment.