Skip to content

Commit c2140f3

Browse files
authored
Merge pull request #6455 from NHSDigital/next
2 parents 7d66315 + ec8d3d1 commit c2140f3

246 files changed

Lines changed: 6058 additions & 4037 deletions

File tree

Some content is hidden

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

CONTRIBUTING.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,22 @@
11
# Contributing
22

3-
## Code reviews
3+
## Branching strategy
44

5-
All pull requests should be reviewed by another developer on the team before
6-
they can be merged in.
5+
We have three named long-lasting branches in the repo:
76

8-
Don't be afraid to use "Request changes" when suggesting changes to a pull
9-
request. This helps to make it easier to filter in lists of pull requests
10-
which are still in need of a review, and the person who raised the pull
11-
request can still dismiss the review if they disagree.
7+
- `release` - This represents the version of the code that is deployed to
8+
production.
9+
- `main` - This represents the version of the code that is either deployed
10+
to production or assured to be deployed to production.
11+
- `next`- This represents the code that is currently in development and not
12+
yet ready to be deployed to production.
1213

13-
## Branch naming
14+
In most cases, new PRs should be raised against the `next` branch, where once
15+
merged, will go out in the next scheduled release. In the case of an emergency
16+
release it can sometimes be necessary to raise a PR against the `main` branch,
17+
where the `next` branch is then rebased against `main` once merged in.
18+
19+
### Naming
1420

1521
We use simple descriptive names for branches such as `add-patient-model`.
1622
To tie commits to Jira tickets etc. we use Git trailers in the comment, e.g.
@@ -19,8 +25,18 @@ To tie commits to Jira tickets etc. we use Git trailers in the comment, e.g.
1925
Jira-Issue: MAV-1234
2026
```
2127

28+
## Code reviews
29+
30+
All pull requests should be reviewed by another developer on the team before
31+
they can be merged in.
32+
33+
Don't be afraid to use "Request changes" when suggesting changes to a pull
34+
request. This helps to make it easier to filter in lists of pull requests
35+
which are still in need of a review, and the person who raised the pull
36+
request can still dismiss the review if they disagree.
37+
2238
## Merging
2339

24-
We use a simple merge rather than a squash merge. Consider doing an interactive
25-
rebase first, to squash any trivial commits that don't add any value to change
26-
history by themselves.
40+
We use a simple merge rather than a squash merge. Consider doing an
41+
interactive rebase first, to squash any trivial commits that don't add any
42+
value to change history by themselves.

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source "https://rubygems.org"
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

66
ruby file: ".ruby-version"
7-
gem "rails", "8.1.2.1"
7+
gem "rails", "8.1.3"
88

99
# Framework gems
1010
gem "bootsnap", require: false

Gemfile.lock

Lines changed: 66 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/citizensadvice/capybara_accessible_selectors.git
3-
revision: dd47f6a892ecffbc76154336dba7c43a28eb4913
3+
revision: 69cddaeb83625b539f32df22adbee29b3d0ed255
44
specs:
55
capybara_accessible_selectors (0.15.0)
66
capybara (~> 3.36)
@@ -27,9 +27,9 @@ GEM
2727
specs:
2828
action_text-trix (2.1.17)
2929
railties
30-
actioncable (8.1.2.1)
31-
actionpack (= 8.1.2.1)
32-
activesupport (= 8.1.2.1)
30+
actioncable (8.1.3)
31+
actionpack (= 8.1.3)
32+
activesupport (= 8.1.3)
3333
nio4r (~> 2.0)
3434
websocket-driver (>= 0.6.1)
3535
zeitwerk (~> 2.6)
@@ -39,54 +39,54 @@ GEM
3939
nio4r (~> 2.0)
4040
websocket-driver (>= 0.6.1)
4141
zeitwerk (~> 2.6)
42-
actionmailbox (8.1.2.1)
43-
actionpack (= 8.1.2.1)
44-
activejob (= 8.1.2.1)
45-
activerecord (= 8.1.2.1)
46-
activestorage (= 8.1.2.1)
47-
activesupport (= 8.1.2.1)
42+
actionmailbox (8.1.3)
43+
actionpack (= 8.1.3)
44+
activejob (= 8.1.3)
45+
activerecord (= 8.1.3)
46+
activestorage (= 8.1.3)
47+
activesupport (= 8.1.3)
4848
mail (>= 2.8.0)
49-
actionmailer (8.1.2.1)
50-
actionpack (= 8.1.2.1)
51-
actionview (= 8.1.2.1)
52-
activejob (= 8.1.2.1)
53-
activesupport (= 8.1.2.1)
49+
actionmailer (8.1.3)
50+
actionpack (= 8.1.3)
51+
actionview (= 8.1.3)
52+
activejob (= 8.1.3)
53+
activesupport (= 8.1.3)
5454
mail (>= 2.8.0)
5555
rails-dom-testing (~> 2.2)
56-
actionpack (8.1.2.1)
57-
actionview (= 8.1.2.1)
58-
activesupport (= 8.1.2.1)
56+
actionpack (8.1.3)
57+
actionview (= 8.1.3)
58+
activesupport (= 8.1.3)
5959
nokogiri (>= 1.8.5)
6060
rack (>= 2.2.4)
6161
rack-session (>= 1.0.1)
6262
rack-test (>= 0.6.3)
6363
rails-dom-testing (~> 2.2)
6464
rails-html-sanitizer (~> 1.6)
6565
useragent (~> 0.16)
66-
actiontext (8.1.2.1)
66+
actiontext (8.1.3)
6767
action_text-trix (~> 2.1.15)
68-
actionpack (= 8.1.2.1)
69-
activerecord (= 8.1.2.1)
70-
activestorage (= 8.1.2.1)
71-
activesupport (= 8.1.2.1)
68+
actionpack (= 8.1.3)
69+
activerecord (= 8.1.3)
70+
activestorage (= 8.1.3)
71+
activesupport (= 8.1.3)
7272
globalid (>= 0.6.0)
7373
nokogiri (>= 1.8.5)
74-
actionview (8.1.2.1)
75-
activesupport (= 8.1.2.1)
74+
actionview (8.1.3)
75+
activesupport (= 8.1.3)
7676
builder (~> 3.1)
7777
erubi (~> 1.11)
7878
rails-dom-testing (~> 2.2)
7979
rails-html-sanitizer (~> 1.6)
8080
active_record_union (1.4.0)
8181
activerecord (>= 6.0)
82-
activejob (8.1.2.1)
83-
activesupport (= 8.1.2.1)
82+
activejob (8.1.3)
83+
activesupport (= 8.1.3)
8484
globalid (>= 0.3.6)
85-
activemodel (8.1.2.1)
86-
activesupport (= 8.1.2.1)
87-
activerecord (8.1.2.1)
88-
activemodel (= 8.1.2.1)
89-
activesupport (= 8.1.2.1)
85+
activemodel (8.1.3)
86+
activesupport (= 8.1.3)
87+
activerecord (8.1.3)
88+
activemodel (= 8.1.3)
89+
activesupport (= 8.1.3)
9090
timeout (>= 0.4.0)
9191
activerecord-import (2.2.0)
9292
activerecord (>= 4.2)
@@ -96,13 +96,13 @@ GEM
9696
cgi (>= 0.3.6)
9797
rack (>= 2.0.8, < 4)
9898
railties (>= 7.0)
99-
activestorage (8.1.2.1)
100-
actionpack (= 8.1.2.1)
101-
activejob (= 8.1.2.1)
102-
activerecord (= 8.1.2.1)
103-
activesupport (= 8.1.2.1)
99+
activestorage (8.1.3)
100+
actionpack (= 8.1.3)
101+
activejob (= 8.1.3)
102+
activerecord (= 8.1.3)
103+
activesupport (= 8.1.3)
104104
marcel (~> 1.0)
105-
activesupport (8.1.2.1)
105+
activesupport (8.1.3)
106106
base64
107107
bigdecimal
108108
concurrent-ruby (~> 1.0, >= 1.3.1)
@@ -175,7 +175,7 @@ GEM
175175
protocol-websocket (~> 0.17)
176176
attr_required (1.0.2)
177177
aws-eventstream (1.4.0)
178-
aws-partitions (1.1228.0)
178+
aws-partitions (1.1229.0)
179179
aws-sdk-accessanalyzer (1.86.0)
180180
aws-sdk-core (~> 3, >= 3.244.0)
181181
aws-sigv4 (~> 1.5)
@@ -199,7 +199,7 @@ GEM
199199
aws-sdk-kms (1.123.0)
200200
aws-sdk-core (~> 3, >= 3.244.0)
201201
aws-sigv4 (~> 1.5)
202-
aws-sdk-rds (1.309.0)
202+
aws-sdk-rds (1.310.0)
203203
aws-sdk-core (~> 3, >= 3.244.0)
204204
aws-sigv4 (~> 1.5)
205205
aws-sdk-s3 (1.217.0)
@@ -360,14 +360,14 @@ GEM
360360
fiber-local (1.1.0)
361361
fiber-storage
362362
fiber-storage (1.0.1)
363-
flipper (1.4.0)
363+
flipper (1.4.1)
364364
concurrent-ruby (< 2)
365-
flipper-active_record (1.4.0)
365+
flipper-active_record (1.4.1)
366366
activerecord (>= 4.2, < 9)
367-
flipper (~> 1.4.0)
368-
flipper-ui (1.4.0)
367+
flipper (~> 1.4.1)
368+
flipper-ui (1.4.1)
369369
erubi (>= 1.0.0, < 2.0.0)
370-
flipper (~> 1.4.0)
370+
flipper (~> 1.4.1)
371371
rack (>= 1.4, < 4)
372372
rack-protection (>= 1.5.3, < 5.0.0)
373373
rack-session (>= 1.0.2, < 3.0.0)
@@ -386,7 +386,7 @@ GEM
386386
activemodel (>= 6.1)
387387
activesupport (>= 6.1)
388388
html-attributes-utils (~> 1)
389-
govuk_markdown (2.0.3)
389+
govuk_markdown (2.0.4)
390390
activesupport
391391
redcarpet
392392
haml (7.1.0)
@@ -424,7 +424,7 @@ GEM
424424
jmespath (1.6.2)
425425
jsbundling-rails (1.3.1)
426426
railties (>= 6.0.0)
427-
json (2.19.2)
427+
json (2.19.3)
428428
json-jwt (1.17.0)
429429
activesupport (>= 4.2)
430430
aes_key_wrap
@@ -618,20 +618,20 @@ GEM
618618
rack (>= 1.0.0)
619619
rackup (2.3.1)
620620
rack (>= 3)
621-
rails (8.1.2.1)
622-
actioncable (= 8.1.2.1)
623-
actionmailbox (= 8.1.2.1)
624-
actionmailer (= 8.1.2.1)
625-
actionpack (= 8.1.2.1)
626-
actiontext (= 8.1.2.1)
627-
actionview (= 8.1.2.1)
628-
activejob (= 8.1.2.1)
629-
activemodel (= 8.1.2.1)
630-
activerecord (= 8.1.2.1)
631-
activestorage (= 8.1.2.1)
632-
activesupport (= 8.1.2.1)
621+
rails (8.1.3)
622+
actioncable (= 8.1.3)
623+
actionmailbox (= 8.1.3)
624+
actionmailer (= 8.1.3)
625+
actionpack (= 8.1.3)
626+
actiontext (= 8.1.3)
627+
actionview (= 8.1.3)
628+
activejob (= 8.1.3)
629+
activemodel (= 8.1.3)
630+
activerecord (= 8.1.3)
631+
activestorage (= 8.1.3)
632+
activesupport (= 8.1.3)
633633
bundler (>= 1.15.0)
634-
railties (= 8.1.2.1)
634+
railties (= 8.1.3)
635635
rails-dom-testing (2.3.0)
636636
activesupport (>= 5.0.0)
637637
minitest
@@ -643,9 +643,9 @@ GEM
643643
rack
644644
railties (>= 5.1)
645645
semantic_logger (~> 4.16)
646-
railties (8.1.2.1)
647-
actionpack (= 8.1.2.1)
648-
activesupport (= 8.1.2.1)
646+
railties (8.1.3)
647+
actionpack (= 8.1.3)
648+
activesupport (= 8.1.3)
649649
irb (~> 1.13)
650650
rackup (>= 1.0.0)
651651
rake (>= 12.2)
@@ -667,7 +667,7 @@ GEM
667667
redcarpet (3.6.1)
668668
redis (5.4.1)
669669
redis-client (>= 0.22.0)
670-
redis-client (0.27.0)
670+
redis-client (0.28.0)
671671
connection_pool
672672
redis-prescription (2.6.0)
673673
regexp_parser (2.11.3)
@@ -782,7 +782,7 @@ GEM
782782
sidekiq (>= 5.0)
783783
shoulda-matchers (7.0.1)
784784
activesupport (>= 7.1)
785-
sidekiq (8.1.1)
785+
sidekiq (8.1.2)
786786
connection_pool (>= 3.0.0)
787787
json (>= 2.16.0)
788788
logger (>= 1.7.0)
@@ -992,7 +992,7 @@ DEPENDENCIES
992992
pstore
993993
pundit
994994
rack_session_access
995-
rails (= 8.1.2.1)
995+
rails (= 8.1.3)
996996
rails_semantic_logger
997997
rainbow
998998
redis

app/components/app_activity_log_component.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,14 @@ def pre_screening_events
429429
end
430430

431431
def session_events
432-
patient_locations.map do |patient_location|
433-
[
434-
{
435-
title: "Added to the session at #{patient_location.location.name}",
436-
at: patient_location.created_at
437-
}
438-
]
432+
patient_locations.filter_map do |patient_location|
433+
location = patient_location.location
434+
next if location.generic_school?
435+
436+
{
437+
title: "Added to the session at #{location.name}",
438+
at: patient_location.created_at
439+
}
439440
end
440441
end
441442

app/components/app_location_card_component.rb

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,9 @@ def call
2121

2222
delegate :govuk_summary_list, to: :helpers
2323

24-
def link_to
25-
school_patients_path(
26-
location.generic_clinic? ? Location::URN_UNKNOWN : location
27-
)
28-
end
24+
def link_to = school_patients_path(location)
2925

30-
def heading = location.school_name
26+
def heading = location.name
3127

3228
def rows
3329
[

app/components/app_patient_programme_vaccination_card_component.html.erb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,12 @@
5050
<% end %>
5151
<% end %>
5252
<% end %>
53+
54+
<% if can_record_new_vaccination? %>
55+
<div class="nhsuk-button-group">
56+
<%= govuk_button_to "Record a vaccination in clinic",
57+
record_new_vaccination_patient_programme_path(patient, programme),
58+
secondary: true %>
59+
</div>
60+
<% end %>
5361
<% end %>

app/components/app_patient_programme_vaccination_card_component.rb

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ def initialize(patient, academic_year:, programme: nil, show_caption: false)
1010

1111
private
1212

13-
delegate :govuk_table, :vaccination_record_source, to: :helpers
14-
1513
attr_reader :patient, :academic_year, :programme, :show_caption
1614

15+
delegate :govuk_button_to,
16+
:govuk_table,
17+
:policy,
18+
:vaccination_record_source,
19+
to: :helpers
20+
1721
def vaccination_records
1822
patient
1923
.vaccination_records
@@ -40,4 +44,14 @@ def programme_status_tag
4044
resolved_status.fetch(:prefix) => resolved_status
4145
)
4246
end
47+
48+
def can_record_new_vaccination?
49+
programme_status = patient.programme_status(programme, academic_year:)
50+
51+
if programme_status.not_eligible? || programme_status.vaccinated?
52+
return false
53+
end
54+
55+
policy(VaccinationRecord.new).new?
56+
end
4357
end

0 commit comments

Comments
 (0)