From 4564be24fd7ceebdc8ca673d9e2115de65344c04 Mon Sep 17 00:00:00 2001 From: Ayan Sinha Mahapatra Date: Mon, 21 Jul 2025 15:27:38 +0530 Subject: [PATCH] Fix license detections page error and improve UI Reference: https://github.com/aboutcode-org/scancode.io/issues/1750 Signed-off-by: Ayan Sinha Mahapatra --- scanpipe/filters.py | 4 ++ scanpipe/models.py | 1 - .../scanpipe/license_detection_list.html | 16 ++++---- .../panels/license_clarity_panel.html | 2 +- .../panels/license_detections_summary.html | 38 ++++++++++++++----- .../panels/resource_status_summary.html | 2 +- .../scanpipe/panels/scan_summary_panel.html | 4 +- scanpipe/views.py | 19 +++++++--- 8 files changed, 58 insertions(+), 28 deletions(-) diff --git a/scanpipe/filters.py b/scanpipe/filters.py index e8d5846eec..1a063d730d 100644 --- a/scanpipe/filters.py +++ b/scanpipe/filters.py @@ -840,6 +840,8 @@ class LicenseFilterSet(FilterSetUtilsMixin, django_filters.FilterSet): "compliance_alert", "license_expression", "license_expression_spdx", + "is_license_clue", + "needs_review", ] search = DiscoveredLicenseSearchFilter( @@ -853,6 +855,8 @@ class LicenseFilterSet(FilterSetUtilsMixin, django_filters.FilterSet): "license_expression", "license_expression_spdx", "compliance_alert", + "is_license_clue", + "needs_review", ], ) license_expression = django_filters.AllValuesFilter() diff --git a/scanpipe/models.py b/scanpipe/models.py index ac28627808..dd3f353c7f 100644 --- a/scanpipe/models.py +++ b/scanpipe/models.py @@ -2537,7 +2537,6 @@ class Meta: """ license_expression_field = None - license_expression_spdx_field = None class Compliance(models.TextChoices): OK = "ok" diff --git a/scanpipe/templates/scanpipe/license_detection_list.html b/scanpipe/templates/scanpipe/license_detection_list.html index 6ea52f5196..364e8c98e8 100644 --- a/scanpipe/templates/scanpipe/license_detection_list.html +++ b/scanpipe/templates/scanpipe/license_detection_list.html @@ -26,12 +26,12 @@ {{ license_detection.identifier }} {% if license_detection.needs_review %} - + {% endif %} {% if license_detection.has_compliance_alert %} - + {% endif %} @@ -50,13 +50,13 @@ {{ license_detection.needs_review }} - {% if display_compliance_alert %} - - - {{ license_detection.compliance_alert }} - - + + {% if display_compliance_alert %} + + {{ license_detection.compliance_alert }} + {% endif %} + {% empty %} diff --git a/scanpipe/templates/scanpipe/panels/license_clarity_panel.html b/scanpipe/templates/scanpipe/panels/license_clarity_panel.html index 457b5b7ceb..78927ba526 100644 --- a/scanpipe/templates/scanpipe/panels/license_clarity_panel.html +++ b/scanpipe/templates/scanpipe/panels/license_clarity_panel.html @@ -1,4 +1,4 @@ -
+
License clarity {% include "scanpipe/dropdowns/help_dropdown_tooltip.html" with content="License clarity is a set of metrics that indicate how clearly, comprehensively and accurately a software project has defined and communicated the licensing that applies to the software." only %} diff --git a/scanpipe/templates/scanpipe/panels/license_detections_summary.html b/scanpipe/templates/scanpipe/panels/license_detections_summary.html index d31b5e41ab..3e41b6ae81 100644 --- a/scanpipe/templates/scanpipe/panels/license_detections_summary.html +++ b/scanpipe/templates/scanpipe/panels/license_detections_summary.html @@ -1,16 +1,32 @@ {% load humanize %} {% if license_detection_summary %} -
+
+
+
+ Unique license detections + {% include "scanpipe/dropdowns/help_dropdown_tooltip.html" with content="All unique license detections in the codebase identified by matched license text and other license match characteristics. Also contains other license clues." only %} +
+
+
+
{% endif %} \ No newline at end of file diff --git a/scanpipe/templates/scanpipe/panels/resource_status_summary.html b/scanpipe/templates/scanpipe/panels/resource_status_summary.html index 9040e16ca7..4330d97f95 100644 --- a/scanpipe/templates/scanpipe/panels/resource_status_summary.html +++ b/scanpipe/templates/scanpipe/panels/resource_status_summary.html @@ -1,7 +1,7 @@ {% load humanize %} {% if resource_status_summary %}
-