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

Create a container element for search in standalone gnav #2833

Merged
merged 11 commits into from
Sep 16, 2024

Conversation

sonawanesnehal3
Copy link
Contributor

Copy link
Contributor

aem-code-sync bot commented Sep 5, 2024

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

Choose a reason for hiding this comment

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

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.

console.error('Global navigation Error: header and footer configurations are missing.');

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember the context for this one, but having console errors might not be desirable. Would LANA logs not be enough?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is for standalone Gnav in which we need to notify the consuming clients of the error.

Copy link
Contributor

aem-code-sync bot commented Sep 5, 2024

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

@sonawanesnehal3 sonawanesnehal3 added the needs-verification PR requires E2E testing by a reviewer label Sep 5, 2024
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.08%. Comparing base (8df386c) to head (5b9e6f1).
Report is 37 commits behind head on stage.

Additional details and impacted files
@@            Coverage Diff             @@
##            stage    #2833      +/-   ##
==========================================
+ Coverage   95.89%   96.08%   +0.19%     
==========================================
  Files         173      215      +42     
  Lines       46126    53947    +7821     
==========================================
+ Hits        44231    51835    +7604     
- Misses       1895     2112     +217     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@spadmasa spadmasa self-assigned this Sep 5, 2024
Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

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

Had a small chat with @narcis-radu regarding this, seems like is the least evil option. Looks good in that case!

Comment on lines 817 to 818
this.elements.customSearch = toFragment`<div class="feds-client-search"></div>`;
return this.elements.customSearch;
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like you're using this.elements.customSearch anywhere, so why not just

Suggested change
this.elements.customSearch = toFragment`<div class="feds-client-search"></div>`;
return this.elements.customSearch;
return toFragment`<div class="feds-client-search"></div>`;

Alternatively, you could have the searchEnabled check here and return the element or '' and then just call the method directly in decorateMainNav.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @overmyheadandbody ,
Updated the code. Please review again.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't remember the context for this one, but having console errors might not be desirable. Would LANA logs not be enough?

Copy link
Contributor

github-actions bot commented Sep 7, 2024

This PR is currently in the needs-verification state. Please assign a QA engineer to verify the changes.

@spadmasa
Copy link

spadmasa commented Sep 9, 2024

@spadmasa spadmasa added verified PR has been E2E tested by a reviewer and removed needs-verification PR requires E2E testing by a reviewer labels Sep 9, 2024
Copy link
Contributor

Reminder to set the Ready for Stage label - to queue this to get merged to stage & production.

@@ -822,6 +822,7 @@ class Gnav {
${isDesktop.matches ? '' : this.decorateSearch()}
${this.elements.mainNav}
${isDesktop.matches ? this.decorateSearch() : ''}
${getConfig().searchEnabled === 'on' ? toFragment`<div class="feds-client-search"></div>` : ''}
Copy link
Contributor

Choose a reason for hiding this comment

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

One thing is not very clear to me. This feature is supposed to be relevant for the standalone Gnav, yet the config is added through scripts.js at a consumer level. Couldn't a config be passed directly to the standalone version? I feel like I'm missing something, but also want to make sure we're not polluting scripts.js with irrelevant properties.

Copy link
Contributor

Choose a reason for hiding this comment

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

@overmyheadandbody There is no separate config for standalone Gnav. The standalone version directly calls the init of global-navigation /global-footer and we set the miloLibs from navigation.js not through script.js.

@milo-pr-merge milo-pr-merge bot merged commit 13b62d5 into stage Sep 16, 2024
22 checks passed
@milo-pr-merge milo-pr-merge bot deleted the mwpw157417 branch September 16, 2024 08:52
@milo-pr-merge milo-pr-merge bot mentioned this pull request Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants