Keep beta Rules at cutover, fall back when a kind is typed, and replace the terms license claim #115

Merged
an.di merged 3 commits from adilallo/fix/product-leftovers into main 2026-11-23 18:01:22 +00:00
5 changed files with 64 additions and 55 deletions
Showing only changes of commit 4b90bce006 - Show all commits

No files matched your search

@@ -0,0 +1,33 @@
"use client";
import { useCallback, useState } from "react";
import AskOrganizerInquiryModal from "../../components/modals/AskOrganizerInquiry";
const LINK_CLASS =
"cursor-pointer border-none bg-transparent p-0 font-[inherit] text-[inherit] underline decoration-solid underline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2";
type LegalAskOrganizerLinkProps = {
label: string;
};
/** Inline legal-page control that opens the Ask an organizer dialog. */
export default function LegalAskOrganizerLink({
label,
}: LegalAskOrganizerLinkProps) {
const [open, setOpen] = useState(false);
const openInquiry = useCallback(() => setOpen(true), []);
const closeInquiry = useCallback(() => setOpen(false), []);
return (
<>
<button
type="button"
className={LINK_CLASS}
onClick={openInquiry}
>
{label}
</button>
<AskOrganizerInquiryModal isOpen={open} onClose={closeInquiry} />
</>
);
}
@@ -10,6 +10,7 @@ import { getRequestSiteOrigin } from "../../../lib/requestSiteOrigin";
import { absoluteSiteUrl } from "../../../lib/siteMetadata";
import { isPrivacyPolicyEnabled } from "../../../lib/privacyPolicyEnabled";
import ContentBanner from "../../components/sections/ContentBanner";
import LegalAskOrganizerLink from "./LegalAskOrganizerLink";
type LegalDocumentPageProps = {
slug: LegalDocumentSlug;
@@ -46,7 +47,10 @@ function LegalInlineText({ text }: { text: string }) {
const label = match[1];
const href = match[2];
if (href === "/privacy" && !isPrivacyPolicyEnabled()) {
if (href === "dialog:ask-organizer") {
nodes.push(<LegalAskOrganizerLink key={key} label={label} />);
key += 1;
} else if (href === "/privacy" && !isPrivacyPolicyEnabled()) {
nodes.push(label);
} else if (isSafeHref(href)) {
const isInternal = href.startsWith("/") && !href.startsWith("//");
+3 -3
View File
@@ -185,9 +185,9 @@
"keywords": ["privacy", "personal information", "communityrule"]
},
"terms": {
"title": "Terms of Service",
"description": "How you may use CommunityRule, including licenses and the templates API.",
"keywords": ["terms of service", "license", "communityrule"]
"title": "Our terms are being reviewed",
"description": "University counsel is reviewing CommunityRule's terms of service.",
"keywords": ["terms of service", "communityrule"]
},
"cookies": {
"title": "Cookies",
+7 -29
View File
@@ -1,36 +1,14 @@
{
"_comment": "Terms of service. Owns licenses, API use, and acceptable use. Privacy owns data, hosting, and ranking. Not a substitute for university counsel review.",
"_comment": "Interim terms notice while university counsel reviews the policy. No licensing claims about Rules, cards, or templates. Counsel-read copy ships at the 19 Jan 2027 cutover.",
"banner": {
"title": "Terms of Service",
"description": "How you may use CommunityRule, including licenses and the templates API.",
"title": "Our terms are being reviewed",
"description": "University counsel is reviewing CommunityRule's terms of service.",
"author": "Media Economies Design Lab",
"date": "2026-08-15"
"date": "2026-11-21"
},
"updated": "Last updated August 15, 2026.",
"updated": "Last updated November 21, 2026.",
"intro": [
"CommunityRule is a toolkit for drafting and publishing community governance documents (“Rules”). It is a project of the [Media Economies Design Lab](https://www.colorado.edu/lab/medlab/) at the University of Colorado Boulder. It is not legal advice."
"University counsel is reviewing CommunityRule's terms of service. The reviewed terms will be posted here before CommunityRule launches. Until then, every Rule starts private, and only the people you invite can read it until the person who holds the pen turns on a link. Questions? [Ask an organizer](dialog:ask-organizer)."
],
"sections": [
{
"heading": "Licenses",
"paragraphs": [
"Guides, template copy, and other materials we publish here, and Rules you publish, are licensed [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/). Do not publish material you cannot share under that license.",
"CommunityRule is open source. Application source code is [GPL-3.0 or later](https://www.gnu.org/licenses/gpl-3.0.html). You can read and fork it on [Gitea](https://git.medlab.host/CommunityRule/community-rule)."
]
},
{
"heading": "Templates API",
"paragraphs": [
"The curated template library is available as JSON without signing in. [GET /api/templates](/api/templates) lists templates; GET /api/templates/{slug} returns one template. Reuse that copy under CC BY-SA.",
"Do not overload this hosted API. If you need your own copy, run the GPL-licensed source yourself."
]
},
{
"heading": "Using the service",
"paragraphs": [
"Do not break, overload, or misuse the site or its APIs. We may suspend access to protect it or other people. The service is offered as-is for research and education; to the extent the law allows, MEDLab and the University of Colorado are not liable for your use of it or of a Rule created here.",
"Questions: [medlab@colorado.edu](mailto:medlab@colorado.edu)."
]
}
]
"sections": []
}
+16 -22
View File
@@ -1,5 +1,6 @@
import { describe, expect, test, vi } from "vitest";
import { screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { renderWithProviders as render } from "../utils/test-utils";
import PrivacyPage from "../../app/(marketing)/privacy/page";
import LegalDocumentPage from "../../app/(marketing)/_components/LegalDocumentPage";
@@ -111,38 +112,31 @@ describe("legal document pages", () => {
);
});
test("terms page covers licenses and the templates API, not ranking", async () => {
test("terms page is a counsel-review notice with no licensing claim", async () => {
const user = userEvent.setup();
await renderLegalPage("terms", messages.pages.terms);
const page = messages.pages.terms;
expect(
screen.getByRole("heading", { level: 1, name: page.banner.title }),
).toBeInTheDocument();
expect(page.banner.title).toBe("Our terms are being reviewed");
expect(page.intro.join(" ")).not.toMatch(/CC BY-SA/i);
expect(page.intro.join(" ")).not.toMatch(/licensed/i);
expect(page.sections).toEqual([]);
expect(screen.queryByRole("heading", { name: "Licenses" })).not.toBeInTheDocument();
expect(
screen.getByRole("heading", { level: 2, name: "Licenses" }),
).toBeInTheDocument();
expect(
screen.getByRole("heading", { level: 2, name: "Templates API" }),
).toBeInTheDocument();
expect(
screen.queryByRole("heading", { name: "Recommendations" }),
screen.queryByRole("heading", { name: "Templates API" }),
).not.toBeInTheDocument();
expect(
screen.getByRole("link", { name: "CC BY-SA 4.0" }),
).toHaveAttribute(
"href",
"https://creativecommons.org/licenses/by-sa/4.0/",
);
screen.getByText(/every Rule starts private/),
).toBeInTheDocument();
await user.click(screen.getByRole("button", { name: "Ask an organizer" }));
expect(screen.getByRole("dialog")).toBeInTheDocument();
expect(
screen.getByRole("link", { name: "GPL-3.0 or later" }),
).toHaveAttribute("href", "https://www.gnu.org/licenses/gpl-3.0.html");
expect(screen.getByRole("link", { name: "Gitea" })).toHaveAttribute(
"href",
"https://git.medlab.host/CommunityRule/community-rule",
);
expect(
screen.getByRole("link", { name: "GET /api/templates" }),
).toHaveAttribute("href", "/api/templates");
screen.getByRole("heading", { name: "Ask an organizer" }),
).toBeInTheDocument();
});
test("cookies settings page explains there are no optional cookies", async () => {