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

Remove content from the course results and course summary #4696

Merged
merged 7 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions app/components/find/courses/summary_component/view.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@

<%= govuk_summary_list(actions: false) do |summary_list| %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".fee_or_salary")) %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<%= course.funding %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>

<% unless no_fee? %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<% if course.salaried? %>
<%= t(".pays_salary_html") %>
<% if course.apprenticeship? %>
<%= t(".teaching_apprenticeship") %>
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= t(".no_fee") %></span>
<% elsif course.apprenticeship? %>
<%= t(".pays_salary_html") %>
<span class="govuk-hint govuk-!-font-size-16"><%= t(".no_fee") %></span>
<% else %>
<%= course.course_fee_content %>
<div><span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span></div>
<% end %>
<% end %>
<% end %>
Expand Down
36 changes: 16 additions & 20 deletions app/components/find/results/search_result_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,22 @@
<% end %>

<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".fee_or_salary")) %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value do %>
<%= course.funding %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span>
<% end %>
<% end %>

<% unless no_fee? %>
<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".course_fee")) %>
<% row.with_value(text: course.course_fee_content) %>
<% if course.salaried? %>
<%= t(".pays_salary_html") %>
<% if course.apprenticeship? %>
<%= t(".teaching_apprenticeship") %>
<% end %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= t(".no_fee") %></span>
<% elsif course.apprenticeship? %>
<%= t(".pays_salary_html") %>
<span class="govuk-hint govuk-!-font-size-16"><%= t(".no_fee") %></span>
<% else %>
<%= course.course_fee_content %>
<div><span class="govuk-hint govuk-!-font-size-16"><%= course.funding_option %></span></div>
<% end %>
<% end %>
<% end %>

Expand All @@ -48,15 +52,7 @@

<% summary_list.with_row do |row| %>
<% row.with_key(text: t(".qualification")) %>
<% row.with_value do %>
<% if accredited_provider %>
<%= formatted_qualification %>
<br>
<span class="govuk-hint govuk-!-font-size-16"><%= accredited_provider %></span>
<% else %>
<%= formatted_qualification %>
<% end %>
<% end %>
<% row.with_value(text: formatted_qualification) %>
<% end %>

<% summary_list.with_row do |row| %>
Expand Down
6 changes: 0 additions & 6 deletions app/components/find/results/search_result_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,6 @@ def visa_sponsorship_status
'Visas cannot be sponsored'
end
end

def accredited_provider
return nil if course.accrediting_provider.blank?

"QTS ratified by #{helpers.smart_quotes(course.accrediting_provider.provider_name)}"
end
end
end
end
8 changes: 4 additions & 4 deletions app/decorators/course_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,14 @@ def funding_option

if excluded_from_bursary?
# Duplicate branch body detected
'Student finance if you’re eligible'
'Student loans if you’re eligible'
elsif has_scholarship_and_bursary? && bursary_and_scholarship_flag_active_or_preview?
'Scholarships or bursaries, as well as student finance, are available if you’re eligible'
'Scholarships or bursaries, as well as student loans, are available if you’re eligible'
elsif has_bursary? && bursary_and_scholarship_flag_active_or_preview?
'Bursaries and student finance are available if you’re eligible'
'Bursaries and student loans are available if you’re eligible'
else
# Duplicate branch body detected
'Student finance is available if you’re eligible'
'Student loans are available if you’re eligible'
end
end

Expand Down
6 changes: 6 additions & 0 deletions config/locales/find.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ en:
find_out_more_about_tda: Find out more about teacher degree apprenticeships
summary_component:
view:
pays_salary_html: This course pays a <strong>salary</strong>
teaching_apprenticeship: It is a teaching apprenticeship
no_fee: There is no fee
fee_or_salary: Fee or salary
course_summary: Course summary
course_fee: Course fee
Expand Down Expand Up @@ -192,6 +195,9 @@ en:
training_with_disabilities_link: Find out about training with disabilities and other needs at %{provider_name}.
results:
search_result_component:
pays_salary_html: This course pays a <strong>salary</strong>
teaching_apprenticeship: It is a teaching apprenticeship
no_fee: There is no fee
no_degree_required: No degree required
fee_based:
location: Placement schools
Expand Down
7 changes: 4 additions & 3 deletions spec/components/find/courses/sumary_component/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module SummaryComponent

result = render_inline(described_class.new(course))
expect(result.text).to include(
'Fee or salary',
'Course fee',
'Course length',
'Age range',
Expand All @@ -29,7 +28,9 @@ module SummaryComponent

result = render_inline(described_class.new(course))
expect(result.text).not_to include('£9,250')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
expect(result.text).to include('This course pays a salary')
expect(result.text).to include('It is a teaching apprenticeship')
end
end

Expand Down Expand Up @@ -185,7 +186,7 @@ module SummaryComponent

expect(result.text).not_to include('for UK citizens')
expect(result.text).not_to include('£14,000 for Non-UK citizens')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end
end
Expand Down
16 changes: 2 additions & 14 deletions spec/components/find/results/search_result_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,6 @@ module Find
end
end

context 'when there is an accrediting provider' do
it 'renders correct message' do
course = build(
:course,
accrediting_provider: build(:provider, :accredited_provider, provider_name: 'ACME SCITT A1')
)
result = render_inline(described_class.new(course:, results_view:))

expect(result.text).to include('QTS ratified by ACME SCITT A1')
end
end

context 'when there is no accrediting provider' do
it 'renders correct message' do
course = build(
Expand All @@ -122,7 +110,7 @@ module Find

result = render_inline(described_class.new(course:, results_view:))
expect(result.text).not_to include('£9,250')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end

Expand Down Expand Up @@ -175,7 +163,7 @@ module Find

expect(result.text).not_to include('for UK citizens')
expect(result.text).not_to include('£14,000 for Non-UK citizens')
expect(result.text).not_to include('Course fee')
expect(result.text).to include('Course fee')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/find/search/course_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def i_see_the_courses
expect(first_course.provider_name.text).to be_present
expect(first_course).to have_text('QTS with PGCE')
expect(first_course).to have_text('1 year - full time')
expect(first_course).to have_text('Teaching apprenticeship - with salary')
expect(first_course).to have_text('This course pays a salary')
end
end

Expand Down
Loading