refactor: remove Fix Receipts UI section
Fix Receipts was showing 'No fixes logged' most of the time since: - Runbooks were removed - Remediation logging was inconsistent Just adds visual clutter without value. Removed ~100 lines of UI code.
This commit is contained in:
parent
284ca0271b
commit
7e66423042
1 changed files with 2 additions and 105 deletions
|
|
@ -3282,111 +3282,8 @@ function OverviewTab(props: {
|
|||
</div>
|
||||
</Show>
|
||||
|
||||
<Show when={remediationLoadingByFinding()[finding.id] || remediationErrorsByFinding()[finding.id] || remediationsByFinding()[finding.id] !== undefined}>
|
||||
<div class="mt-3 p-3 rounded-lg border border-emerald-200 dark:border-emerald-800 bg-emerald-50/40 dark:bg-emerald-900/10">
|
||||
<div class="text-xs font-medium text-emerald-700 dark:text-emerald-300 mb-2">
|
||||
Pulse Fix Receipts
|
||||
</div>
|
||||
<Show when={remediationLoadingByFinding()[finding.id]}>
|
||||
<div class="text-xs text-gray-500 dark:text-gray-400 flex items-center gap-2">
|
||||
<span class="h-3 w-3 border-2 border-current border-t-transparent rounded-full animate-spin" />
|
||||
Loading fix history...
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={remediationErrorsByFinding()[finding.id]}>
|
||||
<div class="text-xs text-red-600 dark:text-red-400">
|
||||
{remediationErrorsByFinding()[finding.id]}
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={!remediationLoadingByFinding()[finding.id]}>
|
||||
<Show when={remediationLockedByFinding()[finding.id]}>
|
||||
<div class="rounded-md border border-amber-200 dark:border-amber-800 bg-amber-50 dark:bg-amber-900/20 p-2 text-xs text-amber-800 dark:text-amber-200">
|
||||
<div class="flex items-center justify-between gap-2">
|
||||
<div>
|
||||
<p class="font-medium">Pulse Pro required</p>
|
||||
<p class="text-[11px] text-amber-700 dark:text-amber-300 mt-1">
|
||||
Upgrade to view detailed fix receipts for this finding.
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
class="text-[11px] font-medium text-amber-800 dark:text-amber-200 underline"
|
||||
href={remediationUpgradeURLByFinding()[finding.id] || patrolUpgradeURL()}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
Upgrade
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={!remediationLockedByFinding()[finding.id] && (remediationsByFinding()[finding.id] || []).length > 0} fallback={
|
||||
<Show when={!remediationLockedByFinding()[finding.id]}>
|
||||
<div class="text-xs text-gray-500 dark:text-gray-400">
|
||||
No fixes logged for this finding yet.
|
||||
</div>
|
||||
</Show>
|
||||
}>
|
||||
<div class="space-y-2">
|
||||
<For each={remediationsByFinding()[finding.id]}>
|
||||
{(remediation) => {
|
||||
const [showEvidence, setShowEvidence] = createSignal(false);
|
||||
const hasEvidence = Boolean(remediation.output && remediation.output.trim());
|
||||
return (
|
||||
<div class="rounded-md border border-emerald-100 dark:border-emerald-800 bg-white/70 dark:bg-gray-900/40 p-2 text-xs">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class={`px-1.5 py-0.5 rounded-full text-[10px] font-semibold ${remediation.outcome === 'resolved'
|
||||
? 'bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300'
|
||||
: remediation.outcome === 'partial'
|
||||
? 'bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300'
|
||||
: remediation.outcome === 'failed'
|
||||
? 'bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300'
|
||||
: 'bg-gray-100 text-gray-700 dark:bg-gray-700 dark:text-gray-300'
|
||||
}`}>
|
||||
{remediation.outcome}
|
||||
</span>
|
||||
<Show when={remediation.automatic}>
|
||||
<span class="px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-blue-100 text-blue-700 dark:bg-blue-900/40 dark:text-blue-300">
|
||||
Auto-Fix
|
||||
</span>
|
||||
</Show>
|
||||
<span class="text-gray-500 dark:text-gray-400">
|
||||
{formatTimestamp(remediation.timestamp)}
|
||||
</span>
|
||||
<Show when={hasEvidence}>
|
||||
<button
|
||||
class="ml-auto text-[10px] font-medium text-emerald-700 dark:text-emerald-300 underline"
|
||||
onClick={() => setShowEvidence(!showEvidence())}
|
||||
type="button"
|
||||
>
|
||||
{showEvidence() ? 'Hide evidence' : 'Show evidence'}
|
||||
</button>
|
||||
</Show>
|
||||
</div>
|
||||
<div class="text-gray-700 dark:text-gray-200 font-medium mt-1">
|
||||
{remediation.action}
|
||||
</div>
|
||||
<div class="text-gray-500 dark:text-gray-400">
|
||||
{remediation.problem}
|
||||
</div>
|
||||
<Show when={remediation.note}>
|
||||
<div class="text-gray-500 dark:text-gray-400 mt-1">
|
||||
{remediation.note}
|
||||
</div>
|
||||
</Show>
|
||||
<Show when={showEvidence() && hasEvidence}>
|
||||
<pre class="mt-2 text-[11px] text-gray-600 dark:text-gray-300 bg-gray-100 dark:bg-gray-800/60 rounded p-2 whitespace-pre-wrap">
|
||||
{remediation.output}
|
||||
</pre>
|
||||
</Show>
|
||||
</div>
|
||||
);
|
||||
}}
|
||||
</For>
|
||||
</div>
|
||||
</Show>
|
||||
</Show>
|
||||
</div>
|
||||
</Show>
|
||||
{/* Fix Receipts section removed - was showing "No fixes logged" without runbooks */}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</Show>
|
||||
|
|
|
|||
Loading…
Reference in a new issue