Skip to content

Commit b73b43c

Browse files
committed
Merge branch 'master' into feat/sass-import-deprecation
2 parents aac6384 + e6bb800 commit b73b43c

35 files changed

+380
-122
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ AppEngine version, listed here to ease deployment and troubleshooting.
33

44
## Next Release (replace with git tag when deployed)
55

6+
## `20241022t092400-all`
7+
* Bumped runtimeVersion to `2024.10.21`.
8+
69
## `20241017t095600-all`
710
* Bumped runtimeVersion to `2024.10.15`.
811
* Upgraded pana to `0.22.13`.

app/lib/admin/backend.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -929,4 +929,16 @@ class AdminBackend {
929929
_logger.info('Deleting moderated user: ${user.userId}');
930930
}
931931
}
932+
933+
/// Whether the [ModerationCase] has been appealed by [email] already.
934+
Future<bool> isModerationCaseAppealedByEmail({
935+
required String caseId,
936+
required String email,
937+
}) async {
938+
final query = dbService.query<ModerationCase>()
939+
..filter('appealedCaseId =', caseId);
940+
final list = await query.run().toList();
941+
final emails = list.map((mc) => mc.reporterEmail).toSet();
942+
return emails.contains(email);
943+
}
932944
}

app/lib/frontend/handlers/documentation.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,11 @@ Future<ResolvedDocUrlVersion> _resolveDocUrlVersion(
167167
}
168168

169169
// Select the closest version (may be the same as version) that has a finished analysis.
170-
final closest = await taskBackend.closestFinishedVersion(package, version);
170+
final closest = await taskBackend.closestFinishedVersion(
171+
package,
172+
version,
173+
preferDocsCompleted: true,
174+
);
171175
return ResolvedDocUrlVersion(
172176
version: closest ?? version,
173177
urlSegment: closest ?? version,

app/lib/frontend/handlers/experimental.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import '../../shared/cookie_utils.dart';
99
const _publicFlags = <String>{
1010
'dark',
1111
'search-completion',
12+
'download-counts',
1213
};
1314

1415
const _allFlags = <String>{
@@ -89,6 +90,8 @@ class ExperimentalFlags {
8990
bool get isDarkModeEnabled => isEnabled('dark');
9091
bool get isDarkModeDefault => isEnabled('dark-as-default');
9192

93+
bool get showDownloadCounts => isEnabled('download-counts');
94+
9295
String encodedAsCookie() => _enabled.join(':');
9396

9497
@override

app/lib/frontend/handlers/report.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,17 @@ Future<Message> processReportPageHandler(
206206

207207
final isAppeal = form.caseId != null;
208208

209+
if (isAppeal) {
210+
final appealExists = await adminBackend.isModerationCaseAppealedByEmail(
211+
caseId: form.caseId!,
212+
email: userEmail!,
213+
);
214+
if (appealExists) {
215+
throw InvalidInputException(
216+
'You have previously appealed this incident, we are unable to accept another appeal.');
217+
}
218+
}
219+
209220
bool isSubjectOwner = false;
210221
if (user != null) {
211222
if (subject.isPackage) {

app/lib/frontend/templates/listing.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,14 @@ d.Node? _nameMatches(SearchForm form, List<String>? matches) {
135135
: 'Matching package ${singular ? 'name' : 'names'}: ';
136136

137137
return d.p(children: [
138-
d.b(text: nameMatchLabel),
138+
d.text(nameMatchLabel),
139139
...matches.expandIndexed((i, name) {
140140
return [
141141
if (i > 0) d.text(', '),
142-
d.code(child: d.a(href: urls.pkgPageUrl(name), text: name)),
142+
d.a(
143+
href: urls.pkgPageUrl(name),
144+
child: d.b(text: name),
145+
),
143146
];
144147
}),
145148
]);

app/lib/frontend/templates/package_misc.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ d.Node labeledScoresNodeFromPackageView(PackageView view, {String? version}) {
197197
likeCount: view.likes,
198198
grantedPubPoints: view.grantedPubPoints,
199199
popularity: view.popularity,
200+
thirtyDaysDownloads: view.thirtyDaysDownloadCounts,
200201
);
201202
}
202203

app/lib/frontend/templates/report.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,9 @@ Iterable<d.Node> _appeal(
208208
'(source repositories, screenshots, logs, bug tracker entries, etc) '
209209
'consider uploading these and sharing a link.',
210210
),
211+
d.p(
212+
child: d.b(text: 'You can appeal at most once per case.'),
213+
),
211214
if (!(sessionData?.isAuthenticated ?? false))
212215
d.fragment([
213216
d.p(text: 'Contact information:'),

app/lib/frontend/templates/views/pkg/index.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ d.Node packageListingNode({
2020
}) {
2121
final innerContent = d.fragment([
2222
listingInfo,
23-
if (nameMatches != null) nameMatches,
23+
if (nameMatches != null)
24+
d.div(classes: ['listing-highlight-block'], child: nameMatches),
2425
packageList,
2526
if (pagination != null) pagination,
2627
d.markdown('Check our help page for details on '

0 commit comments

Comments
 (0)