Skip to content

Commit 433f2a9

Browse files
authored
Merge pull request #1528 from aboutcode-org/1287-resume-combining-affected-fixed-tabs
Match affected and fixed-by Packages
2 parents 021b568 + a4a3b3e commit 433f2a9

File tree

11 files changed

+723
-177
lines changed

11 files changed

+723
-177
lines changed

vulnerabilities/templates/package_details.html

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{% load humanize %}
33
{% load widget_tweaks %}
44
{% load static %}
5+
{% load url_filters %}
56

67
{% block title %}
78
VulnerableCode Package Details - {{ package.purl }}
@@ -91,7 +92,7 @@
9192
</td>
9293
<td class="two-col-right">
9394
{% if fixed_package_details.next_non_vulnerable.version %}
94-
<a href="/packages/{{ fixed_package_details.next_non_vulnerable }}?search={{ fixed_package_details.next_non_vulnerable }}"
95+
<a href="/packages/{{ fixed_package_details.next_non_vulnerable|url_quote }}?search={{ fixed_package_details.next_non_vulnerable }}"
9596
target="_self">{{ fixed_package_details.next_non_vulnerable.version }}</a>
9697
{% else %}
9798
<span class="emphasis-vulnerable">None.</span>
@@ -104,7 +105,7 @@
104105
</td>
105106
<td class="two-col-right">
106107
{% if fixed_package_details.latest_non_vulnerable.version %}
107-
<a href="/packages/{{ fixed_package_details.latest_non_vulnerable }}?search={{ fixed_package_details.latest_non_vulnerable }}"
108+
<a href="/packages/{{ fixed_package_details.latest_non_vulnerable|url_quote }}?search={{ fixed_package_details.latest_non_vulnerable }}"
108109
target="_self">{{ fixed_package_details.latest_non_vulnerable.version }}</a>
109110
{% else %}
110111
<span class="emphasis-vulnerable">None.</span>
@@ -119,15 +120,15 @@
119120

120121
<div class="content ml-3 mr-3 pb-1">
121122
<div class="has-text-weight-bold ml-1 mb-0 pb-0">
122-
<span class="affected-fixed">Vulnerabilities affecting</span> this package ({{ affected_by_vulnerabilities|length }})
123+
Vulnerabilities affecting this package ({{ affected_by_vulnerabilities|length }})
123124
</div>
124125

125126
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
126127
<thead>
127128
<tr>
128129
<th style="width: 200px;">Vulnerability</th>
129130
<th>Summary</th>
130-
<th style="width: 310px;"><span class="affected-fixed">Fixed by</span></th>
131+
<th style="width: 310px;">Fixed by</th>
131132
</tr>
132133
</thead>
133134

@@ -160,32 +161,28 @@
160161
{% for vuln in value %}
161162
{% if vuln.vulnerability.vulnerability_id == vulnerability.vulnerability_id %}
162163
{% if vuln.fixed_by_package_details is None %}
163-
<span class="emphasis-vulnerable">There are no reported <span
164-
class="affected-fixed">fixed by</span> versions.</span>
164+
<span class="emphasis-vulnerable">There are no reported fixed by versions.</span>
165165
{% else %}
166166
{% for fixed_pkg in vuln.fixed_by_package_details %}
167167
<section>
168168
{% if fixed_pkg.fixed_by_purl_vulnerabilities|length == 0 %}
169-
<a href="/packages/{{ fixed_pkg.fixed_by_purl }}?search={{ fixed_pkg.fixed_by_purl }}"
169+
<a href="/packages/{{ fixed_pkg.fixed_by_purl|url_quote }}?search={{ fixed_pkg.fixed_by_purl }}"
170170
target="_self">{{ fixed_pkg.fixed_by_purl.version }}</a>
171171
<br />
172-
<span class="emphasis-not-vulnerable"><span class="affected-fixed">Affected
173-
by</span> 0 other vulnerabilities.</span>
172+
<span class="emphasis-not-vulnerable">Affected by 0 other vulnerabilities.</span>
174173
{% else %}
175-
<a href="/packages/{{ fixed_pkg.fixed_by_purl }}?search={{ fixed_pkg.fixed_by_purl }}"
174+
<a href="/packages/{{ fixed_pkg.fixed_by_purl|url_quote }}?search={{ fixed_pkg.fixed_by_purl }}"
176175
target="_self">{{ fixed_pkg.fixed_by_purl.version }}</a>
177176
{% if fixed_pkg.fixed_by_purl_vulnerabilities|length != 1 %}
178177
<br />
179-
<span class="emphasis-vulnerable"><span class="affected-fixed">Affected
180-
by</span> {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other
178+
<span class="emphasis-vulnerable">Affected by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other
181179
vulnerabilities.</span>
182180
{% else %}
183181
<br />
184-
<span class="emphasis-vulnerable"><span class="affected-fixed">Affected
185-
by</span> {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other
182+
<span class="emphasis-vulnerable">Affected by {{ fixed_pkg.fixed_by_purl_vulnerabilities|length }} other
186183
vulnerability.</span>
187184
{% endif %}
188-
185+
189186
<div class="dropdown is-hoverable has-text-weight-normal is-right">
190187
<div class="dropdown-trigger">
191188
<i
@@ -196,8 +193,7 @@
196193
<div class="dropdown-content dropdown-instructions-box-shadow">
197194
<div class="dropdown-item">
198195
<div style="max-height: 200px; overflow-y: auto;">
199-
This version is <span class="affected-fixed">affected
200-
by</span> these other vulnerabilities:
196+
This version is affected by these other vulnerabilities:
201197
<div style="padding-top: 5px;">
202198
{% for fixed_by_vuln in fixed_pkg.fixed_by_purl_vulnerabilities %}
203199
<div>
@@ -226,8 +222,7 @@
226222
{% empty %}
227223
<tr>
228224
<td colspan="3">
229-
<span class="emphasis-not-vulnerable">This package is not known to be <span
230-
class="affected-fixed">affected by</span> vulnerabilities.</span>
225+
<span class="emphasis-not-vulnerable">This package is not known to be affected by vulnerabilities.</span>
231226
</td>
232227
</tr>
233228
{% endfor %}
@@ -237,7 +232,7 @@
237232

238233
<div class="content ml-3 mr-3 pb-0 mb-0">
239234
<div class="has-text-weight-bold ml-1 mb-0 pb-0">
240-
<span class="affected-fixed">Vulnerabilities fixed by</span> this package ({{ fixing_vulnerabilities|length }})
235+
Vulnerabilities fixed by this package ({{ fixing_vulnerabilities|length }})
241236
</div>
242237

243238
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
@@ -273,8 +268,7 @@
273268
{% empty %}
274269
<tr>
275270
<td colspan="3">
276-
This package is not known to <span class="affected-fixed">fix</span>
277-
vulnerabilities.
271+
This package is not known to fix vulnerabilities.
278272
</td>
279273
</tr>
280274
{% endfor %}
@@ -340,4 +334,4 @@
340334
</section>
341335
<script src="{% static 'js/main.js' %}" crossorigin="anonymous"></script>
342336
{% endif %}
343-
{% endblock %}
337+
{% endblock %}

vulnerabilities/templates/packages.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@
4141
<span
4242
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
4343
data-tooltip="This is the number of vulnerabilities that affect the package.">
44-
<span class="affected-fixed">Affected by</span> vulnerabilities
44+
Affected by vulnerabilities
4545
</span>
4646
</th>
4747
<th style="width: 225px;">
4848
<span
4949
class="has-tooltip-multiline has-tooltip-black has-tooltip-arrow has-tooltip-text-left"
5050
data-tooltip="This is the number of vulnerabilities fixed by the package.">
51-
<span class="affected-fixed">Fixing</span> vulnerabilities
51+
Fixing vulnerabilities
5252
</span>
5353
</th>
5454
</tr>

vulnerabilities/templates/vulnerabilities.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
<tr>
3333
<th>Vulnerability id</th>
3434
<th style="width: 225px;">Aliases</th>
35-
<th style="width: 225px;"><span class="affected-fixed">Affected</span> packages</th>
36-
<th style="width: 225px;"><span class="affected-fixed">Fixed by</span> packages</th>
35+
<th style="width: 225px;">Affected packages</th>
36+
<th style="width: 225px;">Fixed by packages</th>
3737
</tr>
3838
</thead>
3939
<tbody>

0 commit comments

Comments
 (0)