Skip to content

Commit

Permalink
Multiple adjustments #98
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Nov 27, 2024
1 parent 05ee85f commit 9db7348
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h5>
<strong id="analysis-vulnerability-id"></strong>
</h5>
<div>
Package: <strong id="analysis-package-purl"></strong>
Package: <strong id="analysis-package-identifier"></strong>
</div>
</div>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,11 @@
// Extract info from data-* attributes
let edit_url = button.data('edit-url');
let vulnerability_id = button.data('vulnerability-id');
let package_purl = button.data('package-purl');
let package_identifier = button.data('package-identifier');

$('#submit-vulnerability-analysis-form').data('edit-url', edit_url);
$('#vulnerability-analysis-modal #analysis-vulnerability-id').text(vulnerability_id);
$('#vulnerability-analysis-modal #analysis-package-purl').text(package_purl);
$('#vulnerability-analysis-modal #analysis-package-identifier').text(package_identifier);

$.ajax({
url: edit_url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<td rowspan="{{ affected_packages_count }}">
{{ vulnerability.weighted_severity|default_if_none:"" }}
</td>
<td rowspan="{{ affected_packages_count }}" class="fs-110pct">
<td rowspan="{{ affected_packages_count }}" class="fs-110pct">
{% include 'vulnerabilities/includes/risk_score_badge.html' with risk_score=vulnerability.risk_score only %}
</td>
{% for package in vulnerability.affected_packages.all %}
Expand Down Expand Up @@ -72,7 +72,7 @@
<span data-bs-toggle="modal"
data-bs-target="#vulnerability-analysis-modal"
data-vulnerability-id="{{ vulnerability.vulnerability_id }}"
data-package-purl="{{ package.package_url }}"
data-package-identifier="{{ package.identifier }}"
data-edit-url="{{ product.get_absolute_url }}vulnerability_analysis_ajax_view/?vulnerability_id={{ vulnerability.vulnerability_id }}&package_uuid={{ package.uuid }}"
>
<button type="button" data-bs-toggle="tooltip" title="Edit" class="btn btn-link p-0" aria-label="Edit">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Generated by Django 5.0.9 on 2024-11-25 16:26

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('product_portfolio', '0008_productdependency_is_resolved_to_is_pinned'),
('vulnerabilities', '0003_vulnerabilityanalysis'),
]

operations = [
migrations.AlterField(
model_name='vulnerabilityanalysis',
name='product_package',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='vulnerability_analyses', to='product_portfolio.productpackage'),
),
]
2 changes: 0 additions & 2 deletions vulnerabilities/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,6 @@ class VulnerabilityAnalysis(
to="product_portfolio.ProductPackage",
related_name="vulnerability_analyses",
on_delete=models.CASCADE,
null=True,
blank=True,
)

class Meta:
Expand Down

0 comments on commit 9db7348

Please sign in to comment.