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

Search: Migrate more helper classes to package #21751

Merged
merged 11 commits into from
Nov 25, 2021

Conversation

jsnmoon
Copy link
Contributor

@jsnmoon jsnmoon commented Nov 16, 2021

Split off from #21637.

Changes proposed in this Pull Request:

  • Migrates the template tags helper class, which is primarily responsible for rendering clickable filters within the Jetpack Search widget.
  • Migrates the site settings helper class, which is used to persist changes from Customberg onto site options.

Does this pull request change what data or activity we track or use?

No.

Testing instructions:

  1. Apply this change to your site with a Jetpack Search subscription.
  2. Add the Jetpack Search widget with configured filters to a site sidebar with only the search module enabled (i.e. instant search disabled).
  3. Ensure that the filters from (2) render as expected.
  4. Repeat (2) and (3) with Instant Search enabled in addition to the search module.
  5. Navigate to Customberg (/wp-admin/admin.php?page=jetpack-search-configure).
  6. Ensure Customberg reads and saves instant search configuration settings as expected.

@jsnmoon jsnmoon added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. [Feature] Search For all things related to Search Instant Search [Package] Search Contains core Search functionality for Jetpack and Search plugins labels Nov 16, 2021
@jsnmoon jsnmoon requested review from a team November 16, 2021 01:14
@jsnmoon jsnmoon self-assigned this Nov 16, 2021
@github-actions github-actions bot added [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Feature] Extra Sidebar Widgets labels Nov 16, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Nov 16, 2021

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ⚠️ All commits were linted before commit.
  • ✅ Add a "[Status]" label (In Progress, Needs Team Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available.


Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped.
Then, add the "[Status] Needs Team review" label and ask someone from your team review the code.
Once you’ve done so, switch to the "[Status] Needs Review" label; someone from Jetpack Crew will then review this PR and merge it to be included in the next Jetpack release.


Jetpack plugin:

  • Next scheduled release: December 7, 2021.
  • Scheduled code freeze: November 30, 2021.

@jeherve jeherve added [Status] Needs Team Review and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 16, 2021
Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

Hi @jsnmoon it seems Classic_Search is missing from the PR.

projects/plugins/jetpack/modules/widgets/search.php Outdated Show resolved Hide resolved
projects/packages/search/src/class-template-tags.php Outdated Show resolved Hide resolved
@jsnmoon jsnmoon requested a review from kangzj November 17, 2021 01:27
@jsnmoon
Copy link
Contributor Author

jsnmoon commented Nov 17, 2021

Hi @jsnmoon it seems Classic_Search is missing from the PR. (@kangzj)

It was never meant to be included in this PR; fixed! Good catch! 😅

@kangzj
Copy link
Contributor

kangzj commented Nov 18, 2021

Hi @jsnmoon unfortunately this broke /wp-admin/widgets.php for me. I don't see any errors, only a blank screen. Could you have a look at this while I continue my tests and review? Thanks

---------EDIT--------------
Seems something is wrong in function wp_print_media_templates (probably called somewhere from the template tag class?):
image

Other than that, the widget works fine for both Classic and Instant Search. Another thing I noticed that, we'd probably need a version bump by running command: tools/project-version.sh -f -u 0.2.0-alpha packages/search

@jsnmoon jsnmoon added the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Nov 18, 2021
@jsnmoon
Copy link
Contributor Author

jsnmoon commented Nov 18, 2021

Hi @jsnmoon unfortunately this broke /wp-admin/widgets.php for me. I don't see any errors, only a blank screen. Could you have a look at this while I continue my tests and review? (@kangzj)

I noticed this went away after I merged in the latest master, so I'm guessing it was an unrelated regression. It should be fixed now!

Other than that, the widget works fine for both Classic and Instant Search. Another thing I noticed that, we'd probably need a version bump by running command: tools/project-version.sh -f -u 0.2.0-alpha packages/search (@kangzj)

Done!

kangzj
kangzj previously approved these changes Nov 19, 2021
Copy link
Contributor

@kangzj kangzj left a comment

Choose a reason for hiding this comment

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

Well done Jason, this looks good and test well 👍

@kangzj kangzj removed the [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! label Nov 19, 2021
@jsnmoon jsnmoon added the [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. label Nov 19, 2021
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This is going to need a rebase I'm afraid.

You should also be able to remove the now error-free file from tools/phpcs-excludelist.json.

@jeherve jeherve added [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 23, 2021
@kangzj kangzj added [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. and removed [Status] Needs Author Reply We would need you to make some changes or provide some more details about your PR. Thank you! labels Nov 25, 2021
@kangzj
Copy link
Contributor

kangzj commented Nov 25, 2021

Hi @jeherve rebased and removed the file from phpcs excluded list. Thanks.

@kangzj kangzj requested a review from jeherve November 25, 2021 01:17
@kangzj kangzj self-assigned this Nov 25, 2021
@jeherve jeherve added this to the jetpack/10.4 milestone Nov 25, 2021
Copy link
Member

@jeherve jeherve left a comment

Choose a reason for hiding this comment

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

This looks good to me. Let's merge this. I had a question, but that's something that can be discussed after the merge I think.

@jeherve jeherve enabled auto-merge (squash) November 25, 2021 14:40
@jeherve jeherve merged commit 661dbe4 into master Nov 25, 2021
@jeherve jeherve added [Status] Ready to Merge Go ahead, you can push that green button! and removed [Status] Needs Review To request a review from fellow Jetpack developers. Label will be renamed soon. labels Nov 25, 2021
@jeherve jeherve deleted the update/move-more-search-helpers-to-package branch November 25, 2021 14:41
@github-actions github-actions bot removed the [Status] Ready to Merge Go ahead, you can push that green button! label Nov 25, 2021
@kangzj
Copy link
Contributor

kangzj commented Nov 25, 2021

These changes will be synced to WPCOM once the classic/instant search migration is complete.

davidlonjon added a commit that referenced this pull request Dec 2, 2021
* master: (22 commits)
  Update storybook monorepo to v6.4.0 (#21897)
  Refresh the site's modules and settings after successful product activation (#21886)
  Plugin Install: Bump MC stat on success or fail. (#21893)
  Nav Unification: Use correct user capability for the Inbox menu item (#21882)
  Jetpack: Extend disconnection dialog component to handle multiple steps and accept more props (#21048)
  Disable CSSTidy property shorthand optimization in the editor or headstart (#21891)
  Connection UI: Update Composer instructions in README.md (#21890)
  Partner Compatibility: Adding a unique connection screen for customers who receive a coupon from a Jetpack partner (#21813)
  Search package: move search dashboard to package - the base (#21865)
  JITM: wrap CTA below text on small viewports (#21688)
  Licensing JS Package – fix icon positioning and width (#21878)
  JITM: new JS and CSS builder (#21874)
  Support site_intent for `/me/sites` endpoint (#21880)
  Don't render Critical CSS while generating CritCSS. (#21879)
  ConnectScreen: make button full width on small screens (#21683)
  Improve the copy of the license activation banner (#21876)
  Rename Webpack-built files back from `.min.js` and remove hashes (#21748)
  Search: Migrate more helper classes to package (#21751)
  Search: migrate/add search rest API (#21584)
  Add initial state to the connection package (#21864)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Extra Sidebar Widgets [Feature] Search For all things related to Search [Package] Search Contains core Search functionality for Jetpack and Search plugins [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ Touches WP.com Files
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants