Skip to content

Server render search results (search and channel pages) #1833

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

Merged
merged 24 commits into from
Nov 20, 2024

Conversation

jonkafton
Copy link
Contributor

@jonkafton jonkafton commented Nov 18, 2024

What are the relevant tickets?

Closes:
Next.js: Search page: Prefetch API calls #6035
Next.js: Channel details page search: Prefetch API calls #6037

Description (What does it do?)

Prefetches search results for the search and channel details pages.

Dependency on #1822 to merge first and change base to main.

This also needs mitodl/course-search-utils#159 to be published before merging.

How can this be tested?

On the search page /search and channel pages e.g. /c/topic/architecture, /c/department/media-arts-and-sciences, /c/unit/mitx, make various changes to the following, refreshing after each and ensuring that the search results are prerendered on the server with no prefetch warnings in the dev tools console:

  • Search q text
  • Filter facet selections
  • Resource category tab selection
  • Page selection

The search results should render ok on first load with JavaScript disabled in the dev tools debugger settings.

Additional Context

Includes some refactoring to pull out getSearchParams() for reuse and provide a requestSearchParams() to convert Next.js parsed querystrings to our params for learningResources.search() API calls.

odlbot and others added 12 commits November 8, 2024 13:55
* update certification display in v2 drawer to match latest designs

* don't show price info item if runs have differing data

* MicroMasters not Micromasters

* if there is no price for the certificate but it's indicated that one is included, display that

* if resource is free, includes a certification but has no prices, still display the pill in the info item

* generate migration for MicroMasters spelling change

* fix certificate pill padding on mobile
* add format info item

* display location if format is in_person

* add tests

* also show location for hybrid courses
…nt (#1831)

* LocalDate and NoSSR components to render localized dates only on client

* Remove unnecessary React.Fragment
@jonkafton jonkafton marked this pull request as draft November 18, 2024 19:27
jonkafton and others added 4 commits November 18, 2024 20:28
* refactor starts / as taught in functionality to show on separate lines, show "anytime" in starts if availability is anytime

* fix rebase mishap
renovate bot and others added 6 commits November 19, 2024 13:12
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* adding initial vector search view

* adding working vector results endpoint

* regenerate openapi spec

* fixing format of returned results

* adding test

* patching qdrant client

* moving to v0 api

* switch to custom serializer for vector search

* fix v0 url

* using minimal serializer

* returning minimal response for vector results

* regenerate spec

* adding some other useful bits to response

* fixing response for empty query and adjusting test

* regenerate spec

* uninheriting from searchrequest serializer

* updating oai spec

* updating oai spec
* Update dependency @mui/lab to v6.0.0-beta.15

* update lockfile

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: shankar ambady <[email protected]>
@jonkafton jonkafton changed the base branch from jk/5920-prefetch-homepage to main November 19, 2024 20:42
@jonkafton jonkafton changed the base branch from main to jk/5920-prefetch-homepage November 19, 2024 20:42
@jonkafton jonkafton marked this pull request as ready for review November 19, 2024 20:43
@jonkafton jonkafton added the Needs Review An open Pull Request that is ready for review label Nov 19, 2024
@jonkafton jonkafton changed the title Server render search results Server render search results (search and channel pages) Nov 19, 2024
@jonkafton jonkafton merged commit c92adf0 into jk/5920-prefetch-homepage Nov 20, 2024
8 checks passed
@jonkafton jonkafton deleted the jk/6035-prefetch-search branch November 20, 2024 15:22
@jonkafton jonkafton restored the jk/6035-prefetch-search branch November 20, 2024 15:23
jonkafton added a commit that referenced this pull request Nov 20, 2024
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.

4 participants