Files
HiveGrid-Wireframes/03 Quellen und Referenzen/hivegrid-cloud/apps/web/app/components/screens/ak-p21-interim.visual-fixture.tsx
T

149 lines
4.7 KiB
TypeScript

// AK-P21 Interim-UI (AD-28) — deterministic fixture VMs for the privacy
// interim visual baseline. Marked as INTERIM baseline: re-baseline is
// mandatory when David's final D-P21 optics land.
import {
buildAvvVM,
buildGdprExportJobsVM,
buildPrivacyHubVM,
buildSubprocessorsVM,
buildTenantDeletionVM,
} from "@hivegrid/view-models";
import { AvvPage } from "./privacy/AvvPage";
import { GdprExportJobsPage } from "./privacy/GdprExportJobsPage";
import { PrivacyHubPage } from "./privacy/PrivacyHubPage";
import { SubprocessorsPage } from "./privacy/SubprocessorsPage";
import { TenantDeletionPage } from "./privacy/TenantDeletionPage";
export const AK_P21_INTERIM_VISUAL_SCREENS = ["hub", "export-jobs", "deletion", "subprocessors", "avv"] as const;
export type AkP21InterimVisualScreen = (typeof AK_P21_INTERIM_VISUAL_SCREENS)[number];
const NOW = "2026-07-12T12:00:00.000Z";
const exportJobInputs = [
{
id: "job-ready",
scope: "user_self",
status: "ready",
progressPercent: 100,
resultSizeBytes: 4_194_304,
resultExpiresAt: "2026-07-14T12:00:00.000Z",
downloadCount: 1,
createdAt: "2026-07-11T12:00:00.000Z",
},
{
id: "job-processing",
scope: "tenant_full",
status: "processing",
progressPercent: 40,
resultSizeBytes: null,
resultExpiresAt: null,
downloadCount: 0,
createdAt: "2026-07-12T10:00:00.000Z",
},
{
id: "job-expired",
scope: "user_self",
status: "ready",
progressPercent: 100,
resultSizeBytes: 1_024,
resultExpiresAt: "2026-07-10T12:00:00.000Z",
downloadCount: 0,
createdAt: "2026-07-07T12:00:00.000Z",
},
] as const;
export function createAkP21InterimVisualVMs() {
return {
hub: buildPrivacyHubVM({
now: NOW,
tenantSlug: "acme",
graceDays: 30,
userEmail: "anna@example.test",
userPendingDeletion: false,
userScheduledDeletionAt: null,
recentJobs: [...exportJobInputs],
userSelfCountLast24h: 1,
userSelfLimitPer24h: 3,
permissions: { tenantExport: true, tenantDeletion: true, subprocessors: true, avv: true },
activeTenantDeletion: { id: "req-1", gracePeriodEndsAt: "2026-08-01T12:00:00.000Z" },
}),
exportJobs: buildGdprExportJobsVM({
now: NOW,
jobs: [...exportJobInputs],
userSelfCountLast24h: 1,
tenantFullActive: true,
tenantExportAllowed: true,
userSelfLimitPer24h: 3,
downloadTtlHours: 72,
}),
deletion: buildTenantDeletionVM({
now: NOW,
tenantSlug: "acme",
graceDays: 30,
requiresOtp: true,
request: {
id: "req-1",
status: "pending",
reason: "voluntary",
reasonText: null,
gracePeriodEndsAt: "2026-08-01T12:00:00.000Z",
createdAt: "2026-07-02T12:00:00.000Z",
},
}),
subprocessors: buildSubprocessorsVM({
subprocessors: [
{
id: "sub-1",
name: "Hetzner Online GmbH",
purposeText: "Hosting & Storage",
country: "DE",
isEuEea: true,
dataCategories: ["alle"],
dpaUrl: "https://example.test/dpa",
activeSince: "2026-01-01T00:00:00.000Z",
},
{
id: "sub-2",
name: "Mailjet SAS",
purposeText: "Transaktions-E-Mails",
country: "FR",
isEuEea: true,
dataCategories: ["kontakt", "kommunikation"],
dpaUrl: null,
activeSince: null,
},
],
}),
avv: buildAvvVM({
currentVersion: "1.1",
pdfAvailable: false,
acceptances: [
{ id: "avv-1", avvVersion: "1.0", signerName: "Anna Admin", signerRole: "Geschäftsführung", pdfFileId: null, createdAt: "2026-06-01T12:00:00.000Z" },
],
}),
};
}
const noop = () => undefined;
/** Deterministic breadcrumb target so the interim baseline stays stable. */
const HUB_HREF = "/acme/settings/compliance/data-export";
export function AkP21InterimVisualFixture({ screen }: { screen: AkP21InterimVisualScreen }) {
const vms = createAkP21InterimVisualVMs();
switch (screen) {
case "hub":
return <PrivacyHubPage vm={vms.hub} csrf="test-csrf" actions={{ onOpenSection: noop, onDownloadJob: noop, onRetry: noop }} />;
case "export-jobs":
return <GdprExportJobsPage hubHref={HUB_HREF} vm={vms.exportJobs} actions={{ onStart: noop, onDownload: noop, onRetry: noop }} />;
case "deletion":
return <TenantDeletionPage hubHref={HUB_HREF} vm={vms.deletion} actions={{ onRequest: noop, onCancelRequest: noop, onOpenExport: noop, onRetry: noop }} />;
case "subprocessors":
return <SubprocessorsPage hubHref={HUB_HREF} vm={vms.subprocessors} actions={{ onRetry: noop }} />;
case "avv":
return <AvvPage hubHref={HUB_HREF} vm={vms.avv} actions={{ onAccept: noop, onRetry: noop }} />;
}
}