From ccd00caeca5e8a38abe871f3288a925b2a3648ac Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Mon, 30 Sep 2024 12:31:04 +0200 Subject: [PATCH 1/3] Update ModerationSource values and documentation. --- app/lib/admin/models.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/lib/admin/models.dart b/app/lib/admin/models.dart index fc00c01d0f..dd44b7fcea 100644 --- a/app/lib/admin/models.dart +++ b/app/lib/admin/models.dart @@ -34,7 +34,9 @@ class ModerationCase extends db.ExpandoModel { /// The source of the case, one of: /// - `external-notification`, - /// - `internal-notification` (only used for reports from @google.com accounts), or, + /// - `trusted-flagger`, + /// - `authorities`, + /// - `legal-referral`, /// - `automated-detection`. (will not be used) @db.StringProperty(required: true) late String source; @@ -199,17 +201,17 @@ class ModerationCase extends db.ExpandoModel { abstract class ModerationSource { static const externalNotification = 'external-notification'; - static const internalNotification = 'internal-notification'; static const trustedFlagger = 'trusted-flagger'; static const authorities = 'authorities'; static const legalReferral = 'legal-referral'; + static const automatedDetection = 'automated-detection'; static const _values = [ externalNotification, - internalNotification, trustedFlagger, authorities, legalReferral, + automatedDetection, ]; static bool isValidSource(String value) => _values.contains(value); } From 0bafd514185ed902b1a0e437665696d221fe461d Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Mon, 30 Sep 2024 15:15:35 +0200 Subject: [PATCH 2/3] Use trusted-flagger as the default value instead of the internal detection. --- app/lib/admin/actions/moderation_case_create.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/admin/actions/moderation_case_create.dart b/app/lib/admin/actions/moderation_case_create.dart index 7af60e896c..fdfd8c4c8f 100644 --- a/app/lib/admin/actions/moderation_case_create.dart +++ b/app/lib/admin/actions/moderation_case_create.dart @@ -22,7 +22,7 @@ Returns the fields on the newly created moderation case. 'The email of the reporter. (default value: `support@pub.dev`)', 'kind': 'The kind of the moderation case. (default value: `notification`)', 'source': - 'The source of the moderation case. (default value: `internal-notification`)', + 'The source of the moderation case. (default value: `trusted-flagger`)', 'subject': 'The subject of the moderation case.', 'url': 'The url of the moderation case (optional).' }, @@ -37,7 +37,7 @@ Returns the fields on the newly created moderation case. InvalidInputException.check( ModerationKind.isValidKind(kind), 'invalid kind'); - final source = options['source'] ?? ModerationSource.internalNotification; + final source = options['source'] ?? ModerationSource.trustedFlagger; InvalidInputException.check( ModerationSource.isValidSource(source), 'invalid source'); From e761ba7c48c8bc62cb3de3a37d0b8c14147114c1 Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Mon, 30 Sep 2024 15:25:02 +0200 Subject: [PATCH 3/3] updated test --- app/test/admin/moderation_case_test.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/admin/moderation_case_test.dart b/app/test/admin/moderation_case_test.dart index 91caac71c0..6bbfb560e0 100644 --- a/app/test/admin/moderation_case_test.dart +++ b/app/test/admin/moderation_case_test.dart @@ -26,7 +26,7 @@ void main() { 'kind': 'notification', 'opened': isNotEmpty, 'resolved': null, - 'source': 'internal-notification', + 'source': 'trusted-flagger', 'subject': 'package:oxygen', 'isSubjectOwner': false, 'url': null,