patched status change bug
Build and Release Core / Test and Build (push) Failing after 5m19s

This commit is contained in:
t
2026-05-08 09:53:34 -04:00
parent bda39c40f6
commit 5184ad2a35
2 changed files with 24 additions and 13 deletions
+11 -12
View File
@@ -1,4 +1,3 @@
window.showUpsell = function(featureName) {
const featureNameEl = document.getElementById('upsellFeatureName');
const modalEl = document.getElementById('upsellModal');
@@ -10,7 +9,6 @@ window.showUpsell = function(featureName) {
}
};
window.renderMarkdown = function(text) {
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>');
@@ -18,13 +16,11 @@ window.renderMarkdown = function(text) {
return html;
};
window.updateDrawerPreview = function() {
const rawDesc = document.getElementById('drawerDescEdit').value;
document.getElementById('drawerDescPreview').innerHTML = renderMarkdown(rawDesc);
};
window.openDrawer = function(id, title, asset, severity) {
document.getElementById('drawerTicketID').value = id;
document.getElementById('drawerTitle').innerText = title;
@@ -34,9 +30,7 @@ window.openDrawer = function(id, title, asset, severity) {
badge.innerText = severity;
badge.className = `badge ${severity.toLowerCase()}`;
document.getElementById('drawerSeverity').value = severity;
document.getElementById('drawerComment').value = "";
// Read hidden inputs from the table row
const rawDesc = document.getElementById('desc-' + id) ? document.getElementById('desc-' + id).value : "";
const rawRem = document.getElementById('rem-' + id) ? document.getElementById('rem-' + 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 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('drawerRemEdit').value = rawRem;
@@ -307,13 +305,14 @@ document.addEventListener("DOMContentLoaded", function() {
const assigneeInput = document.getElementById("drawerAssignee");
const newAssignee = assigneeInput ? assigneeInput.value.trim() : "";
const currentStatus = document.getElementById("status-" + id).value;
let newStatus = currentStatus;
if (newAssignee !== "" && newAssignee !== "Unassigned") {
// Explicitly grab the selected status from the new dropdown
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";
} 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.");