From e739473bcdcfae3c9c6b3a69636d435bd0dadc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Wed, 13 May 2026 12:17:34 +0400 Subject: [PATCH] Derive consent mode from geolocation, not banner config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The consent mode is now determined dynamically by the visitor's country and its applicable regulation. The configured consent_mode column is dropped from cookie_banners and added to cookie_consent_records to persist the geo-derived mode at consent-recording time. When no regulation matches, the default is OPT_OUT. Signed-off-by: Émile Ré --- .../cookie-banners/NewCookieBannerPage.tsx | 34 +++++-------------- .../_components/BannerSettingsForm.tsx | 20 +---------- e2e/console/cookie_banner_test.go | 25 +++----------- e2e/console/cookie_banner_versioning_test.go | 2 -- e2e/internal/factory/factory.go | 6 ---- .../cookieBanner/activate.operation.ts | 1 - .../actions/cookieBanner/create.operation.ts | 27 --------------- .../cookieBanner/deactivate.operation.ts | 1 - .../actions/cookieBanner/get.operation.ts | 1 - .../actions/cookieBanner/getAll.operation.ts | 1 - .../actions/cookieBanner/update.operation.ts | 30 ---------------- pkg/cmd/cookie-banner/create/create.go | 17 ---------- pkg/cmd/cookie-banner/list/list.go | 14 ++++---- pkg/cmd/cookie-banner/update/update.go | 5 --- pkg/cmd/cookie-banner/view/view.go | 3 -- pkg/cookiebanner/regulation.go | 6 ++-- pkg/cookiebanner/service.go | 32 ++++------------- pkg/cookiebanner/service_test.go | 13 ++++--- pkg/cookiebanner/snapshot.go | 1 - pkg/coredata/cookie_banner.go | 12 ------- pkg/coredata/cookie_banner_version.go | 1 - pkg/coredata/cookie_consent_record.go | 7 ++++ pkg/coredata/migrations/20260513T075812Z.sql | 16 +++++++++ .../api/console/v1/cookie_banner_resolvers.go | 2 -- .../console/v1/graphql/cookie_banner.graphql | 3 -- .../api/console/v1/types/cookie_banner.go | 1 - pkg/server/api/cookiebanner/v1/handler.go | 12 +++++-- pkg/server/api/mcp/v1/schema.resolvers.go | 5 --- pkg/server/api/mcp/v1/specification.yaml | 15 -------- pkg/server/api/mcp/v1/types/cookie_banner.go | 1 - 30 files changed, 68 insertions(+), 246 deletions(-) create mode 100644 pkg/coredata/migrations/20260513T075812Z.sql diff --git a/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx b/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx index 811259409..ec93bff6a 100644 --- a/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx +++ b/apps/console/src/pages/organizations/cookie-banners/NewCookieBannerPage.tsx @@ -21,10 +21,7 @@ import { Card, Field, Input, - Label, - Option, PageHeader, - Select, useToast, } from "@probo/ui"; import { type FormEvent, useState } from "react"; @@ -63,7 +60,6 @@ export default function NewCookieBannerPage() { const [cookiePolicyUrl, setCookiePolicyUrl] = useState(""); const [privacyPolicyUrl, setPrivacyPolicyUrl] = useState(""); const [consentExpiryDays, setConsentExpiryDays] = useState("365"); - const [consentMode, setConsentMode] = useState("OPT_IN"); const handleSubmit = (e: FormEvent) => { e.preventDefault(); @@ -77,7 +73,6 @@ export default function NewCookieBannerPage() { cookiePolicyUrl, privacyPolicyUrl: privacyPolicyUrl || undefined, consentExpiryDays: parseInt(consentExpiryDays, 10), - consentMode: consentMode as "OPT_IN" | "OPT_OUT", }, }, onCompleted(data) { @@ -155,26 +150,15 @@ export default function NewCookieBannerPage() { /> -
-
- - setConsentExpiryDays(e.target.value)} - min="1" - required - /> -
- -
- - -
-
+ + setConsentExpiryDays(e.target.value)} + min="1" + required + /> +