fix
This commit is contained in:
1 parent
176b1fe47f
commit
3bfeb6b61e
8 files changed
+264
-32
No files matched your search
@@ -74,6 +74,8 @@
|
||||
nextSortState,
|
||||
parseSyncIntervalMinutes,
|
||||
sortFeedListRows,
|
||||
syncJobDiagnostic,
|
||||
syncJobDisplayStatus,
|
||||
syncJobProductsLabel,
|
||||
syncJobStatusTone
|
||||
} from "$lib/feeds-list-controls";
|
||||
@@ -686,7 +688,29 @@
|
||||
notifyError(error, { alert: "sync_fail" });
|
||||
return;
|
||||
}
|
||||
const diagnostic = syncJobDiagnostic(job);
|
||||
const displayStatus = syncJobDisplayStatus(job);
|
||||
if (displayStatus === "skipped all" || displayStatus === "empty") {
|
||||
error = diagnostic || i18n.t("feeds.syncFailed");
|
||||
notifyError(error, {
|
||||
alert: "sync_fail",
|
||||
actions: [{ label: i18n.t("feeds.mapFields"), href: `/feeds/${id}/mapping` }]
|
||||
});
|
||||
await load();
|
||||
return;
|
||||
}
|
||||
const products = syncJobProductsLabel(job);
|
||||
if (diagnostic) {
|
||||
// Valid rows were imported; do not show a contradictory full-success toast.
|
||||
success = i18n.t("flash.feed.syncFinishedNamed", {
|
||||
name: feed.name ?? id,
|
||||
status: "partial",
|
||||
products
|
||||
});
|
||||
notifyError(diagnostic, { alert: "sync_partial" });
|
||||
await load();
|
||||
return;
|
||||
}
|
||||
success = i18n.t("flash.feed.syncFinishedNamed", { name: feed.name ?? id, status, products });
|
||||
notifySuccess(i18n.t("toast.feed.syncFinished"), {
|
||||
alert: "sync_done",
|
||||
@@ -1385,12 +1409,12 @@
|
||||
{#each historyJobs as job (job.id)}
|
||||
<TableRow>
|
||||
<TableCell>
|
||||
<Badge variant="outline" class={`capitalize ${syncJobStatusTone(job.status)}`}>
|
||||
{job.status ?? "—"}
|
||||
<Badge variant="outline" class={`capitalize ${syncJobStatusTone(syncJobDisplayStatus(job))}`}>
|
||||
{syncJobDisplayStatus(job)}
|
||||
</Badge>
|
||||
{#if job.error}
|
||||
<p class="mt-1 max-w-xs truncate text-xs text-destructive" title={String(job.error)}>
|
||||
{job.error}
|
||||
{#if syncJobDiagnostic(job)}
|
||||
<p class="mt-1 max-w-sm whitespace-normal break-words text-xs text-destructive">
|
||||
{syncJobDiagnostic(job)}
|
||||
</p>
|
||||
{/if}
|
||||
</TableCell>
|
||||
|
||||
Reference in new issue
Block a user