Skip to content

Conversation

@ChristopherChudzicki
Copy link
Contributor

What are the relevant tickets?

Closes https://github.com/mitodl/hq/issues/5697

Description (What does it do?)

This adds a SearchField component wrapping SearchInput that handles some of the application logic, like resetting search page to 1.

How can this be tested?

  1. Visit http://localhost:8062/c/unit/xpro/?page=3 and submit a new search query text (like, "Cat"). The page should be reset
  2. Visit https://learn.mit.edu/search/?page=3 and submit new search text. The page should be reset.

Comment on lines +30 to +32
if (POSTHOG?.api_key) {
posthog.capture("search_update", { isEnter: isEnter })
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved the posthog stuff out of ol-components and into the new SearchField component. Since ol-components is generally styling / UI focused, I think this new component is a better place for the posthog call.

@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Oct 3, 2024
@ChristopherChudzicki ChristopherChudzicki marked this pull request as ready for review October 3, 2024 13:14
@abeglova abeglova self-assigned this Oct 3, 2024
Copy link
Contributor

@abeglova abeglova left a comment

Choose a reason for hiding this comment

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

Works great

@ChristopherChudzicki ChristopherChudzicki merged commit 3d4b4e9 into main Oct 3, 2024
10 checks passed
@odlbot odlbot mentioned this pull request Oct 4, 2024
5 tasks
mbertrand pushed a commit that referenced this pull request Oct 4, 2024
@rhysyngsun rhysyngsun deleted the cc/search-page-reset branch February 7, 2025 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants