Skip to content

Commit

Permalink
Remove first page of the A levels
Browse files Browse the repository at this point in the history
A levels are always required for a teacher degree apprenticeship
So no option for "No" so make sense to remove the first page of A levels
  • Loading branch information
tomas-stefano committed Jul 8, 2024
1 parent 5b067f6 commit b64516f
Show file tree
Hide file tree
Showing 30 changed files with 51 additions and 488 deletions.
44 changes: 20 additions & 24 deletions app/components/a_level_row_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,28 @@
<% end %>
<% end %>
<% elsif minimum_a_level_completed? %>
<% if @course.a_level_requirements.present? %>
<% Array(@course.a_level_subject_requirements).map do |a_level_subject_requirement| %>
<p class="govuk-body">
<%= a_level_subject_row_content(a_level_subject_requirement.with_indifferent_access) %>
</p>
<% end %>
<% Array(@course.a_level_subject_requirements).map do |a_level_subject_requirement| %>
<p class="govuk-body">
<%= a_level_subject_row_content(a_level_subject_requirement.with_indifferent_access) %>
</p>
<% end %>

<% unless @course.accept_pending_a_level.nil? %>
<p class="govuk-body">
<%= pending_a_level_summary_content %>
</p>
<% end %>
<% unless @course.accept_pending_a_level.nil? %>
<p class="govuk-body">
<%= pending_a_level_summary_content %>
</p>
<% end %>

<% unless @course.accept_a_level_equivalency.nil? %>
<p class="govuk-body">
<%= a_level_equivalency_summary_content %>
</p>
<% end %>
<% unless @course.accept_a_level_equivalency.nil? %>
<p class="govuk-body">
<%= a_level_equivalency_summary_content %>
</p>
<% end %>

<% if @course.accept_a_level_equivalency? && @course.additional_a_level_equivalencies.present? %>
<p class="govuk-body">
<%= @course.additional_a_level_equivalencies %>
</p>
<% end %>
<% else %>
<%= a_level_not_required_content %>
<% if @course.accept_a_level_equivalency? && @course.additional_a_level_equivalencies.present? %>
<p class="govuk-body">
<%= @course.additional_a_level_equivalencies %>
</p>
<% end %>
<% else %>
<%= govuk_inset_text(classes: "app-inset-text--narrow-border app-inset-text--important") do %>
Expand All @@ -47,7 +43,7 @@
</p>
<p class="govuk-body">
<%= govuk_link_to t("publish.providers.courses.description_content.enter_a_levels"),
publish_provider_recruitment_cycle_course_a_levels_are_any_a_levels_required_for_this_course_path(
publish_provider_recruitment_cycle_course_a_levels_what_a_level_is_required_path(
course.provider.provider_code,
course.provider.recruitment_cycle_year,
course.course_code
Expand Down
10 changes: 1 addition & 9 deletions app/components/a_level_row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class ALevelRowComponent < ViewComponent::Base
include ViewHelper

A_LEVEL_ERRORS = %i[
a_level_requirements
a_level_subject_requirements
accept_pending_a_level
accept_a_level_equivalency
Expand All @@ -20,10 +19,6 @@ def initialize(course:, errors: nil)
@errors = errors
end

def a_level_not_required_content
I18n.t('publish.providers.courses.description_content.a_levels_not_required')
end

def a_level_subject_row_content(a_level_subject_requirement)
a_level_subject_requirement_row_component = ALevelSubjectRequirementRowComponent.new(a_level_subject_requirement)

Expand Down Expand Up @@ -51,16 +46,13 @@ def a_level_errors

def wizard_step(a_level_error)
{
a_level_requirements: :are_any_a_levels_required_for_this_course,
a_level_subject_requirements: :what_a_level_is_required,
accept_pending_a_level: :consider_pending_a_level,
accept_a_level_equivalency: :a_level_equivalencies
}.with_indifferent_access[a_level_error]
end

def minimum_a_level_completed?
!course.a_level_requirements.nil? &&
(course.a_level_requirements.blank? ||
(course.a_level_requirements.present? && course.a_level_subject_requirements.present?))
course.a_level_subject_requirements.present?
end
end
28 changes: 15 additions & 13 deletions app/components/find/courses/a_level_component/view.html.erb
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<% if a_levels_not_required? %>
<p class="govuk-body"><%= a_levels_not_required_content %></p>
<% else %>
<% a_level_subject_requirements.each do |a_level_subject_requirement| %>
<p class="govuk-body">
<%= a_level_subject_requirement %>
</p>
<% end %>
<% a_level_subject_requirements.each do |a_level_subject_requirement| %>
<p class="govuk-body">
<%= a_level_subject_requirement %>
</p>
<% end %>

<% unless course.accept_pending_a_level.nil? %>
<p class="govuk-body"><%= pending_a_level_summary_content %></p>
<% end %>

<% unless course.accept_a_level_equivalency.nil? %>
<p class="govuk-body"><%= a_level_equivalency_summary_content %></p>
<% end %>

<% if course.accept_a_level_equivalency? && course.additional_a_level_equivalencies.present? %>
<p class="govuk-body">
<%= course.additional_a_level_equivalencies %>
</p>
<% end %>
<% if course.accept_a_level_equivalency? && course.additional_a_level_equivalencies.present? %>
<p class="govuk-body">
<%= course.additional_a_level_equivalencies %>
</p>
<% end %>
8 changes: 0 additions & 8 deletions app/components/find/courses/a_level_component/view.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ def initialize(course:)
super
end

def a_levels_not_required?
course.a_levels_requirements_answered? && course.a_level_requirements.blank?
end

def a_levels_not_required_content
I18n.t('find.courses.a_level.a_levels_not_required')
end

def a_level_subject_requirements
GroupedALevelSubjectRequirements.new(course).to_a_level_equivalency_array
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<h4 class="govuk-heading-s">A levels</h4>

<% if course.a_levels_requirements_answered? %>
<%= render Find::Courses::ALevelComponent::View.new(course:) %>
<% end %>
<%= render Find::Courses::ALevelComponent::View.new(course:) %>

<h4 class="govuk-heading-s">GCSEs</h4>

This file was deleted.

4 changes: 0 additions & 4 deletions app/decorators/course_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -303,10 +303,6 @@ def gcse_section_complete?
!object.accept_pending_gcse.nil? && !object.accept_gcse_equivalency.nil?
end

def a_levels_requirements_answered?
!object.a_level_requirements.nil?
end

def about_course
object.enrichment_attribute(:about_course)
end
Expand Down
6 changes: 0 additions & 6 deletions app/helpers/view_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@ def enrichment_error_url(provider_code:, course:, field:, message: nil)
study_sites: (course.provider&.study_sites&.none? ? "#{provider_base}/study-sites" : "#{base}/study-sites").to_s,
accrediting_provider: accredited_provider_publish_provider_recruitment_cycle_course_path(course.provider_code, course.recruitment_cycle_year, course.course_code),
applications_open_from: "#{base}/applications-open",
a_level_requirements: publish_provider_recruitment_cycle_course_a_levels_are_any_a_levels_required_for_this_course_path(
course.provider_code,
course.provider.recruitment_cycle_year,
course.course_code,
display_errors: true
),
a_level_subject_requirements: publish_provider_recruitment_cycle_course_a_levels_what_a_level_is_required_path(
course.provider_code,
course.provider.recruitment_cycle_year,
Expand Down
5 changes: 0 additions & 5 deletions app/validators/a_level_course_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

class ALevelCourseValidator < ActiveModel::Validator
def validate(record)
return record.errors.add(:a_level_requirements, :blank) if record.a_level_requirements.nil?

return if record.a_level_requirements.blank? # No A level required

return record.errors.add(:a_level_subject_requirements, :blank) if record.a_level_subject_requirements.blank?

return record.errors.add(:accept_pending_a_level, :blank) if record.accept_pending_a_level.nil?

record.errors.add(:accept_a_level_equivalency, :blank) if record.accept_a_level_equivalency.nil?
Expand Down
2 changes: 1 addition & 1 deletion app/views/publish/courses/_description_content.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
t("publish.providers.courses.description_content.a_levels_label"),
(render ALevelRowComponent.new(course:, errors: @errors)),
%w[a_level_requirements a_level_subject_requirements accept_pending_a_level accept_a_level_equivalency],
action_path: publish_provider_recruitment_cycle_course_a_levels_are_any_a_levels_required_for_this_course_path(
action_path: publish_provider_recruitment_cycle_course_a_levels_what_a_level_is_required_path(
@provider.provider_code,
@provider.recruitment_cycle_year,
course.course_code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% content_for :before_content do %>
<% if @wizard.current_step.maximum_number_of_a_level_subjects? %>
<%= govuk_back_link_to(
publish_provider_recruitment_cycle_course_a_levels_are_any_a_levels_required_for_this_course_path(
publish_provider_recruitment_cycle_course_path(
@provider.provider_code,
@provider.recruitment_cycle_year,
@course.course_code
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
) %>
<% else %>
<%= govuk_back_link_to(
publish_provider_recruitment_cycle_course_a_levels_are_any_a_levels_required_for_this_course_path(
publish_provider_recruitment_cycle_course_path(
@provider.provider_code,
@provider.recruitment_cycle_year,
@course.course_code
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion app/wizards/a_levels_wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class ALevelsWizard < DfE::Wizard::Base

steps do
[
{ are_any_a_levels_required_for_this_course: ALevelSteps::AreAnyALevelsRequiredForThisCourse },
{ what_a_level_is_required: ALevelSteps::WhatALevelIsRequired },
{ add_a_level_to_a_list: ALevelSteps::AddALevelToAList },
{ remove_a_level_subject_confirmation: ALevelSteps::RemoveALevelSubjectConfirmation },
Expand Down
1 change: 0 additions & 1 deletion app/wizards/a_levels_wizard_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class ALevelsWizardStore < DfE::Wizard::Store
def save
return false unless valid_step?

AreAnyALevelsRequiredStore.new(wizard).save if current_step_name == :are_any_a_levels_required_for_this_course
WhatALevelIsRequiredStore.new(wizard).save if current_step_name == :what_a_level_is_required
ConsiderPendingALevelStore.new(wizard).save if current_step_name == :consider_pending_a_level
ALevelEquivalenciesStore.new(wizard).save if current_step_name == :a_level_equivalencies
Expand Down
24 changes: 0 additions & 24 deletions app/wizards/are_any_a_levels_required_store.rb

This file was deleted.

9 changes: 0 additions & 9 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ en:
open: "Course opened"
closed: "Course closed"
add_course: "Add course"
are_any_a_levels_required_for_this_course:
heading: Are any A levels required for this course?
answer_yes: "Yes"
answer_no: "No"
what_a_level_is_required:
heading: What A level is required?
success_message: You have added a required A level
Expand Down Expand Up @@ -433,7 +429,6 @@ en:
enter_a_levels: Enter A levels and equivalency test requirements
a_levels_heading: A levels and equivalency tests
a_levels_label: A levels
a_levels_not_required: A levels are not required for this course
course_length:
edit:
course_length: Course length
Expand Down Expand Up @@ -880,10 +875,6 @@ en:
description:
blank: Enter details about the accredited provider
too_long: Description about the accredited provider must be 100 words or fewer
are_any_a_levels_required_for_this_course:
attributes:
answer:
blank: Select if this course requires any A levels
what_a_level_is_required:
attributes:
subject:
Expand Down
1 change: 0 additions & 1 deletion config/locales/find.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ en:
heading: School placements at %{provider_name}
back: Back to %{course_name} (%{course_code})
a_level:
a_levels_not_required: A levels are not required for this course
consider_pending_a_level: We’ll consider candidates with pending A levels.
not_consider_pending_a_level: We will not consider candidates with pending A levels.
consider_a_level_equivalency: We’ll consider candidates who need to take A level equivalency tests.
Expand Down
2 changes: 0 additions & 2 deletions config/routes/publish.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@
get '/age_range', on: :member, to: 'courses/age_range#edit'
put '/age_range', on: :member, to: 'courses/age_range#update'

get '/a-levels-or-equivalency-tests/required-for-this-course', to: 'courses/a_level_requirements/are_any_a_levels_required_for_this_course#new', as: :a_levels_are_any_a_levels_required_for_this_course
post '/a-levels-or-equivalency-tests/required-for-this-course', to: 'courses/a_level_requirements/are_any_a_levels_required_for_this_course#create'
get '/a-levels-or-equivalency-tests/what-a-level-is-required(/:uuid)', to: 'courses/a_level_requirements/what_a_level_is_required#new', as: :a_levels_what_a_level_is_required
post '/a-levels-or-equivalency-tests/what-a-level-is-required', to: 'courses/a_level_requirements/what_a_level_is_required#create'
get '/a-levels-or-equivalency-tests/add-a-level-to-list', to: 'courses/a_level_requirements/add_a_level_to_a_list#new', as: :a_levels_add_a_level_to_a_list
Expand Down
Loading

0 comments on commit b64516f

Please sign in to comment.