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

Support both .aem. and .hlx. - HLX5 Support #621

Merged
merged 2 commits into from
Feb 13, 2025
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/preview-index/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ There are 2 scripts here, one for full reindex and one to reindex a single docum
The script for full reindex:
* query all 'previewed' resources in folder /cc-shared/fragments/merch/*
* filter out .json or urls that don't contain /merch-card/ in the path
* for each merch-card resource, it will request .hlx.page content
* for each merch-card resource, it will request .aem.page content
* parse the content to the index table row, similar to the 'merch-cards' index definition in 'helix-query.yaml'
* delete all rows from /cc-shared/assets/query-index-cards-preview.xslx, 'raw_index' sheet, 'Table1'
* add new generated rows to the index
Expand All @@ -26,7 +26,7 @@ If you do a change to .env file, remember to re-run 'npm i' before running 'npm
The script for reindexing of a single document
* is triggered on 'resource-previewed' event
* will work only if resource path contains /merch-card/ and does not end with .json
* for the resource path it requests .hlx.page content
* for the resource path it requests .aem.page content
* it searches for the existing row in /cc-shared/assets/query-index-cards-preview.xslx for this resource
* if it exists, it updates that row with new details
* otherwise it inserts new row
Expand Down Expand Up @@ -55,7 +55,7 @@ ENABLED=y

`SHAREPOINT_CLIENT_ID` and `SHAREPOINT_TENANT_ID` can be found on the azure app 'Essential' tab, see 'Application (client) ID' and 'Directory (tenant) ID'.
`PREVIEW_INDEX_FILE` path to the target index file, e.g. "milo/drafts/mariia/preview-index/query-index-cards-preview.xlsx"
`PREVIEW_RESOURCES_FOLDER` path to resource to index, e.g. "/drafts/mariia/preview-index/*". Folder path is not sharepoint path, but mapped *hlx.page location. So if your sharepoint folder is CC/www/cc-shared/myfolder, please specify /cc-shared/myfolder.
`PREVIEW_RESOURCES_FOLDER` path to resource to index, e.g. "/drafts/mariia/preview-index/*". Folder path is not sharepoint path, but mapped *aem.page location. So if your sharepoint folder is CC/www/cc-shared/myfolder, please specify /cc-shared/myfolder.
`PREVIEW_LOCALES` comma separated string of locales supported appart from us e.g. ca,at_de,au

Azure app: [CC preview index](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Overview/appId/94136756-61af-4f63-af05-6991a719b872/isMSAApp~/false)
Expand All @@ -75,7 +75,7 @@ curl -v -X POST --header "Authorization: token admin_token" -H "Content-Type: ap
## EDS Get page content
Admin token and access token are different values!
```
curl -v --header "Authorization: token access_token" -H "Content-Type: application/json" 'https://main--cc--adobecom.hlx.page/cc-shared/fragments/merch/products/catalog/merch-card/ec/target/default'
curl -v --header "Authorization: token access_token" -H "Content-Type: application/json" 'https://main--cc--adobecom.aem.page/cc-shared/fragments/merch/products/catalog/merch-card/ec/target/default'
```

## GRAPH API: Get index file Item ID
Expand Down
4 changes: 2 additions & 2 deletions .github/preview-index/src/indexFull.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ***********************************************************************

Check warning on line 1 in .github/preview-index/src/indexFull.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
* ADOBE CONFIDENTIAL
* ___________________
*
Expand All @@ -24,8 +24,8 @@
* Fetch all previewed resources in specified folder. Bulk status job is asynchronyous,
* so the method will keep re-fetching the status till the job is done. Interval - 5 seconds.
* When Bulk Status returned all previewed resource paths, map each path to a function that will
* request this path content from hlx.page and map it to index row.
* Concurrent Requests to hlx.page are limited to 20 in order not to overload EDS. hlx.page is an uncached endpoint.
* request this path content from aem.page and map it to index row.
* Concurrent Requests to aem.page are limited to 20 in order not to overload EDS. aem.page is an uncached endpoint.
* Promise.allSettled instead of Promise.all insures the script will execute for rest of paths, even if one of them failed.
* @param {*} folder
* @param {*} parseIndexFc
Expand Down
3 changes: 2 additions & 1 deletion .github/preview-index/src/sharepoint.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* ***********************************************************************

Check warning on line 1 in .github/preview-index/src/sharepoint.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
* ADOBE CONFIDENTIAL
* ___________________
*
Expand Down Expand Up @@ -35,7 +35,8 @@
const ENABLED = process.env.ENABLED;

const PREVIEW_STATUS_URL = `https://admin.hlx.page/status/adobecom/${CONSUMER}/main/*`;
const PREVIEW_BASE_URL = `https://main--${CONSUMER}--adobecom.hlx.page`;
const PREVIEW_UPDATE_URL = `https://admin.hlx.page/preview/adobecom/${CONSUMER}/main/${PREVIEW_INDEX_JSON}`;
const PREVIEW_BASE_URL = `https://main--${CONSUMER}--adobecom.aem.page`;
const GRAPH_BASE_URL = 'https://graph.microsoft.com/v1.0';
const SHEET_RAW_INDEX = 'raw_index';
const TABLE_NAME = 'Table1';
Expand Down
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Resolves: [MWPW-NUMBER](https://jira.corp.adobe.com/browse/MWPW-NUMBER)

**Test URLs:**
- Before: https://main--cc--adobecom.hlx.live/?martech=off
- After: https://<branch>--cc--adobecom.hlx.live/?martech=off
- Before: https://main--cc--adobecom.aem.live/?martech=off
- After: https://<branch>--cc--adobecom.aem.live/?martech=off
4 changes: 2 additions & 2 deletions .github/workflows/merge-to-stage.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
const STAGE = 'stage';

Check warning on line 1 in .github/workflows/merge-to-stage.js

View workflow job for this annotation

GitHub Actions / Running eslint

[eslint] reported by reviewdog 🐶 File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. Raw Output: {"fatal":false,"severity":1,"message":"File ignored by default. Use a negated ignore pattern (like \"--ignore-pattern '!<relative/path/to/filename>'\") to override."}
const PROD = 'main';
const PR_TITLE = `[Release] Stage to Main ${new Date().toLocaleDateString("en-US", { month: "2-digit", day: "2-digit" })}`;
const SEEN = {};
let github, owner, repo;
let body = `
**Creative cloud:**
- Before: https://${PROD}--cc--adobecom.hlx.live/?martech=off
- After: https://${STAGE}--cc--adobecom.hlx.live/?martech=off
- Before: https://${PROD}--cc--adobecom.aem.live/?martech=off
- After: https://${STAGE}--cc--adobecom.aem.live/?martech=off
`;
const REQUIRED_APPROVALS = process.env.REQUIRED_APPROVALS || 2;
const LABELS = {
Expand Down
6 changes: 4 additions & 2 deletions creativecloud/blocks/unity/unity.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ function getUnityLibs(prodLibs = '/unitylibs') {
const { hostname } = window.location;
if (!hostname.includes('hlx.page')
&& !hostname.includes('hlx.live')
&& !hostname.includes('aem.page')
&& !hostname.includes('aem.live')
&& !hostname.includes('localhost')) {
return prodLibs;
}
const branch = new URLSearchParams(window.location.search).get('unitylibs') || 'main';
if (branch.indexOf('--') > -1) return `https://${branch}.hlx.live/unitylibs`;
return `https://${branch}--unity--adobecom.hlx.live/unitylibs`;
if (branch.indexOf('--') > -1) return `https://${branch}.aem.live/unitylibs`;
return `https://${branch}--unity--adobecom.aem.live/unitylibs`;
}

export default async function init(el) {
Expand Down
2 changes: 1 addition & 1 deletion creativecloud/features/changeBg/changeBg.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function createGroups(vp, current, swatchArr, srcArr) {

export default async function changeBg(el) {
const { host } = window.location;
if (host.includes('hlx.page')) {
if (host.includes('hlx.page') || host.includes('aem.page')) {
const { default: debug } = await import('./author-feedback.js');
debug(el);
}
Expand Down
10 changes: 6 additions & 4 deletions creativecloud/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const stageDomainsMap = {
'creativecloud.adobe.com': 'stage.creativecloud.adobe.com',
'projectneo.adobe.com': 'stg.projectneo.adobe.com',
},
'--cc--adobecom.hlx.live': {
'--cc--adobecom.(hlx|aem).live': {
'www.adobe.com(?!\\/*\\S*\\/(mini-plans|plans-fragments\\/modals)\\/\\S*)': 'origin',
'business.adobe.com': 'business.stage.adobe.com',
'helpx.adobe.com': 'helpx.stage.adobe.com',
Expand All @@ -143,7 +143,7 @@ const stageDomainsMap = {
'creativecloud.adobe.com': 'stage.creativecloud.adobe.com',
'projectneo.adobe.com': 'stg.projectneo.adobe.com',
},
'--cc--adobecom.hlx.page': {
'--cc--adobecom.(hlx|aem).page': {
'www.adobe.com(?!\\/*\\S*\\/(mini-plans|plans-fragments\\/modals)\\/\\S*)': 'origin',
'business.adobe.com': 'business.stage.adobe.com',
'helpx.adobe.com': 'helpx.stage.adobe.com',
Expand Down Expand Up @@ -171,14 +171,16 @@ export const [setLibs, getLibs] = (() => {
const { hostname } = window.location;
if (!hostname.includes('hlx.page')
&& !hostname.includes('hlx.live')
&& !hostname.includes('aem.page')
&& !hostname.includes('aem.live')
&& !hostname.includes('localhost')) {
libs = prodLibs;
return libs;
}
const branch = new URLSearchParams(window.location.search).get('milolibs') || 'main';
if (branch === 'local') { libs = 'http://localhost:6456/libs'; return libs; }
if (branch.indexOf('--') > -1) { libs = `https://${branch}.hlx.live/libs`; return libs; }
libs = `https://${branch}--milo--adobecom.hlx.live/libs`;
if (branch.indexOf('--') > -1) { libs = `https://${branch}.aem.live/libs`; return libs; }
libs = `https://${branch}--milo--adobecom.aem.live/libs`;
return libs;
}, () => libs,
];
Expand Down
2 changes: 1 addition & 1 deletion libs/deps/README
Original file line number Diff line number Diff line change
@@ -1 +1 @@
this is only for loading lit only once on hlx.page and hlx.live
this is only for loading lit only once on aem.page and aem.live
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ <h2 id="everyone-can-photoshop" class="heading-xxl">Everyone can. Photoshop.</h2
<div>
<div>
<p><a
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon1-video.mp4#_autoplay">https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon1-video.mp4#_autoplay</a>
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon1-video.mp4#_autoplay">https://main--cc--adobecom.aem.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon1-video.mp4#_autoplay</a>
</p>
<p><a
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon2-video.mp4#_autoplay">https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon2-video.mp4#_autoplay</a>
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon2-video.mp4#_autoplay">https://main--cc--adobecom.aem.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon2-video.mp4#_autoplay</a>
</p>
<p><a
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon3-video.mp4#_autoplay">https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon3-video.mp4</a>
href="/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon3-video.mp4#_autoplay">https://main--cc--adobecom.aem.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon3-video.mp4</a>
</p>
<p>
<picture><img loading="lazy" src="./test/blocks/interactive-metadata/mocks/assets/icon_.svg"></picture>
Expand Down
Loading
Loading