Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: clean up legacy consent management UI fields #1826

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
650 changes: 0 additions & 650 deletions scripts/legacyConsentConfigMigrator.py

This file was deleted.

22 changes: 4 additions & 18 deletions scripts/schemaGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import warnings
from enum import Enum
import argparse
from legacyConsentConfigMigrator import restructure_legacy_consent_fields
from utils import (
get_json_from_file,
get_json_diff,
Expand Down Expand Up @@ -1513,7 +1512,6 @@ def get_schema_diff(name, selector, shouldUpdateSchema=False):
action="store_true",
help="Will update existing schema with any changes",
)
parser.add_argument("-restructureLegacyConsentFields", action="store_true")
group.add_argument(
"-name", metavar="name", type=str, help="Enter the folder name under selector"
)
Expand All @@ -1527,27 +1525,15 @@ def get_schema_diff(name, selector, shouldUpdateSchema=False):
selector = args.selector
shouldUpdateSchema = args.update

# THIS IS A TEMPORARY OPTION TO RESTRUCTURE LEGACY CONSENT FIELDS
# THIS WILL BE REMOVED ONCE ALL THE DESTINATIONS ARE UPDATED
restructureLegacyConsentFields = args.restructureLegacyConsentFields

dir_path = f"./{CONFIG_DIR}/{selector}s"
if args.all:
if not os.path.isdir(dir_path):
print(f"No {selector}s folder found")
exit(1)

if restructureLegacyConsentFields:
restructure_legacy_consent_fields(os.listdir(dir_path), dir_path)
else:
current_items = os.listdir(dir_path)
for name in current_items:
get_schema_diff(name, selector, shouldUpdateSchema)
current_items = os.listdir(dir_path)
for name in current_items:
get_schema_diff(name, selector, shouldUpdateSchema)
else:
name = args.name
if restructureLegacyConsentFields:
restructure_legacy_consent_fields(
[dest_name.strip() for dest_name in name.split(",")], dir_path
)
else:
get_schema_diff(name, selector, shouldUpdateSchema)
get_schema_diff(name, selector, shouldUpdateSchema)
72 changes: 72 additions & 0 deletions scripts/template-ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,78 @@
"title": "Web SDK settings",
"note": "not visible in the ui",
"fields": []
},
"consentSettingsTemplate": {
"title": "Consent settings",
"note": "not visible in the ui",
"fields": [
{
"type": "dynamicCustomForm",
"configKey": "consentManagement",
"default": [],
"rowFields": [
{
"type": "singleSelect",
"label": "Consent management provider",
"configKey": "provider",
"options": [
{
"label": "Custom",
"value": "custom"
},
{
"label": "Ketch",
"value": "ketch"
},
{
"label": "OneTrust",
"value": "oneTrust"
}
],
"default": "oneTrust",
"required": true
},
{
"type": "singleSelect",
"label": "the required consent logic",
"configKey": "resolutionStrategy",
"options": [
{
"label": "AND",
"value": "and"
},
{
"label": "OR",
"value": "or"
}
],
"required": true,
"variant": "badge",
"preRequisites": {
"fields": [
{
"configKey": "provider",
"value": "custom"
}
]
}
},
{
"type": "tagInput",
"label": "Enter consent category IDs",
"note": "Input your consent category IDs by pressing 'Enter' after each entry. We recommend using IDs instead of names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"configKey": "consents",
"tagKey": "consent",
"placeholder": "e.g: Marketing",
"default": [
{
"consent": ""
}
]
}
]
}
]
}
}
}
64 changes: 3 additions & 61 deletions src/configurations/destinations/active_campaign/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,56 +112,6 @@
"title": "Consent settings",
"note": "not visible in the ui",
"fields": [
{
"type": "tagInput",
"label": "OneTrust consent category IDs",
"note": "Input your OneTrust category IDs by pressing 'Enter' after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"configKey": "oneTrustCookieCategories",
"tagKey": "oneTrustCookieCategory",
"placeholder": "e.g: C0001",
"default": [
{
"oneTrustCookieCategory": ""
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "tagInput",
"label": "Ketch consent purpose IDs",
"note": "Input your Ketch consent purpose IDs by pressing 'Enter' after each entry.",
"configKey": "ketchConsentPurposes",
"tagKey": "purpose",
"placeholder": "e.g: marketing",
"default": [
{
"purpose": ""
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "dynamicCustomForm",
"configKey": "consentManagement",
Expand Down Expand Up @@ -215,8 +165,8 @@
},
{
"type": "tagInput",
"label": "Enter consent category ID’s",
"note": "Input your consent category IDs by pressing Enter after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"label": "Enter consent category IDs",
"note": "Input your consent category IDs by pressing 'Enter' after each entry. We recommend using IDs instead of names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"configKey": "consents",
"tagKey": "consent",
"placeholder": "e.g: Marketing",
Expand All @@ -226,15 +176,7 @@
}
]
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": true
}
]
}
]
}
]
}
Expand Down
69 changes: 3 additions & 66 deletions src/configurations/destinations/adj/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,66 +134,11 @@
{
"title": "Consent Settings",
"fields": [
{
"type": "dynamicCustomForm",
"value": "oneTrustCookieCategories",
"label": "OneTrust Consent Category IDs",
"footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"customFields": [
{
"type": "textInput",
"placeholder": "C0001",
"value": "oneTrustCookieCategory",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$",
"label": "Category ID",
"required": false
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "dynamicCustomForm",
"value": "ketchConsentPurposes",
"label": "Ketch Consent Purpose IDs",
"customFields": [
{
"type": "textInput",
"placeholder": "marketing",
"value": "purpose",
"label": "Purpose ID",
"regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$",
"required": false
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "dynamicCustomForm",
"value": "consentManagement",
"label": "Consent management settings",
"footerNote": "The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"footerNote": "We recommend using IDs instead of names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"customFields": [
{
"type": "singleSelect",
Expand Down Expand Up @@ -247,7 +192,7 @@
{
"type": "dynamicCustomForm",
"value": "consents",
"label": "Enter consent category ID’s",
"label": "Enter consent category IDs",
"customFields": [
{
"type": "textInput",
Expand All @@ -258,15 +203,7 @@
}
]
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": true
}
]
}
]
}
]
}
Expand Down
64 changes: 3 additions & 61 deletions src/configurations/destinations/adobe_analytics/ui-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -876,56 +876,6 @@
"title": "Consent settings",
"note": "not visible in the ui",
"fields": [
{
"type": "tagInput",
"label": "OneTrust consent category IDs",
"note": "Input your OneTrust category IDs by pressing 'Enter' after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"configKey": "oneTrustCookieCategories",
"tagKey": "oneTrustCookieCategory",
"placeholder": "e.g: C0001",
"default": [
{
"oneTrustCookieCategory": ""
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "tagInput",
"label": "Ketch consent purpose IDs",
"note": "Input your Ketch consent purpose IDs by pressing 'Enter' after each entry.",
"configKey": "ketchConsentPurposes",
"tagKey": "purpose",
"placeholder": "e.g: marketing",
"default": [
{
"purpose": ""
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": false
},
{
"configKey": "AMP_enable-gcm"
}
],
"featureFlagsCondition": "or"
}
},
{
"type": "dynamicCustomForm",
"configKey": "consentManagement",
Expand Down Expand Up @@ -979,8 +929,8 @@
},
{
"type": "tagInput",
"label": "Enter consent category ID’s",
"note": "Input your consent category IDs by pressing Enter after each entry. The support for category names is deprecated. We recommend using the category IDs instead of the names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"label": "Enter consent category IDs",
"note": "Input your consent category IDs by pressing 'Enter' after each entry. We recommend using IDs instead of names as IDs are unique and less likely to change over time, making them a more reliable choice.",
"configKey": "consents",
"tagKey": "consent",
"placeholder": "e.g: Marketing",
Expand All @@ -990,15 +940,7 @@
}
]
}
],
"preRequisites": {
"featureFlags": [
{
"configKey": "AMP_enable-gcm",
"value": true
}
]
}
]
}
]
}
Expand Down
Loading
Loading