-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add the page title and the results summary to the v2 results #4762
Conversation
@@ -7,6 +7,7 @@ class ResultsController < Find::ApplicationController | |||
|
|||
def index | |||
@courses = CoursesQuery.call(params:) | |||
@courses_count = @courses.count |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
79e96dd
to
f218ac5
Compare
No courses found 1 course found X courses found 1,000 courses found
f218ac5
to
23e857d
Compare
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:
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