-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds the views and controller actions to implement the new "Verify LoPS" page according to the new designs of the verification journey. Co-authored-by: Shujat Khalid <[email protected]>
- Loading branch information
1 parent
fd6c765
commit 79db3bf
Showing
20 changed files
with
372 additions
and
203 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# frozen_string_literal: true | ||
|
||
class AssessorInterface::RequestableRequestForm | ||
include ActiveModel::Model | ||
include ActiveModel::Attributes | ||
|
||
attr_accessor :requestable, :user, :application_form, :assessment | ||
validates :requestable, :user, presence: true | ||
|
||
attribute :passed, :boolean | ||
validates :passed, inclusion: [true, false] | ||
|
||
delegate :application_form, :assessment, to: :requestable | ||
|
||
def save | ||
return false if invalid? | ||
|
||
RequestRequestable.call(requestable:, user:) if passed | ||
|
||
true | ||
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
29 changes: 29 additions & 0 deletions
29
app/views/assessor_interface/professional_standing_requests/edit_request.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<% title = "Request LoPS verification" %> | ||
|
||
<% content_for :page_title, "#{"Error: " if @form.errors.any?}#{title}" %> | ||
<% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %> | ||
|
||
<h1 class="govuk-heading-xl"><%= title %></h1> | ||
|
||
<p class="govuk-body">To verify the applications LoPS you need to:</p> | ||
|
||
<ul class="govuk-list govuk-list--bullet"> | ||
<li> go to the Zendesk and apply email macro 'PR Request LoPS verification'</li> | ||
<li> add the applicant's details to the email</li> | ||
<li> attach the LoPS to the email</li> | ||
<li> find the relevant authority's and document their LoPS document</li> | ||
<li> send the email to the relevant teaching authority</li> | ||
</ul> | ||
|
||
<p class="govuk-body"> | ||
Do you want to mark this task as completed and come back after you have sent the email from Zendesk? | ||
</p> | ||
|
||
<%= form_with model: @form, url: [:request, :assessor_interface, @application_form, @assessment, :professional_standing_request] do |f| %> | ||
<%= f.govuk_radio_button :passed, :true, label: { text: "Yes, mark as completed" }, link_errors: true %> | ||
<%= f.govuk_radio_button :passed, :false, label: { text: "No, come back later" } %> | ||
|
||
<%= f.govuk_submit do %> | ||
<%= govuk_link_to "Cancel", [:assessor_interface, @application_form, @assessment, :professional_standing_request] %> | ||
<% end %> | ||
<% end %> |
44 changes: 44 additions & 0 deletions
44
app/views/assessor_interface/professional_standing_requests/show.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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<% content_for :page_title, "Verify LoPS" %> | ||
<% content_for :back_link_url, assessor_interface_application_form_path(@application_form) %> | ||
|
||
<h1 class="govuk-heading-xl">Verify LoPS</h1> | ||
|
||
<p class="govuk-body"> | ||
You need to request verification for this applications LoPS. Follow the steps below: | ||
</p> | ||
|
||
<%= render(TaskList::Component.new( | ||
[ | ||
{ | ||
title: "", | ||
items: [ | ||
{ | ||
name: "Request LoPS verification", | ||
link: unless @professional_standing_request.requested? | ||
[ | ||
:request, | ||
:assessor_interface, | ||
@application_form, | ||
@assessment, | ||
:professional_standing_request, | ||
] | ||
end, | ||
status: @professional_standing_request.requested? ? "completed" : "not_started" | ||
}, | ||
{ | ||
name: "Record LoPS verification", | ||
link: [ | ||
:review, | ||
:assessor_interface, | ||
@application_form, | ||
@assessment, | ||
:professional_standing_request | ||
], | ||
status: @professional_standing_request.status, | ||
} | ||
], | ||
} | ||
] | ||
)) %> | ||
|
||
<%= govuk_button_link_to "Back to overview", [:assessor_interface, @application_form] %> |
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
21 changes: 21 additions & 0 deletions
21
spec/support/autoload/page_objects/assessor_interface/professional_standing_request.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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module PageObjects | ||
module AssessorInterface | ||
class ProfessionalStandingRequest < SitePrism::Page | ||
set_url "/assessor/applications/{application_form_id}/assessments/{assessment_id}" \ | ||
"/professional-standing-request" | ||
|
||
section :task_list, TaskList, ".app-task-list" | ||
element :status_tag, ".govuk-tag" | ||
|
||
def request_lops_verification_task | ||
task_list.find_item("Request LoPS verification") | ||
end | ||
|
||
def record_lops_verification_task | ||
task_list.find_item("Record LoPS verification") | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.