[MWPW-190551] Preflight integration with C2 blocks#5737
Conversation
| asset.addEventListener(event, resolve, { once: true }); | ||
| }))); | ||
| })), | ||
| new Promise((resolve) => { setTimeout(resolve, 5000); }), |
There was a problem hiding this comment.
so i've been testing the preflight in multiple different pages and in one of the draft pages that you gave me (https://main--milo--adobecom.aem.page/drafts/rbogos/c2/multimedia-marquee-21) the Assets never loaded so i figured that it might becuase the element never fired either "loadedmetaddata" or "error" so i added a 5 seconds timeout to fix any race conditions
if 5 seconds is too long i could reduce it to 2 or i could fix the block to make sure that it listens to the correct value to fire back only "loadedmetaddata" or "error"
There was a problem hiding this comment.
A specific timeout can leave room for unwanted behaviour. I would try to use something like the PerformanceObserver and wait for network calls to calm down. Something along the lines of: when no networks calls are done in the past 3s, do something
| const isAutoBlock = AUTO_BLOCKS.some((autoBlock) => autoBlock[name]); | ||
|
|
||
| if (isC2Page && isC1Block && !isC2Block && !isAutoBlock) return { name, isInvalid: true }; | ||
| const isPageAgnostic = name === 'preflight'; |
There was a problem hiding this comment.
can we add to an array; we might have other tools that are basically page agnostic.
| @@ -4,6 +4,18 @@ import { displayPreflightVisuals } from '../visual-metadata.js'; | |||
|
|
|||
There was a problem hiding this comment.
I see https://preflight-siteredesign-integration--milo--adobecom.aem.live/libs/c2/blocks/global-footer/adobe-logo-full.svg is showing that it has never been previewed or published, but accessing a file I get 200. Helix status shows 404.
| const PAGE_AGNOSTIC_BLOCKS = ['preflight']; | ||
| const isPageAgnostic = PAGE_AGNOSTIC_BLOCKS.includes(name); |
There was a problem hiding this comment.
super nit, but why not lump these const declarations with the rest up above
|
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
|
@biljana-cvijanovic - can you provide feedback in the PR? Looks like you had some concerns in JIRA |
|
After testing, I identified several issues and added them as comments in the Jira ticket https://jira.corp.adobe.com/browse/MWPW-190551 . The issues were discussed with @robert-bogos in case he had time to review them while Sino was away. |
|
got it, thankyou @biljana-cvijanovic ! |
|
Reminder to set the |
|
This PR has not been updated recently and will be closed in 7 days if no action is taken. Please ensure all checks are passing, https://github.com/orgs/adobecom/discussions/997 provides instructions. If the PR is ready to be merged, please mark it with the "Ready for Stage" label. |
|
i've added two new commits since last reivew maybe it would be a good to have someone give a quick review before the QA approval @robert-bogos @mokimo |
|
Validated. Test details https://jira.corp.adobe.com/browse/MWPW-190551 |
a05cfe3 to
f25149b
Compare
fixed alt text and logo appearing double, exclude /libs/ from the source path
f25149b to
6833229
Compare
This PR makes it so that
utils.jswould make an exception for prelfight when running on a page that has C2 blocks.in addition it adds some css and code to help it be more compatible with the C2 blocks
Test URLs: