Skip to content

Commit

Permalink
Remove start_term from wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
steventux committed May 29, 2024
1 parent 73ead29 commit bb5883d
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 62 deletions.
5 changes: 0 additions & 5 deletions app/forms/schools/add_participants/add_wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def self.steps
email
email_already_taken
start_date
start_term
cannot_add_registration_not_yet_open
cannot_add_yourself_as_ect
cannot_add_mentor_to_providers
Expand Down Expand Up @@ -96,10 +95,6 @@ def needs_to_choose_partnership?
mentor_participant? && ([lead_provider, delivery_partner].all? || previous_providers_training_on_current_cohort?)
end

def start_term_description
"#{start_term.capitalize} #{start_term == 'spring' ? Time.zone.now.year + 1 : Time.zone.now.year}"
end

def sit_added_as_mentor?
participant_create_args[:email] == current_user.email
end
Expand Down
10 changes: 4 additions & 6 deletions app/forms/schools/add_participants/base_wizard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InvalidStep < StandardError; end
delegate :return_point, :changing_answer?, :transfer?, :participant_type, :trn, :confirmed_trn, :date_of_birth,
:induction_start_date, :nino, :ect_participant?, :mentor_id, :continue_current_programme?, :participant_profile,
:mentor_participant?, :appropriate_body_confirmed?, :appropriate_body_id, :known_by_another_name?,
:was_withdrawn_participant?, :complete?, :start_date, :start_term, :last_visited_step,
:was_withdrawn_participant?, :complete?, :start_date, :last_visited_step,
:ect_mentor?, :join_school_programme, :join_school_programme?, :join_participant_cohort_school_programme?,
:join_current_cohort_school_programme?, :current_providers?, :previous_providers?, :providers_chosen?,
:full_name, to: :data_store
Expand Down Expand Up @@ -464,15 +464,14 @@ def cohort_to_place_participant
Cohort.containing_date(induction_start_date).tap do |cohort|
return Cohort.current if cohort.blank? || cohort.npq_plus_one_or_earlier?
end
elsif Cohort.within_automatic_assignment_period? || start_term == "summer"
elsif Cohort.within_automatic_assignment_period?
# true from 1/9 to end of automatic assignment period
Cohort.current
# we're in the registration window prior to 1/9
elsif start_term.in?(%w[autumn spring]) || induction_start_date.blank?
# we're in the registration window prior to 1/9 and chose autumn or spring the following year
elsif induction_start_date.blank?
Cohort.next
else
# default to now - but should ask the start_term question if not already asked
# default to now
Cohort.current
end
end
Expand Down Expand Up @@ -596,7 +595,6 @@ def reset_form
email
mentor_id
start_date
start_term
appropriate_body_id
appropriate_body_confirmed
continue_current_programme
Expand Down
4 changes: 0 additions & 4 deletions app/services/form_data/add_participant_store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ def induction_start_date
get_date :induction_start_date
end

def start_term
get :start_term
end

def start_date
get_date :start_date
end
Expand Down
4 changes: 0 additions & 4 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,6 @@ en:
start_date:
blank: "Enter the teacher’s induction start date"
invalid: "Enter a valid start date"
schools/add_participants/wizard_steps/start_term_step:
attributes:
start_term:
inclusion: "Select the start you will start mentor training"
schools/add_participants/wizard_steps/joining_date_step:
attributes:
start_date:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def set_participant_data
email: "[email protected]",
nino: "AB123456A",
start_date: nil,
start_term: nil,
}
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def set_participant_data
email: "[email protected]",
nino: "AB123456A",
start_date: nil,
start_term: nil,
}
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
and_i_add_date_of_birth_to_the_school_add_participant_wizard @participant_data[:date_of_birth]
and_i_add_email_address_to_the_school_add_participant_wizard "Sally Teacher", @participant_data[:email]

# FIXME: only before 2023 cohort?
and_i_add_start_term_to_the_school_add_participant_wizard @participant_data[:start_term] if Cohort.within_next_registration_period?

and_i_choose_mentor_later_on_the_school_add_participant_wizard
then_i_am_taken_to_check_details_page

Expand Down Expand Up @@ -72,9 +69,6 @@
and_i_add_date_of_birth_to_the_school_add_participant_wizard @participant_data[:date_of_birth]
and_i_add_email_address_to_the_school_add_participant_wizard "Sally Teacher", @participant_data[:email]

# FIXME: only before 2023 cohort?
and_i_add_start_term_to_the_school_add_participant_wizard @participant_data[:start_term] if Cohort.within_next_registration_period?

then_i_am_taken_to_add_mentor_page
then_the_page_should_be_accessible

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1442,7 +1442,6 @@ def set_participant_data
email: "[email protected]",
nino: "AB123456A",
start_date: Date.new(Cohort.current.start_year, 9, 1),
start_term: "summer",
}
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
let(:found_in_dqt) { false }
let(:registration_open) { false }
let(:need_setup) { false }
let(:confirm_start_term) { false }
let(:participant_withdrawn) { false }
let(:already_enrolled_at_school_but_leaving) { false }
let(:already_enrolled_at_school_but_withdrawn) { false }
Expand Down Expand Up @@ -79,14 +78,6 @@
expect(step.next_step).to eql :none
end

context "when the participant will be asked the start_term question" do
let(:confirm_start_term) { true }

it "returns :none" do
expect(step.next_step).to eql :none
end
end

context "when the cohort needs to be set up" do
let(:need_setup) { true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
let(:confirm_programme) { false }
let(:choose_school_programme) { false }
let(:ect_participant) { false }
let(:confirm_start_term) { false }
let(:confirm_appropriate_body) { false }
let(:sit_adding_themself_as_mentor) { false }
let(:adding_yourself_as_ect) { false }
Expand Down Expand Up @@ -96,14 +95,6 @@
expect(step.next_step).to eql :check_answers
end

context "when the SIT needs to confirm the start term" do
let(:confirm_start_term) { true }

it "returns :start_term" do
expect(step.next_step).to eql :start_term
end
end

context "when a mentor can be chosen" do
let(:choose_mentor) { true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
let(:sit_mentor) { false }
let(:registration_open) { false }
let(:need_setup) { false }
let(:confirm_start_term) { false }
let(:participant_withdrawn) { false }

before do
Expand Down Expand Up @@ -60,14 +59,6 @@
expect(step.next_step).to eql :none
end

context "when the participant will be asked the start_term question" do
let(:confirm_start_term) { true }

it "returns :none" do
expect(step.next_step).to eql :none
end
end

context "when the cohort needs to be set up" do
let(:need_setup) { true }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,6 @@ def add_start_date(start_date)
self
end

def add_start_term(start_term)
choose start_term
click_on "Continue"

self
end

def choose_a_mentor(mentor_full_name)
choose mentor_full_name
click_on "Continue"
Expand Down

0 comments on commit bb5883d

Please sign in to comment.