Give /kit its own page so the printed facilitator-guide link still works after cutover.
This commit is contained in:
1 parent
711ef736df
commit
8f92848e2b
11 files changed
+177
-7
No files matched your search
@@ -91,7 +91,7 @@ export function legalPageMetadata(
|
||||
}
|
||||
|
||||
/**
|
||||
* Public legal documents (`/privacy`, `/terms`, `/cookies`).
|
||||
* Public Content page Template documents (`/privacy`, `/terms`, `/cookies`, `/kit`).
|
||||
*
|
||||
* Figma: "Content page Template" (19003:23305) — ContentBanner guide
|
||||
* (22078:806964) + article column (19003:23574). Body stacks follow
|
||||
|
||||
@@ -1,6 +1,27 @@
|
||||
import { redirect } from "next/navigation";
|
||||
/**
|
||||
* Figma: "C8 Kit page / 1440+" (25218:120616) on "Content page Template" (19003:23305)
|
||||
* https://www.figma.com/design/agv0VBLiBlcnSAaiAORgPR/Community-Rule-System?node-id=25218-120616
|
||||
*/
|
||||
import type { Metadata } from "next";
|
||||
import messages from "../../../messages/en/index";
|
||||
import { legalPathForSlug } from "../../../lib/legalSyntheticPost";
|
||||
import { routeMetadata } from "../../../lib/siteMetadata";
|
||||
import LegalDocumentPage, {
|
||||
legalPageMetadata,
|
||||
} from "../_components/LegalDocumentPage";
|
||||
|
||||
/** Office-hours pointer used in the 48-hour follow-up email. */
|
||||
export default function KitPage() {
|
||||
redirect("/workshops");
|
||||
const SLUG = "kit" as const;
|
||||
const PATH = legalPathForSlug(SLUG);
|
||||
|
||||
export function generateMetadata(): Metadata {
|
||||
return routeMetadata(
|
||||
PATH,
|
||||
legalPageMetadata(messages.metadata.kit, messages.pages.kit),
|
||||
);
|
||||
}
|
||||
|
||||
export default function KitPage() {
|
||||
return (
|
||||
<LegalDocumentPage slug={SLUG} path={PATH} page={messages.pages.kit} />
|
||||
);
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { BlogPost } from "./content";
|
||||
|
||||
export type LegalDocumentSlug = "privacy" | "terms" | "cookies";
|
||||
export type LegalDocumentSlug = "privacy" | "terms" | "cookies" | "kit";
|
||||
|
||||
export type LegalDocumentSection = {
|
||||
heading: string;
|
||||
@@ -23,6 +23,7 @@ const PATH_BY_SLUG: Record<LegalDocumentSlug, string> = {
|
||||
privacy: "/privacy",
|
||||
terms: "/terms",
|
||||
cookies: "/cookies",
|
||||
kit: "/kit",
|
||||
};
|
||||
|
||||
export function legalPathForSlug(slug: LegalDocumentSlug): string {
|
||||
|
||||
@@ -11,6 +11,7 @@ const STATIC_PUBLIC_PATHS = [
|
||||
"/templates",
|
||||
"/blog",
|
||||
"/how-it-works",
|
||||
"/kit",
|
||||
"/privacy",
|
||||
"/terms",
|
||||
"/cookies",
|
||||
|
||||
@@ -27,6 +27,7 @@ import useCasesDetail from "./pages/useCasesDetail.json";
|
||||
import useCasesCompletedRules from "./pages/useCasesCompletedRules.json";
|
||||
import useCasesCompletedRule from "./pages/useCasesCompletedRule.json";
|
||||
import howItWorks from "./pages/howItWorks.json";
|
||||
import kit from "./pages/kit.json";
|
||||
import privacy from "./pages/privacy.json";
|
||||
import terms from "./pages/terms.json";
|
||||
import cookies from "./pages/cookies.json";
|
||||
@@ -112,6 +113,7 @@ export default {
|
||||
useCasesCompletedRules,
|
||||
useCasesCompletedRule,
|
||||
howItWorks,
|
||||
kit,
|
||||
privacy,
|
||||
terms,
|
||||
cookies,
|
||||
|
||||
@@ -39,6 +39,7 @@ import useCasesDetail from "./pages/useCasesDetail.json";
|
||||
import useCasesCompletedRules from "./pages/useCasesCompletedRules.json";
|
||||
import useCasesCompletedRule from "./pages/useCasesCompletedRule.json";
|
||||
import howItWorks from "./pages/howItWorks.json";
|
||||
import kit from "./pages/kit.json";
|
||||
import privacy from "./pages/privacy.json";
|
||||
import terms from "./pages/terms.json";
|
||||
import cookies from "./pages/cookies.json";
|
||||
@@ -84,6 +85,7 @@ const marketingMessages = {
|
||||
useCasesCompletedRules,
|
||||
useCasesCompletedRule,
|
||||
howItWorks,
|
||||
kit,
|
||||
privacy,
|
||||
terms,
|
||||
cookies,
|
||||
|
||||
@@ -147,6 +147,11 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"kit": {
|
||||
"title": "The kit",
|
||||
"description": "Everything your community needs to write its Rule together over five short meetings you already hold. Free for volunteer-run groups.",
|
||||
"keywords": ["kit", "facilitator guide", "office hours", "communityrule"]
|
||||
},
|
||||
"howItWorks": {
|
||||
"title": "When your community sits down to write its Rule",
|
||||
"description": "Sketch your Rule in CommunityRule, then make it your community's own over five short meetings.",
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"_comment": "Kit page at /kit. Figma C8 Kit page (25218:120616) on the Content page Template. Facilitator guide and FigJam board are live; printed cards, poster and zine are named without download links until those files exist. Office hours start 22 February 2027; the page names no weekday until two people can commit to one.",
|
||||
"banner": {
|
||||
"title": "The kit",
|
||||
"description": "Everything your community needs to write its Rule together over five short meetings you already hold. Free for volunteer-run groups.",
|
||||
"author": "Media Economies Design Lab",
|
||||
"date": "2027-01-19"
|
||||
},
|
||||
"updated": "Last updated January 19, 2027.",
|
||||
"intro": [
|
||||
"The kit is how a community writes its Rule without us in the room. Any member can run it. It spreads the work over five short meetings your community already holds, and it starts on paper."
|
||||
],
|
||||
"sections": [
|
||||
{
|
||||
"heading": "What is in it",
|
||||
"paragraphs": [
|
||||
"The facilitator guide, with a printable worksheet for each meeting. [Download the facilitator guide](https://colorado-mutual-aid.notion.site/Workshop-facilitator-guide-40fb9b9e2d3b81b683c0ca15de007f2a).",
|
||||
"The FigJam board, for communities that meet online. [Open the board](https://www.figma.com/board/gnQ55HnX7EtOV9nwlZcW1V?node-id=32-80).",
|
||||
"Thirteen template cards, one for each template.",
|
||||
"The four questions poster.",
|
||||
"The zine.",
|
||||
"No form and no account. [Download the kit](https://colorado-mutual-aid.notion.site/Workshop-facilitator-guide-40fb9b9e2d3b81b683c0ca15de007f2a)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"heading": "How the five meetings run",
|
||||
"paragraphs": [
|
||||
"The first meeting runs an hour. It opens with the question nobody has asked out loud, then takes the first of the four questions. How you talk, who belongs, how you decide and what happens when you disagree.",
|
||||
"The next three meetings take one question each, in forty-five minutes.",
|
||||
"The last meeting takes your values and the signs that one is slipping. Then someone reads the draft aloud and it goes to every member.",
|
||||
"A community with more time can take two questions in one meeting of ninety minutes.",
|
||||
"Every meeting opens by reading aloud how the room decides, and closes the same way. Only the close puts anything into CommunityRule.",
|
||||
"The draft becomes your Rule once every member has read it and has had at least seven days to object. Objections close the day before your next regular meeting, and that meeting settles them the way the draft says. [Create rule](/create/informational)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"heading": "Office hours",
|
||||
"paragraphs": [
|
||||
"Bring your draft, your Rule or a question. No signup. Office hours start 22 February 2027. They run every week through 20 March 2027, then every month. Times are listed here once they are set."
|
||||
]
|
||||
},
|
||||
{
|
||||
"heading": "Stuck between meetings",
|
||||
"paragraphs": [
|
||||
"[Ask an organizer](/#ask-organizer). A person writes back within two working days."
|
||||
]
|
||||
},
|
||||
{
|
||||
"heading": "A larger organization",
|
||||
"paragraphs": [
|
||||
"Credit unions, mutuals and co-ops with thousands of members can bring a facilitator. [Talk to a facilitator](/workshops#workshop-signup)."
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
import { screen } from "@testing-library/react";
|
||||
import { renderWithProviders as render } from "../utils/test-utils";
|
||||
import LegalDocumentPage from "../../app/(marketing)/_components/LegalDocumentPage";
|
||||
import { legalPathForSlug } from "../../lib/legalSyntheticPost";
|
||||
import messages from "../../messages/en/index";
|
||||
|
||||
vi.mock("../../lib/requestSiteOrigin", () => ({
|
||||
getRequestSiteOrigin: async () => "https://communityrule.info",
|
||||
}));
|
||||
|
||||
vi.mock("../../app/components/sections/ContentBanner", () => ({
|
||||
default: ({ post, variant, updatedLabel }) => (
|
||||
<section data-testid="content-banner" data-variant={variant}>
|
||||
<h1>{post.frontmatter.title}</h1>
|
||||
<p>{post.frontmatter.description}</p>
|
||||
{updatedLabel ? (
|
||||
<div>
|
||||
<span>{post.frontmatter.author}</span>
|
||||
<span>{updatedLabel}</span>
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
),
|
||||
}));
|
||||
|
||||
async function renderKitPage() {
|
||||
const page = messages.pages.kit;
|
||||
const ui = await LegalDocumentPage({
|
||||
slug: "kit",
|
||||
path: legalPathForSlug("kit"),
|
||||
page,
|
||||
});
|
||||
return render(ui);
|
||||
}
|
||||
|
||||
describe("kit page", () => {
|
||||
test("covers the five meetings, the facilitator guide, and office hours", async () => {
|
||||
await renderKitPage();
|
||||
const page = messages.pages.kit;
|
||||
|
||||
expect(screen.getByTestId("content-banner")).toHaveAttribute(
|
||||
"data-variant",
|
||||
"guide",
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 1, name: page.banner.title }),
|
||||
).toBeInTheDocument();
|
||||
expect(screen.getByText(page.banner.description)).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 2, name: "What is in it" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 2, name: "How the five meetings run" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("heading", { level: 2, name: "Office hours" }),
|
||||
).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByRole("link", { name: "Download the facilitator guide" }),
|
||||
).toHaveAttribute(
|
||||
"href",
|
||||
"https://colorado-mutual-aid.notion.site/Workshop-facilitator-guide-40fb9b9e2d3b81b683c0ca15de007f2a",
|
||||
);
|
||||
expect(screen.getByRole("link", { name: "Open the board" })).toHaveAttribute(
|
||||
"href",
|
||||
"https://www.figma.com/board/gnQ55HnX7EtOV9nwlZcW1V?node-id=32-80",
|
||||
);
|
||||
expect(screen.getByRole("link", { name: "Create rule" })).toHaveAttribute(
|
||||
"href",
|
||||
"/create/informational",
|
||||
);
|
||||
expect(screen.getByRole("link", { name: "Ask an organizer" })).toHaveAttribute(
|
||||
"href",
|
||||
"/#ask-organizer",
|
||||
);
|
||||
expect(
|
||||
screen.getByRole("link", { name: "Talk to a facilitator" }),
|
||||
).toHaveAttribute("href", "/workshops#workshop-signup");
|
||||
expect(screen.getByText(/22 February 2027/)).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -9,6 +9,7 @@ describe("legalSyntheticPost", () => {
|
||||
expect(legalPathForSlug("privacy")).toBe("/privacy");
|
||||
expect(legalPathForSlug("terms")).toBe("/terms");
|
||||
expect(legalPathForSlug("cookies")).toBe("/cookies");
|
||||
expect(legalPathForSlug("kit")).toBe("/kit");
|
||||
});
|
||||
|
||||
it("builds a guide-shaped post from page messages", () => {
|
||||
|
||||
@@ -16,6 +16,7 @@ describe("buildPublicSitemap", () => {
|
||||
expect(urls).toContain(sitemapUrl("/blog"));
|
||||
expect(urls).not.toContain(sitemapUrl("/use-cases"));
|
||||
expect(urls).toContain(sitemapUrl("/how-it-works"));
|
||||
expect(urls).toContain(sitemapUrl("/kit"));
|
||||
expect(urls).toContain(sitemapUrl("/privacy"));
|
||||
expect(urls).toContain(sitemapUrl("/terms"));
|
||||
expect(urls).toContain(sitemapUrl("/cookies"));
|
||||
@@ -36,7 +37,6 @@ describe("buildPublicSitemap", () => {
|
||||
expect(urls.some((url) => url.includes("/create"))).toBe(false);
|
||||
expect(urls.some((url) => url.includes("/monitor"))).toBe(false);
|
||||
expect(urls.some((url) => url.includes("/rule-counts"))).toBe(false);
|
||||
expect(urls.some((url) => url.includes("/kit"))).toBe(false);
|
||||
expect(urls.some((url) => url.includes("/api/"))).toBe(false);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user