-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8695 from DFE-Digital/33-ca-highlight-candidate-a…
…pplication-edits-on-manage Highlight candidate application edits on manage
- Loading branch information
Showing
18 changed files
with
481 additions
and
38 deletions.
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
2 changes: 1 addition & 1 deletion
2
app/components/provider_interface/contact_information_component.html.erb
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<section class="app-section govuk-!-width-two-thirds" data-qa="contact-information"> | ||
<section id="contact-information-section" class="app-section govuk-!-width-two-thirds" data-qa="contact-information"> | ||
<h2 class="govuk-heading-m govuk-!-font-size-27" id="contact-information">Contact information</h2> | ||
<%= render SummaryListComponent.new(rows: rows) %> | ||
</section> |
2 changes: 1 addition & 1 deletion
2
app/components/provider_interface/diversity_information_component.html.erb
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
2 changes: 1 addition & 1 deletion
2
app/components/provider_interface/personal_information_component.html.erb
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<section class="app-section govuk-!-width-two-thirds" data-qa="personal-information"> | ||
<section id="personal-information-section" class="app-section govuk-!-width-two-thirds" data-qa="personal-information"> | ||
<h2 class="govuk-heading-m govuk-!-font-size-27" id="personal-information">Personal information</h2> | ||
<%= render SummaryListComponent.new(rows: rows) %> | ||
</section> |
2 changes: 1 addition & 1 deletion
2
app/components/provider_interface/training_with_disability_component.html.erb
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Find audits for updates to editable sections on the application form | ||
class RecentlyUpdatedApplicationChoice | ||
UPDATED_RECENTLY_DAYS = 40 | ||
|
||
def initialize(application_choice:) | ||
@application_choice = application_choice | ||
end | ||
|
||
def call | ||
return false if @application_choice.sent_to_provider_at.blank? | ||
|
||
since = [UPDATED_RECENTLY_DAYS.days.ago, @application_choice.sent_to_provider_at].max | ||
|
||
Audited::Audit | ||
.where('audits.created_at >= ? AND audits.action = \'update\'', since) | ||
.where(auditable_type: 'ApplicationForm', auditable_id: @application_choice.application_form_id) | ||
.where(application_form_audits_filter_sql) | ||
.exists? | ||
end | ||
|
||
private | ||
|
||
def application_form_audits_filter_sql | ||
attributes.map do |attribute| | ||
"jsonb_exists(audited_changes, '#{attribute}')" | ||
end.join(' OR ') | ||
end | ||
|
||
attr_reader :application_choice | ||
|
||
def attributes | ||
[ | ||
# Personal Information | ||
'date_of_birth', | ||
'first_name', | ||
'last_name', | ||
|
||
# Contact Information | ||
'phone_number', | ||
'address_line1', | ||
'address_line2', | ||
'address_line3', | ||
'address_line4', | ||
'country', | ||
'postcode', | ||
|
||
# Interview Preferences | ||
'interview_preferences', | ||
|
||
# Disability | ||
'disability_disclosure', | ||
|
||
# Equality and diversity | ||
'equality_and_diversity', | ||
] | ||
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
Oops, something went wrong.