Skip to content

Commit 470d11a

Browse files
authored
Merge pull request #4651 from nhsuk/next
Version 4.2.1
2 parents a478d8f + 2984d05 commit 470d11a

148 files changed

Lines changed: 1247 additions & 1953 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.

.github/pull_request_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
## Screenshots
2+
3+
## Pre-release tasks
4+
5+
- ...
6+
7+
## Post-release tasks
8+
9+
- ...

.github/workflows/deploy-application.yml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ on:
2323
options:
2424
- all
2525
- web
26-
- good-job
2726
- sidekiq
2827
default: all
2928
workflow_call:
@@ -82,8 +81,6 @@ jobs:
8281
"application=" + .codedeploy_application_name.value,
8382
"application_group=" + .codedeploy_deployment_group_name.value,
8483
"cluster_name=" + .ecs_variables.value.cluster_name,
85-
"good_job_service=" + .ecs_variables.value.good_job.service_name,
86-
"good_job_task_definition=" + .ecs_variables.value.good_job.task_definition.arn,
8784
"sidekiq_service=" + .ecs_variables.value.sidekiq.service_name,
8885
"sidekiq_task_definition=" + .ecs_variables.value.sidekiq.task_definition.arn
8986
' > ${{ runner.temp }}/DEPLOYMENT_ENVS
@@ -126,50 +123,6 @@ jobs:
126123
aws deploy wait deployment-successful --deployment-id "$deployment_id"
127124
echo "Deployment successful"
128125
129-
create-good-job-deployment:
130-
name: Create good-job deployment
131-
runs-on: ubuntu-latest
132-
needs: prepare-deployment
133-
if: inputs.server_types == 'good-job' || inputs.server_types == 'all'
134-
permissions:
135-
id-token: write
136-
steps:
137-
- name: Download Artifact
138-
uses: actions/download-artifact@v5
139-
with:
140-
name: DEPLOYMENT_ENVS-${{ inputs.environment }}
141-
path: ${{ runner.temp }}
142-
- name: Configure AWS Credentials
143-
uses: aws-actions/configure-aws-credentials@v5
144-
with:
145-
role-to-assume: ${{ env.aws-role }}
146-
aws-region: eu-west-2
147-
- name: Trigger ECS Deployment
148-
run: |
149-
set -e
150-
source ${{ runner.temp }}/DEPLOYMENT_ENVS
151-
DEPLOYMENT_ID=$(aws ecs update-service --cluster $cluster_name --service $good_job_service \
152-
--task-definition $good_job_task_definition --force-new-deployment \
153-
--query 'service.deployments[?rolloutState==`IN_PROGRESS`].[id][0]' --output text)
154-
echo "Deployment started: $DEPLOYMENT_ID"
155-
echo "deployment_id=$DEPLOYMENT_ID" >> $GITHUB_ENV
156-
- name: Wait for deployment to complete
157-
run: |
158-
set -e
159-
source ${{ runner.temp }}/DEPLOYMENT_ENVS
160-
DEPLOYMENT_STATE=IN_PROGRESS
161-
while [ "$DEPLOYMENT_STATE" == "IN_PROGRESS" ]; do
162-
echo "Waiting for deployment to complete..."
163-
sleep 30
164-
DEPLOYMENT_STATE="$(aws ecs describe-services --cluster $cluster_name --services $good_job_service \
165-
--query "services[0].deployments[?id == \`$deployment_id\`].[rolloutState][0]" --output text)"
166-
done
167-
if [ "$DEPLOYMENT_STATE" != "COMPLETED" ]; then
168-
echo "Deployment failed with state: $DEPLOYMENT_STATE"
169-
exit 1
170-
fi
171-
echo "Deployment successful"
172-
173126
create-sidekiq-deployment:
174127
name: Create sidekiq deployment
175128
runs-on: ubuntu-latest

.github/workflows/deploy.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ on:
4040
options:
4141
- all
4242
- web
43-
- good-job
4443
- sidekiq
4544
- none
4645
default: all
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Draft new release
2+
run-name: Draft release notes for ${{ inputs.release_tag }}
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
inputs:
9+
release_tag:
10+
required: true
11+
description: Release tag
12+
13+
jobs:
14+
create-release-notes:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v5
19+
with:
20+
fetch-depth: 0
21+
- name: Generate release notes
22+
env:
23+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
run: script/draft_new_release.sh ${{ inputs.release_tag }}
25+
- name: Create GitHub Release
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
run: |
29+
gh release create "${{ inputs.release_tag }}" \
30+
--title "Draft release ${{ inputs.release_tag }}" \
31+
--notes-file release_notes.md \
32+
--draft
33+

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,5 @@ VOLUME ["/rails/db/data", "/rails/tmp", "/rails/log", "/tmp", "/var/log", "/var/
8585
# Start web server by default, this can be overwritten by environment variable
8686
EXPOSE 4000
8787
ENV HTTP_PORT=4000
88-
ENV GOOD_JOB_PROBE_PORT=4000
8988
ENV SERVER_TYPE=web
9089
CMD ["./bin/docker-start"]

Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ gem "fhir_models"
3939
gem "flipper"
4040
gem "flipper-active_record"
4141
gem "flipper-ui"
42-
gem "good_job"
4342
gem "govuk-components"
4443
gem "govuk_design_system_formbuilder"
4544
gem "govuk_markdown"

Gemfile.lock

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ GEM
220220
activemodel
221221
erb (5.0.2)
222222
erubi (1.13.1)
223-
et-orbi (1.2.11)
223+
et-orbi (1.3.0)
224224
tzinfo
225225
factory_bot (6.5.5)
226226
activesupport (>= 6.1.0)
@@ -265,18 +265,11 @@ GEM
265265
rack-protection (>= 1.5.3, < 5.0.0)
266266
rack-session (>= 1.0.2, < 3.0.0)
267267
sanitize (< 8)
268-
fugit (1.11.1)
268+
fugit (1.11.2)
269269
et-orbi (~> 1, >= 1.2.11)
270270
raabro (~> 1.4)
271271
globalid (1.2.1)
272272
activesupport (>= 6.1)
273-
good_job (4.11.2)
274-
activejob (>= 6.1.0)
275-
activerecord (>= 6.1.0)
276-
concurrent-ruby (>= 1.3.1)
277-
fugit (>= 1.11.0)
278-
railties (>= 6.1.0)
279-
thor (>= 1.0.0)
280273
govuk-components (5.11.3)
281274
html-attributes-utils (~> 1.0.0, >= 1.0.0)
282275
pagy (>= 6, < 10)
@@ -435,7 +428,7 @@ GEM
435428
racc
436429
pg (1.6.2-arm64-darwin)
437430
pg (1.6.2-x86_64-linux)
438-
phonelib (0.10.11)
431+
phonelib (0.10.12)
439432
pp (0.6.2)
440433
prettyprint
441434
prettier_print (1.2.1)
@@ -454,7 +447,7 @@ GEM
454447
date
455448
stringio
456449
public_suffix (6.0.2)
457-
puma (7.0.2)
450+
puma (7.0.3)
458451
nio4r (~> 2.0)
459452
pundit (2.5.1)
460453
activesupport (>= 3.0.0)
@@ -800,7 +793,6 @@ DEPENDENCIES
800793
flipper
801794
flipper-active_record
802795
flipper-ui
803-
good_job
804796
govuk-components
805797
govuk_design_system_formbuilder
806798
govuk_markdown

app/components/app_activity_log_component.rb

Lines changed: 68 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,59 +14,89 @@ class AppActivityLogComponent < ViewComponent::Base
1414
<% end %>
1515
ERB
1616

17-
def initialize(team:, patient: nil, patient_session: nil)
18-
if patient.nil? && patient_session.nil?
19-
raise "Pass either a patient or a patient session."
20-
elsif patient && patient_session
21-
raise "Pass only a patient or a patient session."
22-
end
17+
def initialize(team:, patient:, session: nil)
18+
@patient = patient
2319

24-
@patient = patient || patient_session.patient
25-
@patient_sessions =
26-
patient_session ? [patient_session] : patient.patient_sessions
20+
@archive_reasons =
21+
@patient.archive_reasons.where(team:).includes(:created_by)
2722

2823
@attendance_records =
29-
(patient || patient_session).attendance_records.includes(:location)
24+
(patient || patient_session)
25+
.attendance_records
26+
.includes(:location)
27+
.then do |scope|
28+
session ? scope.where(location: session.location) : scope
29+
end
3030

3131
@consents =
32-
@patient.consents.includes(
33-
:consent_form,
34-
:parent,
35-
:recorded_by,
36-
:programme,
37-
patient: :parent_relationships
38-
)
32+
@patient
33+
.consents
34+
.includes(
35+
:consent_form,
36+
:parent,
37+
:recorded_by,
38+
:programme,
39+
patient: :parent_relationships
40+
)
41+
.then do |scope|
42+
session ? scope.where(programme: session.programmes) : scope
43+
end
3944

4045
@gillick_assessments =
41-
(patient || patient_session)
46+
@patient
4247
.gillick_assessments
4348
.includes(:performed_by)
4449
.order(:created_at)
50+
.then { |scope| session ? scope.where_session(session) : scope }
4551

4652
@notes =
47-
(patient || patient_session).notes.includes(
48-
:created_by,
49-
:patient,
50-
session: :programmes
51-
)
53+
@patient
54+
.notes
55+
.includes(:created_by, :patient, session: :programmes)
56+
.then { |scope| session ? scope.where(session:) : scope }
57+
58+
@notify_log_entries =
59+
@patient
60+
.notify_log_entries
61+
.includes(:sent_by)
62+
.then do |scope|
63+
session ? scope.where(programme_ids: session.programmes.ids) : scope
64+
end
5265

53-
@notify_log_entries = @patient.notify_log_entries.includes(:sent_by)
66+
@patient_sessions =
67+
@patient
68+
.patient_sessions
69+
.includes_programmes
70+
.includes(session: :location)
71+
.then { |scope| session ? scope.where(session:) : scope }
72+
73+
@patient_specific_directions =
74+
@patient
75+
.patient_specific_directions
76+
.includes(:created_by)
77+
.then do |scope|
78+
session ? scope.where(programme: session.programmes) : scope
79+
end
5480

5581
@pre_screenings =
56-
(patient || patient_session).pre_screenings.includes(:performed_by)
82+
@patient
83+
.pre_screenings
84+
.includes(:performed_by)
85+
.then { |scope| session ? scope.where_session(session) : scope }
5786

58-
@triages = @patient.triages.includes(:performed_by)
87+
@triages =
88+
@patient
89+
.triages
90+
.includes(:performed_by)
91+
.then do |scope|
92+
session ? scope.where(programme: session.programmes) : scope
93+
end
5994

6095
@vaccination_records =
6196
@patient.vaccination_records.with_discarded.includes(
6297
:performed_by_user,
6398
:vaccine
6499
)
65-
66-
@patient_specific_directions =
67-
@patient.patient_specific_directions.includes(:created_by)
68-
69-
@archive_reasons = @patient.archive_reasons.where(team:)
70100
end
71101

72102
attr_reader :archive_reasons,
@@ -216,9 +246,9 @@ def expiration_events
216246
body =
217247
case category
218248
when :not_vaccinated
219-
"#{@patient.full_name} was not vaccinated."
249+
"#{patient.full_name} was not vaccinated."
220250
when :vaccinated_but_seasonal
221-
"#{@patient.full_name} was vaccinated."
251+
"#{patient.full_name} was vaccinated."
222252
end
223253

224254
programmes = expired_items_in_category.values.flatten.uniq
@@ -317,11 +347,14 @@ def pre_screening_events
317347

318348
def session_events
319349
patient_sessions.map do |patient_session|
350+
patient = patient_session.patient
351+
session = patient_session.session
352+
320353
[
321354
{
322-
title: "Added to the session at #{patient_session.location.name}",
355+
title: "Added to the session at #{session.location.name}",
323356
at: patient_session.created_at,
324-
programmes: programmes_for(patient_session)
357+
programmes: session.programmes_for(patient:)
325358
}
326359
]
327360
end

app/components/app_consent_status_component.rb

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)