-
Notifications
You must be signed in to change notification settings - Fork 176
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
Local nav should be displayed when the first element is dropdown #3465
Conversation
|
@@ -402,13 +402,19 @@ class Gnav { | |||
`; | |||
}; | |||
|
|||
removeLocalNav = () => { |
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.
🚫 [eslint] <class-methods-use-this> reported by reviewdog 🐶
Expected 'this' to be used by class method 'removeLocalNav'.
removeLocalNav = () => { | ||
lanaLog({ message: 'Gnav Localnav was removed, potential CLS' }); | ||
document.querySelector('.feds-localnav')?.remove(); | ||
return; |
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.
🚫 [eslint] <no-useless-return> reported by reviewdog 🐶
Unnecessary return statement.
removeLocalNav = () => { | |
lanaLog({ message: 'Gnav Localnav was removed, potential CLS' }); | |
document.querySelector('.feds-localnav')?.remove(); | |
return; | |
removeLocalNav = () => { | |
lanaLog({ message: 'Gnav Localnav was removed, potential CLS' }); | |
document.querySelector('.feds-localnav')?.remove(); | |
lanaLog({ message: 'Gnav Localnav was removed, potential CLS' }); | ||
document.querySelector('.feds-localnav')?.remove(); | ||
return; | ||
} |
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.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## mobile-gnav #3465 +/- ##
===============================================
+ Coverage 96.46% 98.53% +2.06%
===============================================
Files 256 77 -179
Lines 59987 9871 -50116
===============================================
- Hits 57868 9726 -48142
+ Misses 2119 145 -1974 ☔ View full report in Codecov by Sentry. |
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.
Make sure to fix lint
decorateLocalNav = async () => { | ||
if (!this.isLocalNav()) return; | ||
if (this.isLocalNav()) this.removeLocalNav(); |
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.
should it also return here?
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.
It returns from removeLocalNav
function
if (!firstElem) { | ||
lanaLog({ message: 'GNAV: Incorrect authoring of localnav found.', tags: 'errorType=info,module=gnav' }); | ||
return; | ||
this.removeLocalNav(); |
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 return here as well? That way it'll be less confusing to read and modify the logic below.
Resolves: MWPW-164828
Test URLs:
QA: https://main--cc--adobecom.hlx.page/drafts/blaishram/document2?milolibs=mgnav-dropdown&newNav=true