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

Add the page title and the results summary to the v2 results #4762

Conversation

tomas-stefano
Copy link
Contributor

Context

On the new search results page we want to add the description of “x courses found” or “no courses found” and we want to add the page title as well.

Scenarios:

  • No courses found
  • 1 course found
  • X courses found
  • 1,000 courses found

What this PR does NOT do yet

Handle the no courses found message inside the search results (this will be done at later stage when all filters are done).

Changes proposed in this pull request

Guidance to review

  1. Visit /v2/results
  2. Does it work for all scenarios?

@tomas-stefano tomas-stefano added the deploy A Review App will be created for PRs with this label label Dec 11, 2024
@tomas-stefano tomas-stefano requested a review from a team as a code owner December 11, 2024 17:12
@tomas-stefano
Copy link
Contributor Author

@@ -7,6 +7,7 @@ class ResultsController < Find::ApplicationController

def index
@courses = CoursesQuery.call(params:)
@courses_count = @courses.count
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this variable? It feels like we could either call @courses.count or @pagy.count in the view directly. Is it to cache the value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it to cache the value?

Yes. I'd prefer this way

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We use this count two times in the view and will send also for tracking. I think would be good to have this value.

For a while I was thinking that maybe courses query could have this value but we don't hold the courses query instance so I chosen this way.

@tomas-stefano tomas-stefano force-pushed the td/290-foundation-for-the-pre-filter-work-search-results-title-header branch from 79e96dd to f218ac5 Compare December 13, 2024 07:17
@tomas-stefano tomas-stefano force-pushed the td/290-foundation-for-the-pre-filter-work-search-results-title-header branch from f218ac5 to 23e857d Compare December 13, 2024 10:14
@tomas-stefano tomas-stefano merged commit 91d327e into main Dec 13, 2024
19 checks passed
@tomas-stefano tomas-stefano deleted the td/290-foundation-for-the-pre-filter-work-search-results-title-header branch December 13, 2024 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy A Review App will be created for PRs with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants