Skip to content

Commit cc56909

Browse files
Merge pull request #4791 from LibreSign/feat/add-group-activity
feat: add group activity
2 parents a34effb + fff9afe commit cc56909

File tree

3 files changed

+42
-29
lines changed

3 files changed

+42
-29
lines changed

appinfo/info.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Developed with ❤️ by [LibreCode](https://librecode.coop). Help us transform
7171
</settings>
7272
<activity>
7373
<settings>
74-
<setting>OCA\Libresign\Activity\FileToSign</setting>
74+
<setting>OCA\Libresign\Activity\Settings\FileToSign</setting>
7575
</settings>
7676
<filters>
7777
<filter>OCA\Libresign\Activity\Filter</filter>

lib/Activity/Settings/FileToSign.php

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* SPDX-FileCopyrightText: 2025 LibreCode coop and contributors
6+
* SPDX-License-Identifier: AGPL-3.0-or-later
7+
*/
8+
9+
namespace OCA\Libresign\Activity\Settings;
10+
11+
use OCP\IL10N;
12+
13+
class FileToSign extends LibresignActivitySettings {
14+
public function __construct(
15+
protected IL10N $l,
16+
) {
17+
}
18+
19+
/**
20+
* @return string Lowercase a-z and underscore only identifier. The type of table activity
21+
* @since 20.0.0
22+
*/
23+
public function getIdentifier(): string {
24+
return 'file_to_sign';
25+
}
26+
27+
/**
28+
* @return string A translated string
29+
* @since 11.0.0
30+
*/
31+
public function getName(): string {
32+
return $this->l->t('You have a <strong>file to sign</strong>');
33+
}
34+
}

lib/Activity/FileToSign.php renamed to lib/Activity/Settings/LibresignActivitySettings.php

+7-28
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,29 @@
11
<?php
22

33
declare(strict_types=1);
4+
45
/**
56
* SPDX-FileCopyrightText: 2020-2024 LibreCode coop and contributors
67
* SPDX-License-Identifier: AGPL-3.0-or-later
78
*/
8-
9-
namespace OCA\Libresign\Activity;
9+
namespace OCA\Libresign\Activity\Settings;
1010

1111
use OCP\Activity\ActivitySettings;
12-
use OCP\IL10N;
13-
14-
class FileToSign extends ActivitySettings {
15-
public function __construct(
16-
protected IL10N $l,
17-
) {
18-
}
1912

20-
/**
21-
* @return string Lowercase a-z and underscore only identifier. The type of table activity
22-
* @since 20.0.0
23-
*/
24-
public function getIdentifier(): string {
25-
return 'file_to_sign';
26-
}
27-
28-
/**
29-
* @return string A translated string
30-
* @since 11.0.0
31-
*/
32-
public function getName(): string {
33-
return $this->l->t('You have a <strong>file to sign</strong>');
34-
}
13+
abstract class LibresignActivitySettings extends ActivitySettings {
3514

3615
/**
3716
* {@inheritdoc}
3817
*/
39-
public function getGroupIdentifier(): string {
40-
return 'other';
18+
public function getGroupIdentifier() {
19+
return 'libresign';
4120
}
4221

4322
/**
4423
* {@inheritdoc}
4524
*/
46-
public function getGroupName(): string {
47-
return $this->l->t('Other activities');
25+
public function getGroupName() {
26+
return 'LibreSign';
4827
}
4928

5029
/**

0 commit comments

Comments
 (0)