Skip to content

Commit 6630cae

Browse files
authored
Update ModerationSource values and documentation. (#8088)
* Update ModerationSource values and documentation. * Use trusted-flagger as the default value instead of the internal detection. * updated test
1 parent ef90118 commit 6630cae

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

app/lib/admin/actions/moderation_case_create.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Returns the fields on the newly created moderation case.
2222
'The email of the reporter. (default value: `[email protected]`)',
2323
'kind': 'The kind of the moderation case. (default value: `notification`)',
2424
'source':
25-
'The source of the moderation case. (default value: `internal-notification`)',
25+
'The source of the moderation case. (default value: `trusted-flagger`)',
2626
'subject': 'The subject of the moderation case.',
2727
'url': 'The url of the moderation case (optional).'
2828
},
@@ -37,7 +37,7 @@ Returns the fields on the newly created moderation case.
3737
InvalidInputException.check(
3838
ModerationKind.isValidKind(kind), 'invalid kind');
3939

40-
final source = options['source'] ?? ModerationSource.internalNotification;
40+
final source = options['source'] ?? ModerationSource.trustedFlagger;
4141
InvalidInputException.check(
4242
ModerationSource.isValidSource(source), 'invalid source');
4343

app/lib/admin/models.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class ModerationCase extends db.ExpandoModel<String> {
3434

3535
/// The source of the case, one of:
3636
/// - `external-notification`,
37-
/// - `internal-notification` (only used for reports from @google.com accounts), or,
37+
/// - `trusted-flagger`,
38+
/// - `authorities`,
39+
/// - `legal-referral`,
3840
/// - `automated-detection`. (will not be used)
3941
@db.StringProperty(required: true)
4042
late String source;
@@ -199,17 +201,17 @@ class ModerationCase extends db.ExpandoModel<String> {
199201

200202
abstract class ModerationSource {
201203
static const externalNotification = 'external-notification';
202-
static const internalNotification = 'internal-notification';
203204
static const trustedFlagger = 'trusted-flagger';
204205
static const authorities = 'authorities';
205206
static const legalReferral = 'legal-referral';
207+
static const automatedDetection = 'automated-detection';
206208

207209
static const _values = [
208210
externalNotification,
209-
internalNotification,
210211
trustedFlagger,
211212
authorities,
212213
legalReferral,
214+
automatedDetection,
213215
];
214216
static bool isValidSource(String value) => _values.contains(value);
215217
}

app/test/admin/moderation_case_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ void main() {
2626
'kind': 'notification',
2727
'opened': isNotEmpty,
2828
'resolved': null,
29-
'source': 'internal-notification',
29+
'source': 'trusted-flagger',
3030
'subject': 'package:oxygen',
3131
'isSubjectOwner': false,
3232
'url': null,

0 commit comments

Comments
 (0)