From 9029e5c39bf138c5f2a5581b83af42bba7526805 Mon Sep 17 00:00:00 2001 From: Aishwarya Mathuria Date: Thu, 13 Feb 2025 18:38:58 +0530 Subject: [PATCH] Revert "Revert "Support both .aem. and .hlx. - HLX5 Support" (#620)" This reverts commit a739738334e822a120e2f84a0becb5be8560156b. --- .github/preview-index/README.md | 8 +-- .github/preview-index/src/indexFull.js | 4 +- .github/preview-index/src/sharepoint.js | 3 +- .github/pull_request_template.md | 4 +- .github/workflows/merge-to-stage.js | 4 +- creativecloud/blocks/unity/unity.js | 6 +- creativecloud/features/changeBg/changeBg.js | 2 +- creativecloud/scripts/utils.js | 10 +-- libs/deps/README | 2 +- .../mocks/interactive-metadata.html | 6 +- test/features/firefly/mocks/body.html | 72 +++++++++---------- test/features/firefly/mocks/masonry-body.html | 4 +- tools/sidekick/config.json | 10 +-- web-test-runner.config.mjs | 2 +- 14 files changed, 72 insertions(+), 65 deletions(-) diff --git a/.github/preview-index/README.md b/.github/preview-index/README.md index 386f830f1..53cc04686 100644 --- a/.github/preview-index/README.md +++ b/.github/preview-index/README.md @@ -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 @@ -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 @@ -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) @@ -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 diff --git a/.github/preview-index/src/indexFull.js b/.github/preview-index/src/indexFull.js index 0f0559625..26bb646dc 100644 --- a/.github/preview-index/src/indexFull.js +++ b/.github/preview-index/src/indexFull.js @@ -24,8 +24,8 @@ const config = getConfig(); * 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 diff --git a/.github/preview-index/src/sharepoint.js b/.github/preview-index/src/sharepoint.js index 2c30d17b2..20bf72e6b 100644 --- a/.github/preview-index/src/sharepoint.js +++ b/.github/preview-index/src/sharepoint.js @@ -35,7 +35,8 @@ const PREVIEW_LOCALES = process.env.PREVIEW_LOCALES; 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'; diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index dd03e8774..3adcb96c7 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -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://--cc--adobecom.hlx.live/?martech=off +- Before: https://main--cc--adobecom.aem.live/?martech=off +- After: https://--cc--adobecom.aem.live/?martech=off diff --git a/.github/workflows/merge-to-stage.js b/.github/workflows/merge-to-stage.js index 2fed12ac8..b4b710381 100644 --- a/.github/workflows/merge-to-stage.js +++ b/.github/workflows/merge-to-stage.js @@ -5,8 +5,8 @@ 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 = { diff --git a/creativecloud/blocks/unity/unity.js b/creativecloud/blocks/unity/unity.js index 8e709866d..939ed71ff 100644 --- a/creativecloud/blocks/unity/unity.js +++ b/creativecloud/blocks/unity/unity.js @@ -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) { diff --git a/creativecloud/features/changeBg/changeBg.js b/creativecloud/features/changeBg/changeBg.js index bf785b07e..b72c60466 100644 --- a/creativecloud/features/changeBg/changeBg.js +++ b/creativecloud/features/changeBg/changeBg.js @@ -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); } diff --git a/creativecloud/scripts/utils.js b/creativecloud/scripts/utils.js index dd5b3c671..033ec5a71 100644 --- a/creativecloud/scripts/utils.js +++ b/creativecloud/scripts/utils.js @@ -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', @@ -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', @@ -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, ]; diff --git a/libs/deps/README b/libs/deps/README index f75d7a7a7..e4d544495 100644 --- a/libs/deps/README +++ b/libs/deps/README @@ -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 diff --git a/test/blocks/interactive-metadata/mocks/interactive-metadata.html b/test/blocks/interactive-metadata/mocks/interactive-metadata.html index 038a34eac..875b352b8 100644 --- a/test/blocks/interactive-metadata/mocks/interactive-metadata.html +++ b/test/blocks/interactive-metadata/mocks/interactive-metadata.html @@ -49,13 +49,13 @@

Everyone can. Photoshop.

https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon1-video.mp4#_autoplay + 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

https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon2-video.mp4#_autoplay + 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

https://main--cc--adobecom.hlx.page/drafts/mathuria/interactiveelems/demo/northernlights/assets/moon3-video.mp4 + 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

diff --git a/test/features/firefly/mocks/body.html b/test/features/firefly/mocks/body.html index 199ef35a6..f251140fb 100644 --- a/test/features/firefly/mocks/body.html +++ b/test/features/firefly/mocks/body.html @@ -11,33 +11,33 @@

Your imagination’s new best friend.

Get Firefly Free

-

Try it

+

Try it

-----------------------------------------------------------

-

https://firefly.adobe.com/generate/images#_dnt Text to Image

+

https://firefly.adobe.com/generate/images#_dnt Text to Image

Dog in a sweater, primary colors, big smile|Generate

- - - - + + + +

-----------------------------------------------------------

-

https://firefly.adobe.com/upload/inpaint#_dntGenerative Fill

+

https://firefly.adobe.com/upload/inpaint#_dntGenerative Fill

Prompt Used[Turquoise water reflecting a starry sky]|Try Generative Fill

-----------------------------------------------------------

-

https://firefly.adobe.com/generate/font-styles#_dnt|Text Effects

+

https://firefly.adobe.com/generate/font-styles#_dnt|Text Effects

Tiger Fur|Generate

- - - - + + + +

@@ -64,21 +64,21 @@

Your imagination’s new best friend.

Get Firefly Free

-

Try it

+

Try it

-----------------------------------------------------------

Tiger Fur|Generate

+ srcset="https://main--cc--adobecom.aem.page/creativecloud/media_1b4ccb77566c559be9f32aa4b12527bc34e3d5b3f.jpeg?width=750&format=webply&optimize=medium">

@@ -105,21 +105,21 @@

Your imagination’s new best friend.

Get Firefly Free

-

Try it

+

Try it

-----------------------------------------------------------

Tiger Fur|Generate

+ srcset="https://main--cc--adobecom.aem.page/creativecloud/media_1b4ccb77566c559be9f32aa4b12527bc34e3d5b3f.jpeg?width=750&format=webply&optimize=medium">

@@ -139,33 +139,33 @@

Your imagination’s new best friend.

Get Firefly Free

-

Try it

+

Try it

-----------------------------------------------------------

-

https://firefly.adobe.com/upload/inpaint#_dntGenerative Fill

+

https://firefly.adobe.com/upload/inpaint#_dntGenerative Fill

Prompt Used[Turquoise water reflecting a starry sky]|Try Generative Fill

-----------------------------------------------------------

-

https://firefly.adobe.com/generate/images#_dnt Text to Image

+

https://firefly.adobe.com/generate/images#_dnt Text to Image

Dog in a sweater, primary colors, big smile|Generate

- - - - + + + +

-----------------------------------------------------------

-

https://firefly.adobe.com/generate/font-styles#_dnt|Text Effects

+

https://firefly.adobe.com/generate/font-styles#_dnt|Text Effects

Tiger Fur|Generate

- - - - + + + +

diff --git a/test/features/firefly/mocks/masonry-body.html b/test/features/firefly/mocks/masonry-body.html index ebec3b7bb..d96a2c84c 100644 --- a/test/features/firefly/mocks/masonry-body.html +++ b/test/features/firefly/mocks/masonry-body.html @@ -10,9 +10,9 @@

Your imagination’s new best friend.

Get Firefly Free

-

Try it

+

Try it

Prompt Used

-

Launch in Firefly

+

Launch in Firefly

-----------------------------------------------------------

Describe the image you want to create|Generate

diff --git a/tools/sidekick/config.json b/tools/sidekick/config.json index c5a627010..517e911a4 100644 --- a/tools/sidekick/config.json +++ b/tools/sidekick/config.json @@ -1,5 +1,7 @@ { "project": "Creative Cloud", + "previewHost": "main--cc--adobecom.aem.page", + "liveHost": "main--cc--adobecom.aem.live", "plugins": [ { "id": "path", @@ -31,7 +33,7 @@ "id": "localize", "title": "Localize", "environments": [ "edit" ], - "url": "https://main--milo--adobecom.hlx.page/tools/loc/index.html?project=cc--adobecom", + "url": "https://main--milo--adobecom.aem.page/tools/loc/index.html?project=cc--adobecom", "passReferrer": true, "includePaths": [ "**/:x**" ] }, @@ -40,7 +42,7 @@ "id": "localize-2", "title": "Localize (V2)", "environments": [ "edit" ], - "url": "https://main--cc--adobecom.hlx.page/tools/loc?milolibs=locui", + "url": "https://main--cc--adobecom.aem.page/tools/loc?milolibs=locui", "passReferrer": true, "passConfig": true, "includePaths": [ "**.xlsx**" ] @@ -50,7 +52,7 @@ "id": "floodgate", "title": "Floodgate", "environments": [ "edit" ], - "url": "https://main--cc--adobecom.hlx.page/tools/floodgate?milolibs=floodgateui", + "url": "https://main--cc--adobecom.aem.page/tools/floodgate?milolibs=floodgateui", "passReferrer": true, "passConfig": true, "includePaths": [ "**/:x**" ] @@ -152,7 +154,7 @@ "id": "bulk", "title": "Bulk operations", "environments": [ "edit", "dev", "preview", "live" ], - "url": "https://main--cc--adobecom.hlx.page/tools/bulk-publish" + "url": "https://main--cc--adobecom.aem.page/tools/bulk-publish" }, { "containerId": "tools", diff --git a/web-test-runner.config.mjs b/web-test-runner.config.mjs index 77709bb95..a05dcc9fc 100644 --- a/web-test-runner.config.mjs +++ b/web-test-runner.config.mjs @@ -32,7 +32,7 @@ const swcImportMaps = Object.fromEntries([ 'icons/cross.js', ].map((file) => [`/libs/features/spectrum-web-components/dist/${file}`, `/node_modules/@adobecom/milo/libs/features/spectrum-web-components/dist/${file}`])); -const miloImportMaps = { 'libs/': 'https://main--milo--adobecom.hlx.live/libs/' }; +const miloImportMaps = { 'libs/': 'https://main--milo--adobecom.aem.live/libs/' }; export default { coverageConfig: {