Skip to content

Commit eec05bb

Browse files
authored
Add JS clickable tab link functionality (#1288)
1 parent f8412dc commit eec05bb

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

CHANGELOG.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@ Release notes
22
=============
33

44

5+
Next Release
6+
------------
7+
8+
- We fixed a text-overflow issue in the Essentials tab of the Vulnerability details template.
9+
- We added clickable links to the Essentials tab of the Vulnerability details template that enable
10+
the user to navigate to the Fixed by packages tab and the Affected packages tab.
11+
12+
513
Version v33.4.0
614
----------------
715

@@ -12,21 +20,21 @@ Version v33.4.0
1220
Version v33.3.0
1321
----------------
1422

15-
- We filtered out the weakness that are not presented in the
16-
cwe2.database before passing them into the vulnerability details view.
23+
- We filtered out the weakness that are not presented in the
24+
cwe2.database before passing them into the vulnerability details view.
1725

1826

1927
Version v33.2.0
2028
-----------------
2129

22-
- We fixed NVD importer to import the latest data by adding weakness
30+
- We fixed NVD importer to import the latest data by adding weakness
2331
in unique content ID for advisories.
2432

2533

2634
Version v33.1.0
2735
-----------------
2836

29-
- We have paginated the default improver and added keyboard interrupt support for import and improve processes.
37+
- We have paginated the default improver and added keyboard interrupt support for import and improve processes.
3038
- We bumped PyYaml to 6.0.1 and saneyaml to 0.6.0 and dropped docker-compose.
3139

3240

@@ -56,9 +64,9 @@ Version v32.0.0rc4
5664
-------------------
5765

5866
- We added loading of env for GitHub datasource in vulntotal.
59-
- We fixed import process in github importer in vulnerablecode reported here
67+
- We fixed import process in github importer in vulnerablecode reported here
6068
https://github.com/nexB/vulnerablecode/issues/1142.
61-
- We added an improver to get all package versions
69+
- We added an improver to get all package versions
6270
of all ecosystems for a range of affected packages.
6371
- We added documentation for configuring throttling rate for API endpoints.
6472
- We fixed kbmsr2019 importer.

vulnerabilities/templates/vulnerability_details.html

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@
138138
{% if fixed_by_packages|length > 3 %}
139139
<tr>
140140
<td>
141-
... see <i>Fixed by packages</i> tab for more
141+
See <a href="#" onclick="goToTab('fixed-by')"><i>Fixed by packages</i></a> tab for more
142142
</td>
143143
</tr>
144144
{% endif %}
@@ -167,7 +167,7 @@
167167
{% if affected_packages|length > 3 %}
168168
<tr>
169169
<td>
170-
... see <i>Affected packages</i> tab for more
170+
See <a href="#" onclick="goToTab('affected-packages')"><i>Affected packages</i></a> tab for more
171171
</td>
172172
</tr>
173173
{% endif %}
@@ -293,4 +293,21 @@
293293

294294
<script src="{% static 'js/main.js' %}" crossorigin="anonymous"></script>
295295

296+
<script>
297+
function goToTab(tabName) {
298+
const activeLink = document.querySelector('div.tabs.is-boxed li.is-active');
299+
const activeTabContent = document.querySelector('div.tab-div.is-active');
300+
301+
activeLink.classList.remove('is-active');
302+
activeTabContent.classList.remove('is-active');
303+
304+
const target_id = document.querySelector(`[data-tab='${tabName}']`);
305+
const targetTabContent = document.querySelector(`[data-content='${tabName}']`);
306+
307+
target_id.classList.add('is-active');
308+
targetTabContent.classList.add('is-active');
309+
}
310+
</script>
311+
312+
296313
{% endblock %}

0 commit comments

Comments
 (0)