Skip to content

Commit 6be006f

Browse files
authored
Merge pull request #3764 from nhsuk/next
Version 2.2.8
2 parents 1049dde + 16f79f1 commit 6be006f

24 files changed

Lines changed: 1541 additions & 823 deletions

Gemfile.lock

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ GEM
101101
public_suffix (>= 2.0.2, < 7.0)
102102
aes_key_wrap (1.1.0)
103103
amazing_print (1.8.1)
104-
annotaterb (4.14.0)
104+
annotaterb (4.15.0)
105105
array_enum (1.6.0)
106106
activemodel
107107
asciidoctor (2.0.23)
@@ -111,34 +111,34 @@ GEM
111111
ast (2.4.3)
112112
attr_required (1.0.2)
113113
aws-eventstream (1.4.0)
114-
aws-partitions (1.1116.0)
114+
aws-partitions (1.1117.0)
115115
aws-sdk-accessanalyzer (1.72.0)
116116
aws-sdk-core (~> 3, >= 3.225.0)
117117
aws-sigv4 (~> 1.5)
118-
aws-sdk-core (3.225.2)
118+
aws-sdk-core (3.226.0)
119119
aws-eventstream (~> 1, >= 1.3.0)
120120
aws-partitions (~> 1, >= 1.992.0)
121121
aws-sigv4 (~> 1.9)
122122
base64
123123
jmespath (~> 1, >= 1.6.1)
124124
logger
125-
aws-sdk-ec2 (1.530.0)
125+
aws-sdk-ec2 (1.531.0)
126126
aws-sdk-core (~> 3, >= 3.225.0)
127127
aws-sigv4 (~> 1.5)
128-
aws-sdk-ecr (1.103.0)
128+
aws-sdk-ecr (1.104.0)
129129
aws-sdk-core (~> 3, >= 3.225.0)
130130
aws-sigv4 (~> 1.5)
131131
aws-sdk-iam (1.123.0)
132132
aws-sdk-core (~> 3, >= 3.225.0)
133133
aws-sigv4 (~> 1.5)
134-
aws-sdk-kms (1.101.0)
135-
aws-sdk-core (~> 3, >= 3.216.0)
134+
aws-sdk-kms (1.105.0)
135+
aws-sdk-core (~> 3, >= 3.225.0)
136136
aws-sigv4 (~> 1.5)
137137
aws-sdk-rds (1.280.0)
138138
aws-sdk-core (~> 3, >= 3.225.0)
139139
aws-sigv4 (~> 1.5)
140-
aws-sdk-s3 (1.186.0)
141-
aws-sdk-core (~> 3, >= 3.216.0)
140+
aws-sdk-s3 (1.189.1)
141+
aws-sdk-core (~> 3, >= 3.225.0)
142142
aws-sdk-kms (~> 1)
143143
aws-sigv4 (~> 1.5)
144144
aws-sigv4 (1.12.1)
@@ -186,12 +186,12 @@ GEM
186186
bigdecimal
187187
rexml
188188
crass (1.0.6)
189-
cssbundling-rails (1.4.1)
189+
cssbundling-rails (1.4.3)
190190
railties (>= 6.0.0)
191191
csv (3.3.5)
192-
cuprite (0.15.1)
192+
cuprite (0.17)
193193
capybara (~> 3.0)
194-
ferrum (~> 0.15.0)
194+
ferrum (~> 0.17.0)
195195
date (3.4.1)
196196
debug (1.10.0)
197197
irb (~> 1.10)
@@ -216,14 +216,14 @@ GEM
216216
erubi (1.13.1)
217217
et-orbi (1.2.11)
218218
tzinfo
219-
factory_bot (6.5.0)
220-
activesupport (>= 5.0.0)
219+
factory_bot (6.5.4)
220+
activesupport (>= 6.1.0)
221221
factory_bot_instruments (1.2.0)
222222
activerecord (>= 4.0)
223223
factory_bot (>= 4)
224-
factory_bot_rails (6.4.4)
224+
factory_bot_rails (6.5.0)
225225
factory_bot (~> 6.5)
226-
railties (>= 5.0.0)
226+
railties (>= 6.1.0)
227227
faker (3.5.1)
228228
i18n (>= 1.8.11, < 2)
229229
faraday (2.13.1)
@@ -234,8 +234,9 @@ GEM
234234
faraday (>= 1, < 3)
235235
faraday-net_http (3.4.0)
236236
net-http (>= 0.5.0)
237-
ferrum (0.15)
237+
ferrum (0.17.1)
238238
addressable (~> 2.5)
239+
base64 (~> 0.2)
239240
concurrent-ruby (~> 1.1)
240241
webrick (~> 1.7)
241242
websocket-driver (~> 0.7)
@@ -265,10 +266,10 @@ GEM
265266
fugit (>= 1.11.0)
266267
railties (>= 6.1.0)
267268
thor (>= 1.0.0)
268-
govuk-components (5.10.0)
269+
govuk-components (5.10.1)
269270
html-attributes-utils (~> 1.0.0, >= 1.0.0)
270271
pagy (>= 6, < 10)
271-
view_component (>= 3.18, < 3.22)
272+
view_component (>= 3.18, < 3.24)
272273
govuk_design_system_formbuilder (5.10.1)
273274
actionview (>= 6.1)
274275
activemodel (>= 6.1)
@@ -305,7 +306,7 @@ GEM
305306
jmespath (1.6.2)
306307
jsbundling-rails (1.3.1)
307308
railties (>= 6.0.0)
308-
json (2.12.0)
309+
json (2.12.2)
309310
json-jwt (1.16.6)
310311
activesupport (>= 4.2)
311312
aes_key_wrap
@@ -437,7 +438,7 @@ GEM
437438
psych (5.2.6)
438439
date
439440
stringio
440-
public_suffix (6.0.1)
441+
public_suffix (6.0.2)
441442
puma (6.6.0)
442443
nio4r (~> 2.0)
443444
pundit (2.5.0)
@@ -541,40 +542,40 @@ GEM
541542
rspec-mocks (~> 3.13)
542543
rspec-support (~> 3.13)
543544
rspec-support (3.13.4)
544-
rubocop (1.75.2)
545+
rubocop (1.76.1)
545546
json (~> 2.3)
546547
language_server-protocol (~> 3.17.0.2)
547548
lint_roller (~> 1.1.0)
548549
parallel (~> 1.10)
549550
parser (>= 3.3.0.2)
550551
rainbow (>= 2.2.2, < 4.0)
551552
regexp_parser (>= 2.9.3, < 3.0)
552-
rubocop-ast (>= 1.44.0, < 2.0)
553+
rubocop-ast (>= 1.45.0, < 2.0)
553554
ruby-progressbar (~> 1.7)
554555
unicode-display_width (>= 2.4.0, < 4.0)
555-
rubocop-ast (1.44.0)
556+
rubocop-ast (1.45.1)
556557
parser (>= 3.3.7.2)
557558
prism (~> 1.4)
558559
rubocop-capybara (2.22.1)
559560
lint_roller (~> 1.1)
560561
rubocop (~> 1.72, >= 1.72.1)
561-
rubocop-govuk (5.1.4)
562-
rubocop (= 1.75.2)
563-
rubocop-ast (= 1.44.0)
562+
rubocop-govuk (5.1.14)
563+
rubocop (= 1.76.1)
564+
rubocop-ast (= 1.45.1)
564565
rubocop-capybara (= 2.22.1)
565-
rubocop-rails (= 2.31.0)
566+
rubocop-rails (= 2.32.0)
566567
rubocop-rake (= 0.7.1)
567-
rubocop-rspec (= 3.5.0)
568-
rubocop-rails (2.31.0)
568+
rubocop-rspec (= 3.6.0)
569+
rubocop-rails (2.32.0)
569570
activesupport (>= 4.2.0)
570571
lint_roller (~> 1.1)
571572
rack (>= 1.1)
572573
rubocop (>= 1.75.0, < 2.0)
573-
rubocop-ast (>= 1.38.0, < 2.0)
574+
rubocop-ast (>= 1.44.0, < 2.0)
574575
rubocop-rake (0.7.1)
575576
lint_roller (~> 1.1)
576577
rubocop (>= 1.72.1)
577-
rubocop-rspec (3.5.0)
578+
rubocop-rspec (3.6.0)
578579
lint_roller (~> 1.1)
579580
rubocop (~> 1.72, >= 1.72.1)
580581
ruby-prof (1.7.2)
@@ -607,7 +608,7 @@ GEM
607608
simplecov_json_formatter (~> 0.1)
608609
simplecov-html (0.12.3)
609610
simplecov_json_formatter (0.1.4)
610-
solargraph (0.54.5)
611+
solargraph (0.55.1)
611612
backport (~> 1.2)
612613
benchmark (~> 0.4)
613614
bundler (~> 2.0)
@@ -669,9 +670,9 @@ GEM
669670
validate_url (1.0.15)
670671
activemodel (>= 3.0.0)
671672
public_suffix
672-
view_component (3.21.0)
673+
view_component (3.23.2)
673674
activesupport (>= 5.2.0, < 8.1)
674-
concurrent-ruby (~> 1.0)
675+
concurrent-ruby (~> 1)
675676
method_source (~> 1.0)
676677
warden (1.2.9)
677678
rack (>= 2.0.9)
@@ -690,7 +691,7 @@ GEM
690691
hashdiff (>= 0.4.0, < 2.0.0)
691692
webrick (1.9.1)
692693
webrobots (0.1.2)
693-
websocket-driver (0.7.7)
694+
websocket-driver (0.8.0)
694695
base64
695696
websocket-extensions (>= 0.1.0)
696697
websocket-extensions (0.1.5)

app/components/app_card_component.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
class AppCardComponent < ViewComponent::Base
44
erb_template <<-ERB
5-
<div class="<%= card_classes %>">
5+
<<%= top_level_tag %> class="<%= card_classes %>">
66
<div class="<%= content_classes %>">
77
<% if heading.present? %>
88
<h2 class="<%= heading_classes %>">
@@ -22,7 +22,7 @@ class AppCardComponent < ViewComponent::Base
2222
2323
<%= content %>
2424
</div>
25-
</div>
25+
</<%= top_level_tag %>>
2626
ERB
2727

2828
renders_one :heading
@@ -34,7 +34,8 @@ def initialize(
3434
secondary: false,
3535
data: false,
3636
patient: false,
37-
filters: false
37+
filters: false,
38+
section: false
3839
)
3940
super
4041

@@ -44,12 +45,15 @@ def initialize(
4445
@data = data
4546
@patient = patient
4647
@filters = filters
48+
@section = section
4749

4850
@feature = (colour.present? && !data) || filters
4951
end
5052

5153
private
5254

55+
def top_level_tag = @section ? "section" : "div"
56+
5357
def card_classes
5458
[
5559
"nhsuk-card",

app/components/app_vaccinate_form_component.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@ def url
2727
end
2828

2929
def delivery_method
30-
# TODO: Check which method has been consented to.
31-
programme.flu? ? :nasal_spray : :intramuscular
30+
if patient.consent_status(programme:).vaccine_method_nasal?
31+
:nasal_spray
32+
else
33+
:intramuscular
34+
end
3235
end
3336

3437
def dose_sequence

app/lib/status_updater.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def update_consent_statuses!
4343
batch,
4444
on_duplicate_key_update: {
4545
conflict_target: [:id],
46-
columns: %i[status]
46+
columns: %i[status vaccine_methods]
4747
}
4848
)
4949
end

app/models/concerns/has_vaccine_methods.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,12 @@ module HasVaccineMethods
1010

1111
validates :vaccine_methods, subset: %w[injection nasal]
1212
end
13+
14+
def vaccine_method_injection? = vaccine_methods.include?("injection")
15+
16+
def vaccine_method_nasal? = vaccine_methods.include?("nasal")
17+
18+
def vaccine_method_injection_and_nasal?
19+
vaccine_method_injection? && vaccine_method_nasal?
20+
end
1321
end

app/models/consent_form_programme.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ class ConsentFormProgramme < ApplicationRecord
3030

3131
enum :response, { given: 0, refused: 1 }, prefix: true
3232

33-
def vaccine_method_injection? = vaccine_methods.include?("injection")
34-
35-
def vaccine_method_nasal? = vaccine_methods.include?("nasal")
36-
37-
def vaccine_method_injection_and_nasal?
38-
vaccine_method_injection? && vaccine_method_nasal?
39-
end
40-
4133
def vaccines
4234
Vaccine.active.where(programme_id:, method: vaccine_methods)
4335
end

app/models/consolidated_health_answers.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ def initialize(objects = [])
88
end
99

1010
def add_answer(responder:, question:, answer:, notes: nil)
11+
return if answer.nil?
12+
1113
@answers[question] ||= []
1214
@answers[question] << { responder:, answer:, notes: }
1315
end
@@ -33,7 +35,7 @@ def add_answers_from_model(model)
3335
add_answer(
3436
responder: model.who_responded,
3537
question: health_question.question,
36-
answer: health_question.response.humanize.presence,
38+
answer: health_question.response&.humanize.presence,
3739
notes: health_question.notes.presence
3840
)
3941
end

app/models/patient.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def update_from_pds!(pds_patient)
348348
def invalidate!
349349
return if invalidated?
350350

351-
update_column(:invalidated_at, Time.current)
351+
update!(invalidated_at: Time.current)
352352
end
353353

354354
def not_in_organisation? = patient_sessions.empty?

0 commit comments

Comments
 (0)