Skip to content
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

2366 create link with dynamic name #1785

Merged
merged 9 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

module AssessorInterface
class ReviewVerificationsController < BaseController
include RegionHelper
before_action :authorize_assessor

def index
Expand All @@ -11,6 +12,8 @@ def index
@professional_standing_request =
assessment.professional_standing_request if assessment.professional_standing_request.verify_failed?

@teaching_authority_name = region_teaching_authority_name(@assessment.application_form.region, "Contact relevant competent authority")
syed87 marked this conversation as resolved.
Show resolved Hide resolved

render layout: "full_from_desktop"
end

Expand Down
4 changes: 2 additions & 2 deletions app/helpers/region_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def region_certificate_phrase(region)
"#{certificate.indefinite_article} #{tag.span(certificate, lang: region.country.code)}".html_safe
end

def region_teaching_authority_name(region)
region.teaching_authority_name.presence || "teaching authority"
def region_teaching_authority_name(region, default = nil)
region.teaching_authority_name.presence || default || "teaching authority"
end

def region_teaching_authority_name_phrase(region)
Expand Down
23 changes: 14 additions & 9 deletions app/views/assessor_interface/review_verifications/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
The following verification tasks have been flagged for review:
</p>

<%= govuk_table do |table|
<%= render(TaskList::Component.new(
syed87 marked this conversation as resolved.
Show resolved Hide resolved
if @professional_standing_request.present?
syed87 marked this conversation as resolved.
Show resolved Hide resolved
table.with_caption(text: "LoPS")
table.with_body do |body|
body.with_row do |row|
row.with_cell { govuk_link_to region_certificate_name(@application_form.region), [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request] }
row.with_cell { render(StatusTag::Component.new(@professional_standing_request.review_status)) }
end
end
[
{
title: "LoPS",
items: [
{
name: @teaching_authority_name,
link: [:review, :assessor_interface, @application_form, @assessment, :professional_standing_request],
status: @professional_standing_request.review_status,
}
],
}
]
end
end %>
)) %>

<div class="govuk-!-padding-top-3">
<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def when_i_click_on_assessment_decision
end

def when_i_click_on_lops
assessor_review_verifications_page.rows.first.link.click
find(".govuk-link").click
syed87 marked this conversation as resolved.
Show resolved Hide resolved
end

def when_i_fill_in_the_review_lops_form
Expand All @@ -109,15 +109,14 @@ def when_i_click_on_back_to_overview
end

def and_i_see_the_lops_not_started
expect(assessor_review_verifications_page.rows.first.tag.text).to eq(
"NOT STARTED",
)
status_text = find(".govuk-tag.govuk-tag--grey.app-task-list__tag").text
syed87 marked this conversation as resolved.
Show resolved Hide resolved
expect(status_text).to eq("NOT STARTED")
end

def and_i_see_the_lops_accepted
expect(assessor_review_verifications_page.rows.first.tag.text).to eq(
"ACCEPTED",
)
status_text =
find("strong.govuk-tag.govuk-tag--green.app-task-list__tag").text
syed87 marked this conversation as resolved.
Show resolved Hide resolved
expect(status_text).to eq("ACCEPTED")
end

def application_form
Expand Down
Loading