adobecom / firefly

Apache License 2.0
0 stars 2 forks source link

Overriding Milo + UniversalNav header with Susi Light popup #75

Open amol-anand opened 2 weeks ago

amol-anand commented 2 weeks ago

Currently we are overriding the OOTB sign in (full page) functionality by calling the susi-light app onClick: https://github.com/adobecom/firefly/blob/c014da41d6c8cb3d64e4c2e63413824490fa4eda/aemedge/scripts/scripts.js#L230-L246

It then loads the bundle.js that gets generated here: https://github.com/adobecom/firefly/blob/c014da41d6c8cb3d64e4c2e63413824490fa4eda/aemedge/scripts/scripts.js#L209

This bundle.js is created by this build command - https://github.com/adobecom/firefly/blob/c014da41d6c8cb3d64e4c2e63413824490fa4eda/package.json#L13

(we would like to keep building this once a week to get the latest from susi-light and build it based on an node module package and then open PRs to this repo once a week/month IF something has changed eventually

Currently, the main issue is that the click override works 8 out of 10 times but not consistent. Once signed in, there is an event that is supposed to fire that is either not firing or we are not capturing fast enough to then refresh the token and the page to show the signed in experience with this event listener: https://github.com/adobecom/firefly/blob/c014da41d6c8cb3d64e4c2e63413824490fa4eda/aemedge/scripts/scripts.js#L131-L134

Additional Notes: Setup your local environment this way: (last tab on this page) https://main--milo--adobecom.hlx.page/docs/engineering/running-milo-locally-decom IMS integration only works on main, ims branches or https://localhost.adobe.com

amol-anand commented 1 week ago

https://cq-dev.slack.com/archives/C064R9473EG/p1718945387820639?thread_ts=1718808594.609789&cid=C064R9473EG

Manually fixed this in header-fixes for now where we override the config for Unav and reload it. This is working great now.

The discussion above is to get Milo to export the Config needed for UNav so we can override any small piece of it (listening to the preferences click message OR sign in click) Should be ready next week for us to implement. Once it is ready, I will clean up the header-fixes and then open the PR

amol-anand commented 1 week ago

I have a PR open for Milo to make a small change and the rest is in header-fixes branch. Once PR is merged in Milo, will test my branch and close this once completed.