Skip to content

Commit 51efe83

Browse files
authored
Merge pull request #5447 from nhsuk/next
2 parents 7f11df9 + 56e5e45 commit 51efe83

File tree

160 files changed

+5698
-2257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+5698
-2257
lines changed

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ GEM
115115
ast (2.4.3)
116116
attr_required (1.0.2)
117117
aws-eventstream (1.4.0)
118-
aws-partitions (1.1188.0)
118+
aws-partitions (1.1190.0)
119119
aws-sdk-accessanalyzer (1.82.0)
120120
aws-sdk-core (~> 3, >= 3.239.1)
121121
aws-sigv4 (~> 1.5)
@@ -139,10 +139,10 @@ GEM
139139
aws-sdk-kms (1.118.0)
140140
aws-sdk-core (~> 3, >= 3.239.1)
141141
aws-sigv4 (~> 1.5)
142-
aws-sdk-rds (1.300.0)
142+
aws-sdk-rds (1.301.0)
143143
aws-sdk-core (~> 3, >= 3.239.1)
144144
aws-sigv4 (~> 1.5)
145-
aws-sdk-s3 (1.205.0)
145+
aws-sdk-s3 (1.206.0)
146146
aws-sdk-core (~> 3, >= 3.234.0)
147147
aws-sdk-kms (~> 1)
148148
aws-sigv4 (~> 1.5)
@@ -174,7 +174,7 @@ GEM
174174
capybara-screenshot (1.0.26)
175175
capybara (>= 1.0, < 4)
176176
launchy
177-
caxlsx (4.4.0)
177+
caxlsx (4.4.1)
178178
htmlentities (~> 4.3, >= 4.3.4)
179179
marcel (~> 1.0)
180180
nokogiri (~> 1.10, >= 1.10.4)
@@ -237,7 +237,7 @@ GEM
237237
factory_bot_rails (6.5.1)
238238
factory_bot (~> 6.5)
239239
railties (>= 6.1.0)
240-
faker (3.5.2)
240+
faker (3.5.3)
241241
i18n (>= 1.8.11, < 2)
242242
faraday (2.14.0)
243243
faraday-net_http (>= 2.0, < 3.5)
@@ -301,7 +301,7 @@ GEM
301301
railties (>= 7.0.0)
302302
html-attributes-utils (1.0.2)
303303
activesupport (>= 6.1.4.4)
304-
htmlentities (4.3.4)
304+
htmlentities (4.4.2)
305305
http-cookie (1.1.0)
306306
domain_name (~> 0.5)
307307
i18n (1.14.7)

app/assets/stylesheets/components/_card.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@
108108

109109
.nhsuk-card__content {
110110
@include nhsuk-responsive-padding(4);
111-
@include nhsuk-responsive-padding(3, "bottom");
112111
}
113112
}
114113

app/components/app_consent_confirmation_component.rb

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,23 @@ def title
2525

2626
private
2727

28+
attr_reader :consent_form
29+
2830
delegate :given_consent_form_programmes,
2931
:refused_consent_form_programmes,
3032
:response_given?,
3133
:parent_email,
32-
to: :@consent_form
34+
to: :consent_form
35+
3336
delegate :govuk_panel, to: :helpers
3437

35-
def full_name
36-
@consent_form.full_name(context: :parents)
37-
end
38+
def full_name = consent_form.full_name(context: :parents)
3839

3940
def panel_text
40-
location = (@consent_form.education_setting_school? ? " at school" : "")
41+
location = (consent_form.education_setting_school? ? " at school" : "")
4142

4243
if response_given?
43-
if @consent_form.health_answers_require_triage?
44+
if consent_form.health_answers_require_triage?
4445
<<-END_OF_TEXT
4546
As you answered ‘yes’ to some of the health questions, we need to check
4647
the #{given_vaccinations_are} suitable for #{full_name}. We’ll review
@@ -85,10 +86,12 @@ def given_vaccinations_are
8586
end
8687

8788
def dates
88-
@consent_form
89-
.session
90-
.today_or_future_dates
91-
.map { it.to_fs(:short_day_of_week) }
92-
.to_sentence(two_words_connector: " or ", last_word_connector: " or ")
89+
if consent_form.session_dates_are_accurate?
90+
consent_form
91+
.session
92+
.today_or_future_dates
93+
.map { it.to_fs(:short_day_of_week) }
94+
.to_sentence(two_words_connector: " or ", last_word_connector: " or ")
95+
end
9396
end
9497
end

app/components/app_consent_summary_component.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,22 @@ def chosen_vaccine_row
139139
if consent.vaccine_method_nasal_only?
140140
"Nasal spray only"
141141
elsif consent.without_gelatine
142-
"Gelatine-free injected vaccine only"
142+
gelatine_free_vaccine_text
143143
else
144144
"No preference"
145145
end
146146

147147
{ key: { text: "Chosen vaccine" }, value: { text: value } }
148148
end
149149

150+
def gelatine_free_vaccine_text
151+
if programme.flu?
152+
"Injected vaccine only"
153+
else
154+
"Gelatine-free injected vaccine only"
155+
end
156+
end
157+
150158
def reason_for_refusal_row
151159
return if consent.reason_for_refusal.nil?
152160

app/components/app_import_review_school_moves_summary_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def call
2020

2121
table.with_body do |body|
2222
@changesets.each do |changeset|
23-
patient = Patient.find(changeset.patient_id)
23+
patient = changeset.patient
2424

2525
body.with_row do |row|
2626
row.with_cell do
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# frozen_string_literal: true
2+
3+
class AppLocationCardComponent < ViewComponent::Base
4+
def initialize(location, patient_count:, next_session_date:)
5+
@location = location
6+
@patient_count = patient_count
7+
@next_session_date = next_session_date
8+
end
9+
10+
def call
11+
render AppCardComponent.new(link_to:, compact: true) do |card|
12+
card.with_heading(level: 4) { heading }
13+
govuk_summary_list(rows:)
14+
end
15+
end
16+
17+
private
18+
19+
attr_reader :location, :patient_count, :next_session_date
20+
21+
delegate :govuk_summary_list, to: :helpers
22+
23+
def link_to
24+
school_patients_path(
25+
location.generic_clinic? ? Location::URN_UNKNOWN : location
26+
)
27+
end
28+
29+
def heading = location.school_name
30+
31+
def rows
32+
[
33+
patient_count_row,
34+
urn_row,
35+
phase_row,
36+
address_row,
37+
next_session_date_row
38+
].compact
39+
end
40+
41+
def patient_count_row
42+
{
43+
key: {
44+
text: "Children"
45+
},
46+
value: {
47+
text: I18n.t("children", count: patient_count)
48+
}
49+
}
50+
end
51+
52+
def urn_row
53+
return if location.urn_and_site.blank?
54+
55+
{
56+
key: {
57+
text: "URN"
58+
},
59+
value: {
60+
text: tag.span(location.urn_and_site, class: "app-u-monospace")
61+
}
62+
}
63+
end
64+
65+
def phase_row
66+
return if location.phase.blank?
67+
68+
{
69+
key: {
70+
text: "Phase"
71+
},
72+
value: {
73+
text: location.human_enum_name(:phase)
74+
}
75+
}
76+
end
77+
78+
def address_row
79+
return unless location.has_address?
80+
81+
{
82+
key: {
83+
text: "Address"
84+
},
85+
value: {
86+
text: helpers.format_address_multi_line(location)
87+
}
88+
}
89+
end
90+
91+
def next_session_date_row
92+
return if next_session_date.nil?
93+
94+
{
95+
key: {
96+
text: "Next session"
97+
},
98+
value: {
99+
text: next_session_date.to_fs(:long)
100+
}
101+
}
102+
end
103+
end
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<%= form_with url:, method: :get, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
2+
<%= render AppCardComponent.new(filters: true) do |card| %>
3+
<% card.with_heading(level: 2) { "Find school" } %>
4+
5+
<%= render AppSearchInputComponent.new(name: :q, value: form.q, label: { hidden: true }) %>
6+
7+
<%= f.govuk_radio_buttons_fieldset :phase,
8+
legend: { text: "Phase", size: "s" },
9+
small: true do %>
10+
<%= f.govuk_radio_button :phase, "",
11+
checked: form.phase.blank?,
12+
label: { text: "Any" } %>
13+
14+
<% PHASES.each do |value| %>
15+
<%= f.govuk_radio_button :phase,
16+
value,
17+
checked: form.phase == value,
18+
label: { text: value.humanize } %>
19+
<% end %>
20+
<% end %>
21+
22+
<div class="nhsuk-button-group">
23+
<%= f.govuk_submit "Update results", secondary: true, class: "nhsuk-button--small" %>
24+
<%= govuk_button_link_to "Clear filters", clear_filters_path, secondary: true, class: "nhsuk-button--small" %>
25+
</div>
26+
<% end %>
27+
<% end %>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
class AppLocationSearchFormComponent < ViewComponent::Base
4+
def initialize(form, url:)
5+
@form = form
6+
@url = url
7+
end
8+
9+
private
10+
11+
PHASES = %w[nursery primary secondary other].freeze
12+
13+
attr_reader :form, :url
14+
15+
delegate :govuk_button_link_to, to: :helpers
16+
17+
def clear_filters_path = "#{@url}?_clear=true"
18+
end

app/components/app_notices_table_component.html.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<% row.with_cell(text: "Date") %>
1212
<% row.with_cell(text: "Child") %>
1313
<% row.with_cell(text: "Notice") %>
14+
<%= row.with_cell(text: "Actions") %>
1415
<% end %>
1516
<% end %>
1617

@@ -29,6 +30,12 @@
2930
<span class="nhsuk-table-responsive__heading">Notice</span>
3031
<%= notice.message %>
3132
<% end %>
33+
<% row.with_cell do %>
34+
<span class="nhsuk-table-responsive__heading">Actions</span>
35+
<% if notice.can_dismiss? %>
36+
<%= link_to "Dismiss", dismiss_imports_notice_path(notice) %>
37+
<% end %>
38+
<% end %>
3239
<% end %>
3340
<% end %>
3441
<% end %>

app/components/app_patient_search_form_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<%= f.govuk_check_box :programme_types,
1717
programme.type,
1818
checked: form.programme_types&.include?(programme.type),
19-
label: { text: programme.name } %>
19+
label: { text: programme.filter_name } %>
2020
<% end %>
2121
<% end %>
2222
<% end %>

0 commit comments

Comments
 (0)