Give finished Rules a print path, folded launch counts, and a two-day follow-up.

Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
adilallo committed 2026-11-10 18:32:33 -07:00
1 parent 0efc907633
commit d9c475a967
74 files changed
+2401 -630

No files matched your search

+114
View File
@@ -0,0 +1,114 @@
import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import messages from "../../../messages/en/index";
import communityStructure from "../../../messages/en/create/community/communityStructure.json";
import { routeMetadata } from "../../../lib/siteMetadata";
import { getRuleAdminEmails, isDatabaseConfigured } from "../../../lib/server/env";
import { prisma } from "../../../lib/server/db";
import { isRuleAdminEmail } from "../../../lib/server/ruleAdmins";
import { aggregateRuleLaunchCounts } from "../../../lib/server/ruleLaunchCounts";
import { getSessionUser } from "../../../lib/server/session";
export const metadata: Metadata = routeMetadata("/rule-counts", {
title: messages.metadata.ruleCounts.title,
robots: { index: false, follow: false },
});
const ORG_LABELS = Object.fromEntries(
communityStructure.organizationTypes.map((row) => [row.id, row.label]),
);
function typeLabel(orgType: string | null, folded: boolean, copy: typeof messages.pages.ruleCounts): string {
if (folded) return copy.folded;
if (!orgType) return copy.notGiven;
return ORG_LABELS[orgType] ?? orgType;
}
function placeLabel(place: string | null, folded: boolean, copy: typeof messages.pages.ruleCounts): string {
if (folded) return copy.folded;
if (!place) return copy.notGiven;
return place;
}
export default async function RuleCountsPage() {
if (getRuleAdminEmails().length === 0) notFound();
const copy = messages.pages.ruleCounts;
const user = await getSessionUser();
if (!user) {
return (
<section className="mx-auto flex w-full max-w-md flex-col gap-4 px-6 py-16">
<h1 className="x-large-heading text-[var(--color-content-default-primary)]">
{copy.title}
</h1>
<p className="medium-paragraph">{copy.signIn}</p>
<Link href="/login?next=/rule-counts" className="medium-label underline">
{copy.signInButton}
</Link>
</section>
);
}
if (!isRuleAdminEmail(user.email)) {
return (
<section className="mx-auto flex w-full max-w-md flex-col gap-4 px-6 py-16">
<h1 className="x-large-heading text-[var(--color-content-default-primary)]">
{copy.title}
</h1>
<p className="medium-paragraph">{copy.forbidden}</p>
</section>
);
}
const rows = isDatabaseConfigured()
? await prisma.publishedRule.findMany({
select: { orgType: true, communityLocation: true },
})
: [];
const counts = aggregateRuleLaunchCounts(
rows.map((row) => ({
orgType: row.orgType,
place: row.communityLocation,
})),
);
return (
<section className="mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-12">
<h1 className="x-large-heading text-[var(--color-content-default-primary)]">
{copy.title}
</h1>
<p className="medium-paragraph">{copy.intro}</p>
<p className="large-label">
{copy.finished}: {counts.finished}
</p>
{counts.cells.length === 0 ? (
<p className="medium-paragraph">{copy.empty}</p>
) : (
<table className="w-full border-collapse text-left">
<thead>
<tr>
<th className="medium-label py-2">{copy.columns.type}</th>
<th className="medium-label py-2">{copy.columns.place}</th>
<th className="medium-label py-2">{copy.columns.count}</th>
</tr>
</thead>
<tbody>
{counts.cells.map((cell) => (
<tr
key={`${cell.folded ? "folded" : "open"}:${cell.orgType ?? ""}:${cell.place ?? ""}`}
>
<td className="small-paragraph py-2">
{typeLabel(cell.orgType, cell.folded, copy)}
</td>
<td className="small-paragraph py-2">
{placeLabel(cell.place, cell.folded, copy)}
</td>
<td className="small-paragraph py-2">{cell.count}</td>
</tr>
))}
</tbody>
</table>
)}
</section>
);
}
@@ -15,11 +15,10 @@ import {
} from "../../../../lib/create/shareChannels";
import {
buildPublicRuleUrl,
downloadStoredRuleAsMarkdown,
downloadStoredRuleAsPdf,
downloadTextFile,
exportFilenameBase,
exportStoredRuleAsCsv,
exportStoredRuleAsMarkdown,
printStoredRule,
type RuleExportFormat,
} from "../../../../lib/create/ruleExport";
export type CompletedFlowActionBanner = {
@@ -101,7 +100,7 @@ export function useCompletedRuleShareExport({
sharePublishedRuleViaSignal: () => Promise<void>;
sharePublishedRuleViaSlack: () => Promise<void>;
sharePublishedRuleViaDiscord: () => Promise<void>;
onSelectExportFormat: (_format: "pdf" | "csv" | "markdown") => void;
onSelectExportFormat: (_format: RuleExportFormat) => void;
} {
const t = useTranslation("create.reviewAndComplete.completed");
@@ -318,7 +317,7 @@ export function useCompletedRuleShareExport({
]);
const onSelectExportFormat = useCallback(
(format: "pdf" | "csv" | "markdown") => {
(format: RuleExportFormat) => {
if (typeof window === "undefined") return;
const rule = readLastPublishedRule();
if (!rule) {
@@ -331,34 +330,29 @@ export function useCompletedRuleShareExport({
return;
}
const base = exportFilenameBase(rule);
const origin = window.location.origin;
try {
if (format === "pdf") {
downloadStoredRuleAsPdf(rule);
} else if (format === "csv") {
const csv = exportStoredRuleAsCsv(rule);
downloadTextFile(
`${base}-community-rule.csv`,
csv,
"text/csv;charset=utf-8",
);
downloadStoredRuleAsPdf(rule, origin);
} else if (format === "print") {
const opened = printStoredRule(rule, origin);
if (!opened) {
setActionBanner({
key: "completedPrintBlocked",
status: "warning",
title: t("printBlockedTitle"),
description: t("printBlockedDescription"),
});
}
} else {
const md = exportStoredRuleAsMarkdown(rule);
downloadTextFile(
`${base}-community-rule.md`,
md,
"text/markdown;charset=utf-8",
);
downloadStoredRuleAsMarkdown(rule, origin);
}
} catch (e) {
const msg = e instanceof Error && e.message === "exportEmptyDocument";
} catch {
setActionBanner({
key: "completedExportFailed",
status: "danger",
title: msg ? t("exportEmptyDocumentTitle") : t("exportFailedTitle"),
description: msg
? t("exportEmptyDocumentDescription")
: t("exportFailedDescription"),
title: t("exportFailedTitle"),
description: t("exportFailedDescription"),
});
}
},
@@ -196,6 +196,9 @@ export function useCreateFlowFinalize({
title,
summary: summary ?? null,
document: ruleDocument,
...(publishResult.createdAt
? { finishedAt: publishResult.createdAt }
: {}),
});
if (isGuest) {
writePendingKeepRuleLogin();
@@ -4,16 +4,17 @@ import { useState, useEffect } from "react";
import { useRouter, useSearchParams } from "next/navigation";
import CommunityRule from "../../../../components/type/CommunityRule";
import type { CommunityRuleSection } from "../../../../components/type/CommunityRule/CommunityRule.types";
import Link from "next/link";
import Alert from "../../../../components/modals/Alert";
import AskOrganizerInquiryModal from "../../../../components/modals/AskOrganizerInquiry";
import InlineTextButton from "../../../../components/buttons/InlineTextButton";
import { useMessages } from "../../../../contexts/MessagesContext";
import { fetchPublishedRuleDetail } from "../../../../../lib/create/api";
import { parsePublishedDocumentForCommunityRuleDisplay } from "../../../../../lib/create/publishedDocumentToDisplaySections";
import {
finishedAtIso,
readLastPublishedRule,
writeLastPublishedRule,
} from "../../../../../lib/create/lastPublishedRule";
import { ASK_ORGANIZER_HASH } from "../../../../../lib/sharePaths";
import { useCreateFlowMdUp } from "../../hooks/useCreateFlowMdUp";
import { CreateFlowHeaderLockup } from "../../components/CreateFlowHeaderLockup";
import {
@@ -99,7 +100,6 @@ export function CompletedScreen() {
/** Latch: toast copy should survive `router.replace` after we strip `?celebrate=1`. */
const [showCelebrateToast] = useState(celebrateInUrl);
const [showCopiedReady] = useState(copiedInUrl);
const [askOrganizerOpen, setAskOrganizerOpen] = useState(false);
const [headerTitle, setHeaderTitle] = useState(initial.headerTitle);
const [headerDescription, setHeaderDescription] = useState<
string | undefined
@@ -124,11 +124,13 @@ export function CompletedScreen() {
return;
}
const doc = detail.rule.document as Record<string, unknown>;
const finishedAt = finishedAtIso(detail.rule.createdAt);
writeLastPublishedRule({
id: detail.rule.id,
title: detail.rule.title,
summary: detail.rule.summary,
document: doc,
...(finishedAt ? { finishedAt } : {}),
});
const parsed = parsePublishedDocumentForCommunityRuleDisplay(doc);
if (parsed.length === 0) {
@@ -210,13 +212,17 @@ export function CompletedScreen() {
/>
{headerTitle && !surfaceCopied ? (
<p className="mt-[var(--space-400)] max-w-[640px] text-small-paragraph text-[var(--color-content-invert-secondary)]">
{completed.askOrganizerLead}{" "}
<InlineTextButton
className="text-small-paragraph text-[var(--color-content-invert-primary)]"
onClick={() => setAskOrganizerOpen(true)}
{completed.askOrganizerLead ? (
<>
{completed.askOrganizerLead}{" "}
</>
) : null}
<Link
href={`/#${ASK_ORGANIZER_HASH}`}
className="text-small-paragraph text-[var(--color-content-invert-primary)] underline"
>
{completed.askOrganizerLink}
</InlineTextButton>
</Link>
</p>
) : null}
</div>
@@ -261,10 +267,6 @@ export function CompletedScreen() {
</div>
</div>
{toast}
<AskOrganizerInquiryModal
isOpen={askOrganizerOpen}
onClose={() => setAskOrganizerOpen(false)}
/>
</>
);
}
@@ -12,7 +12,10 @@ import { communityPossessive } from "../../../../lib/create/ruleInviteCardMeta";
import { CREATE_FLOW_COPIED_QUERY, CREATE_FLOW_COPIED_VALUE } from "../../../../lib/create/invitePaths";
import { formatInviteLastChanged } from "../../../../lib/create/inviteLastChanged";
import { writeLastPublishedRule } from "../../../../lib/create/lastPublishedRule";
import { downloadStoredRuleAsPdf } from "../../../../lib/create/ruleExport";
import {
downloadStoredRuleAsPdf,
printStoredRule,
} from "../../../../lib/create/ruleExport";
import { createCompletedPath } from "../../create/utils/createFlowPaths";
import { CreateFlowHeaderLockup } from "../../create/components/CreateFlowHeaderLockup";
import { useCreateFlowMdUp } from "../../create/hooks/useCreateFlowMdUp";
@@ -79,18 +82,34 @@ export function InvitedRuleView({
const handlePdf = useCallback(() => {
try {
downloadStoredRuleAsPdf({
id: ruleId,
title,
summary,
document,
});
downloadStoredRuleAsPdf(
{
id: ruleId,
title,
summary,
document,
},
window.location.origin,
);
setExportError(false);
} catch {
setExportError(true);
}
}, [document, ruleId, summary, title]);
const handlePrint = useCallback(() => {
const opened = printStoredRule(
{
id: ruleId,
title,
summary,
document,
},
window.location.origin,
);
setExportError(!opened);
}, [document, ruleId, summary, title]);
const handleCopy = useCallback(
async (communityName: string) => {
setCopyBusy(true);
@@ -194,7 +213,7 @@ export function InvitedRuleView({
size="xsmall"
type="button"
className={outlineButtonClass}
onClick={() => window.print()}
onClick={handlePrint}
>
{t("print")}
</Button>
+8 -10
View File
@@ -19,12 +19,11 @@ import {
type PublishedRuleDetailForClient,
} from "../../../lib/create/api";
import {
downloadStoredRuleAsMarkdown,
downloadStoredRuleAsPdf,
downloadTextFile,
exportFilenameBase,
exportStoredRuleAsMarkdown,
} from "../../../lib/create/ruleExport";
import {
finishedAtIso,
writeLastPublishedRule,
type StoredLastPublishedRule,
} from "../../../lib/create/lastPublishedRule";
@@ -255,11 +254,13 @@ export default function ProfilePageClient() {
setActionError(t("actionError"));
return;
}
const finishedAt = finishedAtIso(detail.rule.createdAt);
writeLastPublishedRule({
id: detail.rule.id,
title: detail.rule.title,
summary: detail.rule.summary,
document: detail.rule.document as Record<string, unknown>,
...(finishedAt ? { finishedAt } : {}),
});
router.push(
createFlowStepPath("confirm-stakeholders", {
@@ -334,11 +335,13 @@ export default function ProfilePageClient() {
) {
return null;
}
const finishedAt = finishedAtIso(rule.createdAt);
return {
id: rule.id,
title: rule.title,
summary: rule.summary,
document: rule.document as Record<string, unknown>,
...(finishedAt ? { finishedAt } : {}),
};
},
[],
@@ -354,7 +357,7 @@ export default function ProfilePageClient() {
return;
}
try {
downloadStoredRuleAsPdf(stored);
downloadStoredRuleAsPdf(stored, window.location.origin);
} catch {
setActionError(t("actionError"));
}
@@ -372,12 +375,7 @@ export default function ProfilePageClient() {
return;
}
try {
const markdown = exportStoredRuleAsMarkdown(stored);
downloadTextFile(
`${exportFilenameBase(stored)}-community-rule.md`,
markdown,
"text/markdown;charset=utf-8",
);
downloadStoredRuleAsMarkdown(stored, window.location.origin);
} catch {
setActionError(t("actionError"));
}
+6
View File
@@ -0,0 +1,6 @@
import { redirect } from "next/navigation";
/** Office-hours pointer used in the 48-hour follow-up email. */
export default function KitPage() {
redirect("/workshops");
}
+42
View File
@@ -0,0 +1,42 @@
import { NextRequest, NextResponse } from "next/server";
import { apiRoute } from "../../../../lib/server/apiRoute";
import { prisma } from "../../../../lib/server/db";
import {
getOpsPruneToken,
getRuleAdminEmails,
isDatabaseConfigured,
} from "../../../../lib/server/env";
import {
dbUnavailable,
notFound,
unauthorized,
} from "../../../../lib/server/responses";
import { isRuleAdminEmail } from "../../../../lib/server/ruleAdmins";
import { aggregateRuleLaunchCounts } from "../../../../lib/server/ruleLaunchCounts";
import { getSessionUser } from "../../../../lib/server/session";
export const GET = apiRoute("ops.ruleCounts", async (request: NextRequest) => {
if (getRuleAdminEmails().length === 0 && !getOpsPruneToken()) {
return notFound();
}
if (!isDatabaseConfigured()) return dbUnavailable();
const header = request.headers.get("authorization") ?? "";
const opsToken = getOpsPruneToken();
const bearerOk = Boolean(opsToken) && header === `Bearer ${opsToken}`;
if (!bearerOk) {
const user = await getSessionUser();
if (!user || !isRuleAdminEmail(user.email)) return unauthorized();
}
const rows = await prisma.publishedRule.findMany({
select: { orgType: true, communityLocation: true },
});
const counts = aggregateRuleLaunchCounts(
rows.map((row) => ({
orgType: row.orgType,
place: row.communityLocation,
})),
);
return NextResponse.json(counts);
});
+112
View File
@@ -0,0 +1,112 @@
import { NextRequest, NextResponse } from "next/server";
import { apiRoute } from "../../../../../../lib/server/apiRoute";
import { prisma } from "../../../../../../lib/server/db";
import {
getSessionPepper,
isDatabaseConfigured,
} from "../../../../../../lib/server/env";
import { getPublicOrigin } from "../../../../../../lib/server/publicOrigin";
import {
dbUnavailable,
forbidden,
notFound,
unauthorized,
} from "../../../../../../lib/server/responses";
import { isRuleAdminEmail } from "../../../../../../lib/server/ruleAdmins";
import { ruleExportTokenMatches } from "../../../../../../lib/server/ruleExportToken";
import { getSessionUser } from "../../../../../../lib/server/session";
import {
RULE_MD_FILENAME,
buildStoredRulePdfBytes,
exportPdfFilename,
exportStoredRuleAsMarkdown,
} from "../../../../../../lib/create/ruleExport";
type RouteContext = { params: Promise<{ id: string; format: string }> };
function attachmentDisposition(filename: string): string {
const ascii = filename.replace(/[^\x20-\x7E]/g, "_").replace(/"/g, "");
const encoded = encodeURIComponent(filename);
return `attachment; filename="${ascii}"; filename*=UTF-8''${encoded}`;
}
function documentRecord(value: unknown): Record<string, unknown> | null {
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
return value as Record<string, unknown>;
}
export const GET = apiRoute<RouteContext>(
"rules.export",
async (request: NextRequest, context) => {
if (!isDatabaseConfigured()) return dbUnavailable();
const { id, format } = await context.params;
if (format !== "pdf" && format !== "md") return notFound();
const row = await prisma.publishedRule.findUnique({
where: { id },
select: {
id: true,
title: true,
summary: true,
document: true,
createdAt: true,
userId: true,
},
});
if (!row) return notFound();
const token = request.nextUrl.searchParams.get("t") ?? "";
let tokenOk = false;
if (token.length > 0) {
try {
tokenOk = ruleExportTokenMatches(row.id, token, getSessionPepper());
} catch {
tokenOk = false;
}
}
if (!tokenOk) {
const user = await getSessionUser();
if (!user) return unauthorized();
const isOwner = row.userId === user.id;
if (!isOwner && !isRuleAdminEmail(user.email)) {
return forbidden("You do not have permission to export this rule");
}
}
const document = documentRecord(row.document);
if (!document) return notFound();
const origin = getPublicOrigin(request);
const source = {
id: row.id,
title: row.title,
summary: row.summary,
document,
finishedAt: row.createdAt,
};
if (format === "pdf") {
const bytes = buildStoredRulePdfBytes(source, origin);
return new NextResponse(Buffer.from(bytes), {
headers: {
"Content-Type": "application/pdf",
"Content-Disposition": attachmentDisposition(
exportPdfFilename(row.title),
),
"Cache-Control": "private, no-store",
},
});
}
const markdown = exportStoredRuleAsMarkdown(source, origin);
return new NextResponse(markdown, {
headers: {
"Content-Type": "text/markdown; charset=utf-8",
"Content-Disposition": attachmentDisposition(RULE_MD_FILENAME),
"Cache-Control": "private, no-store",
},
});
},
);
+2
View File
@@ -16,6 +16,7 @@ import { linkUploadsToRule } from "../../../../lib/server/uploads/linkUploads";
import { publishRuleBodySchema } from "../../../../lib/server/validation/createFlowSchemas";
import { readLimitedJson } from "../../../../lib/server/validation/requestBody";
import { jsonFromZodError } from "../../../../lib/server/validation/zodHttp";
import { publishedRuleAnalyticsColumns } from "../../../../lib/server/publishedRulePersist";
type RouteContext = { params: Promise<{ id: string }> };
@@ -88,6 +89,7 @@ export const PATCH = apiRoute<RouteContext>(
title,
summary,
document: document as Prisma.InputJsonValue,
...publishedRuleAnalyticsColumns(document),
},
});
await linkUploadsToRule({
+4
View File
@@ -34,6 +34,7 @@ import {
} from "../../../lib/server/validation/createFlowSchemas";
import { readLimitedJson } from "../../../lib/server/validation/requestBody";
import { jsonFromZodError } from "../../../lib/server/validation/zodHttp";
import { publishedRuleAnalyticsColumns } from "../../../lib/server/publishedRulePersist";
/** One anonymous publish per IP per minute (in-memory limiter). */
const ANONYMOUS_PUBLISH_IP_MIN_INTERVAL_MS = 60_000;
@@ -113,6 +114,7 @@ export const POST = apiRoute(
summary,
document: document as Prisma.InputJsonValue,
claimTokenHash,
...publishedRuleAnalyticsColumns(document),
},
});
@@ -160,6 +162,7 @@ export const POST = apiRoute(
title,
summary,
document: document as Prisma.InputJsonValue,
...publishedRuleAnalyticsColumns(document),
},
});
await linkUploadsToRule({
@@ -196,6 +199,7 @@ export const POST = apiRoute(
title,
summary,
document: document as Prisma.InputJsonValue,
...publishedRuleAnalyticsColumns(document),
},
});
const toSend: { email: string; token: string }[] = [];
+3
View File
@@ -18,6 +18,7 @@ import Numeric2CircleIcon from "./numeric-2-circle.svg";
import Numeric3CircleIcon from "./numeric-3-circle.svg";
import NumberIcon from "./number.svg";
import PictureAsPdfIcon from "./picture_as_pdf.svg";
import PrintIcon from "./print.svg";
import TagsIcon from "./tags.svg";
import TextBlockIcon from "./text_block.svg";
import WarningIcon from "./warning.svg";
@@ -39,6 +40,7 @@ export const ICON_NAME_OPTIONS = [
"numeric_3_circle",
"number",
"picture_as_pdf",
"print",
"tags",
"text_block",
"warning",
@@ -68,6 +70,7 @@ const iconMap: Record<IconName, SvgComponent> = {
numeric_3_circle: Numeric3CircleIcon,
number: NumberIcon,
picture_as_pdf: PictureAsPdfIcon,
print: PrintIcon,
tags: TagsIcon,
text_block: TextBlockIcon,
warning: WarningIcon,
+6
View File
@@ -0,0 +1,6 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M18 7H6V3H18V7ZM18 12.5C18.2833 12.5 18.5208 12.4042 18.7125 12.2125C18.9042 12.0208 19 11.7833 19 11.5C19 11.2167 18.9042 10.9792 18.7125 10.7875C18.5208 10.5958 18.2833 10.5 18 10.5C17.7167 10.5 17.4792 10.5958 17.2875 10.7875C17.0958 10.9792 17 11.2167 17 11.5C17 11.7833 17.0958 12.0208 17.2875 12.2125C17.4792 12.4042 17.7167 12.5 18 12.5ZM16 19V15H8V19H16ZM18 21H6V17H2V11C2 10.1667 2.29167 9.45833 2.875 8.875C3.45833 8.29167 4.16667 8 5 8H19C19.8333 8 20.5417 8.29167 21.125 8.875C21.7083 9.45833 22 10.1667 22 11V17H18V21Z"
fill="currentColor"
/>
</svg>

After

Width:  |  Height:  |  Size: 680 B

@@ -88,18 +88,18 @@ const CreateFlowTopNavContainer = memo<CreateFlowTopNavProps>(
leadingIcon: "picture_as_pdf",
onClick: () => onSelectExportFormat("pdf"),
},
{
id: "export-csv",
label: tPopover("downloadCsv"),
leadingIcon: "csv",
onClick: () => onSelectExportFormat("csv"),
},
{
id: "export-markdown",
label: tPopover("downloadMarkdown"),
leadingIcon: "markdown_copy",
onClick: () => onSelectExportFormat("markdown"),
},
{
id: "export-print",
label: tPopover("print"),
leadingIcon: "print",
onClick: () => onSelectExportFormat("print"),
},
);
}
@@ -233,8 +233,8 @@ const CreateFlowTopNavContainer = memo<CreateFlowTopNavProps>(
actionMenuItems={actionMenuItems}
exportPopoverMenuAriaLabel={tPopover("menuAriaLabel")}
exportPopoverPdfLabel={tPopover("downloadPdf")}
exportPopoverCsvLabel={tPopover("downloadCsv")}
exportPopoverMarkdownLabel={tPopover("downloadMarkdown")}
exportPopoverPrintLabel={tPopover("print")}
moreOptionsAriaLabel={t("moreOptionsAriaLabel")}
actionsMenuAriaLabel={t("actionsMenuAriaLabel")}
shareLabel={t("share")}
@@ -55,7 +55,7 @@ export interface CreateFlowTopNavProps {
/**
* Callback when user picks an export format from the Export menu.
*/
onSelectExportFormat?: (_format: "pdf" | "csv" | "markdown") => void;
onSelectExportFormat?: (_format: "pdf" | "markdown" | "print") => void;
/**
* Callback when Edit button is clicked
*/
@@ -106,8 +106,8 @@ export type CreateFlowTopNavViewProps = CreateFlowTopNavProps & {
actionMenuItems: CreateFlowTopNavActionMenuItem[];
exportPopoverMenuAriaLabel: string;
exportPopoverPdfLabel: string;
exportPopoverCsvLabel: string;
exportPopoverMarkdownLabel: string;
exportPopoverPrintLabel: string;
moreOptionsAriaLabel: string;
actionsMenuAriaLabel: string;
shareLabel: string;
@@ -61,8 +61,8 @@ export function CreateFlowTopNavView({
actionMenuItems,
exportPopoverMenuAriaLabel,
exportPopoverPdfLabel,
exportPopoverCsvLabel,
exportPopoverMarkdownLabel,
exportPopoverPrintLabel,
moreOptionsAriaLabel,
actionsMenuAriaLabel,
shareLabel,
@@ -145,19 +145,19 @@ export function CreateFlowTopNavView({
/>
<ListItem
showDivider
leadingIcon="csv"
label={exportPopoverCsvLabel}
leadingIcon="markdown_copy"
label={exportPopoverMarkdownLabel}
onClick={() => {
onSelectExportFormat("csv");
onSelectExportFormat("markdown");
setExportMenuOpen(false);
}}
/>
<ListItem
showDivider={false}
leadingIcon="markdown_copy"
label={exportPopoverMarkdownLabel}
leadingIcon="print"
label={exportPopoverPrintLabel}
onClick={() => {
onSelectExportFormat("markdown");
onSelectExportFormat("print");
setExportMenuOpen(false);
}}
/>
+3
View File
@@ -210,6 +210,9 @@ const Footer = memo(({ siteOrigin = PRODUCTION_SITE_ORIGIN }: { siteOrigin?: str
lg:gap-10
lg:text-small-paragraph"
>
<Link href={t("takeawayHref")} className={legalLinkClass}>
{t("takeaway")}
</Link>
<Link href={t("legal.privacyPolicyHref")} className={legalLinkClass}>
{t("legal.privacyPolicy")}
</Link>
@@ -2,6 +2,7 @@
import ContentLockup from "../../type/ContentLockup";
import Button from "../../buttons/Button";
import { ASK_ORGANIZER_HASH } from "../../../../lib/sharePaths";
import type { AskOrganizerViewProps } from "./AskOrganizer.types";
function AskOrganizerView({
@@ -28,6 +29,7 @@ function AskOrganizerView({
return (
<section
id={ASK_ORGANIZER_HASH}
className={`${sectionPadding} ${className}`}
aria-labelledby={labelledBy}
aria-label={labelledBy ? undefined : ctaAriaLabel}
+23 -6
View File
@@ -2,6 +2,7 @@ import { Inter, Bricolage_Grotesque } from "next/font/google";
import type { Metadata, Viewport } from "next";
import type { ReactNode } from "react";
import { headers } from "next/headers";
import Script from "next/script";
import messages from "../messages/en/index";
import { ASSETS, getAssetPath } from "../lib/assetUtils";
import {
@@ -9,6 +10,7 @@ import {
originFromHost,
resolveRequestHost,
} from "../lib/siteMetadata";
import { umamiTracker } from "../lib/umami";
import "./globals.css";
// Session chrome (`ConditionalNavigation`) lives in `(marketing)`, `(app)`, and
@@ -124,7 +126,7 @@ export async function generateMetadata(): Promise<Metadata> {
}
export default function RootLayout({ children }: { children: ReactNode }) {
// Load messages for the default locale (single locale setup)
const umami = umamiTracker();
return (
<html lang="en" className="font-sans">
@@ -148,11 +150,26 @@ export default function RootLayout({ children }: { children: ReactNode }) {
type="image/png"
/>
</head>
<body className={`${inter.variable} ${bricolageGrotesque.variable}`}>
<div className="mx-auto flex min-h-screen w-full max-w-[1920px] flex-col">
{children}
</div>
</body>
{umami ? (
<body className={`${inter.variable} ${bricolageGrotesque.variable}`}>
<Script
src={umami.src}
strategy="afterInteractive"
data-website-id={umami.websiteId}
data-do-not-track="true"
data-exclude-search="true"
/>
<div className="mx-auto flex min-h-screen w-full max-w-[1920px] flex-col">
{children}
</div>
</body>
) : (
<body className={`${inter.variable} ${bricolageGrotesque.variable}`}>
<div className="mx-auto flex min-h-screen w-full max-w-[1920px] flex-col">
{children}
</div>
</body>
)}
</html>
);
}