fix(web): show source mismatch reason in status chain
This commit is contained in:
@@ -276,8 +276,16 @@ export function AwoooPStatusChainPanel({
|
||||
no_incident_context: t("source.verificationStatuses.noIncidentContext"),
|
||||
fetch_failed: t("source.verificationStatuses.fetchFailed"),
|
||||
};
|
||||
const sourceReasonLabels: Record<string, string> = {
|
||||
provider_heartbeat_present_but_no_incident_match: t("source.reasons.providerHeartbeatNoMatch"),
|
||||
no_matching_provider_source_event: t("source.reasons.noMatchingProviderSourceEvent"),
|
||||
no_incident_ids: t("source.reasons.noIncidentIds"),
|
||||
incident_not_found: t("source.reasons.incidentNotFound"),
|
||||
source_correlation_fetch_failed: t("source.reasons.fetchFailed"),
|
||||
};
|
||||
const sourceStatus = String(sourceCorrelation?.status ?? "missing");
|
||||
const sourceVerificationStatus = String(sourceCorrelation?.verification_status ?? sourceStatus);
|
||||
const sourceMissingReason = String(sourceCorrelation?.missing_reason ?? "");
|
||||
const topAppliedLink = sourceCorrelation?.top_candidates?.find(
|
||||
(item) => item.link_state === "applied"
|
||||
);
|
||||
@@ -398,6 +406,7 @@ export function AwoooPStatusChainPanel({
|
||||
}),
|
||||
detail: t("toolchain.sourceDetail", {
|
||||
providers: sourceProviderSummary || emptyLabel,
|
||||
reason: sourceReasonLabels[sourceMissingReason] ?? valueOrEmpty(sourceMissingReason, emptyLabel),
|
||||
}),
|
||||
},
|
||||
{
|
||||
@@ -603,7 +612,7 @@ export function AwoooPStatusChainPanel({
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-5">
|
||||
<div className="grid gap-px bg-[#e0ddd4] md:grid-cols-6">
|
||||
<div className="min-w-0 bg-white px-4 py-3">
|
||||
<p className="text-xs font-semibold text-[#77736a]">{t("source.status")}</p>
|
||||
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceStatusLabels[sourceStatus] ?? sourceStatus}>
|
||||
@@ -635,6 +644,15 @@ export function AwoooPStatusChainPanel({
|
||||
{latestAppliedLabel}
|
||||
</p>
|
||||
</div>
|
||||
<div className="min-w-0 bg-white px-4 py-3">
|
||||
<p className="text-xs font-semibold text-[#77736a]">{t("source.reason")}</p>
|
||||
<p
|
||||
className="mt-2 truncate font-mono text-sm text-[#141413]"
|
||||
title={sourceReasonLabels[sourceMissingReason] ?? sourceMissingReason}
|
||||
>
|
||||
{sourceReasonLabels[sourceMissingReason] ?? valueOrEmpty(sourceMissingReason, emptyLabel)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="min-w-0 bg-white px-4 py-3">
|
||||
<p className="text-xs font-semibold text-[#77736a]">{t("source.providers")}</p>
|
||||
<p className="mt-2 truncate font-mono text-sm text-[#141413]" title={sourceProviderSummary}>
|
||||
|
||||
Reference in New Issue
Block a user