Skip to content

Commit

Permalink
Merge pull request #913 from adobecom/stage
Browse files Browse the repository at this point in the history
MWPW-161670 F&S Analytics Fix
  • Loading branch information
TsayAdobe authored Dec 5, 2024
2 parents 1f82d61 + 8d62f2d commit c3e20b8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/clear-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
description: 'Network'
required: true
type: string
command:
description: 'Command'
required: true
type: string

workflow_dispatch:
inputs:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
with:
cpCode: 1551833
network: production
command: delete
secrets: inherit

clear-prod-cache:
Expand All @@ -21,4 +22,6 @@ jobs:
with:
cpCode: 1551836
network: production
command: delete

secrets: inherit
8 changes: 2 additions & 6 deletions acrobat/blocks/verb-widget/verb-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ export default async function init(element) {
});

element.addEventListener('unity:track-analytics', (e) => {
const date = new Date();
date.setTime(date.getTime() + 1 * 60 * 1000);
const cookieExp = `expires=${date.toUTCString()}`;
const cookieExp = new Date(Date.now() + 90 * 1000).toUTCString();

if (e.detail?.event === 'change') {
verbAnalytics('choose-file:open', VERB, e.detail?.data);
Expand Down Expand Up @@ -277,9 +275,7 @@ export default async function init(element) {
});

window.addEventListener('beforeunload', () => {
const date = new Date();
date.setTime(date.getTime() + 1 * 60 * 1000);
const cookieExp = `expires=${date.toUTCString()}`;
const cookieExp = new Date(Date.now() + 90 * 1000).toUTCString();
if (exitFlag) {
document.cookie = `UTS_Redirect=${Date.now()};domain=.adobe.com;path=/;expires=${cookieExp}`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ async function addCheckbox({ card, md, fragAudience, cardPlanType }) {
const cardId = `${fragAudience}-${cardPlanType}-${cardTitle}`;
card.dataset.aiAdded = false;
const callout = card.querySelector(CALLOUT_SELECTOR);
const description = md.checkbox.description.replace('[AIP]', '<span class="price-placeholder"></span>');
const isReader = card.querySelector('.con-button[href*="adobe.com/reader/"]');
let description = isReader
? md.checkbox.reader.description
: md.checkbox.description;
description = description.replace('[AIP]', '<span class="price-placeholder"></span>');
const checkboxContainer = createTag(
'div',
{ slot: 'callout-content', class: 'ai-checkbox-container' },
Expand Down Expand Up @@ -221,6 +225,9 @@ function processCard(card, md) {
}
export default async function init(el) {
const md = parseMetadata(getMetadata(el));
document.querySelectorAll('merch-card').forEach((card) => {
processCard(card, md);
});
const mainObserver = new MutationObserver((mutationsList) => {
for (const mutation of mutationsList) {
if (mutation.type === 'childList' && mutation.addedNodes.length > 0) {
Expand Down

0 comments on commit c3e20b8

Please sign in to comment.