From 4b90bce006ed30b6b17507d24aeb1ed52c5291ca Mon Sep 17 00:00:00 2001 From: adilallo <39313955+adilallo@users.noreply.github.com> Date: Mon, 23 Nov 2026 10:40:16 -0700 Subject: [PATCH] Replace the terms page CC BY-SA claim with a counsel-review notice. Login still agrees to Terms of Service, but the page no longer says a community Rule is openly licensed, and Ask an organizer opens the inquiry dialog. --- .../_components/LegalAskOrganizerLink.tsx | 33 ++++++++++++++++ .../_components/LegalDocumentPage.tsx | 6 ++- messages/en/metadata.json | 6 +-- messages/en/pages/terms.json | 36 ++++-------------- tests/pages/legal.test.tsx | 38 ++++++++----------- 5 files changed, 64 insertions(+), 55 deletions(-) create mode 100644 app/(marketing)/_components/LegalAskOrganizerLink.tsx diff --git a/app/(marketing)/_components/LegalAskOrganizerLink.tsx b/app/(marketing)/_components/LegalAskOrganizerLink.tsx new file mode 100644 index 0000000..0a89354 --- /dev/null +++ b/app/(marketing)/_components/LegalAskOrganizerLink.tsx @@ -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 ( + <> + + + + ); +} diff --git a/app/(marketing)/_components/LegalDocumentPage.tsx b/app/(marketing)/_components/LegalDocumentPage.tsx index a8d247a..7ed506c 100644 --- a/app/(marketing)/_components/LegalDocumentPage.tsx +++ b/app/(marketing)/_components/LegalDocumentPage.tsx @@ -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(); + key += 1; + } else if (href === "/privacy" && !isPrivacyPolicyEnabled()) { nodes.push(label); } else if (isSafeHref(href)) { const isInternal = href.startsWith("/") && !href.startsWith("//"); diff --git a/messages/en/metadata.json b/messages/en/metadata.json index d7d8339..f0a513b 100644 --- a/messages/en/metadata.json +++ b/messages/en/metadata.json @@ -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", diff --git a/messages/en/pages/terms.json b/messages/en/pages/terms.json index 0da0a73..b3051a9 100644 --- a/messages/en/pages/terms.json +++ b/messages/en/pages/terms.json @@ -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": [] } diff --git a/tests/pages/legal.test.tsx b/tests/pages/legal.test.tsx index 30e1efe..27dea77 100644 --- a/tests/pages/legal.test.tsx +++ b/tests/pages/legal.test.tsx @@ -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 () => {