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

[Release] Stage to Main #3355

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 41 additions & 21 deletions .github/workflows/helpers.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override.

Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,62 @@
const owner = process.env.REPO_OWNER || ''; // example owner: adobecom
const repo = process.env.REPO_NAME || ''; // example repo name: milo
const auth = process.env.GH_TOKEN || ''; // https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
const CURRENT_YEAR = 2024;
const RCPDates = [
{
start: new Date('2024-05-26T00:00:00-07:00'),
end: new Date('2024-06-01T00:00:00-07:00'),
start: new Date('2024-12-12T11:00:00-08:00'),
end: new Date('2024-12-12T14:00:00-08:00'),
},
{
start: new Date('2024-06-13T11:00:00-07:00'),
end: new Date('2024-06-13T14:00:00-07:00'),
start: new Date('2024-12-15T00:00:00-08:00'),
end: new Date('2025-01-02T00:00:00-08:00'),
},
{
start: new Date('2024-06-30T00:00:00-07:00'),
end: new Date('2024-07-06T00:00:00-07:00'),
start: new Date('2025-02-23T00:00:00-08:00'),
end: new Date('2025-03-01T00:00:00-08:00'),
},
{
start: new Date('2024-08-25T00:00:00-07:00'),
end: new Date('2024-08-31T00:00:00-07:00'),
start: new Date('2025-03-12T11:00:00-07:00'),
end: new Date('2025-03-12T14:00:00-07:00'),
},
{
start: new Date('2024-09-12T11:00:00-07:00'),
end: new Date('2024-09-12T14:00:00-07:00'),
start: new Date('2025-03-17T00:00:00-07:00'),
end: new Date('2025-03-20T17:00:00-07:00'),
},
{
start: new Date('2024-10-07T00:00:00-07:00'),
end: new Date('2024-10-18T17:00:00-07:00'),
start: new Date('2025-05-25T00:00:00-07:00'),
end: new Date('2025-05-31T00:00:00-07:00'),
},
{
start: new Date('2024-11-17T00:00:00-08:00'),
end: new Date('2024-11-30T00:00:00-08:00'),
start: new Date('2025-06-12T11:00:00-07:00'),
end: new Date('2025-06-12T14:00:00-07:00'),
},
{
start: new Date('2024-12-12T11:00:00-08:00'),
end: new Date('2024-12-12T14:00:00-08:00'),
start: new Date('2025-06-29T00:00:00-07:00'),
end: new Date('2025-07-05T00:00:00-07:00'),
},
{
start: new Date('2024-12-15T00:00:00-08:00'),
end: new Date('2025-01-02T00:00:00-08:00'),
start: new Date('2025-08-24T00:00:00-07:00'),
end: new Date('2025-08-30T00:00:00-07:00'),
},
{
start: new Date('2025-09-11T11:00:00-07:00'),
end: new Date('2025-09-11T14:00:00-07:00'),
},
{
start: new Date('2025-10-06T00:00:00-07:00'),
end: new Date('2025-10-16T17:00:00-07:00'),
},
{
start: new Date('2025-11-16T00:00:00-08:00'),
end: new Date('2025-11-29T00:00:00-08:00'),
},
{
start: new Date('2025-12-10T11:00:00-08:00'),
end: new Date('2025-12-10T14:00:00-08:00'),
},
{
start: new Date('2025-12-14T00:00:00-08:00'),
end: new Date('2026-01-04T00:00:00-08:00'),
},
];

Expand All @@ -49,8 +68,9 @@ const isShortRCP = (start, end) => {

const isWithinRCP = ({ offset = 0, excludeShortRCP = false } = {}) => {
const now = new Date();
if (now.getFullYear() !== CURRENT_YEAR) {
console.log(`ADD NEW RCPs for ${CURRENT_YEAR + 1}`);
const lastRcpDate = RCPDates.reverse()[0];
if (now > lastRcpDate.end) {
console.log('ADD NEW RCPs for the current year');
return true;
}

Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/update-dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Update file and create PR if needed
- name: Update ims lib and create PR if needed
uses: actions/github-script@v7
with:
script: |
Expand All @@ -26,5 +26,18 @@ jobs:
branch: 'update-imslib',
scriptPath: './libs/deps/imslib.min.js'
})
- name: Update forms2 and create PR if needed
uses: actions/github-script@v7
with:
script: |
const updateDependency = require('./.github/workflows/update-script.js')
updateDependency({
github,
context,
title: '[AUTOMATED-PR] Update forms2.min.js dependency',
path: 'https://engage.adobe.com/js/forms2/js/forms2.min.js',
branch: 'update-forms2',
scriptPath: './libs/deps/forms2.min.js'
})
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96 changes: 61 additions & 35 deletions .github/workflows/update-script.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] reported by reviewdog 🐶
File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override.

Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,67 @@ const localRunConfigs = {
origin: process.env.LOCAL_RUN_ORIGIN || 'origin',
};

const getPrDescription = ({ branch, scriptPath }) => `## Description
Update ${scriptPath} to the latest version

## Related Issue
Resolves: NO TICKET - AUTOMATED CREATED PR.

## Testing instructions
1. Signing in should still function
2. Signing out should still work
3. Regression tests on all consumers

## Test URLs
**Acrobat:**
- Before: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off
- After: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off&milolibs=${branch}--milo--adobecom

**BACOM:**
- Before: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off
- After: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off&milolibs=${branch}--milo--adobecom

**CC:**
- Before: https://main--cc--adobecom.hlx.live/?martech=off
- After: https://main--cc--adobecom.hlx.live/?martech=off&milolibs=${branch}--milo--adobecom

**Homepage:**
- Before: https://main--homepage--adobecom.hlx.page/homepage/index-loggedout?martech=off
- After: https://main--homepage--adobecom.hlx.page/homepage/index-loggedout?martech=off&milolibs=${branch}--milo--adobecom

**Blog:**
- Before: https://main--blog--adobecom.hlx.page/?martech=off
- After: https://main--blog--adobecom.hlx.page/?martech=off&milolibs=${branch}--milo--adobecom

**Milo:**
- Before: https://main--milo--adobecom.aem.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off
- After: https://${branch}--milo--adobecom.aem.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off`;
const getPrDescription = ({ branch, scriptPath }) => {
switch(scriptPath) {
case './libs/deps/imslib.min.js':
return `## Description
Update ${scriptPath} to the latest version

## Related Issue
Resolves: NO TICKET - AUTOMATED CREATED PR.

## Testing instructions - IMS Libs
1. Signing in should still function
2. Signing out should still work
3. Regression tests on all consumers

## Test URLs - IMS
**Acrobat:**
- Before: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off
- After: https://www.stage.adobe.com/acrobat/online/sign-pdf.html?martech=off&milolibs=${branch}--milo--adobecom

**BACOM:**
- Before: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off
- After: https://business.stage.adobe.com/fr/customer-success-stories.html?martech=off&milolibs=${branch}--milo--adobecom

**CC:**
- Before: https://main--cc--adobecom.hlx.live/?martech=off
- After: https://main--cc--adobecom.hlx.live/?martech=off&milolibs=${branch}--milo--adobecom

**Homepage:**
- Before: https://main--homepage--adobecom.hlx.page/homepage/index-loggedout?martech=off
- After: https://main--homepage--adobecom.hlx.page/homepage/index-loggedout?martech=off&milolibs=${branch}--milo--adobecom

**Blog:**
- Before: https://main--blog--adobecom.hlx.page/?martech=off
- After: https://main--blog--adobecom.hlx.page/?martech=off&milolibs=${branch}--milo--adobecom

**Milo:**
- Before: https://main--milo--adobecom.aem.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off
- After: https://${branch}--milo--adobecom.aem.page/ch_de/drafts/ramuntea/gnav-refactor?martech=off`
case './libs/deps/forms2.min.js':
return `## Description
Update ${scriptPath} to the latest version

## Related Issue
Resolves: NO TICKET - AUTOMATED CREATED PR.

## Testing instructions - Marketo Forms
1. The form should still load
2. The form should still submit
3. The form should redirect you a new page

## Test URLs - Marketo

**BACOM:**
- Before: https://business.stage.adobe.com?martech=off
- After: https://business.stage.adobe.com?martech=off&milolibs=${branch}--milo--adobecom

**Milo:**
- Before: https://main--milo--adobecom.hlx.live/drafts/bmarshal/marketo/full
- After: https://${branch}--milo--adobecom.hlx.live/drafts/bmarshal/marketo/full`
}
}

const fetchScript = (path) =>
new Promise((resolve, reject) => {
Expand Down
28 changes: 15 additions & 13 deletions libs/blocks/carousel/carousel.css
Original file line number Diff line number Diff line change
Expand Up @@ -373,36 +373,38 @@ html[dir="rtl"] .carousel-slides .section.carousel-slide {
width: unset;
}

.carousel.rounded-corners .carousel-slide,
.carousel.rounded-corners .carousel-slide > div :is(p):has(> picture) img {
.carousel:is(.rounded-corners, .m-rounded-corners) .carousel-slide,
.carousel:is(.rounded-corners, .m-rounded-corners) .carousel-slide > div :is(p > picture img, p > video, p > .milo-video, p > .video-holder video) {
border-radius: var(--m-rounded-corners);
}

.carousel.l-rounded-corners .carousel-slide,
.carousel.l-rounded-corners .carousel-slide > div :is(p):has(> picture) img {
border-radius: var(--l-rounded-corners);
.carousel[class*='rounded-corners'] .carousel-slide,
.carousel[class*='rounded-corners'] .carousel-slide > div :is(p > video, p > .milo-video, p > .video-holder video) {
overflow: hidden;
}

.carousel.s-rounded-corners .carousel-slide,
.carousel.s-rounded-corners .carousel-slide > div :is(p):has(> picture) img {
.carousel.s-rounded-corners .carousel-slide > div :is(p > picture img, p > video, p > .milo-video, p > .video-holder video) {
border-radius: var(--s-rounded-corners);
}

.carousel.full-rounded-corners .carousel-slide,
.carousel.full-rounded-corners .carousel-slide > div :is(p):has(> picture) img {
border-radius: var(--full-rounded-corners);
.carousel.l-rounded-corners .carousel-slide,
.carousel.l-rounded-corners .carousel-slide > div :is(p > picture img, p > video, p > .milo-video, p > .video-holder video) {
border-radius: var(--l-rounded-corners);
}

.carousel[class*='rounded-corners'] .carousel-slide {
overflow: hidden;
.carousel.full-rounded-corners .carousel-slide,
.carousel.full-rounded-corners .carousel-slide > div :is(p > picture img, p > video, p > .milo-video, p > .video-holder video) {
border-radius: var(--full-rounded-corners);
}

.carousel .carousel-slide > div p :is(.video-holder, video) {
.carousel.video-fill .carousel-slide > div p :is(.video-holder, video),
.carousel .carousel-slide.video-fill > div p :is(.video-holder, video) {
width: 100%;
height: auto;
}

.carousel[class*='rounded-corners'] .carousel-slide > div :is(p):has(> video, > picture, > .milo-video, > .modal-img-link) {
.carousel[class*='rounded-corners'] .carousel-slide > div :is(p):has(> video, > picture, > .milo-video, > .modal-img-link, > .video-holder) {
margin-top: 0;
margin-bottom: 0;
line-height: 0;
Expand Down
4 changes: 3 additions & 1 deletion libs/blocks/marketo/marketo.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
loadLink,
localizeLink,
createTag,
getConfig,
createIntersectionObserver,
SLD,
} from '../../utils/utils.js';
Expand Down Expand Up @@ -173,8 +174,9 @@ export const loadMarketo = (el, formData) => {
const baseURL = formData[BASE_URL];
const munchkinID = formData[MUNCHKIN_ID];
const formID = formData[FORM_ID];
const { base } = getConfig();

loadScript(`https://${baseURL}/js/forms2/js/forms2.min.js`)
loadScript(`${base}/deps/forms2.min.js`)
.then(() => {
const { MktoForms2 } = window;
if (!MktoForms2) throw new Error('Marketo forms not loaded');
Expand Down
10 changes: 9 additions & 1 deletion libs/blocks/merch/merch.js
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,14 @@ export function setCtaHash(el, checkoutLinkConfig, offerType) {
return hash;
}

const isProdModal = (url) => {
try {
return (new URL(url)).hostname.endsWith('.adobe.com');
} catch (e) {
return false;
}
};

export async function getModalAction(offers, options, el) {
const [{
offerType,
Expand All @@ -529,7 +537,7 @@ export async function getModalAction(offers, options, el) {
const hash = setCtaHash(el, checkoutLinkConfig, offerType);
let url = checkoutLinkConfig[columnName];
if (!url) return undefined;
url = isInternalModal(url)
url = isInternalModal(url) || isProdModal(url)
? localizeLink(checkoutLinkConfig[columnName]) : checkoutLinkConfig[columnName];
return { url, handler: (e) => openModal(e, url, offerType, hash, options.extraOptions) };
}
Expand Down
Loading
Loading