Add slug to cookie categories for stable consent identifiers
The category slug provides a stable, URL-safe key used as the data-cookie-consent attribute value and consent data key, replacing the fragile category name. This prevents breakage when categories are renamed. - Add slug column with unique-per-banner constraint and backfill migration - Add Slug validator (lowercase alphanumeric + hyphens) - Propagate slug through GraphQL schema, service layer, and snapshot - Update console UI with slug field in create/edit forms - Switch cookie-banner widget to use slug as consent data keys Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -119,6 +119,7 @@ type CookieCategory implements Node {
|
||||
id: ID!
|
||||
cookieBanner: CookieBanner @goField(forceResolver: true)
|
||||
name: String!
|
||||
slug: String!
|
||||
description: String!
|
||||
kind: CookieCategoryKind!
|
||||
rank: Int!
|
||||
@@ -300,6 +301,7 @@ input PublishCookieBannerVersionInput {
|
||||
input CreateCookieCategoryInput {
|
||||
cookieBannerId: ID!
|
||||
name: String!
|
||||
slug: String!
|
||||
description: String!
|
||||
rank: Int!
|
||||
}
|
||||
@@ -307,6 +309,7 @@ input CreateCookieCategoryInput {
|
||||
input UpdateCookieCategoryInput {
|
||||
cookieCategoryId: ID!
|
||||
name: String
|
||||
slug: String
|
||||
description: String
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user