Skip to content

Commit d72a8cd

Browse files
committed
Display a warning notification on the analyzed_package project page
Signed-off-by: tdruez <[email protected]>
1 parent 91b3d98 commit d72a8cd

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<section class="pt-0 mx-5 mb-3">
2+
<article class="message is-warning">
3+
<div class="message-body">
4+
<p class="block">
5+
<span class="icon width-1 height-1 mr-1">
6+
<i class="fa-solid fa-info-circle"></i>
7+
</span>
8+
<span>
9+
This package analysis was initiated for the
10+
<strong>
11+
<a href="{% url 'package_detail' project.analyzed_package.project.slug project.analyzed_package.uuid %}">
12+
{{ project.analyzed_package.package_url }}
13+
</a>
14+
</strong>
15+
package of the
16+
<strong>
17+
<a href="{% url 'project_detail' project.analyzed_package.project.slug %}">
18+
{{ project.analyzed_package.project.slug }}
19+
</a>
20+
</strong>
21+
project.
22+
</span>
23+
</p>
24+
</div>
25+
</article>
26+
</section>

scanpipe/templates/scanpipe/project_detail.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
</section>
5555

5656
<hr class="mx-5 mt-0">
57+
58+
{% if project.analyzed_package %}
59+
{% include "scanpipe/includes/project_analyzed_package_warning.html" %}
60+
{% endif %}
5761
{% include "scanpipe/includes/project_summary_level.html" with project=project title_class="title" %}
5862

5963
<section class="pt-0 mx-5">

scanpipe/tests/test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,6 +2503,7 @@ def test_scanpipe_package_model_integrity_with_toolkit_package_model(self):
25032503
"resolved_from_dependencies",
25042504
"parent_packages",
25052505
"children_packages",
2506+
"analysis_subproject",
25062507
"notes",
25072508
]
25082509

scanpipe/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,11 +1662,13 @@ def get_queryset(self):
16621662
"package_uid",
16631663
*PACKAGE_URL_FIELDS,
16641664
"project",
1665+
"download_url",
16651666
"primary_language",
16661667
"declared_license_expression",
16671668
"compliance_alert",
16681669
"copyright",
16691670
"affected_by_vulnerabilities",
1671+
"analysis_subproject",
16701672
)
16711673
.with_resources_count()
16721674
.order_by_package_url()

0 commit comments

Comments
 (0)