feat(hk): explain background updates with protected content links and retry details
CI / check (push) Failing after 1m34s
CI / deploy (push) Skipped
CI / publish-container (push) Skipped

This commit is contained in:
Simo committed 2026-09-13 19:41:25 +02:00
1 parent dd7613850e
commit c5c9941768
42 files changed
+1542 -145

No files matched your search

+119
View File
@@ -0,0 +1,119 @@
import { useTranslations } from "next-intl";
import { Button } from "@/components/ui/button";
import {
DeliveryCard,
type DeliveryCardItem,
} from "@/features/operations/delivery-card";
import { deliveryContext } from "@/features/operations/delivery-context";
const shared: Omit<DeliveryCardItem, "id" | "operationId" | "context"> = {
topic: "news.refresh",
status: "pending",
attempts: 2,
actorId: 7,
createdAt: "2030-01-01T11:00:00Z",
availableAt: "2030-01-01T12:05:00Z",
hasError: true,
};
const records: DeliveryCardItem[] = [
{
...shared,
id: "delivery-authorized-news-1234567890",
operationId: "operation-authorized-news-1234567890",
context: deliveryContext(
"news.update",
JSON.stringify({
articleId: "9007199254740993",
articleTitle: `Community update: ${"SummerFestival".repeat(14)}`,
internalNotes: "SERIALIZED_METADATA_SECRET",
lastError: "INTERNAL_FILE_PATH_SECRET",
}),
{ news: true, catalog: false },
),
},
{
...shared,
id: "delivery-failed-catalog-1234567890",
operationId: "operation-failed-catalog-1234567890",
topic: "catalog.refresh",
status: "failed",
attempts: 5,
context: deliveryContext("catalog.bulk.apply", '{"changedCount":9}', {
news: false,
catalog: true,
}),
},
{
...shared,
id: "delivery-restricted-news",
operationId: "operation-restricted-news",
hasError: false,
context: deliveryContext(
"news.update",
'{"articleTitle":"RESTRICTED_NEWS_TITLE","articleId":"99"}',
{ news: false, catalog: true },
),
},
{
...shared,
id: "delivery-restricted-catalog",
operationId: "operation-restricted-catalog",
topic: "catalog.refresh",
hasError: false,
context: deliveryContext("catalog.bulk.apply", '{"changedCount":489}', {
news: true,
catalog: false,
}),
},
{
...shared,
id: "delivery-unknown",
operationId: "operation-unknown",
topic: "future.topic",
status: "future.status",
actorId: 0,
createdAt: "invalid",
context: deliveryContext(
"future.operation",
'{"articleTitle":"UNKNOWN_OPERATION_SECRET"}',
{ news: true, catalog: true },
),
},
{
...shared,
id: "delivery-completed-export",
operationId: "operation-completed-export",
topic: "catalog.export.request",
status: "done",
hasError: false,
context: deliveryContext("catalog.bulk.apply", '{"changedCount":4}', {
news: false,
catalog: true,
}),
},
];
export function DeliveriesHarness() {
const t = useTranslations("pages.admin.deliveries");
return (
<section aria-label="Delivery review" className="min-w-0 space-y-4">
<p>{t("scope")}</p>
<ul className="space-y-3">
{records.map((item) => (
<li key={item.id}>
<DeliveryCard
item={item}
retry={
item.status === "failed" ? (
<Button type="button" variant="outline">
{t("retry")}
</Button>
) : undefined
}
/>
</li>
))}
</ul>
</section>
);
}
+15 -6
View File
@@ -7,6 +7,7 @@ import { CmsSettingsForm } from "@/app/admin/settings/cms-settings-form";
import { TicketsTable } from "@/app/admin/tickets/tickets-table";
import { ArticleForm } from "@/components/admin/article-form";
import { FurnitureSyncQueue } from "@/components/admin/studio/furniture-sync-queue";
import { OrganizeImportsLauncher } from "@/components/admin/studio/organize-imports-launcher";
import { StudioClient } from "@/components/admin/studio/studio-client";
import { NotificationCenter } from "@/features/notifications/notification-center";
import type { ArticleSaveResult } from "@/lib/article-input";
@@ -15,6 +16,7 @@ import { themePaletteCss } from "@/lib/theme-css";
import { PRESETS } from "@/lib/theme-presets";
import messages from "@/messages/en.json";
import { AttachmentHarness } from "./attachment-harness";
import { DeliveriesHarness } from "./deliveries-harness";
import { FurnitureJobsHarness } from "./furniture-jobs-harness";
import { fixtureAction } from "./server-actions";
import { UnsavedHarness } from "./unsaved-harness";
@@ -120,18 +122,25 @@ createRoot(root).render(
? "Support desk"
: route.includes("articles")
? "News editor"
: "Furniture synchronization"}
: route.includes("deliveries-harness")
? "Background updates"
: "Furniture synchronization"}
</h1>
{route.includes("notifications") ? (
<NotificationCenter userId={7} />
) : route.includes("deliveries-harness") ? (
<DeliveriesHarness />
) : route.includes("unsaved-harness") ? (
<UnsavedHarness />
) : route.includes("studio-harness") ? (
<StudioClient
source={buildFurniImportSource("it")}
initialTree={[]}
defaultTranslate={false}
/>
<>
<OrganizeImportsLauncher />
<StudioClient
source={buildFurniImportSource("it")}
initialTree={[]}
defaultTranslate={false}
/>
</>
) : route.includes("attachment-harness") ? (
<AttachmentHarness />
) : route.includes("events/recovery") ? (
+3
View File
@@ -32,3 +32,6 @@ export const deleteImportedFurni = (input: unknown) =>
fixtureAction("delete-imported-furni", input);
export const setFurnidataTranslateEnabled = (input: unknown) =>
fixtureAction("furnidata-translation", input);
export const organizeImportFurni = (input: unknown) =>
fixtureAction("organize-import-furni", input);