feat: add legacy service terms

This commit is contained in:
Codex
2026-07-29 16:23:21 +08:00
parent 8735a88ef6
commit 00bbf193e4
6 changed files with 1330 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import { redirectToLegalDocument } from "../legalDocumentRedirect";
export default function ServiceTermsRedirect() {
redirectToLegalDocument("service-terms");
}
+1
View File
@@ -34,6 +34,7 @@ export function SiteShell({ children }: { children: ReactNode }) {
<a href="/cozsweet/data-deletion.html">Data Deletion</a> <a href="/cozsweet/data-deletion.html">Data Deletion</a>
<a href="/cozsweet/membership-agreement.html">Membership Agreement</a> <a href="/cozsweet/membership-agreement.html">Membership Agreement</a>
<a href="/cozsweet/auto-renewal-agreement.html">Auto-Renewal Agreement</a> <a href="/cozsweet/auto-renewal-agreement.html">Auto-Renewal Agreement</a>
<a href="/cozsweet/service-terms.html">Terms of Service</a>
</div> </div>
</nav> </nav>
</div> </div>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+18
View File
@@ -23,6 +23,11 @@ const legalDocuments = [
title: "Auto-Renewal Service Agreement - CozSweet", title: "Auto-Renewal Service Agreement - CozSweet",
marker: "AUTO-RENEWAL SERVICE AGREEMENT", marker: "AUTO-RENEWAL SERVICE AGREEMENT",
}, },
{
path: "../public/service-terms.html",
title: "Terms of Service - elio",
marker: "DESCRIPTION OF SERVICE",
},
{ {
path: "../public/cozsweet/privacy-policy.html", path: "../public/cozsweet/privacy-policy.html",
title: "Privacy Policy - CozSweet", title: "Privacy Policy - CozSweet",
@@ -43,6 +48,11 @@ const legalDocuments = [
title: "Auto-Renewal Service Agreement - CozSweet", title: "Auto-Renewal Service Agreement - CozSweet",
marker: "AUTO-RENEWAL SERVICE AGREEMENT", marker: "AUTO-RENEWAL SERVICE AGREEMENT",
}, },
{
path: "../public/cozsweet/service-terms.html",
title: "Terms of Service - elio",
marker: "DESCRIPTION OF SERVICE",
},
]; ];
for (const document of legalDocuments) { for (const document of legalDocuments) {
@@ -70,6 +80,7 @@ for (const documentName of [
"data-deletion", "data-deletion",
"membership-agreement", "membership-agreement",
"auto-renewal-agreement", "auto-renewal-agreement",
"service-terms",
]) { ]) {
test(`keeps both ${documentName} URLs byte-identical`, async () => { test(`keeps both ${documentName} URLs byte-identical`, async () => {
const rootDocument = await readFile( const rootDocument = await readFile(
@@ -94,6 +105,7 @@ test("exposes all legal documents from the site footer", async () => {
"/cozsweet/data-deletion.html", "/cozsweet/data-deletion.html",
"/cozsweet/membership-agreement.html", "/cozsweet/membership-agreement.html",
"/cozsweet/auto-renewal-agreement.html", "/cozsweet/auto-renewal-agreement.html",
"/cozsweet/service-terms.html",
]) { ]) {
assert.ok(source.includes(`href="${href}"`), `Missing footer link: ${href}`); assert.ok(source.includes(`href="${href}"`), `Missing footer link: ${href}`);
} }
@@ -110,6 +122,7 @@ test("redirects the legacy .html URLs through the worker", async () => {
"data-deletion", "data-deletion",
"membership-agreement", "membership-agreement",
"auto-renewal-agreement", "auto-renewal-agreement",
"service-terms",
]) { ]) {
assert.ok( assert.ok(
source.includes( source.includes(
@@ -118,4 +131,9 @@ test("redirects the legacy .html URLs through the worker", async () => {
`Missing legacy redirect: ${documentName}`, `Missing legacy redirect: ${documentName}`,
); );
} }
assert.ok(
source.includes('"/cozsweet/data-deletion/": "/data-deletion.html"'),
"Missing trailing-slash data deletion redirect",
);
}); });
+6
View File
@@ -24,6 +24,12 @@ const LEGAL_DOCUMENT_REDIRECTS: Record<string, string> = {
"/cozsweet/data-deletion.html": "/data-deletion.html", "/cozsweet/data-deletion.html": "/data-deletion.html",
"/cozsweet/membership-agreement.html": "/membership-agreement.html", "/cozsweet/membership-agreement.html": "/membership-agreement.html",
"/cozsweet/auto-renewal-agreement.html": "/auto-renewal-agreement.html", "/cozsweet/auto-renewal-agreement.html": "/auto-renewal-agreement.html",
"/cozsweet/service-terms.html": "/service-terms.html",
"/cozsweet/privacy-policy/": "/privacy-policy.html",
"/cozsweet/data-deletion/": "/data-deletion.html",
"/cozsweet/membership-agreement/": "/membership-agreement.html",
"/cozsweet/auto-renewal-agreement/": "/auto-renewal-agreement.html",
"/cozsweet/service-terms/": "/service-terms.html",
}; };
// Image security config. SVG sources with .svg extension auto-skip the // Image security config. SVG sources with .svg extension auto-skip the