admin docs: only list objects that actually exist (drop dead/phantom rows)

Filter the documents list to objects that exist in storage, so stray keys (a
template pdf_minio_path, or a phantom mcs150 esign_records row on a UCR order
from the shared remediation pipeline) no longer surface as dead rows. The UI
drops the now-unreachable 'not generated yet' branch.
This commit is contained in:
justin 2026-06-16 02:37:33 -05:00
parent c8e0065729
commit 8e1e2f16bf
2 changed files with 10 additions and 8 deletions

View file

@ -401,13 +401,12 @@
box.innerHTML = documents.map((d) => {
const u = API + "/api/v1/admin/compliance-orders/" + encodeURIComponent(orderNumber)
+ "/document?key=" + encodeURIComponent(d.key) + "&token=" + tok;
const action = (d.exists === false)
? `<span class="small" style="color:#9ca3af;">not generated yet</span>`
: `<a href="${u}" target="_blank" rel="noopener" class="btn btn-blue btn-sm" style="text-decoration:none;">View</a>`;
return `<div class="svc-row"><div class="svc-left">
<span style="font-size:13px;">${esc(d.label)}</span>
<span class="small">${esc(d.key.split("/").pop())}</span>
</div><div class="svc-right">${action}</div></div>`;
</div><div class="svc-right">
<a href="${u}" target="_blank" rel="noopener" class="btn btn-blue btn-sm" style="text-decoration:none;">View</a>
</div></div>`;
}).join("");
} catch (e) {
box.innerHTML = `<div style="color:#b91c1c;font-size:12px;">Could not load documents: ${esc(e.message)}</div>`;