fix(activity): regroup Files and spltit sharing activity

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
This commit is contained in:
skjnldsv 2024-08-01 09:28:26 +02:00 committed by John Molakvoæ
parent c52b7e5ebc
commit 80231e60aa
4 changed files with 35 additions and 21 deletions

View 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;
}

View 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');
}
}

View 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

View 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() {