Skip to content

Commit f240333

Browse files
committed
Update Dependency field labels #447
* Remove related dependencies when resetting a project Signed-off-by: Jono Yang <[email protected]>
1 parent 310097a commit f240333

File tree

4 files changed

+41
-12
lines changed

4 files changed

+41
-12
lines changed

scanpipe/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ def reset(self, keep_input=True):
480480
self.projecterrors,
481481
self.runs,
482482
self.discoveredpackages,
483+
self.discovereddependencys,
483484
self.codebaseresources,
484485
]
485486

scanpipe/templates/scanpipe/dependency_list.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
1919
<thead>
2020
<tr>
21-
<th>purl</th>
22-
<th>extracted_requirement</th>
21+
<th>Package URL</th>
22+
<th>Extracted requirement</th>
2323
<th>scope</th>
24-
<th>is_runtime</th>
25-
<th>is_optional</th>
26-
<th>is_resolved</th>
27-
<th>dependency_uid</th>
28-
<th>for_package_uid</th>
29-
<th>datafile_path</th>
30-
<th>datasource_id</th>
24+
<th>Is runtime</th>
25+
<th>Is optional</th>
26+
<th>Is resolved</th>
27+
<th>Dependency UID</th>
28+
<th>For package UID</th>
29+
<th>Datafile path</th>
30+
<th>Datasource ID</th>
3131
</tr>
3232
</thead>
3333
<tbody>
@@ -51,13 +51,13 @@
5151
<td>
5252
{{ dependency.is_resolved }}
5353
</td>
54-
<td style="min-width: 500px;" title="{{ dependency.dependency_uid }}">
54+
<td style="min-width: 400px;" title="{{ dependency.dependency_uid }}">
5555
{{ dependency.dependency_uid }}
5656
</td>
57-
<td style="min-width: 500px;" title="{{ dependency.for_package_uid }}">
57+
<td style="min-width: 400px;" title="{{ dependency.for_package_uid }}">
5858
{{ dependency.for_package_uid }}
5959
</td>
60-
<td style="min-width: 500px;" title="{{ dependency.datafile_path }}">
60+
<td style="min-width: 400px;" title="{{ dependency.datafile_path }}">
6161
{{ dependency.datafile_path }}
6262
</td>
6363
<td>

scanpipe/templates/scanpipe/includes/project_list_table.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<tr>
55
<th>Name</th>
66
<th>Packages</th>
7+
<th>Dependencies</th>
78
<th>Resources</th>
89
<th>Errors</th>
910
<th>Pipelines</th>
@@ -28,6 +29,17 @@
2829
</span>
2930
{% endif %}
3031
</td>
32+
<td>
33+
{% if project.dependency_count %}
34+
<a href="{% url 'project_dependencies' project.uuid %}">
35+
{{ project.dependency_count|intcomma }}
36+
</a>
37+
{% else %}
38+
<span>
39+
{{ project.dependency_count|intcomma }}
40+
</span>
41+
{% endif %}
42+
</td>
3143
<td>
3244
{% if project.resource_count %}
3345
<a href="{% url 'project_resources' project.uuid %}">

scanpipe/templates/scanpipe/includes/project_summary_level.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@
1616
</p>
1717
</div>
1818
</div>
19+
<div class="level-item has-text-centered">
20+
<div>
21+
<p class="heading">Dependencies</p>
22+
<p class="{{ title_class }}">
23+
{% if project.dependency_count %}
24+
<a href="{% url 'project_dependencies' project.uuid %}">
25+
{{ project.dependency_count|intcomma }}
26+
</a>
27+
{% else %}
28+
<span>
29+
{{ project.dependency_count|intcomma }}
30+
</span>
31+
{% endif %}
32+
</p>
33+
</div>
34+
</div>
1935
<div class="level-item has-text-centered">
2036
<div>
2137
<p class="heading">Resources</p>

0 commit comments

Comments
 (0)