mirror of
https://github.com/boostorg/website-v2.git
synced 2026-01-19 04:42:17 +00:00
Tweaks to report formatting and new library handling (#2051)
This commit is contained in:
@@ -84,4 +84,4 @@ class SiteSettings(models.Model):
|
||||
|
||||
@property
|
||||
def wordcloud_ignore_set(self):
|
||||
return set(x.strip() for x in self.wordcloud_ignore.split(","))
|
||||
return set(x.strip().lower() for x in self.wordcloud_ignore.split(","))
|
||||
|
||||
@@ -341,7 +341,9 @@ class CreateReportForm(CreateReportFullForm):
|
||||
library_data = get_library_data(library_order, prior_version.pk, version.pk)
|
||||
slack_stats = get_slack_stats(prior_version, version)
|
||||
|
||||
library_index_library_data = get_libraries_for_index(library_data, version)
|
||||
library_index_library_data = get_libraries_for_index(
|
||||
library_data, version, prior_version
|
||||
)
|
||||
batched_library_data = conditional_batched(
|
||||
library_data,
|
||||
2,
|
||||
@@ -463,7 +465,9 @@ class CreateReportForm(CreateReportFullForm):
|
||||
library_data = get_library_data(library_order, prior_version.pk, version.pk)
|
||||
slack_stats = get_slack_stats(prior_version, version)
|
||||
|
||||
library_index_library_data = get_libraries_for_index(library_data, version)
|
||||
library_index_library_data = get_libraries_for_index(
|
||||
library_data, version, prior_version
|
||||
)
|
||||
batched_library_data = conditional_batched(
|
||||
library_data,
|
||||
2,
|
||||
|
||||
@@ -642,13 +642,29 @@ def get_slack_channels():
|
||||
)
|
||||
|
||||
|
||||
def get_libraries_for_index(library_data, version: Version):
|
||||
def get_libraries_for_index(
|
||||
library_data, version: Version, prior_version: Version | None = None
|
||||
):
|
||||
library_index_library_data = []
|
||||
|
||||
# Get libraries that existed in prior version
|
||||
prior_version_library_ids = set()
|
||||
if prior_version:
|
||||
prior_version_library_ids = set(
|
||||
LibraryVersion.objects.filter(version=prior_version).values_list(
|
||||
"library_id", flat=True
|
||||
)
|
||||
)
|
||||
|
||||
changed_libraries = {lib["library"] for lib in library_data}
|
||||
|
||||
for library in get_libraries_by_quality(version):
|
||||
is_changed = library in changed_libraries
|
||||
is_new = library.id not in prior_version_library_ids
|
||||
library_index_library_data.append(
|
||||
(
|
||||
library,
|
||||
library in [lib["library"] for lib in library_data],
|
||||
is_changed or is_new,
|
||||
)
|
||||
)
|
||||
return library_index_library_data
|
||||
|
||||
@@ -232,7 +232,7 @@ ul.slack-channels li div a:hover,
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col justify-center">
|
||||
<div class="flex flex-col justify-center flex-1">
|
||||
<h3 class="mx-auto">Most Committed Libraries</h3>
|
||||
<div id="top-committed-libraries-chart" class="w-full text-center"></div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user