Add the Privacy and Terms pages, data requests and click-to-load embeds
- Privacy Policy (with cookies and storage) and Terms of Service, from what the code actually stores and loads; shared LegalText layout - Data requests: a 'privacy' feedback type sent from the Privacy page's form, email required, triaged in Admin -> Feedback - Migration 039: Panel -> Site settings -> Privacy contact email (over site.json's privacyEmail), shown on the Privacy page - The hero livestream, the hero featured video and schedule maps load only when pressed, so no third party sets anything before a click - A small dismissible privacy notice instead of a consent banner Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
bff082652a
commit
ee61568911
17 changed files with 507 additions and 81 deletions
|
|
@ -29,10 +29,10 @@ const LIMITS = {
|
|||
|
||||
const MIN_MESSAGE = 10;
|
||||
|
||||
// Must match FEEDBACK_TYPES in src/pages/sections/FeedbackForm.jsx.
|
||||
// Must match FEEDBACK_TYPES and DATA_REQUEST in src/data/feedbackTypes.ts.
|
||||
// Anything else falls back to 'general' rather than being rejected,
|
||||
// a renamed option shouldn't lose someone's submission.
|
||||
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other"];
|
||||
const TYPES = ["broken", "confusing", "outdated", "request", "praise", "other", "privacy"];
|
||||
|
||||
/* ── Input cleaning ──────────────────────────────────────────── */
|
||||
|
||||
|
|
@ -76,6 +76,10 @@ feedback.post("/", async (c) => {
|
|||
const errors = {};
|
||||
if (message.length < MIN_MESSAGE) errors.message = "Please write a little more.";
|
||||
if (!looksLikeEmail(email)) errors.email = "That email doesn't look right.";
|
||||
// A data request (Privacy page) has to be answerable.
|
||||
else if (feedbackType === "privacy" && !email) {
|
||||
errors.email = "We need an email address to reply to a data request.";
|
||||
}
|
||||
|
||||
if (Object.keys(errors).length > 0) {
|
||||
return c.json({ error: "Validation failed", fields: errors }, 422);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue