From 741a1dbb9faf5d283fb1b255ab0e88d1f3f747e7 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Mon, 16 Nov 2026 00:51:26 +0100 Subject: [PATCH 1/4] feat(legal): describe feature requests, priority tiers and fair use The maintainer approved standard add-ons, including two monthly feature-request priority tiers. The terms gain one section, EN and DA, after "Hosting and ending it": - hosted projects' feature requests are picked up in a monthly round at no extra cost; large wishes get a fixed-price quote; no hourly rates; - Priority picks requests up about weekly; Express starts work and replies within 1 business day; - fair use: one request in progress per customer at a time; - other add-ons are part of the order; monthly ones are billed with hosting, end with one month's notice and end with hosting. Draft for the danish-law review. Co-Authored-By: Claude Opus 5.5 --- src/components/business/legal-copy.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/components/business/legal-copy.ts b/src/components/business/legal-copy.ts index bf0124a3..8027c4d6 100644 --- a/src/components/business/legal-copy.ts +++ b/src/components/business/legal-copy.ts @@ -197,6 +197,12 @@ const terms = { 'As a private customer you can in any case end hosting with one month’s notice to the end of a month once five months have passed since the agreement. If you have paid for a period after the end date, I refund that amount immediately.', 'When hosting ends, I hand over your content and code as described in your proposal.', ] }, + { title: 'Feature requests and add-ons', blocks: [ + 'While your project is hosted, you can ask for new features. Requests are picked up in a monthly round, at no extra cost. A large wish, such as a whole new module or a new integration, gets a fixed-price quote first. There are no hourly rates.', + 'Two monthly add-ons speed this up. With Priority, requests are picked up about once a week. With Express, work on a request starts within 1 business day, and you get replies within 1 business day. Business days are Monday to Friday, except Danish public holidays.', + 'Fair use applies to every level: one request is in progress per customer at a time. The next request is picked up when the current one is finished.', + 'Other add-ons, such as an extra language or visitor statistics, are part of your order at the prices it states. A monthly add-on is billed with your hosting. You can end it by email with one month’s notice to the end of a month, and it ends with your hosting.', + ] }, { title: 'Faults and complaints', blocks: [ `If something delivered does not match what we agreed, write to ${company.email} within a reasonable time after you notice it. Then we will find a solution. If you are a private customer, the rules on defects in the Danish Sale of Goods Act (købeloven) may apply.`, 'If we cannot agree, a private customer can complain to Nævnenes Hus, Toldboden 2, 8800 Viborg. If you live in another EU country, the European Consumer Centre in Denmark (Forbruger Europa) can help.', @@ -262,6 +268,12 @@ const terms = { 'Som privatkunde kan du under alle omstændigheder opsige hostingen med en måneds varsel til udgangen af en måned, når der er gået fem måneder efter aftalens indgåelse. Har du betalt for en periode efter ophøret, tilbagebetaler jeg straks beløbet for den periode.', 'Når hostingen ophører, overdrager jeg dit indhold og din kode som beskrevet i dit tilbud.', ] }, + { title: 'Ønsker og tilvalg', blocks: [ + 'Mens dit projekt er hostet, kan du ønske nye funktioner. Ønsker tages op i en månedlig runde uden ekstra betaling. Et stort ønske, fx et helt nyt modul eller en ny integration, får først et tilbud til fast pris. Der er ingen timepriser.', + 'To månedlige tilvalg gør det hurtigere. Med Prioritet tages ønsker op cirka en gang om ugen. Med Ekspres begynder arbejdet på et ønske inden for 1 arbejdsdag, og du får svar inden for 1 arbejdsdag. Arbejdsdage er mandag til fredag undtagen danske helligdage.', + 'Rimelig brug gælder på alle niveauer: én opgave er under arbejde pr. kunde ad gangen. Det næste ønske tages op, når det aktuelle er færdigt.', + 'Andre tilvalg, fx et ekstra sprog eller besøgsstatistik, indgår i din ordre til de priser, den angiver. Et månedligt tilvalg betales sammen med hostingen. Du kan opsige det på e-mail med en måneds varsel til udgangen af en måned, og det ophører sammen med hostingen.', + ] }, { title: 'Fejl og klager', blocks: [ `Hvis det leverede ikke svarer til det aftalte, så skriv til ${company.email} inden rimelig tid efter, at du har opdaget det. Så finder vi en løsning. Er du privatkunde, kan købelovens mangelsregler finde anvendelse.`, 'Kan vi ikke blive enige, kan en privatkunde klage til Nævnenes Hus, Toldboden 2, 8800 Viborg. Bor du i et andet EU-land, kan Forbruger Europa hjælpe.', From 3a27152c01264fd27ae0ec23cad7a8ba1c82b269 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Mon, 16 Nov 2026 01:49:05 +0100 Subject: [PATCH 2/4] fix(legal): include small feature requests and make the tiers targets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The danish-law review and the maintainer's decisions on #621: - small, clearly bounded feature requests are included in hosting; only a large wish (a whole new module or a new integration) gets a fixed-price quote; - Priority and Express are targets, not guarantees, with an away clause for holidays and illness; - a monthly add-on can be ended in the portal or by email from the next month (Forbrugeraftaleloven § 28 a). Co-Authored-By: Claude Opus 5.5 --- src/components/business/legal-copy.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/business/legal-copy.ts b/src/components/business/legal-copy.ts index 8027c4d6..175924e9 100644 --- a/src/components/business/legal-copy.ts +++ b/src/components/business/legal-copy.ts @@ -198,10 +198,10 @@ const terms = { 'When hosting ends, I hand over your content and code as described in your proposal.', ] }, { title: 'Feature requests and add-ons', blocks: [ - 'While your project is hosted, you can ask for new features. Requests are picked up in a monthly round, at no extra cost. A large wish, such as a whole new module or a new integration, gets a fixed-price quote first. There are no hourly rates.', - 'Two monthly add-ons speed this up. With Priority, requests are picked up about once a week. With Express, work on a request starts within 1 business day, and you get replies within 1 business day. Business days are Monday to Friday, except Danish public holidays.', + 'While your project is hosted, you can send feature requests at any time. Small, clearly bounded requests are included in the monthly price and are picked up in a monthly round. A large wish, such as a whole new module or a new integration, gets a fixed-price quote before any work starts. There are no hourly rates.', + 'Two monthly add-ons speed this up. With Priority, the target is to pick up your requests about once a week. With Express, the target is to start work on a request within 1 business day and to reply within 1 business day. Business days are Monday to Friday, except Danish public holidays. These are targets, not guarantees: during holidays or illness they can take longer, and I tell you as early as I can.', 'Fair use applies to every level: one request is in progress per customer at a time. The next request is picked up when the current one is finished.', - 'Other add-ons, such as an extra language or visitor statistics, are part of your order at the prices it states. A monthly add-on is billed with your hosting. You can end it by email with one month’s notice to the end of a month, and it ends with your hosting.', + 'Other add-ons, such as an extra language or visitor statistics, are part of your order at the prices it states. A monthly add-on is billed with your hosting. You can end it in the portal or by email from the next month, and it ends with your hosting.', ] }, { title: 'Faults and complaints', blocks: [ `If something delivered does not match what we agreed, write to ${company.email} within a reasonable time after you notice it. Then we will find a solution. If you are a private customer, the rules on defects in the Danish Sale of Goods Act (købeloven) may apply.`, @@ -269,10 +269,10 @@ const terms = { 'Når hostingen ophører, overdrager jeg dit indhold og din kode som beskrevet i dit tilbud.', ] }, { title: 'Ønsker og tilvalg', blocks: [ - 'Mens dit projekt er hostet, kan du ønske nye funktioner. Ønsker tages op i en månedlig runde uden ekstra betaling. Et stort ønske, fx et helt nyt modul eller en ny integration, får først et tilbud til fast pris. Der er ingen timepriser.', - 'To månedlige tilvalg gør det hurtigere. Med Prioritet tages ønsker op cirka en gang om ugen. Med Ekspres begynder arbejdet på et ønske inden for 1 arbejdsdag, og du får svar inden for 1 arbejdsdag. Arbejdsdage er mandag til fredag undtagen danske helligdage.', + 'Mens dit projekt er hostet, kan du til enhver tid sende ønsker til nye funktioner. Små, klart afgrænsede ønsker er med i månedsprisen og tages op i en månedlig runde. Et stort ønske, fx et helt nyt modul eller en ny integration, får et tilbud til fast pris, før arbejdet begynder. Der er ingen timepriser.', + 'To månedlige tilvalg gør det hurtigere. Med Prioritet er målet at tage dine ønsker op cirka en gang om ugen. Med Ekspres er målet at begynde arbejdet på et ønske inden for 1 arbejdsdag og at svare inden for 1 arbejdsdag. Arbejdsdage er mandag til fredag undtagen danske helligdage. Det er mål, ikke garantier: Under ferie eller sygdom kan det tage længere tid, og jeg giver besked så tidligt, jeg kan.', 'Rimelig brug gælder på alle niveauer: én opgave er under arbejde pr. kunde ad gangen. Det næste ønske tages op, når det aktuelle er færdigt.', - 'Andre tilvalg, fx et ekstra sprog eller besøgsstatistik, indgår i din ordre til de priser, den angiver. Et månedligt tilvalg betales sammen med hostingen. Du kan opsige det på e-mail med en måneds varsel til udgangen af en måned, og det ophører sammen med hostingen.', + 'Andre tilvalg, fx et ekstra sprog eller besøgsstatistik, indgår i din ordre til de priser, den angiver. Et månedligt tilvalg betales sammen med hostingen. Du kan opsige det i portalen eller på e-mail fra næste måned, og det ophører sammen med hostingen.', ] }, { title: 'Fejl og klager', blocks: [ `Hvis det leverede ikke svarer til det aftalte, så skriv til ${company.email} inden rimelig tid efter, at du har opdaget det. Så finder vi en løsning. Er du privatkunde, kan købelovens mangelsregler finde anvendelse.`, From ae452f8768407dfd25c7b70c464c4510ec9b9445 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Mon, 16 Nov 2026 01:59:29 +0100 Subject: [PATCH 3/4] fix(legal): point feature requests at the hosting terms #625's hosting paragraph now says which feature requests are included and that they are picked up in a monthly round, one at a time. The add-on section refers to it instead of repeating it. Co-Authored-By: Claude Opus 5.5 --- src/components/business/legal-copy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/business/legal-copy.ts b/src/components/business/legal-copy.ts index 175924e9..dfc088b2 100644 --- a/src/components/business/legal-copy.ts +++ b/src/components/business/legal-copy.ts @@ -198,7 +198,7 @@ const terms = { 'When hosting ends, I hand over your content and code as described in your proposal.', ] }, { title: 'Feature requests and add-ons', blocks: [ - 'While your project is hosted, you can send feature requests at any time. Small, clearly bounded requests are included in the monthly price and are picked up in a monthly round. A large wish, such as a whole new module or a new integration, gets a fixed-price quote before any work starts. There are no hourly rates.', + 'You can send feature requests at any time while your project is hosted. Hosting and ending it says which are included and which get a fixed-price quote. There are no hourly rates.', 'Two monthly add-ons speed this up. With Priority, the target is to pick up your requests about once a week. With Express, the target is to start work on a request within 1 business day and to reply within 1 business day. Business days are Monday to Friday, except Danish public holidays. These are targets, not guarantees: during holidays or illness they can take longer, and I tell you as early as I can.', 'Fair use applies to every level: one request is in progress per customer at a time. The next request is picked up when the current one is finished.', 'Other add-ons, such as an extra language or visitor statistics, are part of your order at the prices it states. A monthly add-on is billed with your hosting. You can end it in the portal or by email from the next month, and it ends with your hosting.', @@ -269,7 +269,7 @@ const terms = { 'Når hostingen ophører, overdrager jeg dit indhold og din kode som beskrevet i dit tilbud.', ] }, { title: 'Ønsker og tilvalg', blocks: [ - 'Mens dit projekt er hostet, kan du til enhver tid sende ønsker til nye funktioner. Små, klart afgrænsede ønsker er med i månedsprisen og tages op i en månedlig runde. Et stort ønske, fx et helt nyt modul eller en ny integration, får et tilbud til fast pris, før arbejdet begynder. Der er ingen timepriser.', + 'Du kan til enhver tid sende ønsker til nye funktioner, mens dit projekt er hostet. Afsnittet om hosting og opsigelse beskriver, hvilke der er inkluderet, og hvilke der får et fastpristilbud. Der er ingen timepriser.', 'To månedlige tilvalg gør det hurtigere. Med Prioritet er målet at tage dine ønsker op cirka en gang om ugen. Med Ekspres er målet at begynde arbejdet på et ønske inden for 1 arbejdsdag og at svare inden for 1 arbejdsdag. Arbejdsdage er mandag til fredag undtagen danske helligdage. Det er mål, ikke garantier: Under ferie eller sygdom kan det tage længere tid, og jeg giver besked så tidligt, jeg kan.', 'Rimelig brug gælder på alle niveauer: én opgave er under arbejde pr. kunde ad gangen. Det næste ønske tages op, når det aktuelle er færdigt.', 'Andre tilvalg, fx et ekstra sprog eller besøgsstatistik, indgår i din ordre til de priser, den angiver. Et månedligt tilvalg betales sammen med hostingen. Du kan opsige det i portalen eller på e-mail fra næste måned, og det ophører sammen med hostingen.', From be0ce1e108d02cf7db022381a6730dec03d785d2 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Mon, 16 Nov 2026 04:33:33 +0100 Subject: [PATCH 4/4] fix(legal): keep add-on terms behind their release gate Gate only the new bilingual add-on section with a private build setting. Pin runtime packages off, exercise both rendered states and inherited-setting refusal, and track retirement in #632. Part of #21. --- scripts/check-svelte-company.sh | 18 +++++++++--------- scripts/package-runtime.sh | 2 +- scripts/vat-activation.test.mjs | 7 +++++-- src/components/business/legal-copy.ts | 18 +++++++++--------- web/README.md | 6 ++++++ web/src/env.ts | 1 + web/src/lib/legal.server.ts | 4 ++-- web/tests/company-output.mjs | 6 ++++++ web/tests/legal-copy.test.ts | 17 +++++++++++++++++ 9 files changed, 56 insertions(+), 23 deletions(-) diff --git a/scripts/check-svelte-company.sh b/scripts/check-svelte-company.sh index bc5ab6f0..46821ef4 100644 --- a/scripts/check-svelte-company.sh +++ b/scripts/check-svelte-company.sh @@ -4,15 +4,15 @@ set -euo pipefail cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." scratch="$(mktemp -d)" trap 'rm -rf "$scratch"' EXIT -unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY PUBLIC_CONTENT_PROFILE COMPANY_POSTAL_ADDRESS +unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY FEATURE_ADDON_TERMS PUBLIC_CONTENT_PROFILE COMPANY_POSTAL_ADDRESS bash scripts/build-journal-reference.sh > "$scratch/content.log" 2>&1 || { tail -80 "$scratch/content.log" >&2; exit 1; } for mode in false published preview independent template unset; do - unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY PUBLIC_CONTENT_PROFILE COMPANY_POSTAL_ADDRESS + unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY FEATURE_ADDON_TERMS PUBLIC_CONTENT_PROFILE COMPANY_POSTAL_ADDRESS case "$mode" in - false) export FEATURE_COMPANY_IDENTITY=false FEATURE_OFFER_COPY=false ;; - published) export FEATURE_COMPANY_IDENTITY=true FEATURE_OFFER_COPY=false ;; - preview|template) export FEATURE_COMPANY_IDENTITY=true FEATURE_OFFER_COPY=true FEATURE_PORTAL_PRIVACY=true ;; - independent) export FEATURE_COMPANY_IDENTITY=false FEATURE_OFFER_COPY=true ;; + false) export FEATURE_COMPANY_IDENTITY=false FEATURE_OFFER_COPY=false FEATURE_ADDON_TERMS=false ;; + published) export FEATURE_COMPANY_IDENTITY=true FEATURE_OFFER_COPY=false FEATURE_ADDON_TERMS=false ;; + preview|template) export FEATURE_COMPANY_IDENTITY=true FEATURE_OFFER_COPY=true FEATURE_PORTAL_PRIVACY=true FEATURE_ADDON_TERMS=true ;; + independent) export FEATURE_COMPANY_IDENTITY=false FEATURE_OFFER_COPY=true FEATURE_ADDON_TERMS=true ;; esac export COMPANY_POSTAL_ADDRESS=$'Example & company-address-fixture-187 1\n1234 Exampletown' if [[ "$mode" == template ]]; then @@ -30,8 +30,8 @@ for mode in false published preview independent template unset; do done # Native framework validation must reject ambiguous switches before output. -unset COMPANY_POSTAL_ADDRESS PUBLIC_CONTENT_PROFILE FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY -for flag in FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY; do +unset COMPANY_POSTAL_ADDRESS PUBLIC_CONTENT_PROFILE FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY FEATURE_ADDON_TERMS +for flag in FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY FEATURE_ADDON_TERMS; do if env "$flag=ambiguous" npm --prefix web run build > "$scratch/rejected.log" 2>&1; then printf 'Invalid business setting was accepted: %s\n' "$flag" >&2; exit 1 fi @@ -52,7 +52,7 @@ if PUBLIC_CONTENT_PROFILE=invalid npm --prefix web run build > "$scratch/rejecte fi grep -q 'PUBLIC_CONTENT_PROFILE must be' "$scratch/rejected.log" # With identity off the public application needs no private disclosure input. -unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY COMPANY_POSTAL_ADDRESS PUBLIC_CONTENT_PROFILE +unset FEATURE_COMPANY_IDENTITY FEATURE_OFFER_COPY FEATURE_PORTAL_PRIVACY FEATURE_ADDON_TERMS COMPANY_POSTAL_ADDRESS PUBLIC_CONTENT_PROFILE npm --prefix web run build > "$scratch/default.log" 2>&1 node web/tests/check-output.mjs enabled node web/tests/check-discovery-output.mjs enabled diff --git a/scripts/package-runtime.sh b/scripts/package-runtime.sh index d0dac74f..0937259a 100644 --- a/scripts/package-runtime.sh +++ b/scripts/package-runtime.sh @@ -25,7 +25,7 @@ cleanup_inputs() { } trap cleanup_inputs EXIT build_env=(env -u FEATURE_SVELTE_FRONTEND -u FEATURE_CLIENT_PORTFOLIO -u FEATURE_PREVIEW_BANNER -u FEATURE_OFFER_COPY -u FEATURE_FEATURED_PORTFOLIO -u FEATURE_COMPANY_IDENTITY -u COMPANY_POSTAL_ADDRESS -u PUBLIC_STARS_SNAPSHOT -u PUBLIC_CONTENT_PROFILE) -build_env+=("PUBLIC_CONTENT_PROFILE=$profile" "FEATURE_COMPANY_IDENTITY=false" "COMPANY_POSTAL_ADDRESS=" "FEATURE_PREVIEW_BANNER=false" "FEATURE_OFFER_COPY=false" "FEATURE_PORTAL_PRIVACY=false" "FEATURE_CLIENT_PORTFOLIO=true" "FEATURE_FEATURED_PORTFOLIO=true") +build_env+=("PUBLIC_CONTENT_PROFILE=$profile" "FEATURE_COMPANY_IDENTITY=false" "COMPANY_POSTAL_ADDRESS=" "FEATURE_PREVIEW_BANNER=false" "FEATURE_OFFER_COPY=false" "FEATURE_PORTAL_PRIVACY=false" "FEATURE_ADDON_TERMS=false" "FEATURE_CLIENT_PORTFOLIO=true" "FEATURE_FEATURED_PORTFOLIO=true") if [[ "$profile" == production-template ]]; then inputs="$(mktemp -d "$output/public-inputs.XXXXXX")" bash scripts/refresh-public-stars.sh "$inputs/stars.json" diff --git a/scripts/vat-activation.test.mjs b/scripts/vat-activation.test.mjs index 49a86db7..485287f0 100644 --- a/scripts/vat-activation.test.mjs +++ b/scripts/vat-activation.test.mjs @@ -9,7 +9,7 @@ import { load } from 'js-yaml'; const ci = load(readFileSync('.github/workflows/ci.yaml', 'utf8')); // The served production image is CI's production-template package. Its packager, // not the workflow, selects the presentation, so CI passes none of these settings. -const presentation = ['FEATURE_COMPANY_IDENTITY', 'FEATURE_OFFER_COPY', 'FEATURE_PORTAL_PRIVACY', 'FEATURE_VAT_PRICES', 'FEATURE_CUSTOMER_SCOPE']; +const presentation = ['FEATURE_COMPANY_IDENTITY', 'FEATURE_OFFER_COPY', 'FEATURE_PORTAL_PRIVACY', 'FEATURE_ADDON_TERMS', 'FEATURE_VAT_PRICES', 'FEATURE_CUSTOMER_SCOPE']; const runtimeJob = workflow => workflow.jobs?.['test-combined-runtime']; const productionPackages = workflow => runtimeJob(workflow)?.steps?.filter(step => step.run === 'bash scripts/package-runtime.sh --release --production-template') ?? []; const currentRuntimeCI = workflow => { @@ -18,6 +18,7 @@ const currentRuntimeCI = workflow => { .every(env => presentation.every(flag => !Object.hasOwn(env ?? {}, flag))); }; const current = state => state.FEATURE_COMPANY_IDENTITY === 'true' && state.FEATURE_OFFER_COPY === 'false' && state.FEATURE_PORTAL_PRIVACY === 'false' && + state.FEATURE_ADDON_TERMS === 'false' && !Object.hasOwn(state, 'FEATURE_VAT_PRICES') && !Object.hasOwn(state, 'FEATURE_CUSTOMER_SCOPE'); const packagerSource = readFileSync('scripts/package-runtime.sh', 'utf8'); /** Run the actual (or a changed) packager; the build double records every FEATURE_ setting it receives. */ @@ -122,7 +123,7 @@ for (const mode of ['missing', 'duplicate', 'skipped', 'ignored', 'no-address', test('the actual production runtime packager selects confirmed VAT, identity and customer invitation', () => { assert.ok(currentRuntimeCI(ci), 'CI builds the production package once and passes it no presentation setting'); assert.ok(current(productionPresentation())); - assert.ok(current(productionPresentation(packagerSource, { FEATURE_COMPANY_IDENTITY: 'false', FEATURE_OFFER_COPY: 'true', FEATURE_PORTAL_PRIVACY: 'true' })), + assert.ok(current(productionPresentation(packagerSource, { FEATURE_COMPANY_IDENTITY: 'false', FEATURE_OFFER_COPY: 'true', FEATURE_PORTAL_PRIVACY: 'true', FEATURE_ADDON_TERMS: 'true' })), 'inherited settings cannot change the production presentation'); }); for (const flag of presentation) { @@ -152,6 +153,8 @@ for (const [mode, from, to] of [ ['ambiguous offer', '"FEATURE_OFFER_COPY=false"', '"FEATURE_OFFER_COPY=ambiguous"'], ['portal privacy unpinned', ' "FEATURE_PORTAL_PRIVACY=false"', ''], ['portal privacy released', '"FEATURE_PORTAL_PRIVACY=false"', '"FEATURE_PORTAL_PRIVACY=true"'], + ['add-on terms unpinned', ' "FEATURE_ADDON_TERMS=false"', ''], + ['add-on terms released', '"FEATURE_ADDON_TERMS=false"', '"FEATURE_ADDON_TERMS=true"'], ['legacy VAT', production, `${production} "FEATURE_VAT_PRICES=false"`], ['stale audience', production, `${production} "FEATURE_CUSTOMER_SCOPE=false"`], ]) { diff --git a/src/components/business/legal-copy.ts b/src/components/business/legal-copy.ts index dfc088b2..cec7ece8 100644 --- a/src/components/business/legal-copy.ts +++ b/src/components/business/legal-copy.ts @@ -142,7 +142,7 @@ const privacy = (portal: boolean) => ({ }, }) satisfies Record; -const terms = { +const terms = (addons: boolean) => ({ en: { title: 'Terms for projects and hosting', description: 'How agreements with Devantler Tech work: proposals, prices, payment, your right of withdrawal and ending hosting.', @@ -197,12 +197,12 @@ const terms = { 'As a private customer you can in any case end hosting with one month’s notice to the end of a month once five months have passed since the agreement. If you have paid for a period after the end date, I refund that amount immediately.', 'When hosting ends, I hand over your content and code as described in your proposal.', ] }, - { title: 'Feature requests and add-ons', blocks: [ + ...(addons ? [{ title: 'Feature requests and add-ons', blocks: [ 'You can send feature requests at any time while your project is hosted. Hosting and ending it says which are included and which get a fixed-price quote. There are no hourly rates.', 'Two monthly add-ons speed this up. With Priority, the target is to pick up your requests about once a week. With Express, the target is to start work on a request within 1 business day and to reply within 1 business day. Business days are Monday to Friday, except Danish public holidays. These are targets, not guarantees: during holidays or illness they can take longer, and I tell you as early as I can.', 'Fair use applies to every level: one request is in progress per customer at a time. The next request is picked up when the current one is finished.', 'Other add-ons, such as an extra language or visitor statistics, are part of your order at the prices it states. A monthly add-on is billed with your hosting. You can end it in the portal or by email from the next month, and it ends with your hosting.', - ] }, + ] }] : []), { title: 'Faults and complaints', blocks: [ `If something delivered does not match what we agreed, write to ${company.email} within a reasonable time after you notice it. Then we will find a solution. If you are a private customer, the rules on defects in the Danish Sale of Goods Act (købeloven) may apply.`, 'If we cannot agree, a private customer can complain to Nævnenes Hus, Toldboden 2, 8800 Viborg. If you live in another EU country, the European Consumer Centre in Denmark (Forbruger Europa) can help.', @@ -268,12 +268,12 @@ const terms = { 'Som privatkunde kan du under alle omstændigheder opsige hostingen med en måneds varsel til udgangen af en måned, når der er gået fem måneder efter aftalens indgåelse. Har du betalt for en periode efter ophøret, tilbagebetaler jeg straks beløbet for den periode.', 'Når hostingen ophører, overdrager jeg dit indhold og din kode som beskrevet i dit tilbud.', ] }, - { title: 'Ønsker og tilvalg', blocks: [ + ...(addons ? [{ title: 'Ønsker og tilvalg', blocks: [ 'Du kan til enhver tid sende ønsker til nye funktioner, mens dit projekt er hostet. Afsnittet om hosting og opsigelse beskriver, hvilke der er inkluderet, og hvilke der får et fastpristilbud. Der er ingen timepriser.', 'To månedlige tilvalg gør det hurtigere. Med Prioritet er målet at tage dine ønsker op cirka en gang om ugen. Med Ekspres er målet at begynde arbejdet på et ønske inden for 1 arbejdsdag og at svare inden for 1 arbejdsdag. Arbejdsdage er mandag til fredag undtagen danske helligdage. Det er mål, ikke garantier: Under ferie eller sygdom kan det tage længere tid, og jeg giver besked så tidligt, jeg kan.', 'Rimelig brug gælder på alle niveauer: én opgave er under arbejde pr. kunde ad gangen. Det næste ønske tages op, når det aktuelle er færdigt.', 'Andre tilvalg, fx et ekstra sprog eller besøgsstatistik, indgår i din ordre til de priser, den angiver. Et månedligt tilvalg betales sammen med hostingen. Du kan opsige det i portalen eller på e-mail fra næste måned, og det ophører sammen med hostingen.', - ] }, + ] }] : []), { title: 'Fejl og klager', blocks: [ `Hvis det leverede ikke svarer til det aftalte, så skriv til ${company.email} inden rimelig tid efter, at du har opdaget det. Så finder vi en løsning. Er du privatkunde, kan købelovens mangelsregler finde anvendelse.`, 'Kan vi ikke blive enige, kan en privatkunde klage til Nævnenes Hus, Toldboden 2, 8800 Viborg. Bor du i et andet EU-land, kan Forbruger Europa hjælpe.', @@ -285,11 +285,11 @@ const terms = { ] }, ], }, -} as const satisfies Record; +}) as const satisfies Record; export type LegalKind = 'privacy' | 'terms'; -/** One legal page; portal-only privacy text appears only when `portal` is true. */ -export function legalPage(kind: LegalKind, locale: Locale, portal: boolean): LegalPage { - return kind === 'privacy' ? privacy(portal)[locale] : terms[locale]; +/** Portal privacy and add-on terms have independent, default-off releases. */ +export function legalPage(kind: LegalKind, locale: Locale, portal: boolean, addons = false): LegalPage { + return kind === 'privacy' ? privacy(portal)[locale] : terms(addons)[locale]; } diff --git a/web/README.md b/web/README.md index 2e861363..b1cb0c67 100644 --- a/web/README.md +++ b/web/README.md @@ -57,6 +57,12 @@ HTML documents; shared data, scripts and unrelated routes must never carry it. L fictional addresses. `PUBLIC_CONTENT_PROFILE=production-template` retains the existing Go runtime's escaped address placeholders. Invalid profiles fail. Revised-offer copy remains separately gated. +`FEATURE_ADDON_TERMS` is an independent server-only, default-off build setting for the +English/Danish add-on terms. Ordinary and production-template runtime packages pin it off, +including when the invoking environment enables it. Preview builds may set it to `true`. +Coordinated add-on activation and live bilingual verification precede its retirement in +[#632](https://github.com/devantler-tech/business-site/issues/632). + The approved VAT-inclusive guide prices, public/private customer invitation, six-tool catalogue and bilingual content are permanent. The old frontend variable has no effect. Unsupported old preview/client/featured presentation combinations fail rather than silently changing the result. diff --git a/web/src/env.ts b/web/src/env.ts index 79df5588..d091d78a 100644 --- a/web/src/env.ts +++ b/web/src/env.ts @@ -5,6 +5,7 @@ export const variables = defineEnvVars({ FEATURE_COMPANY_IDENTITY: { static: true, schema: parseBooleanRelease }, FEATURE_OFFER_COPY: { static: true, schema: parseBooleanRelease }, FEATURE_PORTAL_PRIVACY: { static: true, schema: parseBooleanRelease }, + FEATURE_ADDON_TERMS: { static: true, schema: parseBooleanRelease }, COMPANY_POSTAL_ADDRESS: { static: true, schema: (value) => value }, PUBLIC_CONTENT_PROFILE: { static: true, schema: (value) => { if (value === undefined || value === "default") return "default"; diff --git a/web/src/lib/legal.server.ts b/web/src/lib/legal.server.ts index 3619f7c5..59f94e63 100644 --- a/web/src/lib/legal.server.ts +++ b/web/src/lib/legal.server.ts @@ -1,5 +1,5 @@ import { error } from "@sveltejs/kit"; -import { FEATURE_COMPANY_IDENTITY, FEATURE_PORTAL_PRIVACY } from "$app/env/private"; +import { FEATURE_ADDON_TERMS, FEATURE_COMPANY_IDENTITY, FEATURE_PORTAL_PRIVACY } from "$app/env/private"; import { legalPage, type LegalKind } from "../../../src/components/business/legal-copy"; // The privacy notice and customer terms name the registered business, so they @@ -8,5 +8,5 @@ import { legalPage, type LegalKind } from "../../../src/components/business/lega export function legalPageLoad(kind: LegalKind, locale: string | undefined) { if (!FEATURE_COMPANY_IDENTITY || (locale !== undefined && locale !== "da")) error(404); const selected: "en" | "da" = locale === "da" ? "da" : "en"; - return { locale: selected, kind, copy: legalPage(kind, selected, FEATURE_PORTAL_PRIVACY) }; + return { locale: selected, kind, copy: legalPage(kind, selected, FEATURE_PORTAL_PRIVACY, FEATURE_ADDON_TERMS) }; } diff --git a/web/tests/company-output.mjs b/web/tests/company-output.mjs index 7695940c..ed9e687d 100644 --- a/web/tests/company-output.mjs +++ b/web/tests/company-output.mjs @@ -20,6 +20,7 @@ const links = node => walk(node).filter(item => item.tagName === "a").map(item = const files = dir => readdirSync(dir, {withFileTypes:true}).flatMap(entry => entry.isDirectory() ? files(join(dir,entry.name)) : [join(dir,entry.name)]); /** The portal's privacy section is released separately from the rest of the notice. */ const portalPrivacy = process.env.FEATURE_PORTAL_PRIVACY === "true"; +const addonTerms = process.env.FEATURE_ADDON_TERMS === "true"; /** The published phone number, or "" until the business adds one to company.json. */ const companyPhone = JSON.parse(readFileSync(new URL("../../src/data/company.json", import.meta.url), "utf8")).phone?.trim() ?? ""; @@ -105,6 +106,11 @@ export function assertCompanyOutput(candidate, {identity, scope, template, addre if (kind === "privacy") for (const phrase of ["accounts.devantler.tech", locale === "da" ? "30 dage" : "30 days", "GitHub"]) { assert.equal(text(main).includes(phrase), portalPrivacy, `portal privacy text follows FEATURE_PORTAL_PRIVACY: ${phrase}`); } + if (kind === "terms") { + for (const phrase of locale === "da" ? ["Ønsker og tilvalg", "mål, ikke garantier"] : ["Feature requests and add-ons", "targets, not guarantees"]) { + assert.equal(text(main).includes(phrase), addonTerms, `add-on terms follow FEATURE_ADDON_TERMS: ${phrase}`); + } + } } const path = join(candidate,`${prefix}company/index.html`); if (!identity) { assert.equal(existsSync(path),false,"disabled company route must be absent, not merely empty"); continue; } diff --git a/web/tests/legal-copy.test.ts b/web/tests/legal-copy.test.ts index 3fd79cc4..f2680d08 100644 --- a/web/tests/legal-copy.test.ts +++ b/web/tests/legal-copy.test.ts @@ -20,3 +20,20 @@ test("the portal's privacy text appears only when FEATURE_PORTAL_PRIVACY is on", test("the terms do not depend on the portal flag", () => { for (const locale of ["en", "da"] as const) assert.deepEqual(legalPage("terms", locale, true), legalPage("terms", locale, false)); }); + +test("add-on terms remain absent until their independent release is enabled", () => { + for (const locale of ["en", "da"] as const) { + const heading = locale === "da" ? "Ønsker og tilvalg" : "Feature requests and add-ons"; + const published = legalPage("terms", locale, false); + const off = legalPage("terms", locale, true, false); + const on = legalPage("terms", locale, false, true); + assert.deepEqual(off, published, "portal privacy cannot activate add-on terms"); + assert.ok(!flat(published).includes(heading), `${locale} draft add-on terms leaked`); + assert.ok(flat(on).includes(heading), `${locale} enabled add-on terms missing`); + assert.match(flat(on), locale === "da" ? /mål, ikke garantier/ : /targets, not guarantees/); + assert.deepEqual(on.sections.filter(section => section.title !== heading), published.sections, + "activation changes only the add-on section, retaining the published hosting terms"); + assert.deepEqual(legalPage("privacy", locale, true, true), legalPage("privacy", locale, true), + "add-on terms cannot change portal privacy"); + } +});