Skip to content

Commit 5c28e7c

Browse files
Merge pull request #5707 from nhsuk/mike/mnr-hide-archive-reasons-for-upload-only-teams
Hide archive reasons in activity log for upload only teams
2 parents 2a8df83 + 80f3403 commit 5c28e7c

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

app/components/app_activity_log_component.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ def initialize(team:, patient:, session: nil)
1818
@patient = patient
1919

2020
@archive_reasons =
21-
@patient.archive_reasons.where(team:).includes(:created_by)
21+
if team.has_upload_only_access?
22+
[]
23+
else
24+
@patient.archive_reasons.where(team:).includes(:created_by)
25+
end
2226

2327
@attendance_records =
2428
patient

spec/components/app_activity_log_component_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@
8686
notes: "Extra details",
8787
date: "1 June 2024 at 12:00pm",
8888
by: "JOY, Nurse"
89+
90+
context "when viewing as an upload only team" do
91+
let(:team) { create(:team, type: :upload_only, programmes:) }
92+
93+
it "does not render archive events" do
94+
expect(rendered).not_to have_content("Record archived")
95+
end
96+
end
8997
end
9098

9199
describe "consent given by parents" do

0 commit comments

Comments
 (0)