This commit is contained in:
+11
-12
@@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
window.showUpsell = function(featureName) {
|
window.showUpsell = function(featureName) {
|
||||||
const featureNameEl = document.getElementById('upsellFeatureName');
|
const featureNameEl = document.getElementById('upsellFeatureName');
|
||||||
const modalEl = document.getElementById('upsellModal');
|
const modalEl = document.getElementById('upsellModal');
|
||||||
@@ -10,7 +9,6 @@ window.showUpsell = function(featureName) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
window.renderMarkdown = function(text) {
|
window.renderMarkdown = function(text) {
|
||||||
if (!text) return "<i style='color:#94a3b8;'>No description provided.</i>";
|
if (!text) return "<i style='color:#94a3b8;'>No description provided.</i>";
|
||||||
let html = text.replace(/!\[.*?\]\((.*?)\)/g, '<br><img src="$1" style="max-width: 100%; max-height: 400px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 4px; margin: 10px 0; display: block; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);"><br>');
|
let html = text.replace(/!\[.*?\]\((.*?)\)/g, '<br><img src="$1" style="max-width: 100%; max-height: 400px; object-fit: contain; border: 1px solid #e2e8f0; border-radius: 4px; margin: 10px 0; display: block; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);"><br>');
|
||||||
@@ -18,13 +16,11 @@ window.renderMarkdown = function(text) {
|
|||||||
return html;
|
return html;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
window.updateDrawerPreview = function() {
|
window.updateDrawerPreview = function() {
|
||||||
const rawDesc = document.getElementById('drawerDescEdit').value;
|
const rawDesc = document.getElementById('drawerDescEdit').value;
|
||||||
document.getElementById('drawerDescPreview').innerHTML = renderMarkdown(rawDesc);
|
document.getElementById('drawerDescPreview').innerHTML = renderMarkdown(rawDesc);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
window.openDrawer = function(id, title, asset, severity) {
|
window.openDrawer = function(id, title, asset, severity) {
|
||||||
document.getElementById('drawerTicketID').value = id;
|
document.getElementById('drawerTicketID').value = id;
|
||||||
document.getElementById('drawerTitle').innerText = title;
|
document.getElementById('drawerTitle').innerText = title;
|
||||||
@@ -34,9 +30,7 @@ window.openDrawer = function(id, title, asset, severity) {
|
|||||||
badge.innerText = severity;
|
badge.innerText = severity;
|
||||||
badge.className = `badge ${severity.toLowerCase()}`;
|
badge.className = `badge ${severity.toLowerCase()}`;
|
||||||
|
|
||||||
document.getElementById('drawerSeverity').value = severity;
|
// Read hidden inputs from the table row
|
||||||
document.getElementById('drawerComment').value = "";
|
|
||||||
|
|
||||||
const rawDesc = document.getElementById('desc-' + id) ? document.getElementById('desc-' + id).value : "";
|
const rawDesc = document.getElementById('desc-' + id) ? document.getElementById('desc-' + id).value : "";
|
||||||
const rawRem = document.getElementById('rem-' + id) ? document.getElementById('rem-' + id).value : "";
|
const rawRem = document.getElementById('rem-' + id) ? document.getElementById('rem-' + id).value : "";
|
||||||
const rawEv = document.getElementById('ev-' + id) ? document.getElementById('ev-' + id).value : "";
|
const rawEv = document.getElementById('ev-' + id) ? document.getElementById('ev-' + id).value : "";
|
||||||
@@ -44,6 +38,10 @@ window.openDrawer = function(id, title, asset, severity) {
|
|||||||
const rawComment = document.getElementById('comment-' + id) ? document.getElementById('comment-' + id).value : "";
|
const rawComment = document.getElementById('comment-' + id) ? document.getElementById('comment-' + id).value : "";
|
||||||
const assignee = document.getElementById('assignee-' + id) ? document.getElementById('assignee-' + id).value : "";
|
const assignee = document.getElementById('assignee-' + id) ? document.getElementById('assignee-' + id).value : "";
|
||||||
|
|
||||||
|
// Set initial values in the drawer
|
||||||
|
document.getElementById('drawerSeverity').value = severity;
|
||||||
|
document.getElementById('drawerStatus').value = status; // Pre-select current status
|
||||||
|
document.getElementById('drawerComment').value = "";
|
||||||
document.getElementById('drawerDescEdit').value = rawDesc;
|
document.getElementById('drawerDescEdit').value = rawDesc;
|
||||||
document.getElementById('drawerRemEdit').value = rawRem;
|
document.getElementById('drawerRemEdit').value = rawRem;
|
||||||
|
|
||||||
@@ -307,13 +305,14 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
|
|
||||||
const assigneeInput = document.getElementById("drawerAssignee");
|
const assigneeInput = document.getElementById("drawerAssignee");
|
||||||
const newAssignee = assigneeInput ? assigneeInput.value.trim() : "";
|
const newAssignee = assigneeInput ? assigneeInput.value.trim() : "";
|
||||||
const currentStatus = document.getElementById("status-" + id).value;
|
|
||||||
|
|
||||||
let newStatus = currentStatus;
|
// Explicitly grab the selected status from the new dropdown
|
||||||
if (newAssignee !== "" && newAssignee !== "Unassigned") {
|
let explicitStatus = document.getElementById("drawerStatus").value;
|
||||||
|
let newStatus = explicitStatus;
|
||||||
|
|
||||||
|
// Helpful UX: If they typed an email but left the status as "Waiting", auto-assign it
|
||||||
|
if (newAssignee !== "" && newAssignee !== "Unassigned" && explicitStatus === "Waiting to be Triaged") {
|
||||||
newStatus = "Assigned Out";
|
newStatus = "Assigned Out";
|
||||||
} else if (currentStatus === "Returned to Security") {
|
|
||||||
newStatus = "Waiting to be Triaged";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!comment.trim()) return alert("An audit trail comment is strictly required when modifying a finding.");
|
if (!comment.trim()) return alert("An audit trail comment is strictly required when modifying a finding.");
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
<textarea id="drawerRemEdit" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; resize: vertical; min-height: 80px;"></textarea>
|
<textarea id="drawerRemEdit" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; resize: vertical; min-height: 80px;"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px;">
|
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; margin-bottom: 20px;">
|
||||||
<div>
|
<div>
|
||||||
<label style="font-weight: bold; color: #334155; display: block; margin-bottom: 5px;">Adjust Severity:</label>
|
<label style="font-weight: bold; color: #334155; display: block; margin-bottom: 5px;">Adjust Severity:</label>
|
||||||
<select id="drawerSeverity" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem;">
|
<select id="drawerSeverity" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem;">
|
||||||
@@ -101,6 +101,18 @@
|
|||||||
<option value="Info">Info</option>
|
<option value="Info">Info</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label style="font-weight: bold; color: #334155; display: block; margin-bottom: 5px;">Adjust Status:</label>
|
||||||
|
<select id="drawerStatus" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem;">
|
||||||
|
<option value="Waiting to be Triaged">Waiting to be Triaged</option>
|
||||||
|
<option value="Assigned Out">Assigned Out</option>
|
||||||
|
<option value="Returned to Security">Returned to Security</option>
|
||||||
|
<option value="Patched">Remediated</option>
|
||||||
|
<option value="False Positive">False Positive</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label style="font-weight: bold; color: #334155; display: block; margin-bottom: 5px;">Assign to IT (Email):</label>
|
<label style="font-weight: bold; color: #334155; display: block; margin-bottom: 5px;">Assign to IT (Email):</label>
|
||||||
<input type="text" id="drawerAssignee" placeholder="e.g. sysadmin@company.com" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem; box-sizing: border-box;">
|
<input type="text" id="drawerAssignee" placeholder="e.g. sysadmin@company.com" style="width: 100%; padding: 10px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.95rem; box-sizing: border-box;">
|
||||||
|
|||||||
Reference in New Issue
Block a user