-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change how we display Mandatory Qualifications in Check
- Add support for rendering multiple MQs by following the same approach we use for NPQs - Change the MQ section heading and make the row key more specific to accommodate for the fact that we may be rendering multiple MQs for different specialisms - Update test data and system spec to cover these changes
- Loading branch information
1 parent
9f406a5
commit c18dae8
Showing
6 changed files
with
46 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<% if rows.any? %> | ||
<div class="govuk-!-margin-bottom-9"> | ||
<h2 class="govuk-heading-m">Mandatory qualifications (MQs) for specialist teachers of pupils with sensory impairments</h2> | ||
<%= render GovukComponent::SummaryListComponent.new(rows:) %> | ||
</div> | ||
<% 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# frozen_string_literal: true | ||
|
||
class CheckRecords::MqSummaryComponent < ViewComponent::Base | ||
include ActiveModel::Model | ||
|
||
attr_accessor :mqs | ||
|
||
def rows | ||
mqs.map do |mq| | ||
{ | ||
key: { | ||
text: key_text(mq) | ||
}, | ||
value: { | ||
text: mq.awarded_at.to_fs(:long_uk) | ||
} | ||
} | ||
end | ||
end | ||
|
||
private | ||
|
||
def key_text(mandatory_qualification) | ||
"Date #{mandatory_qualification.details.specialism.downcase} MQ awarded" | ||
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