From 54ac1fef3a868c491bcee9deff4b735e6d14edaa Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Tue, 1 Aug 2023 11:10:30 +0530 Subject: [PATCH 1/5] feat(iterable): move to new ui --- .../destinations/iterable/db-config.json | 22 +- .../destinations/iterable/schema.json | 230 ++++++-- .../destinations/iterable/ui-config.json | 553 ++++++++++++------ 3 files changed, 574 insertions(+), 231 deletions(-) diff --git a/src/configurations/destinations/iterable/db-config.json b/src/configurations/destinations/iterable/db-config.json index 0c040ce67..2ef6f6c53 100644 --- a/src/configurations/destinations/iterable/db-config.json +++ b/src/configurations/destinations/iterable/db-config.json @@ -29,9 +29,7 @@ "iconPath", "isRequiredToDismissMessage", "closeButtonPosition", - "oneTrustCookieCategories", - "preferUserId", - "mergeNestedObjects" + "oneTrustCookieCategories" ], "excludeKeys": [], "supportedSourceTypes": [ @@ -46,7 +44,19 @@ "flutter", "cordova" ], - "supportedMessageTypes": ["identify", "page", "screen", "track", "alias"], + "supportedMessageTypes": [ + "identify", + "page", + "screen", + "track", + "alias" + ], + "supportedConnectionModes": { + "web": [ + "cloud", + "device" + ] + }, "destConfig": { "defaultConfig": [ "apiKey", @@ -68,7 +78,6 @@ "displayInterval", "onOpenScreenReaderMessage", "onOpenNodeToTakeFocus", - "packageName", "rightOffset", "topOffset", "bottomOffset", @@ -79,7 +88,8 @@ "closeButtonColorSideOffset", "iconPath", "isRequiredToDismissMessage", - "closeButtonPosition" + "closeButtonPosition", + "connectionMode" ] }, "secretKeys": [] diff --git a/src/configurations/destinations/iterable/schema.json b/src/configurations/destinations/iterable/schema.json index 639492251..fee06c4e9 100644 --- a/src/configurations/destinations/iterable/schema.json +++ b/src/configurations/destinations/iterable/schema.json @@ -46,64 +46,202 @@ "initialisationIdentifier": { "type": "object", "properties": { - "web": { "type": "string", "enum": ["email", "userId"], "default": "email" } + "web": { + "type": "string", + "enum": [ + "email", + "userId" + ], + "default": "email" + } } }, - "sendTrackForInapp": { "type": "object", "properties": { "web": { "type": "boolean" } } }, - "packageName": { "type": "object", "properties": { "web": { "type": "string" } } }, - "animationDuration": { "type": "object", "properties": { "web": { "type": "string" } } }, - "bottomOffset": { "type": "object", "properties": { "web": { "type": "string" } } }, - "rightOffset": { "type": "object", "properties": { "web": { "type": "string" } } }, - "topOffset": { "type": "object", "properties": { "web": { "type": "string" } } }, - "displayInterval": { "type": "object", "properties": { "web": { "type": "string" } } }, - "handleLinks": { + "sendTrackForInapp": { "type": "object", "properties": { "web": { - "type": "string", - "enum": ["open-all-new-tab", "open-all-same-tab", "external-new-tab", ""] + "type": "boolean" } } }, - "onOpenScreenReaderMessage": { - "type": "object", - "properties": { "web": { "type": "string" } } - }, - "onOpenNodeToTakeFocus": { "type": "object", "properties": { "web": { "type": "string" } } }, - "closeButtonColor": { "type": "object", "properties": { "web": { "type": "string" } } }, - "closeButtonSize": { "type": "object", "properties": { "web": { "type": "string" } } }, - "closeButtonPosition": { "type": "object", "properties": { "web": { "type": "string" } } }, - "closeButtonColorTopOffset": { - "type": "object", - "properties": { "web": { "type": "string" } } - }, - "closeButtonColorSideOffset": { - "type": "object", - "properties": { "web": { "type": "string" } } - }, - "iconPath": { "type": "object", "properties": { "web": { "type": "string" } } }, - "isRequiredToDismissMessage": { + "packageName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + } + }, + "animationDuration": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "bottomOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "rightOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "topOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "displayInterval": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "handleLinks": { + "type": "object", + "properties": { + "web": { + "type": "string", + "enum": [ + "open-all-new-tab", + "open-all-same-tab", + "external-new-tab", + "" + ] + } + } + }, + "onOpenScreenReaderMessage": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "onOpenNodeToTakeFocus": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "closeButtonColor": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "closeButtonSize": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "closeButtonPosition": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "closeButtonColorTopOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "closeButtonColorSideOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "iconPath": { + "type": "object", + "properties": { + "web": { + "type": "string" + } + } + }, + "isRequiredToDismissMessage": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, + "mapToSingleEvent": { + "type": "boolean", + "default": true + }, + "trackAllPages": { + "type": "boolean", + "default": false + }, + "trackCategorisedPages": { + "type": "boolean", + "default": true + }, + "trackNamedPages": { + "type": "boolean", + "default": true + }, + "preferUserId": { + "type": "boolean", + "default": true + }, + "mergeNestedObjects": { + "type": "boolean", + "default": true + }, + "oneTrustCookieCategories": { + "type": "array", + "items": { "type": "object", - "properties": { "web": { "type": "boolean" } } - }, - "mapToSingleEvent": { "type": "boolean", "default": true }, - "trackAllPages": { "type": "boolean", "default": false }, - "trackCategorisedPages": { "type": "boolean", "default": true }, - "trackNamedPages": { "type": "boolean", "default": true }, - "preferUserId": { "type": "boolean", "default": true }, - "mergeNestedObjects": { "type": "boolean", "default": true }, - "oneTrustCookieCategories": { - "type": "array", - "items": { - "type": "object", - "properties": { - "oneTrustCookieCategory": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" - } + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" } } } + }, + "connectionMode": { + "type": "object", + "properties": { + "web": { + "type": "string", + "enum": [ + "cloud", + "device" + ] + } + } } } } diff --git a/src/configurations/destinations/iterable/ui-config.json b/src/configurations/destinations/iterable/ui-config.json index 7e536c8f8..56e51aa78 100644 --- a/src/configurations/destinations/iterable/ui-config.json +++ b/src/configurations/destinations/iterable/ui-config.json @@ -1,291 +1,486 @@ { - "uiConfig": [ - { - "title": "Connection Settings:", - "fields": [ - { - "type": "textInput", - "label": "Iterable Api Key", - "value": "apiKey", - "required": true, - "placeholder": "e.g: 42f187310705012194bd0bd694905664ae", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", - "regexErrorMessage": "Invalid Iterable Api Key" - } - ] - }, - { - "title": "Native SDK", + "uiConfig": { + "baseTemplate": [ + { + "title": "Initial setup", + "note": "Review how this destination is set up", + "sections": [ + { + "groups": [ + { + "title": "One click checkout", + "note": "Update your connection settings here", + "icon": "settings", + "fields": [ + { + "type": "textInput", + "label": "Iterable Api Key", + "configKey": "apiKey", + "regex": "^(.{1,100})$", + "regexErrorMessage": "Invalid Iterable Api Key", + "placeholder": "e.g: 42f187310705012194bd0bd694905664ae" + }, + { + "type": "textInput", + "label": "Package Name", + "configKey": "packageName", + "regex": "^(.{1,100})$", + "regexErrorMessage": "Invalid package name", + "note": "Iterable package name. Applicable to device mode only", + "placeholder": "e.g: my-website" + } + ] + } + ] + }, + { + "groups": [ + { + "title": "Connection mode", + "note": [ + "Update how you want to route events from your source to destination. ", + { + "text": "Get help deciding", + "link": "https://www.rudderstack.com/docs/destinations/rudderstack-connection-modes/" + } + ], + "icon": "sliders", + "fields": [] + } + ] + } + ] + }, + { + "title": "Configuration settings", + "note": "Manage the settings for your destination", + "sections": [ + { + "title": "Destination settings", + "note": "Configure advanced destination-specific settings here", + "icon": "settings", + "groups": [ + { + "title": "Page and Screen settings", + "note": "Set how you want to send your page and screen calls to Iterable", + "icon": "file", + "fields": [ + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Map All Pages to Single Event Name", + "configKey": "mapToSingleEvent", + "default": true + }, + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Track All Pages", + "configKey": "trackAllPages", + "default": false + }, + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Track Categorised Pages", + "configKey": "trackCategorisedPages", + "default": true + }, + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Track Named Pages", + "configKey": "trackNamedPages", + "default": true + } + ] + }, + { + "title": "Identify and Track settings", + "icon": "magnifyingGlass", + "note": "Configure your Identify and Track calls properties settings here", + "fields": [ + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "textInput", + "label": "Iterable Mobile/Web Api Key", + "configKey": "registerDeviceOrBrowserApiKey", + "placeholder": "e.g: 42f187310705012194bd0bd694905664ae", + "regex": "^(.{0,100})$", + "regexErrorMessage": "Invalid Iterable Mobile/Web Api Key", + "note": "Iterable mobile/web key is required when you are sending token information in an identify call. RudderStack will use this key for registerDevice or registerBrowser api call" + }, + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Create new user if userID exists", + "configKey": "preferUserId", + "default": true, + "note": [ + "For more information about preferUserId refer ", + { + "text": "this", + "link": "https://api.iterable.com/api/docs#users_updateUser" + }, + " link" + ] + }, + { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.cloud", + "value": true + } + ] + }, + "type": "checkbox", + "label": "Merge top-level objects", + "configKey": "mergeNestedObjects", + "default": true, + "note": [ + "For more information about mergeNestedObjects refer ", + { + "text": "this", + "link": "https://api.iterable.com/api/docs#users_updateUser" + }, + " link" + ] + } + ] + } + ] + }, + { + "title": "Other settings", + "note": "Configure advanced RudderStack features here", + "icon": "otherSettings", + "groups": [ + { + "title": "Client-side event filtering", + "note": "Decide what events are allowed (allowlisting) and blocked (denylisting)", + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.webDevice", + "value": true + }, + { + "configKey": "connectionModes.mobileDevice", + "value": true + } + ], + "condition": "or" + }, + "fields": [ + { + "type": "singleSelect", + "label": "Choose if you want to turn on events filtering:", + "configKey": "eventFilteringOption", + "note": "You must select either allowlist or denylist to enable events filtering", + "options": [ + { + "label": "Disabled", + "value": "disable" + }, + { + "label": "Filter via allowlist", + "value": "whitelistedEvents" + }, + { + "label": "Filter via denylist", + "value": "blacklistedEvents" + } + ], + "default": "disable" + }, + { + "type": "tagInput", + "label": "Allowlisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to allowlist.", + "configKey": "whitelistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "whitelistedEvents" + } + ] + } + }, + { + "type": "tagInput", + "label": "Denylisted events", + "note": "Input separate events by pressing ‘Enter’.\nInput the events you want to denylist. ", + "configKey": "blacklistedEvents", + "tagKey": "eventName", + "placeholder": "e.g: Anonymous page visit", + "default": [ + { + "eventName": "" + } + ], + "preRequisites": { + "fields": [ + { + "configKey": "eventFilteringOption", + "value": "blacklistedEvents" + } + ] + } + } + ] + }, + { + "title": "OneTrust cookie consent settings", + "note": [ + "Enter your OneTrust category names if you have them configured. ", + { + "text": "Learn more ", + "link": "https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/onetrust-consent-manager/" + }, + "about RudderStack’s OneTrust Consent Manager feature." + ], + "fields": [ + { + "type": "tagInput", + "label": "Cookie category name", + "note": "Input your OneTrust category names by pressing ‘Enter’ after each entry", + "configKey": "oneTrustCookieCategories", + "tagKey": "oneTrustCookieCategory", + "placeholder": "e.g: Credit card visit", + "default": [ + { + "oneTrustCookieCategory": "" + } + ] + } + ] + } + ] + } + ] + } + ], + "sdkTemplate": { + "title": "Web SDK settings", + "note": "not visible in the ui", "fields": [ { - "type": "checkbox", - "label": "Use device-mode to send events", - "value": "useNativeSDK", - "default": true - }, - { - "type": "dynamicCustomForm", - "value": "getInAppEventMapping", + "type": "tagInput", "label": "Mapping to trigger the getInApp messages", - "customFields": [ + "configKey": "getInAppEventMapping", + "tagKey": "eventName", + "default": [ { - "type": "textInput", - "value": "eventName", - "required": false, - "placeholder": "e.g: Trigger inApp" + "eventName": "" } ], - "footerNote": "Set the event names for which you want to trigger the web in-app push events" + "note": "Set the event names for which you want to trigger the web in-app push events" }, { - "type": "dynamicCustomForm", - "value": "purchaseEventMapping", + "type": "tagInput", "label": "Mapping to trigger the purchase events", - "customFields": [ + "configKey": "purchaseEventMapping", + "tagKey": "eventName", + "default": [ { - "type": "textInput", - "value": "eventName", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "required": false, - "placeholder": "e.g: Trigger purchase" + "eventName": "" } ], - "footerNote": "Set the event names for which you want to trigger the purchase events" + "note": "Set the event names for which you want to trigger the purchase events" }, { "type": "singleSelect", "label": "Identifier to identify a user over a session", - "value": "initialisationIdentifier", + "configKey": "initialisationIdentifier", "options": [ { - "name": "Email", + "label": "Email", "value": "email" }, { - "name": "UserID", + "label": "UserID", "value": "userId" } ], - "defaultOption": { - "name": "Email", - "value": "email" - } + "default": "email" }, { "type": "checkbox", "label": "Trigger a track event for web in-app push", - "value": "sendTrackForInapp", + "configKey": "sendTrackForInapp", "default": false, - "footerNote": "Enable this if you want to track web in-app push notifications." - }, - { - "type": "textInput", - "label": "Package Name", - "value": "packageName", - "required": true, - "placeholder": "e.g: my-website" + "note": "Enable this if you want to track web in-app push notifications" }, { "type": "textInput", "label": "Time (in ms) for messages to animate in and out", - "value": "animationDuration", - "required": false, + "configKey": "animationDuration", "placeholder": "e.g: 400" }, { "type": "textInput", - "label": "Space (px or %) between screen bottom & messages.", - "value": "bottomOffset", - "required": false, + "label": "Space (px or %) between screen bottom & messages", + "configKey": "bottomOffset", "placeholder": "e.g: 20%", - "footerNote": "Set the spacing between the screen bottom and push notification pop-up. This is not applicable for center, top, or full-screen messages" + "note": "Set the spacing between the screen bottom and push notification pop-up. This is not applicable for center, top, or full-screen messages" }, { "type": "textInput", - "label": "Space (px or %) between screen right & messages.", - "value": "rightOffset", - "required": false, + "label": "Space (px or %) between screen right & messages", + "configKey": "rightOffset", "placeholder": "e.g: 20%", - "footerNote": "Set the spacing between the screen right and push notification pop-up. This is not applicable for center, top, or full-screen messages." + "note": "Set the spacing between the screen right and push notification pop-up. This is not applicable for center, top, or full-screen messages" }, { "type": "textInput", - "label": "Space (px or %) between screen top & messages.", - "value": "topOffset", - "required": false, + "label": "Space (px or %) between screen top & messages", + "configKey": "topOffset", "placeholder": "e.g: 20%", - "footerNote": "Set the spacing between the screen top and push notification pop-up. This is not applicable for center, top, or full-screen messages." + "note": "Set the spacing between the screen top and push notification pop-up. This is not applicable for center, top, or full-screen messages" }, { "type": "textInput", "label": "Wait time for next message", - "value": "displayInterval", - "required": false, + "configKey": "displayInterval", "placeholder": "e.g: 25000", - "footerNote": "Time (in ms) to wait before showing next in-app message after closing the currently opened one." + "note": "Time (in ms) to wait before showing next in-app message after closing the currently opened one" }, { "type": "singleSelect", - "label": "Control how to open links.", - "value": "handleLinks", - "required": false, + "label": "Control how to open links", + "configKey": "handleLinks", + "note": "Set how do you want the links present in the push notification to open", "options": [ { - "name": "Open all in new tabs", + "label": "Open all in new tabs", "value": "open-all-new-tab" }, { - "name": "Open all in same tabs", + "label": "Open all in same tabs", "value": "open-all-same-tab" }, { - "name": "Open in external new tab", + "label": "Open in external new tab", "value": "external-new-tab" } ], - "footerNote": "Set how do you want the links present in the push notification to open." + "default": "open-all-new-tab" }, { "type": "textInput", "label": "Screen Reader Text", - "value": "onOpenScreenReaderMessage", - "required": false, + "configKey": "onOpenScreenReaderMessage", "placeholder": "e.g: Reader message here", - "footerNote": "Text that screen reader should use to announce when opening in-app messages." + "note": "Text that screen reader should use to announce when opening in-app messages" }, { "type": "textInput", "label": "Focus Element", - "value": "onOpenNodeToTakeFocus", - "required": false, + "configKey": "onOpenNodeToTakeFocus", "placeholder": "e.g: input", - "footerNote": "Specify the DOM element to take keyboard focus when the in-app message opens." + "note": "Specify the DOM element to take keyboard focus when the in-app message opens" }, { "type": "textInput", "label": "Color of Close button", - "value": "closeButtonColor", - "required": false, + "configKey": "closeButtonColor", "placeholder": "e.g: cyan" }, { - "type": "textInput", - "label": "Size of Close button", - "value": "closeButtonSize", - "required": false, - "placeholder": "e.g: 24" - }, - { - "type": "textInput", - "label": "Position", - "value": "closeButtonPosition", - "required": false, - "footerNote": "Cross button's position relative to the in-app message.", + "type": "singleSelect", + "label": "Position of Close button", + "configKey": "closeButtonPosition", + "note": "Cross button's position relative to the in-app message", "options": [ { - "name": "Top Right", - "value": "otop-right" + "label": "Top Right", + "value": "top-right" }, { - "name": "Top Left", + "label": "Top Left", "value": "top-left" } - ] + ], + "default": "top-right" }, { "type": "textInput", "label": "Space between button & container top", - "value": "closeButtonColorTopOffset", - "required": false, + "configKey": "closeButtonColorTopOffset", "placeholder": "e.g: 4%", - "footerNote": "Set the spacing between the cross button and the pop-up notification's top border" + "note": "Set the spacing between the cross button and the pop-up notification's top border" }, { "type": "textInput", "label": "Space between button & container side", - "value": "closeButtonColorSideOffset", - "required": false, + "configKey": "closeButtonColorSideOffset", "placeholder": "e.g: 4%", - "footerNote": "Set the spacing between the cross button and the pop-up notification's side borders" + "note": "Set the spacing between the cross button and the pop-up notification's side borders" }, { "type": "textInput", "label": "Custom pathname", - "value": "iconPath", - "required": false, + "configKey": "iconPath", "placeholder": "e.g: path/to/icon", - "footerNote": "image or SVG to show instead of the default X" + "note": "image or SVG to show instead of the default X" }, { "type": "checkbox", "label": "Prevent user dismissing in-app message by clicking outside message", - "value": "isRequiredToDismissMessage", - "default": false - } - ] - }, - { - "title": "Other Settings", - "fields": [ - { - "type": "checkbox", - "label": "Map All Pages to Single Event Name", - "value": "mapToSingleEvent", - "default": true - }, - { - "type": "checkbox", - "label": "Track All Pages", - "value": "trackAllPages", - "default": false - }, - { - "type": "checkbox", - "label": "Track Categorised Pages", - "value": "trackCategorisedPages", - "default": true - }, - { - "type": "checkbox", - "label": "Track Named Pages", - "value": "trackNamedPages", - "default": true - }, - { - "type": "checkbox", - "label": "Create new user if userID exists", - "value": "preferUserId", - "footerNote": "For more information refer preferUserId in this link https://api.iterable.com/api/docs#users_updateUser", - "default": true - }, - { - "type": "checkbox", - "label": "Merge top-level objects", - "value": "mergeNestedObjects", - "footerNote": "For more information refer mergeNestedObjects in this link https://api.iterable.com/api/docs#users_updateUser", - "default": true - } - ] - }, - { - "title": "Consent Settings", - "fields": [ - { - "type": "dynamicCustomForm", - "value": "oneTrustCookieCategories", - "label": "OneTrust Cookie Categories", - "customFields": [ - { - "type": "textInput", - "placeholder": "Marketing", - "value": "oneTrustCookieCategory", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$", - "label": "Category Name/ID", - "required": false - } - ] + "configKey": "isRequiredToDismissMessage" } ] } - ] + } } From b364fad5350e2724b4966dfbed6548800afd887e Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Tue, 1 Aug 2023 17:16:43 +0530 Subject: [PATCH 2/5] chore: additional improvements --- .../destinations/iterable/db-config.json | 13 +- .../destinations/iterable/schema.json | 349 ++++++++++-------- .../destinations/iterable/ui-config.json | 8 + .../validation/destinations/iterable.json | 197 ++++++++-- 4 files changed, 380 insertions(+), 187 deletions(-) diff --git a/src/configurations/destinations/iterable/db-config.json b/src/configurations/destinations/iterable/db-config.json index 2ef6f6c53..ae38804cd 100644 --- a/src/configurations/destinations/iterable/db-config.json +++ b/src/configurations/destinations/iterable/db-config.json @@ -60,13 +60,14 @@ "destConfig": { "defaultConfig": [ "apiKey", - "mapToSingleEvent", + "packageName", + "preferUserId", "trackAllPages", - "trackCategorisedPages", "trackNamedPages", - "oneTrustCookieCategories", - "preferUserId", - "mergeNestedObjects" + "mapToSingleEvent", + "mergeNestedObjects", + "trackCategorisedPages", + "oneTrustCookieCategories" ], "web": [ "useNativeSDK", @@ -94,4 +95,4 @@ }, "secretKeys": [] } -} +} \ No newline at end of file diff --git a/src/configurations/destinations/iterable/schema.json b/src/configurations/destinations/iterable/schema.json index fee06c4e9..5903b4db9 100644 --- a/src/configurations/destinations/iterable/schema.json +++ b/src/configurations/destinations/iterable/schema.json @@ -1,14 +1,23 @@ { "configSchema": { "$schema": "http://json-schema.org/draft-07/schema#", - "required": ["apiKey"], + "required": [ + "apiKey" + ], "type": "object", "properties": { "apiKey": { "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" }, - "useNativeSDK": { "type": "object", "properties": { "web": { "type": "boolean" } } }, + "useNativeSDK": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } + } + }, "getInAppEventMapping": { "type": "object", "properties": { @@ -64,184 +73,210 @@ } } }, - "packageName": { - "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" - } - }, - "animationDuration": { - "type": "object", - "properties": { - "web": { - "type": "string" + "animationDuration": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "bottomOffset": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "bottomOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "rightOffset": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "rightOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "topOffset": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "topOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "displayInterval": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "displayInterval": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "handleLinks": { - "type": "object", - "properties": { - "web": { - "type": "string", - "enum": [ - "open-all-new-tab", - "open-all-same-tab", - "external-new-tab", - "" - ] + }, + "handleLinks": { + "type": "object", + "properties": { + "web": { + "type": "string", + "enum": [ + "open-all-new-tab", + "open-all-same-tab", + "external-new-tab", + "" + ] + } } - } - }, - "onOpenScreenReaderMessage": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "onOpenScreenReaderMessage": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "onOpenNodeToTakeFocus": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "onOpenNodeToTakeFocus": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "closeButtonColor": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "closeButtonColor": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "closeButtonSize": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "closeButtonSize": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "closeButtonPosition": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "closeButtonPosition": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "closeButtonColorTopOffset": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "closeButtonColorTopOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "closeButtonColorSideOffset": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "closeButtonColorSideOffset": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "iconPath": { - "type": "object", - "properties": { - "web": { - "type": "string" + }, + "iconPath": { + "type": "object", + "properties": { + "web": { + "type": "string" + } } - } - }, - "isRequiredToDismissMessage": { - "type": "object", - "properties": { - "web": { - "type": "boolean" + }, + "isRequiredToDismissMessage": { + "type": "object", + "properties": { + "web": { + "type": "boolean" + } } - } - }, - "mapToSingleEvent": { - "type": "boolean", - "default": true - }, - "trackAllPages": { - "type": "boolean", - "default": false - }, - "trackCategorisedPages": { - "type": "boolean", - "default": true - }, - "trackNamedPages": { - "type": "boolean", - "default": true - }, - "preferUserId": { - "type": "boolean", - "default": true - }, - "mergeNestedObjects": { - "type": "boolean", - "default": true - }, - "oneTrustCookieCategories": { - "type": "array", - "items": { + }, + "mapToSingleEvent": { + "type": "boolean", + "default": true + }, + "trackAllPages": { + "type": "boolean", + "default": false + }, + "trackCategorisedPages": { + "type": "boolean", + "default": true + }, + "trackNamedPages": { + "type": "boolean", + "default": true + }, + "preferUserId": { + "type": "boolean", + "default": true + }, + "mergeNestedObjects": { + "type": "boolean", + "default": true + }, + "oneTrustCookieCategories": { + "type": "array", + "items": { + "type": "object", + "properties": { + "oneTrustCookieCategory": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + } + } + } + }, + "connectionMode": { "type": "object", "properties": { - "oneTrustCookieCategory": { + "web": { "type": "string", - "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + "enum": [ + "cloud", + "device" + ] } } } }, - "connectionMode": { - "type": "object", - "properties": { - "web": { - "type": "string", - "enum": [ - "cloud", - "device" + "anyOf": [ + { + "if": { + "properties": { + "connectionMode": { + "type": "object", + "properties": { + "web": { + "const": "device" + } + } + } + }, + "required": [ + "connectionMode" + ] + }, + "then": { + "properties": { + "packageName": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" + } + }, + "required": [ + "packageName" ] } } - } + ] } -} +} \ No newline at end of file diff --git a/src/configurations/destinations/iterable/ui-config.json b/src/configurations/destinations/iterable/ui-config.json index 56e51aa78..41a22cb8d 100644 --- a/src/configurations/destinations/iterable/ui-config.json +++ b/src/configurations/destinations/iterable/ui-config.json @@ -21,6 +21,14 @@ "placeholder": "e.g: 42f187310705012194bd0bd694905664ae" }, { + "preRequisites": { + "fields": [ + { + "configKey": "connectionModes.webDevice", + "value": true + } + ] + }, "type": "textInput", "label": "Package Name", "configKey": "packageName", diff --git a/test/data/validation/destinations/iterable.json b/test/data/validation/destinations/iterable.json index 4271639dc..ba08420cf 100644 --- a/test/data/validation/destinations/iterable.json +++ b/test/data/validation/destinations/iterable.json @@ -6,31 +6,180 @@ "trackAllPages": false, "trackCategorisedPages": true, "trackNamedPages": true, - "useNativeSDK": { "web": true }, - "initialisationIdentifier": { "web": "email" }, + "useNativeSDK": { + "web": false + }, + "connectionMode": { + "web": "cloud" + }, + "initialisationIdentifier": { + "web": "email" + }, "getInAppEventMapping": { - "web": [{ "eventName": "sale notification" }, { "eventName": "festival discount" }] - }, - "purchaseEventMapping": { "web": [{ "eventName": "Checkout Done" }] }, - "sendTrackForInapp": { "web": true }, - "animationDuration": { "web": "200" }, - "displayInterval": { "web": "2500" }, - "onOpenScreenReaderMessage": { "web": "" }, - "onOpenNodeToTakeFocus": { "web": "" }, - "packageName": { "web": "my-package-test" }, - "rightOffset": { "web": "15" }, - "topOffset": { "web": "11" }, - "bottomOffset": { "web": "24%" }, - "handleLinks": { "web": "open-all-new-tab" }, - "closeButtonColor": { "web": "blue" }, - "closeButtonSize": { "web": "" }, - "closeButtonColorTopOffset": { "web": "3%" }, - "closeButtonColorSideOffset": { "web": "2%" }, - "iconPath": { "web": "" }, - "isRequiredToDismissMessage": { "web": true }, - "closeButtonPosition": { "web": "" }, - "oneTrustCookieCategories": [{ "oneTrustCookieCategory": "" }] + "web": [ + { + "eventName": "sale notification" + }, + { + "eventName": "festival discount" + } + ] + }, + "purchaseEventMapping": { + "web": [ + { + "eventName": "Checkout Done" + } + ] + }, + "sendTrackForInapp": { + "web": true + }, + "animationDuration": { + "web": "200" + }, + "displayInterval": { + "web": "2500" + }, + "onOpenScreenReaderMessage": { + "web": "" + }, + "onOpenNodeToTakeFocus": { + "web": "" + }, + "rightOffset": { + "web": "15" + }, + "topOffset": { + "web": "11" + }, + "bottomOffset": { + "web": "24%" + }, + "handleLinks": { + "web": "open-all-new-tab" + }, + "closeButtonColor": { + "web": "blue" + }, + "closeButtonSize": { + "web": "" + }, + "closeButtonColorTopOffset": { + "web": "3%" + }, + "closeButtonColorSideOffset": { + "web": "2%" + }, + "iconPath": { + "web": "" + }, + "isRequiredToDismissMessage": { + "web": true + }, + "closeButtonPosition": { + "web": "" + }, + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ] }, "result": true + }, + { + "config": { + "apiKey": "73983282843839749873", + "mapToSingleEvent": true, + "trackAllPages": false, + "trackCategorisedPages": true, + "trackNamedPages": true, + "useNativeSDK": { + "web": true + }, + "connectionMode": { + "web": "device" + }, + "initialisationIdentifier": { + "web": "email" + }, + "getInAppEventMapping": { + "web": [ + { + "eventName": "sale notification" + }, + { + "eventName": "festival discount" + } + ] + }, + "purchaseEventMapping": { + "web": [ + { + "eventName": "Checkout Done" + } + ] + }, + "sendTrackForInapp": { + "web": true + }, + "animationDuration": { + "web": "200" + }, + "displayInterval": { + "web": "2500" + }, + "onOpenScreenReaderMessage": { + "web": "" + }, + "onOpenNodeToTakeFocus": { + "web": "" + }, + "rightOffset": { + "web": "15" + }, + "topOffset": { + "web": "11" + }, + "bottomOffset": { + "web": "24%" + }, + "handleLinks": { + "web": "open-all-new-tab" + }, + "closeButtonColor": { + "web": "blue" + }, + "closeButtonSize": { + "web": "" + }, + "closeButtonColorTopOffset": { + "web": "3%" + }, + "closeButtonColorSideOffset": { + "web": "2%" + }, + "iconPath": { + "web": "" + }, + "isRequiredToDismissMessage": { + "web": true + }, + "closeButtonPosition": { + "web": "" + }, + "oneTrustCookieCategories": [ + { + "oneTrustCookieCategory": "" + } + ] + }, + "result": false, + "err": [ + " must have required property 'packageName'", + " must match \"then\" schema", + " must match a schema in anyOf" + ] } -] +] \ No newline at end of file From e902815a7d665445b35394ff8be9f99e10efa1a0 Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Wed, 23 Aug 2023 11:56:25 +0530 Subject: [PATCH 3/5] fix(iterable): schema issues --- .../destinations/iterable/schema.json | 13 +++++++++---- .../destinations/iterable/ui-config.json | 2 +- test/data/validation/destinations/iterable.json | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/configurations/destinations/iterable/schema.json b/src/configurations/destinations/iterable/schema.json index 5903b4db9..141045533 100644 --- a/src/configurations/destinations/iterable/schema.json +++ b/src/configurations/destinations/iterable/schema.json @@ -121,9 +121,9 @@ "enum": [ "open-all-new-tab", "open-all-same-tab", - "external-new-tab", - "" - ] + "external-new-tab" + ], + "default": "open-all-new-tab" } } }, @@ -163,7 +163,12 @@ "type": "object", "properties": { "web": { - "type": "string" + "type": "string", + "enum": [ + "top-right", + "top-left" + ], + "default": "top-right" } } }, diff --git a/src/configurations/destinations/iterable/ui-config.json b/src/configurations/destinations/iterable/ui-config.json index 41a22cb8d..50589b757 100644 --- a/src/configurations/destinations/iterable/ui-config.json +++ b/src/configurations/destinations/iterable/ui-config.json @@ -32,7 +32,7 @@ "type": "textInput", "label": "Package Name", "configKey": "packageName", - "regex": "^(.{1,100})$", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", "regexErrorMessage": "Invalid package name", "note": "Iterable package name. Applicable to device mode only", "placeholder": "e.g: my-website" diff --git a/test/data/validation/destinations/iterable.json b/test/data/validation/destinations/iterable.json index ba08420cf..09030fc40 100644 --- a/test/data/validation/destinations/iterable.json +++ b/test/data/validation/destinations/iterable.json @@ -78,7 +78,7 @@ "web": true }, "closeButtonPosition": { - "web": "" + "web": "top-right" }, "oneTrustCookieCategories": [ { @@ -167,7 +167,7 @@ "web": true }, "closeButtonPosition": { - "web": "" + "web": "top-right" }, "oneTrustCookieCategories": [ { From 4d806d47d133eee6302103f7975c669c1e5eef6a Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Wed, 23 Aug 2023 19:59:07 +0530 Subject: [PATCH 4/5] chore: added support of registerDeviceOrBrowserApiKey --- src/configurations/destinations/iterable/db-config.json | 3 ++- src/configurations/destinations/iterable/schema.json | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/configurations/destinations/iterable/db-config.json b/src/configurations/destinations/iterable/db-config.json index d82f62df9..4ececab61 100644 --- a/src/configurations/destinations/iterable/db-config.json +++ b/src/configurations/destinations/iterable/db-config.json @@ -68,7 +68,8 @@ "mapToSingleEvent", "mergeNestedObjects", "trackCategorisedPages", - "oneTrustCookieCategories" + "oneTrustCookieCategories", + "registerDeviceOrBrowserApiKey" ], "web": [ "useNativeSDK", diff --git a/src/configurations/destinations/iterable/schema.json b/src/configurations/destinations/iterable/schema.json index 141045533..57fce027f 100644 --- a/src/configurations/destinations/iterable/schema.json +++ b/src/configurations/destinations/iterable/schema.json @@ -10,6 +10,10 @@ "type": "string", "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$" }, + "registerDeviceOrBrowserApiKey": { + "type": "string", + "pattern": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{0,100})$" + }, "useNativeSDK": { "type": "object", "properties": { From bfb1f1e7c3415acc56ffa01d9348b743959b12f6 Mon Sep 17 00:00:00 2001 From: mihir-4116 Date: Thu, 14 Sep 2023 10:36:56 +0530 Subject: [PATCH 5/5] chore: code review changes --- .../destinations/iterable/ui-config.json | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/configurations/destinations/iterable/ui-config.json b/src/configurations/destinations/iterable/ui-config.json index 50589b757..73a2e8ce1 100644 --- a/src/configurations/destinations/iterable/ui-config.json +++ b/src/configurations/destinations/iterable/ui-config.json @@ -8,7 +8,7 @@ { "groups": [ { - "title": "One click checkout", + "title": "Connection settings", "note": "Update your connection settings here", "icon": "settings", "fields": [ @@ -21,6 +21,13 @@ "placeholder": "e.g: 42f187310705012194bd0bd694905664ae" }, { + "type": "textInput", + "label": "Package Name", + "configKey": "packageName", + "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", + "regexErrorMessage": "Invalid package name", + "note": "Iterable package name. Applicable to device mode only", + "placeholder": "e.g: my-website", "preRequisites": { "fields": [ { @@ -28,14 +35,7 @@ "value": true } ] - }, - "type": "textInput", - "label": "Package Name", - "configKey": "packageName", - "regex": "(^\\{\\{.*\\|\\|(.*)\\}\\}$)|(^env[.].+)|^(.{1,100})$", - "regexErrorMessage": "Invalid package name", - "note": "Iterable package name. Applicable to device mode only", - "placeholder": "e.g: my-website" + } } ] }