Skip to content

Commit 80f3403

Browse files
Hide archive reasons in activity log for upload only teams
It is sufficient to hide them based on the team type and not based on whether the patient was created via a bulk vaccination upload as all patients in these teams' cohorts will be archived. Jira: MAV-2999
1 parent f04cd79 commit 80f3403

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)