-
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 course summary card to the new results page #4825
Add course summary card to the new results page #4825
Conversation
- **Location field**: Provides a label describing the course's placement location information. - Potential values: - "Placement schools" for Fee - "Employing school" (for one school) / "Employing schools" (for multiple schools) for Salary and Apprenticeship - Dependencies: `course.funding`, `available_placements_count` - **Location Value**: Displays detailed placement location information and proximity to the user's search location. - Potential values: - "Not listed yet" - "Nearest of X potential [school_term] school(s)" - "X potential [school_term] school(s)" - "X miles from [location]" - Dependencies: - `available_placements_count` - `@search_params[:location]` - `course.minimum_distance_to_search_location` - `school_term` (dynamic based on `course.funding`) - **Fee field name**: A label indicating the fees associated with the course. - Potential values: "Fee or salary" - **Fee Value**: Provides details on the fees for UK and international students or mentions that the course is salaried. - Potential values: - "Salary" - "Salary (apprenticeship)" - "Fees for UK students": "%{value} for UK citizens" - "Fees for international students": "%{value} for Non-UK citizens" - Bursaries and Scholarships hint: - "Bursaries of %{bursary_amount} are available" - "Scholarships of %{scholarship_amount} are available" - "Scholarships of %{scholarship_amount} or bursaries of %{bursary_amount} are available" - Rules for displaying bursaries: - Hidden when the financial incentives feature flag is off. - Displays based on the course’s main subject and financial incentive. - When "visa sponsorship" filter is applied, affects bursary/scholarship hint display (show when Physics and languages only). - Dependencies: - `course.funding`, `fee_uk`, `fee_international`, `main subject -> financial_incentive` - **Course Length field**: A label indicating the duration of the course. - Potential values: "Course Length" - **Course Length Value**: Displays the duration of the course along with the study mode. - Potential values: "1 year - full-time," "2 years - part-time" - Dependencies: `course.enrichment_attribute(:course_length)`, `course.study_mode` - **Age Group**: A label describing the age group the course is aimed at. - Potential values: "Age Group" - **Age Group Value**: Indicates the level of the course and the age range it covers. - Potential values: "Primary - 5 to 11," "Secondary - 11 to 16" - Dependencies: `course.level`, `course.age_range_in_years` - **Qualification**: A label describing the type of qualification awarded by the course. - Potential values: "Qualification awarded" - **Qualification Value**: Specifies the qualification type. - Potential values: - "QTS" (QTS only) - "QTS with PGCE" - "QTS with PGDE" - "PGCE without QTS" - "PGDE without QTS" - "Undergraduate degree with QTS" - Notes for Abbreviations: Displays terms (e.g., QTS, PGCE) directly in the browser. - Dependencies: `course.qualification` - **Degree Requirements**: A label describing the degree requirements for the course. - Potential values: - Postgraduate: - "2:1 bachelor’s degree" - "2:2 bachelor’s degree" - "Bachelor’s degree" - Undergraduate: "No degree required" - Dependencies: `course.degree_type`, `course.degree_grade` - **Visa Sponsorship**: A label indicating whether the course supports visa sponsorship. - Potential values: - "Visa Sponsorship" - **Visa Sponsorship Value**: Indicates visa sponsorship eligibility for international students. - Potential values: - "Visas cannot be sponsored" - "Student visas can be sponsored" - "Skilled Worker visas can be sponsored" - Dependencies: `course.visa_sponsorship`, `course.funding`
9e44c92
to
c4ceb6e
Compare
t( | ||
'.location_value.distance', | ||
school_term:, | ||
distance: content_tag(:span, pluralize(course.minimum_distance_to_search_location, 'mile'), class: 'govuk-!-font-weight-bold'), |
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.
the minimum_distance_to_search_location
still doesn't exist. The idea is to return into the SELECT
statement because we shouldn't be looping through all the placements in Ruby to calculate the minimum distance from the user searched location.
This will be done when the location search is implemented.
AND site.latitude IS NULL | ||
AND site.longitude IS NULL" | ||
) | ||
end |
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.
I moved the Ruby loop and add a SQL for it. Although I didn't add any spec (because this will be removed).
The idea is to remove this code and return also in the SELECT
statement the available placements count.
First I isolated here, so I can remove before the pre-filter work is finished.
This will be done in a separate PR.
|
||
def main_subject | ||
@main_subject ||= Subject.find_by(id: course.master_subject_id) | ||
end |
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 need to create the "main subject" concept into the app.
For now I added here.
I will create a trello card and make sure it is finished before the prefilter work is delivered.
This also will be done in a separate card.
|
||
def financial_incentive | ||
@financial_incentive ||= main_subject&.financial_incentive | ||
end |
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.
One more query to the DB for each search result.
Will check performance in a separate PR.
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.
Looks good.
Couple of suggestions
@@ -892,6 +892,44 @@ def name_and_code | |||
"#{name} (#{course_code})" | |||
end | |||
|
|||
def available_placements |
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.
Could this be better living in a module?
AvailablePlacements.new(course:).call
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.
It is a good idea, but this code will be removed because this should be in the db SELECT
list on the courses query, so I am reluctantly to move to a class now.
Only passes the parameters it uses not the whole search params This components only uses location and visa sponsorship
It should help with the template visualisation too. Now we now that all fields have a key, a value, and a possible hint.
Context
This PR adds all the course summary content into the search result.
The goal was:
SearchResultComponent
if you want)If you wanna see the details of each field please read the commit message.
Caveats