Skip to content

Commit

Permalink
Add JS clickable tab link functionality (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmhoran authored Aug 31, 2023
1 parent f8412dc commit eec05bb
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
20 changes: 14 additions & 6 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ Release notes
=============


Next Release
------------

- We fixed a text-overflow issue in the Essentials tab of the Vulnerability details template.
- We added clickable links to the Essentials tab of the Vulnerability details template that enable
the user to navigate to the Fixed by packages tab and the Affected packages tab.


Version v33.4.0
----------------

Expand All @@ -12,21 +20,21 @@ Version v33.4.0
Version v33.3.0
----------------

- We filtered out the weakness that are not presented in the
cwe2.database before passing them into the vulnerability details view.
- We filtered out the weakness that are not presented in the
cwe2.database before passing them into the vulnerability details view.


Version v33.2.0
-----------------

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


Version v33.1.0
-----------------

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


Expand Down Expand Up @@ -56,9 +64,9 @@ Version v32.0.0rc4
-------------------

- We added loading of env for GitHub datasource in vulntotal.
- We fixed import process in github importer in vulnerablecode reported here
- We fixed import process in github importer in vulnerablecode reported here
https://github.com/nexB/vulnerablecode/issues/1142.
- We added an improver to get all package versions
- We added an improver to get all package versions
of all ecosystems for a range of affected packages.
- We added documentation for configuring throttling rate for API endpoints.
- We fixed kbmsr2019 importer.
Expand Down
21 changes: 19 additions & 2 deletions vulnerabilities/templates/vulnerability_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
{% if fixed_by_packages|length > 3 %}
<tr>
<td>
... see <i>Fixed by packages</i> tab for more
See <a href="#" onclick="goToTab('fixed-by')"><i>Fixed by packages</i></a> tab for more
</td>
</tr>
{% endif %}
Expand Down Expand Up @@ -167,7 +167,7 @@
{% if affected_packages|length > 3 %}
<tr>
<td>
... see <i>Affected packages</i> tab for more
See <a href="#" onclick="goToTab('affected-packages')"><i>Affected packages</i></a> tab for more
</td>
</tr>
{% endif %}
Expand Down Expand Up @@ -293,4 +293,21 @@

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

<script>
function goToTab(tabName) {
const activeLink = document.querySelector('div.tabs.is-boxed li.is-active');
const activeTabContent = document.querySelector('div.tab-div.is-active');

activeLink.classList.remove('is-active');
activeTabContent.classList.remove('is-active');

const target_id = document.querySelector(`[data-tab='${tabName}']`);
const targetTabContent = document.querySelector(`[data-content='${tabName}']`);

target_id.classList.add('is-active');
targetTabContent.classList.add('is-active');
}
</script>


{% endblock %}

0 comments on commit eec05bb

Please sign in to comment.