Skip to content
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

Closed
wants to merge 2 commits into from

Conversation

bandana147
Copy link
Contributor

Copy link
Contributor

aem-code-sync bot commented Jan 13, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link
Contributor

aem-code-sync bot commented Jan 13, 2025

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

@@ -402,13 +402,19 @@ class Gnav {
`;
};

removeLocalNav = () => {
Copy link
Contributor

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'.

Comment on lines +405 to +408
removeLocalNav = () => {
lanaLog({ message: 'Gnav Localnav was removed, potential CLS' });
document.querySelector('.feds-localnav')?.remove();
return;
Copy link
Contributor

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.

Suggested change
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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.

Suggested change
}
};

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.53%. Comparing base (37dd614) to head (fe99f90).
Report is 1 commits behind head on mobile-gnav.

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.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@sharmrj sharmrj left a 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();
Copy link
Contributor

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?

Copy link
Contributor Author

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();
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants