Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(activity): regroup Files and split sharing activity #46942

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading