Skip to content
Draft
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.7
3.4.8
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ------------------------------------------------------------------------------
# base
# ------------------------------------------------------------------------------
FROM ruby:3.4.7-alpine AS base
FROM ruby:3.4.8-alpine AS base

RUN addgroup -S appgroup && adduser -S appuser -G appgroup

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "3.4.7"
ruby "3.4.8"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 8.1"
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.4.7p58
ruby 3.4.8p72

BUNDLED WITH
2.6.9
15 changes: 15 additions & 0 deletions app/assets/stylesheets/components/button_to.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
font-size: inherit;
line-height: inherit;

font-family: "GDS Transport";
font-size: 16px;

&:focus {
@include govuk-focused-text;
}
Expand All @@ -26,3 +29,15 @@
.inline {
display: inline;
}

.button-to-as-back-link {
padding: 0;
background: none;
border: none;
outline: none;
box-shadow: none;

width: 4rem;

@extend .govuk-back-link;
}
2 changes: 1 addition & 1 deletion app/controllers/concerns/http_auth_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module HttpAuthConcern
extend ActiveSupport::Concern

included do
if ENV["BASIC_AUTH_USERNAME"].present? && ENV["BASIC_AUTH_PASSWORD"].present?
if ENV["BASIC_AUTH_USERNAME"].present? && ENV["BASIC_AUTH_PASSWORD"].present? && !FeatureFlag.enabled?(:bypass_basic_auth)
http_basic_authenticate_with(
name: ENV.fetch("BASIC_AUTH_USERNAME"),
password: ENV.fetch("BASIC_AUTH_PASSWORD")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class CheckYourAnswersForm < Form
def save
journey_session.answers.assign_attributes(
check_your_answers_completed: true
)
journey_session.save!
end

def completed?
answers.check_your_answers_completed?
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class ConfirmationForm < Form
def reference
"ABC123456"
end

def email_address
"test@example.com"
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class EligibilityConfirmedForm < Form
attribute :accept_payment, :boolean

validates :accept_payment,
inclusion: {
in: [true, false],
message: i18n_error_message(:inclusion)
}

def save
return false unless valid?

journey_session.answers.assign_attributes(
accept_payment: accept_payment
)
journey_session.save!
end

def radio_options
[
OpenStruct.new(id: true, name: "Yes"),
OpenStruct.new(id: false, name: "No")
]
end
end
end
end
end

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class GenderForm < Form
VALID_GENDERS = %w[female male non_binary other prefer_not_to_say].freeze

attribute :payroll_gender, :string
attribute :payroll_gender_other, :string

validates :payroll_gender,
inclusion: {
in: VALID_GENDERS,
message: i18n_error_message(:inclusion)
}

validates :payroll_gender_other,
presence: {message: i18n_error_message(:other_required)},
if: -> { payroll_gender == "other" }

def save
return false unless valid?

journey_session.answers.assign_attributes(
payroll_gender: payroll_gender,
payroll_gender_other: (payroll_gender == "other") ? payroll_gender_other : nil
)
journey_session.save!
end

def radio_options
[
OpenStruct.new(id: "female", name: "Female"),
OpenStruct.new(id: "male", name: "Male"),
OpenStruct.new(id: "non_binary", name: "Non-binary"),
OpenStruct.new(id: "other", name: "Other"),
OpenStruct.new(id: "prefer_not_to_say", name: "Prefer not to say")
]
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class HowWeUseYourInformationForm < Form
def save
true
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class OneLoginCallbackSuccessForm < Form
def save
true
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class PaymentNotAcceptedForm < Form
def completed?
false
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class PaymentOptionsForm < Form
attribute :payment_option, :string

validates :payment_option,
inclusion: {
in: %w[lump_sum monthly_instalments],
message: i18n_error_message(:inclusion)
}

def save
return false unless valid?

journey_session.answers.assign_attributes(
payment_option: payment_option
)
journey_session.save!
end

def radio_options
[
OpenStruct.new(
id: "lump_sum",
name: t(:lump_sum_label),
hint: t(:lump_sum_hint)
),
OpenStruct.new(
id: "monthly_instalments",
name: t(:monthly_instalments_label),
hint: t(:monthly_instalments_hint)
)
]
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class PersonalBankAccountForm < ::PersonalBankAccountForm
def save
return false unless valid?

journey_session.answers.assign_attributes(
banking_name: banking_name,
bank_sort_code: normalised_bank_detail(bank_sort_code),
bank_account_number: normalised_bank_detail(bank_account_number)
)

journey_session.save!
end

private

def bank_account_is_valid
# Skip HMRC validation for prototype/user research
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Journeys
module EarlyYearsTeachers
module Practitioner
class SignInForm < Form
def save
true
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module Journeys
module EarlyYearsTeachers
module Provider
class CheckNurseryDetailsForm < Form
attribute :nursery_details_confirmed, :boolean

validates(
:nursery_details_confirmed,
inclusion: {
in: [true, false],
message: "Confirm if the nursery details are correct"
}
)

def rows
[
{
key: {text: "Nursery name"},
value: {text: answers.nursery_name.humanize}
},
{
key: {text: "Address"},
value: {text: nursery_address}
},
{
key: {text: "Ofsted URN"},
value: {text: answers.ofsted_urn.humanize}
},
{
key: {text: "Provider status"},
value: {text: answers.provider_status.humanize}
},
{
key: {text: "Type"},
value: {text: answers.nursery_type.humanize}
},
{
key: {text: "Subtype"},
value: {text: answers.nursery_subtype.humanize}
}
]
end

def radio_options
[
Option.new(id: true, name: "Yes"),
Option.new(id: false, name: "No")
]
end

def save
return false if invalid?

journey_session.answers.assign_attributes(
nursery_details_confirmed: nursery_details_confirmed
)
journey_session.save!
end

private

def nursery_address
[
answers.nursery_address_line_1,
answers.nursery_address_city,
answers.nursery_address_postcode
].join("<br>").html_safe
end
end
end
end
end
Loading