Skip to content

Commit

Permalink
Merge pull request #1729 from DFE-Digital/2263-update-assessor-task-l…
Browse files Browse the repository at this point in the history
…ist-sections

2263 update assessor task list sections
  • Loading branch information
thomasleese authored Oct 4, 2023
2 parents 822de58 + 39ea004 commit 2eb46a4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def duplicate_matches
def task_list_sections
[
pre_assessment_task_list_section,
initial_assessment_task_list_section,
further_information_task_list_section,
assessment_task_list_section,
verification_task_list_section,
].compact
end
Expand Down Expand Up @@ -120,18 +119,20 @@ def await_professional_standing_task_list_item
}
end

def initial_assessment_task_list_section
def assessment_task_list_section
return unless pre_assessment_complete?

{
title:
I18n.t(
"assessor_interface.application_forms.show.assessment_tasks.sections.initial_assessment",
"assessor_interface.application_forms.show.assessment_tasks.sections.assessment",
),
items:
(
assessment_section_task_list_items(preliminary: false) +
[initial_assessment_recommendation_task_list_item] +
further_information_task_list_items
),
items: [
*assessment_section_task_list_items(preliminary: false),
initial_assessment_recommendation_task_list_item,
],
}
end

Expand Down Expand Up @@ -208,19 +209,10 @@ def initial_assessment_recommendation_task_list_item
}
end

def further_information_task_list_section
{
title:
I18n.t(
"assessor_interface.application_forms.show.assessment_tasks.sections.further_information_requests",
),
items:
further_information_requests.map do |further_information_request|
further_information_request_task_list_item(
further_information_request,
)
end,
}
def further_information_task_list_items
further_information_requests.map do |further_information_request|
further_information_request_task_list_item(further_information_request)
end
end

def further_information_request_task_list_item(further_information_request)
Expand Down Expand Up @@ -267,7 +259,7 @@ def verification_task_list_section
{
title:
I18n.t(
"assessor_interface.application_forms.show.assessment_tasks.sections.verification_requests",
"assessor_interface.application_forms.show.assessment_tasks.sections.verification",
),
items:,
}
Expand Down
5 changes: 2 additions & 3 deletions config/locales/assessor_interface.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ en:
show:
assessment_tasks:
sections:
further_information_requests: Further information requests
initial_assessment: Initial assessment
assessment: Assessment
pre_assessment_tasks: Pre-assessment tasks
verification_requests: Verification requests
verification: Verification
items:
assessment_recommendation: Assessment recommendation
await_professional_standing_request: Awaiting third-party professional standing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,31 @@

it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Check personal information",
)
end
it do
is_expected.to_not include_task_list_item(
"Initial assessment",
"Assessment",
"Check qualifications",
)
end
it do
is_expected.to_not include_task_list_item(
"Initial assessment",
"Assessment",
"Check work history",
)
end
it do
is_expected.to_not include_task_list_item(
"Initial assessment",
"Assessment",
"Check professional standing",
)
end
it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :cannot_start,
)
Expand Down Expand Up @@ -196,7 +196,7 @@

it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Check work history",
)
end
Expand All @@ -209,7 +209,7 @@

it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Check professional standing",
)
end
Expand All @@ -220,7 +220,7 @@

it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :not_started,
)
Expand All @@ -230,7 +230,7 @@
before { assessment.award! }
it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :completed,
)
Expand All @@ -241,7 +241,7 @@
before { assessment.decline! }
it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :completed,
)
Expand All @@ -257,7 +257,7 @@

it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :in_progress,
)
Expand All @@ -267,7 +267,7 @@
before { create(:further_information_request, assessment:) }
it do
is_expected.to include_task_list_item(
"Initial assessment",
"Assessment",
"Initial assessment recommendation",
status: :completed,
)
Expand All @@ -281,7 +281,7 @@

it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :cannot_start,
)
Expand All @@ -293,7 +293,7 @@

it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :not_started,
)
Expand All @@ -308,7 +308,7 @@

it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :in_progress,
)
Expand All @@ -323,7 +323,7 @@

it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :in_progress,
)
Expand All @@ -337,7 +337,7 @@
end
it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :completed,
)
Expand All @@ -351,7 +351,7 @@
end
it do
is_expected.to include_task_list_item(
"Further information requests",
"Assessment",
"Review requested information from applicant",
status: :completed,
)
Expand All @@ -363,19 +363,19 @@

it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Record LOPS response",
)
end
it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Review LOPS response",
)
end
it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Assessment recommendation",
)
end
Expand All @@ -386,13 +386,13 @@

it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Record qualifications responses",
)
end
it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Assessment recommendation",
)
end
Expand All @@ -403,13 +403,13 @@

it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Verify reference requests",
)
end
it do
is_expected.to include_task_list_item(
"Verification requests",
"Verification",
"Assessment recommendation",
)
end
Expand Down

0 comments on commit 2eb46a4

Please sign in to comment.