From 5c79e4e6cfc2efb13e0c689df08ad5a79d4443dd Mon Sep 17 00:00:00 2001 From: CatalinVoineag <11318084+CatalinVoineag@users.noreply.github.com> Date: Thu, 11 Jul 2024 14:46:27 +0100 Subject: [PATCH] Redesign visa sponsorship on course page The International students section is going to be removed from the publis/find course show pages. This is part of a redesign of the course page to make it easier for users to view the information without being overwhelmed The visa sponsorship content will now be in a drop-down details tag. The content inside has also been tweaked. --- .../view.html.erb | 14 +++++++---- .../international_students_component/view.rb | 18 +++++++++++++- .../courses/summary_component/view.html.erb | 4 +++- app/helpers/view_helper.rb | 24 +++++++++++++++++++ app/views/find/courses/show.html.erb | 2 -- app/views/publish/courses/preview.html.erb | 2 -- config/locales/find.yml | 23 +++++++++--------- .../view_spec.rb | 12 ++-------- .../find/search/viewing_a_course_spec.rb | 9 ++++--- .../publish/viewing_a_course_preview_spec.rb | 4 ++++ 10 files changed, 74 insertions(+), 38 deletions(-) diff --git a/app/components/find/courses/international_students_component/view.html.erb b/app/components/find/courses/international_students_component/view.html.erb index c8ec1dfad0..d5b0c66963 100644 --- a/app/components/find/courses/international_students_component/view.html.erb +++ b/app/components/find/courses/international_students_component/view.html.erb @@ -1,5 +1,4 @@ -
-

International candidates

+<%= govuk_details(summary_text: visa_sponsorship_summary) do %>
<% if apprenticeship? %> @@ -10,7 +9,9 @@ EEA, Switzerland, Gibraltar, or the UK for at least the previous 3 years will also be eligible.

<% end %> -

<%= apprenticeship? ? "You’ll also" : "You’ll" %> need the <%= right_required %> in the UK. You already have this if, for example, you:

+

<%= apprenticeship? ? "You’ll also" : "You’ll" %> need the <%= right_required %> in the UK

+ +

You already have this if, for example, you:

- <%= t("find.international_candidates.#{visa_type}.#{sponsorship_availability}.html") %> + <%= t( + "find.international_candidates.#{visa_type}.#{sponsorship_availability}.html", + provider_url: x_provider_url + ) %>

Learn more about <%= govuk_link_to("training to teach in England as an international student", t("find.get_into_teaching.url_train_to_teach_as_international_candidate")) %>.

-
+<% end %> diff --git a/app/components/find/courses/international_students_component/view.rb b/app/components/find/courses/international_students_component/view.rb index e078686412..35d281f338 100644 --- a/app/components/find/courses/international_students_component/view.rb +++ b/app/components/find/courses/international_students_component/view.rb @@ -4,9 +4,15 @@ module Find module Courses module InternationalStudentsComponent class View < ViewComponent::Base + include ::ViewHelper + include PreviewHelper attr_reader :course - delegate :apprenticeship?, to: :course + delegate :apprenticeship?, + :salaried?, + :can_sponsor_student_visa, + :can_sponsor_skilled_worker_visa, + to: :course def initialize(course:) super @@ -32,6 +38,16 @@ def sponsorship_availability def course_subject_codes @course_subject_codes ||= course.subjects.pluck(:subject_code).compact end + + def visa_sponsorship_summary + if !salaried? && can_sponsor_student_visa + t('.student_visas_can_be_sponsored') + elsif salaried? && can_sponsor_skilled_worker_visa + t('.skilled_worker_visas_can_be_sponsored') + else + t('.visas_cannot_be_sponsored') + end + end end end end diff --git a/app/components/find/courses/summary_component/view.html.erb b/app/components/find/courses/summary_component/view.html.erb index ede1910804..656bc4cbb8 100644 --- a/app/components/find/courses/summary_component/view.html.erb +++ b/app/components/find/courses/summary_component/view.html.erb @@ -68,6 +68,8 @@ <% summary_list.with_row do |row| %> <% row.with_key(text: t(".visa_sponsorship")) %> - <% row.with_value(text: visa_sponsorship_row) %> + <% row.with_value do %> + <%= render Find::Courses::InternationalStudentsComponent::View.new(course:) %> + <% end %> <% end %> <% end %> diff --git a/app/helpers/view_helper.rb b/app/helpers/view_helper.rb index dce728ae2d..308db31a11 100644 --- a/app/helpers/view_helper.rb +++ b/app/helpers/view_helper.rb @@ -151,6 +151,30 @@ def classnames(*args) alias cns classnames + def x_provider_url + if preview?(params) + provider_publish_provider_recruitment_cycle_course_path( + course.provider_code, + course.recruitment_cycle_year, + course.course_code + ) + else + find_provider_path(course.provider_code, course.course_code) + end + end + + def x_accrediting_provider_url + if preview?(params) + accredited_by_publish_provider_recruitment_cycle_course_path( + course.provider_code, + course.recruitment_cycle_year, + course.course_code + ) + else + find_accrediting_provider_path(course.provider_code, course.course_code) + end + end + private def base_errors_hash(provider_code, course) diff --git a/app/views/find/courses/show.html.erb b/app/views/find/courses/show.html.erb index 8cc136a8a3..fb714c582a 100644 --- a/app/views/find/courses/show.html.erb +++ b/app/views/find/courses/show.html.erb @@ -51,8 +51,6 @@ <%= render partial: "find/courses/interview_process", locals: { course: @course } %> <% end %> - <%= render Find::Courses::InternationalStudentsComponent::View.new(course: @course) %> - <% if @provider.train_with_disability.present? %>

<%= t(".training_with_disabilities") %> diff --git a/app/views/publish/courses/preview.html.erb b/app/views/publish/courses/preview.html.erb index 7c6ff4356b..00464da24f 100644 --- a/app/views/publish/courses/preview.html.erb +++ b/app/views/publish/courses/preview.html.erb @@ -41,8 +41,6 @@ <%= render partial: "find/courses/interview_process", locals: { course: } %> <% end %> - <%= render Find::Courses::InternationalStudentsComponent::View.new(course:) %> -

<%= t(".training_with_disabilities") %>

diff --git a/config/locales/find.yml b/config/locales/find.yml index 372dd4bfd2..418d13f4f0 100644 --- a/config/locales/find.yml +++ b/config/locales/find.yml @@ -73,6 +73,11 @@ en: courses: train_with_disabilities: heading: Training with disabilities and other needs at %{provider_name} + international_students_component: + view: + student_visas_can_be_sponsored: Student visas can be sponsored + skilled_worker_visas_can_be_sponsored: Skilled Worker visas can be sponsored + visas_cannot_be_sponsored: Visas cannot be sponsored summary_component: view: fee_or_salary: Fee or salary @@ -149,27 +154,21 @@ en: skilled_worker_visa: not_available: html: -

If you do not already have the right to work in the UK, you may need to apply for a visa. The main visa for salaried courses is the Skilled Worker visa.

-

Sponsorship for a Skilled Worker visa is not available for this course.

-

If you need a visa, filter your course search to find courses with visa sponsorship.

-

You can also learn more about different types of visa which allow you to train to be a teacher without being sponsored.

+

If you do not already have the right to study in the UK, you may need to apply for your visa to train to teach in England .

available: html: -

If you do not already have the right to work in the UK for the duration of this course, you may need to apply for a Skilled Worker visa.

+

If you do not already have the right to work in the UK, you may need to apply for your visa to train to teach in England .

To do this, you’ll need to be sponsored by your employer.

-

Before you apply for this course, contact us to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.

+

Before you apply for this course, contact the training provider to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.

student_visa: not_available: html: -

If you do not already have the right to study in the UK, you may need to apply for a visa.

-

Sponsorship for a student visa is not available for this course.

-

If you need a visa, filter your course search to find courses with visa sponsorship.

-

You can also learn more about different types of visa which allow you to train to be a teacher without being sponsored.

+

If you do not already have the right to study in the UK, you may need to apply for your visa to train to teach in England .

available: html: -

If you do not already have the right to study in the UK for the duration of this course, you may need to apply for a Student visa.

+

If you do not already have the right to study in the UK, you may need to apply for your visa to train to teach in England .

To do this, you’ll need to be sponsored by your training provider.

-

Before you apply for this course, contact us to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.

+

Before you apply for this course, contact the training provider to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.

entitlement: html:

You may be entitled to £10,000 from the UK government to help with the financial costs of moving to England.

diff --git a/spec/components/find/courses/international_students_component/view_spec.rb b/spec/components/find/courses/international_students_component/view_spec.rb index 35e1da11b7..ecdd153e17 100644 --- a/spec/components/find/courses/international_students_component/view_spec.rb +++ b/spec/components/find/courses/international_students_component/view_spec.rb @@ -16,10 +16,6 @@ it 'tells candidates they’ll need the right to study' do expect(page).to have_text('You’ll need the right to study in the UK') end - - it 'tells candidates sponsorship is not available' do - expect(page).to have_text('Sponsorship for a student visa is not available for this course') - end end context 'when the course is fee-paying and does sponsor Student visas' do @@ -37,7 +33,7 @@ end it 'tells candidates visa sponsorship may be available, but they should check' do - expect(page).to have_text('Before you apply for this course, contact us to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.') + expect(page).to have_text('Before you apply for this course, contact the training provider to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.') end it 'does not tell candidates the 3-year residency rule' do @@ -64,7 +60,7 @@ end it 'tells candidates visa sponsorship may be available, but they should check' do - expect(page).to have_text('Before you apply for this course, contact us to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.') + expect(page).to have_text('Before you apply for this course, contact the training provider to check Skilled Worker visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.') end end @@ -82,10 +78,6 @@ expect(page).to have_text('You’ll need the right to work in the UK') end - it 'tells candidates visa sponsorship is not available' do - expect(page).to have_text('Sponsorship for a Skilled Worker visa is not available for this course') - end - it 'does not tell candidates the 3-year residency rule' do expect(page).to have_no_text('To apply for this teaching apprenticeship course, you’ll need to have lived in the UK for at least 3 years before the start of the course') end diff --git a/spec/features/find/search/viewing_a_course_spec.rb b/spec/features/find/search/viewing_a_course_spec.rb index 5816a66bba..8ea8e70c46 100644 --- a/spec/features/find/search/viewing_a_course_spec.rb +++ b/spec/features/find/search/viewing_a_course_spec.rb @@ -188,6 +188,10 @@ def then_i_should_see_the_course_information 'QTS with PGCE' ) + expect(find_course_show_page).to have_content( + 'Student visas can be sponsored' + ) + expect(find_course_show_page).to have_content( '11 to 18' ) @@ -242,11 +246,6 @@ def then_i_should_see_the_course_information @course.latest_published_enrichment.required_qualifications ) - expect(find_course_show_page).to have_international_students - expect(find_course_show_page.international_students).to have_content( - 'Before you apply for this course, contact us to check Student visa sponsorship is available. If it is, and you get a place on this course, we’ll help you apply for your visa.' - ) - expect(find_course_show_page.required_qualifications).to have_content( 'Grade 4 (C) or above in English and maths, or equivalent qualification.' ) diff --git a/spec/features/publish/viewing_a_course_preview_spec.rb b/spec/features/publish/viewing_a_course_preview_spec.rb index 4387b52028..f6adae9a4d 100644 --- a/spec/features/publish/viewing_a_course_preview_spec.rb +++ b/spec/features/publish/viewing_a_course_preview_spec.rb @@ -187,6 +187,10 @@ def then_i_see_the_course_preview_details 'QTS with PGCE' ) + expect(publish_course_preview_page).to have_content( + 'Visas cannot be sponsored' + ) + expect(publish_course_preview_page).to have_content( '11 to 18' )