-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Faith school catholic flow #7222
Open
starswan
wants to merge
16
commits into
faith-schools-flow
Choose a base branch
from
faith-school-catholic-flow
base: faith-schools-flow
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5054ea9
Faith schools part 1 - publisher questions
starswan 172a2ba
Standard locations for labels and hints
starswan 18de0d0
wip
starswan 2b24fa2
religious info on review page
starswan 3b5b74f
slim lint errors
starswan 28006ef
add blurb to references screen
starswan 5434ab9
fix up issues with submitting job application
starswan 0ff07bf
cope with candidate not following a religion
starswan 930be75
Disallow edits on religious info form when viewing
starswan 70f63a2
anchor link on view application for relgious section
starswan 0421e18
only shwo religious information where relevant
starswan 95242d6
added baptism certificate to fields as it is not an 'attribute'
starswan e5c93b8
add test to submit an application with a baptism certificate
starswan 66a715f
create blank baptism cert
starswan 9093a97
copy religious information from previous job application
starswan e5eea15
DRY up accept field on baptism certificate
starswan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
app/components/job_application_review_component/religious_information_section.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class JobApplicationReviewComponent::ReligiousInformationSection < JobApplicationReviewComponent::Section | ||
def initialize(job_application, allow_edit:, name:) | ||
# only include the details form if we follow a religion | ||
forms = if job_application.following_religion | ||
%w[FollowingReligionForm ReligionDetailsForm] | ||
else | ||
%w[FollowingReligionForm] | ||
end | ||
super(job_application, forms: forms, name: name, allow_edit: allow_edit) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
app/form_models/jobseekers/job_application/following_religion_form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Jobseekers::JobApplication::FollowingReligionForm < Jobseekers::JobApplication::BaseForm | ||
include ActiveModel::Model | ||
include ActiveModel::Attributes | ||
|
||
def self.fields | ||
%i[following_religion] | ||
end | ||
attribute :following_religion, :boolean | ||
|
||
validates :following_religion, inclusion: { in: [true, false] } | ||
end |
31 changes: 31 additions & 0 deletions
31
app/form_models/jobseekers/job_application/religion_details_form.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Jobseekers::JobApplication::ReligionDetailsForm < Jobseekers::JobApplication::BaseForm | ||
include ActiveRecord::AttributeAssignment | ||
include DateAttributeAssignment | ||
|
||
def self.fields | ||
%i[faith | ||
place_of_worship | ||
religious_reference_type | ||
religious_referee_name | ||
religious_referee_address | ||
religious_referee_role | ||
religious_referee_email | ||
religious_referee_phone | ||
baptism_certificate | ||
baptism_address | ||
baptism_date] | ||
end | ||
attr_accessor(*fields) | ||
|
||
validates :faith, presence: true | ||
validates :religious_reference_type, inclusion: { in: JobApplication::RELIGIOUS_REFERENCE_TYPES.keys.map(&:to_s), nil: false } | ||
|
||
validates :religious_referee_name, :religious_referee_address, :religious_referee_role, :religious_referee_email, | ||
presence: true, if: -> { religious_reference_type == "referee" } | ||
validates :religious_referee_email, email: true, if: -> { religious_reference_type == "referee" } | ||
|
||
validates :baptism_address, :baptism_date, | ||
presence: true, if: -> { religious_reference_type == "baptism_date" } | ||
|
||
validates :baptism_certificate, form_file: DOCUMENT_VALIDATION_OPTIONS, presence: true, if: -> { religious_reference_type == "baptism_certificate" } | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had so many. Good trim