Skip to content

Commit

Permalink
Display VCID in modal title #98
Browse files Browse the repository at this point in the history
Signed-off-by: tdruez <[email protected]>
  • Loading branch information
tdruez committed Nov 25, 2024
1 parent bbd769c commit 3135c69
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Vulnerability analysis</h5>
<h5 class="modal-title">
Vulnerability analysis:
<strong id="analysis-vulnerability-id"></strong>
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<form autocomplete="off" method="post" id="vulnerability-analysis-form">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,11 +244,10 @@
let button = $(event.relatedTarget); // Button that triggered the modal
// Extract info from data-* attributes
let edit_url = button.data('edit-url');
let is_addition = button.data('is-addition');
let submit_label = is_addition ? 'Add' : 'Update';
let vulnerability_id = button.data('vulnerability-id');

$('#submit-vulnerability-analysis-form').data('edit-url', edit_url);
<!-- $('#edit-productrelation-modal #title-add-update').text(submit_label);-->
$('#vulnerability-analysis-modal #analysis-vulnerability-id').text(vulnerability_id);

$.ajax({
url: edit_url,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@
{% endif %}
</td>
<td class="p-1">
<span data-bs-toggle="modal" data-bs-target="#vulnerability-analysis-modal" class=""
<span data-bs-toggle="modal"
data-bs-target="#vulnerability-analysis-modal"
data-vulnerability-id="{{ vulnerability.vulnerability_id }}"
data-edit-url="{{ product.get_absolute_url }}vulnerability_analysis_ajax_view/?vulnerability_id={{ vulnerability.vulnerability_id }}"
>
<button type="button" data-bs-toggle="tooltip" title="Edit" class="btn btn-link p-0" aria-label="Edit">
Expand Down

0 comments on commit 3135c69

Please sign in to comment.