-
Couldn't load subscription status.
- Fork 19
Removed Campaign details from LC #474
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
base: develop
Are you sure you want to change the base?
Changes from all commits
d773ca1
3dfe7f5
8e1ee19
1b05435
8d6ee66
63e89ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -219,7 +219,6 @@ | |||||||||||||||||
| const POPUP_LOADING = 'WZRK_POPUP_LOADING'; | ||||||||||||||||||
| const CUSTOM_HTML_PREVIEW = 'ctCustomHtmlPreview'; | ||||||||||||||||||
| const WEB_POPUP_PREVIEW = 'ctWebPopupPreview'; | ||||||||||||||||||
| const QUALIFIED_CAMPAIGNS = 'WZRK_QC'; | ||||||||||||||||||
| const CUSTOM_CT_ID_PREFIX = '_w_'; | ||||||||||||||||||
| const BLOCK_REQUEST_COOKIE = 'WZRK_BLOCK'; // Flag key for optional sub-domain profile isolation | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
@@ -9350,31 +9349,6 @@ | |||||||||||||||||
| targetEl.appendChild(newScript); | ||||||||||||||||||
| script.remove(); | ||||||||||||||||||
| } | ||||||||||||||||||
| function addCampaignToLocalStorage(campaign) { | ||||||||||||||||||
| var _campaign$display3; | ||||||||||||||||||
|
|
||||||||||||||||||
| let region = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'eu1'; | ||||||||||||||||||
| let accountId = arguments.length > 2 ? arguments[2] : undefined; | ||||||||||||||||||
|
|
||||||||||||||||||
| /* No Need to store campaigns in local storage in preview mode */ | ||||||||||||||||||
| if ((campaign === null || campaign === void 0 ? void 0 : (_campaign$display3 = campaign.display) === null || _campaign$display3 === void 0 ? void 0 : _campaign$display3.preview) === true) { | ||||||||||||||||||
| return; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| const campaignId = campaign.wzrk_id.split('_')[0]; | ||||||||||||||||||
| const dashboardUrl = "https://".concat(region, ".dashboard.clevertap.com/").concat(accountId, "/campaigns/campaign/").concat(campaignId, "/report/stats"); | ||||||||||||||||||
| const enrichedCampaign = { ...campaign, | ||||||||||||||||||
| url: dashboardUrl | ||||||||||||||||||
| }; | ||||||||||||||||||
| const storedData = StorageManager.readFromLSorCookie(QUALIFIED_CAMPAIGNS); | ||||||||||||||||||
| const existingCampaigns = storedData ? JSON.parse(decodeURIComponent(storedData)) : []; | ||||||||||||||||||
| const isDuplicate = existingCampaigns.some(c => c.wzrk_id === campaign.wzrk_id); | ||||||||||||||||||
|
|
||||||||||||||||||
| if (!isDuplicate) { | ||||||||||||||||||
| const updatedCampaigns = [...existingCampaigns, enrichedCampaign]; | ||||||||||||||||||
| StorageManager.saveToLSorCookie(QUALIFIED_CAMPAIGNS, encodeURIComponent(JSON.stringify(updatedCampaigns))); | ||||||||||||||||||
| } | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| // CleverTap specific utilities | ||||||||||||||||||
| const getCampaignObject = () => { | ||||||||||||||||||
|
|
@@ -13849,7 +13823,7 @@ | |||||||||||||||||
| case WVE_QUERY_PARAMS.SDK_CHECK: | ||||||||||||||||||
| if (parentWindow) { | ||||||||||||||||||
| logger.debug('SDK version check'); | ||||||||||||||||||
| const sdkVersion = '2.2.2'; | ||||||||||||||||||
| const sdkVersion = '2.2.3'; | ||||||||||||||||||
| parentWindow.postMessage({ | ||||||||||||||||||
| message: 'SDKVersion', | ||||||||||||||||||
| accountId, | ||||||||||||||||||
|
|
@@ -15786,10 +15760,6 @@ | |||||||||||||||||
| const msgArr = []; | ||||||||||||||||||
|
|
||||||||||||||||||
| for (let index = 0; index < msg.inbox_notifs.length; index++) { | ||||||||||||||||||
| var _CampaignContext$msg, _CampaignContext$msg$; | ||||||||||||||||||
|
|
||||||||||||||||||
| addCampaignToLocalStorage(msg.inbox_notifs[index], CampaignContext.region, (_CampaignContext$msg = CampaignContext.msg) === null || _CampaignContext$msg === void 0 ? void 0 : (_CampaignContext$msg$ = _CampaignContext$msg.arp) === null || _CampaignContext$msg$ === void 0 ? void 0 : _CampaignContext$msg$.id); | ||||||||||||||||||
|
|
||||||||||||||||||
| if (this.doCampHouseKeeping(msg.inbox_notifs[index], Logger.getInstance()) !== false) { | ||||||||||||||||||
| msgArr.push(msg.inbox_notifs[index]); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
@@ -15808,9 +15778,6 @@ | |||||||||||||||||
| }; | ||||||||||||||||||
|
|
||||||||||||||||||
| for (let index = 0; index < sortedCampaigns.length; index++) { | ||||||||||||||||||
| var _CampaignContext$msg2, _CampaignContext$msg3; | ||||||||||||||||||
|
|
||||||||||||||||||
| addCampaignToLocalStorage(sortedCampaigns[index], CampaignContext.region, (_CampaignContext$msg2 = CampaignContext.msg) === null || _CampaignContext$msg2 === void 0 ? void 0 : (_CampaignContext$msg3 = _CampaignContext$msg2.arp) === null || _CampaignContext$msg3 === void 0 ? void 0 : _CampaignContext$msg3.id); | ||||||||||||||||||
| const targetNotif = sortedCampaigns[index]; | ||||||||||||||||||
|
|
||||||||||||||||||
| if (targetNotif.display.wtarget_type === CAMPAIGN_TYPES.FOOTER_NOTIFICATION || targetNotif.display.wtarget_type === CAMPAIGN_TYPES.FOOTER_NOTIFICATION_2) { | ||||||||||||||||||
|
|
@@ -16328,7 +16295,7 @@ | |||||||||||||||||
| let proto = document.location.protocol; | ||||||||||||||||||
| proto = proto.replace(':', ''); | ||||||||||||||||||
| dataObject.af = { ...dataObject.af, | ||||||||||||||||||
| lib: 'web-sdk-v2.2.2', | ||||||||||||||||||
| lib: 'web-sdk-v2.2.3', | ||||||||||||||||||
| protocol: proto, | ||||||||||||||||||
| ...$ct.flutterVersion | ||||||||||||||||||
| }; // app fields | ||||||||||||||||||
|
Comment on lines
+16298
to
16301
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion DRY the SDK version in telemetry payload data.af.lib repeats a versioned string. Build it from a single SDK_VERSION constant to prevent mismatches with other locations (handleActionMode and getSDKVersion). - lib: 'web-sdk-v2.2.3',
+ lib: `web-sdk-v${SDK_VERSION}`,📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
@@ -18250,7 +18217,7 @@ | |||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| getSDKVersion() { | ||||||||||||||||||
| return 'web-sdk-v2.2.2'; | ||||||||||||||||||
| return 'web-sdk-v2.2.3'; | ||||||||||||||||||
| } | ||||||||||||||||||
|
Comment on lines
+18220
to
18221
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Expose getSDKVersion from the same constant Return the same version used elsewhere; avoid another hard-coded literal. - return 'web-sdk-v2.2.3';
+ return `web-sdk-v${SDK_VERSION}`;📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
|
|
||||||||||||||||||
| defineVariable(name, defaultValue) { | ||||||||||||||||||
|
|
@@ -18299,16 +18266,6 @@ | |||||||||||||||||
| addOneTimeVariablesChangedCallback(callback) { | ||||||||||||||||||
| _classPrivateFieldLooseBase(this, _variableStore)[_variableStore].addOneTimeVariablesChangedCallback(callback); | ||||||||||||||||||
| } | ||||||||||||||||||
| /* | ||||||||||||||||||
| This function is used for debugging and getting the details of all the campaigns | ||||||||||||||||||
| that were qualified and rendered for the current user | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
| getAllQualifiedCampaignDetails() { | ||||||||||||||||||
| const existingCampaign = StorageManager.readFromLSorCookie(QUALIFIED_CAMPAIGNS) && JSON.parse(decodeURIComponent(StorageManager.readFromLSorCookie(QUALIFIED_CAMPAIGNS))); | ||||||||||||||||||
| return existingCampaign; | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
|
|
||||||||||||||||||
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid hard-coded SDK version; derive from a single source of truth
The string literal '2.2.3' here will drift from other places. Introduce a single SDK_VERSION constant and reuse it for the dashboard postMessage, data.af.lib, and getSDKVersion().
Apply something like:
And below (see other comments) derive "web-sdk-v..." from SDK_VERSION instead of embedding more literals.
📝 Committable suggestion
🤖 Prompt for AI Agents