From 4c824c38de2cf45fde7ae911240364d366e1b594 Mon Sep 17 00:00:00 2001 From: fumimowdan Date: Thu, 12 Oct 2023 16:37:10 +0100 Subject: [PATCH 1/4] When applicant do not follow the form natural step order some user fill in the date-of-entry step before the start-date and this caused a bug in the form analytic widget which assumed that the form was filled in the order expected. TODO: This type of behaviour could be used as a way to flag potential fraud application. --- app/models/form/eligibility_check.rb | 2 ++ app/queries/forms_funnel_query.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/form/eligibility_check.rb b/app/models/form/eligibility_check.rb index e5139d8f..d50965db 100644 --- a/app/models/form/eligibility_check.rb +++ b/app/models/form/eligibility_check.rb @@ -40,6 +40,8 @@ def failure_reason end def date_of_entry_eligible?(date_of_entry, start_date) + return false unless date_of_entry && start_date + date_of_entry >= start_date - 3.months end diff --git a/app/queries/forms_funnel_query.rb b/app/queries/forms_funnel_query.rb index cd52c211..0b227a50 100644 --- a/app/queries/forms_funnel_query.rb +++ b/app/queries/forms_funnel_query.rb @@ -63,7 +63,7 @@ def entry_date_step_query(required_field) form_dates = date_of_entries.each_with_object([]) do |(id, date_of_entry), list| entry = start_dates.detect { |(sid, _)| sid == id } - list << [date_of_entry.to_date, entry.last.to_date] + list << [date_of_entry.to_date, entry&.last&.to_date] list end From 5ef67f266cf9d87b027c7670f47ab9e6c1fc9c09 Mon Sep 17 00:00:00 2001 From: fumimowdan Date: Thu, 12 Oct 2023 10:55:24 +0100 Subject: [PATCH 2/4] Copy changes for salaried_trainee subject step --- config/locales/steps.en.yml | 2 +- spec/steps/subject_step_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/locales/steps.en.yml b/config/locales/steps.en.yml index 5f49c753..f2d770b1 100644 --- a/config/locales/steps.en.yml +++ b/config/locales/steps.en.yml @@ -84,7 +84,7 @@ en: teacher: Physics, general or combined science including physics, and languages can be combined with other subjects but must make up at least 50% of your time in the classroom. salaried_trainee: - Physics or languages can be combined with other subjects but must make up at least 50% of your course content. This will be validated by Department for Education with the school where you are training. + Physics or languages can be combined with other subjects but must make up at least 50% of your course content. answers: physics: text: Physics diff --git a/spec/steps/subject_step_spec.rb b/spec/steps/subject_step_spec.rb index 859efbf4..ec0d8ed9 100644 --- a/spec/steps/subject_step_spec.rb +++ b/spec/steps/subject_step_spec.rb @@ -28,7 +28,7 @@ context "salaried_trainee" do let(:form) { build(:trainee_form) } - question_hint = "Physics or languages can be combined with other subjects but must make up at least 50% of your course content. This will be validated by Department for Education with the school where you are training." + question_hint = "Physics or languages can be combined with other subjects but must make up at least 50% of your course content." include_examples "behaves like a step", described_class, From dfd7f7e26e68b4c02ee0dbd92c58a16c067e5b5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 11 Oct 2023 01:29:18 +0000 Subject: [PATCH 3/4] Bump sentry-rails from 5.11.0 to 5.12.0 Bumps [sentry-rails](https://github.com/getsentry/sentry-ruby) from 5.11.0 to 5.12.0. - [Release notes](https://github.com/getsentry/sentry-ruby/releases) - [Changelog](https://github.com/getsentry/sentry-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-ruby/compare/5.11.0...5.12.0) --- updated-dependencies: - dependency-name: sentry-rails dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 07cbd9b2..a6104ab3 100644 --- a/Gemfile +++ b/Gemfile @@ -42,7 +42,7 @@ gem "httparty", "~> 0.21" gem "invisible_captcha" gem "omniauth-azure-activedirectory-v2" gem "rolify" -gem "sentry-rails", "~> 5.11" +gem "sentry-rails", "~> 5.12" group :test do gem "shoulda-matchers", "~> 5.0" diff --git a/Gemfile.lock b/Gemfile.lock index fc87f53e..dce9b068 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -218,7 +218,7 @@ GEM language_server-protocol (3.17.0.3) launchy (2.5.2) addressable (~> 2.8) - loofah (2.21.3) + loofah (2.21.4) crass (~> 1.0.2) nokogiri (>= 1.12.0) mail (2.8.1) @@ -402,10 +402,10 @@ GEM activerecord (>= 4.0.0) railties (>= 4.0.0) semantic_range (3.0.0) - sentry-rails (5.11.0) + sentry-rails (5.12.0) railties (>= 5.0) - sentry-ruby (~> 5.11.0) - sentry-ruby (5.11.0) + sentry-ruby (~> 5.12.0) + sentry-ruby (5.12.0) concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (5.3.0) activesupport (>= 5.2.0) @@ -461,7 +461,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.11) + zeitwerk (2.6.12) PLATFORMS ruby @@ -507,7 +507,7 @@ DEPENDENCIES rubocop-rails rubocop-rspec scenic - sentry-rails (~> 5.11) + sentry-rails (~> 5.12) shoulda-matchers (~> 5.0) sidekiq (~> 6.5) sidekiq-cron (~> 1.10) From 349390139ca9bf0788c50463dca428d4f7a190b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 02:02:38 +0000 Subject: [PATCH 4/4] Bump devise from 4.9.2 to 4.9.3 Bumps [devise](https://github.com/heartcombo/devise) from 4.9.2 to 4.9.3. - [Release notes](https://github.com/heartcombo/devise/releases) - [Changelog](https://github.com/heartcombo/devise/blob/main/CHANGELOG.md) - [Commits](https://github.com/heartcombo/devise/compare/v4.9.2...v4.9.3) --- updated-dependencies: - dependency-name: devise dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index dce9b068..0253b236 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ GEM reline (>= 0.3.1) debug_inspector (1.1.0) deep_merge (1.2.2) - devise (4.9.2) + devise (4.9.3) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) @@ -335,7 +335,7 @@ GEM io-console (~> 0.5) request_store (1.5.1) rack (>= 1.4) - responders (3.1.0) + responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.6)