-
Notifications
You must be signed in to change notification settings - Fork 168
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
MWPW-157965: Upgrade Universal Nav to Version 1.3 #2867
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #2867 +/- ##
==========================================
+ Coverage 96.09% 96.18% +0.08%
==========================================
Files 215 215
Lines 53954 53989 +35
==========================================
+ Hits 51849 51929 +80
+ Misses 2105 2060 -45 ☔ View full report in Codecov by Sentry. |
@@ -608,9 +608,6 @@ class Gnav { | |||
locale, | |||
imsClientId: window.adobeid?.client_id, | |||
theme: isDarkMode() ? 'dark' : 'light', | |||
onReady: () => { | |||
this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is onReady
callback removed in new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in PR description - Unav suggested to not rely on onReady
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this is true for 1.2 as well? (should someone want to use that version)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think it affects 1.2 as the window.UNav() promise came up with 1.3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -608,9 +608,6 @@ class Gnav { | |||
locale, | |||
imsClientId: window.adobeid?.client_id, | |||
theme: isDarkMode() ? 'dark' : 'light', | |||
onReady: () => { | |||
this.decorateAppPrompt({ getAnchorState: () => window.UniversalNav.getComponent?.('app-switcher') }); | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this is true for 1.2 as well? (should someone want to use that version)
window.UniversalNav.reload(CONFIG.universalNav.universalNavConfig); | ||
}); | ||
window.UniversalNav(CONFIG.universalNav.universalNavConfig) | ||
.then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super minor, but I wonder if this won't be clearer with an await
instead of a .then
. That way we we get less nesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure. I've updated this to await
This PR is currently in the |
Upgrades the UNav to 1.3
Adding eventListener for reloading Unav once Unav promise resolved as with v1.3 - the window.UniversalNav() returns a promise post which we can use methods like window.UniversalNav().reload() - ref
Also, Unav suggested to not rely on onReady method for triggering PEP modal instead we can wait for promise returned by
window.UniversalNav()
to be resolved.Resolves: MWPW-157965
Test URLs: