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

fix(search-algolia): Algolia plugin SearchPage does not respect configuration #10156

Closed
wants to merge 2 commits into from

Conversation

ncoughlin
Copy link
Contributor

@ncoughlin ncoughlin commented May 20, 2024

Note that this update converts the file to JS, which I assume is not desirable. This change is based on a JS swizzled version of the component. If you view the change comparison file you should be able to easily modify the original TS file to reflect these changes.

With this update the SearchPage component now checks the contextualSearch value of the config file. Disjunctive Facet Refinements are no longer added to the query if this setting is false.

Additionally if a user has now explicitly defined a title or description in their algolia index config, those items will be used in place of hierarchy items. otherwise hierarchy functions as normal.

Tested working for contextualSearch true & false.

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • [no unit tests but it works] If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

I wanted the Search page to work. Sounds like this issue has been open for three years. 👍

Test Plan

Was only tested manually with contextualSearch: false/true.

algolia

Related issues/PRs

Fix #3805

With this update the SearchPage component now checks the contextualSearch value of the config file. Disjunctive Facet Refinements are no longer added to the query if this setting is false.

Additionally if a user has now explicitly defined a title or description in their algolia index config, those items will be used in place of hierarchy items. otherwise hierarchy functions as normal.

Tested working for contextualSearch true & false.
@facebook-github-bot
Copy link
Contributor

Hi @ncoughlin!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link

netlify bot commented May 20, 2024

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit bd46eb7
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/664bc7e31d317900084c05f0
😎 Deploy Preview https://deploy-preview-10156--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🔴 38 🟢 98 🟢 96 🟢 100 🟠 88 Report
/docs/installation 🟠 65 🟢 96 🟢 100 🟢 100 🟠 88 Report
/docs/category/getting-started 🟠 75 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog 🟠 69 🟢 100 🟢 100 🟢 90 🟠 88 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 68 🟢 96 🟢 100 🟢 100 🟠 88 Report
/blog/tags/release 🟠 68 🟢 100 🟢 100 🟠 80 🟠 88 Report
/blog/tags 🟠 73 🟢 100 🟢 100 🟢 90 🟠 88 Report

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 20, 2024
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@slorber slorber changed the title [closes #3805] Algolia plugin SearchPage does not respect configuration fix(search-algolia): Algolia plugin SearchPage does not respect configuration May 23, 2024
@slorber slorber added the pr: bug fix This PR fixes a bug in a past release. label May 23, 2024
Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

Thanks for trying to solve this issue.

Note that this update converts the file to JS, which I assume is not desirable. This change is based on a JS swizzled version of the component. If you view the change comparison file you should be able to easily modify the original TS file to reflect these changes.

Yes we want to keep TS. I'm not sure what you expect me to do with this PR since I can't merge it as is, nor review it properly considering there's a lot of diff noise that makes it difficult to see the actual significant changes you made.

Am I supposed to fix your PR and restore TS?

Or am I supposed to take inspiration from it and create a new one? 🤷‍♂️

@ncoughlin
Copy link
Contributor Author

ncoughlin commented May 24, 2024 via email

@slorber
Copy link
Collaborator

slorber commented May 27, 2024

Thanks

We'll get a new PR, so let's close this one until then.

If you don't send a new PR, feel free to post there a clear JS diff of your solution, I could try to submit the TS PR myself based on your proposed solution. The problem for me atm is that it's even hard to know what you modified exactly

@slorber slorber closed this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: bug fix This PR fixes a bug in a past release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Algolia plugin SearchPage does not respect configuration
3 participants