Skip to content

Commit 3e213e5

Browse files
authored
Merge pull request #5591 from nhsuk/next
Version 6.8.0
2 parents 6e0e39e + 1139b88 commit 3e213e5

File tree

267 files changed

+4534
-3824
lines changed

Some content is hidden

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

267 files changed

+4534
-3824
lines changed

Gemfile.lock

Lines changed: 6 additions & 6 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: 568699fc71b6648e7186a4ac77bba072447c131e
3+
revision: 3feb17c2e2723bc2e177ce00765a50d6cddf479e
44
specs:
55
capybara_accessible_selectors (0.15.0)
66
capybara (~> 3.36)
@@ -115,7 +115,7 @@ GEM
115115
ast (2.4.3)
116116
attr_required (1.0.2)
117117
aws-eventstream (1.4.0)
118-
aws-partitions (1.1191.0)
118+
aws-partitions (1.1194.0)
119119
aws-sdk-accessanalyzer (1.82.0)
120120
aws-sdk-core (~> 3, >= 3.239.1)
121121
aws-sigv4 (~> 1.5)
@@ -127,7 +127,7 @@ GEM
127127
bigdecimal
128128
jmespath (~> 1, >= 1.6.1)
129129
logger
130-
aws-sdk-ec2 (1.584.0)
130+
aws-sdk-ec2 (1.585.0)
131131
aws-sdk-core (~> 3, >= 3.239.1)
132132
aws-sigv4 (~> 1.5)
133133
aws-sdk-ecr (1.115.0)
@@ -142,7 +142,7 @@ GEM
142142
aws-sdk-rds (1.302.0)
143143
aws-sdk-core (~> 3, >= 3.239.1)
144144
aws-sigv4 (~> 1.5)
145-
aws-sdk-s3 (1.206.0)
145+
aws-sdk-s3 (1.207.0)
146146
aws-sdk-core (~> 3, >= 3.234.0)
147147
aws-sdk-kms (~> 1)
148148
aws-sigv4 (~> 1.5)
@@ -716,8 +716,8 @@ GEM
716716
unicode-display_width (~> 3.1)
717717
temple (0.10.4)
718718
thor (1.4.0)
719-
thruster (0.1.16-arm64-darwin)
720-
thruster (0.1.16-x86_64-linux)
719+
thruster (0.1.17-arm64-darwin)
720+
thruster (0.1.17-x86_64-linux)
721721
tilt (2.6.1)
722722
timeout (0.4.4)
723723
tsort (0.2.0)

app/assets/stylesheets/components/_add-another.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ $_counter-size: 2rem;
1414
--label-font: var(--font-fieldset-label);
1515
position: relative;
1616
padding-bottom: nhsuk-spacing(3);
17+
}
18+
19+
.app-add-another__list-counter {
1720
padding-left: calc($_counter-size + nhsuk-spacing(3));
1821

1922
&::before {

app/components/app_details_component.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class AppDetailsComponent < ViewComponent::Base
44
erb_template <<-ERB
55
<details class="nhsuk-details<%= expander_class %>"<%= open_attr %>>
6-
<summary class="nhsuk-details__summary">
6+
<summary class="nhsuk-details__summary" <%= sticky_class %>>
77
<span class="nhsuk-details__summary-text">
88
<%= summary %>
99
</span>
@@ -17,10 +17,11 @@ class AppDetailsComponent < ViewComponent::Base
1717

1818
renders_one :summary
1919

20-
def initialize(summary: nil, open: false, expander: false)
20+
def initialize(summary: nil, open: false, expander: false, sticky: false)
2121
with_summary { summary } if summary
2222
@open = open
2323
@expander = expander
24+
@sticky = sticky
2425
end
2526

2627
def open_attr
@@ -34,4 +35,10 @@ def expander_class
3435

3536
" nhsuk-expander"
3637
end
38+
39+
def sticky_class
40+
return unless @sticky
41+
42+
" data-module=app-sticky"
43+
end
3744
end

app/components/app_gillick_assessment_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def gillick_assessment
1919
.gillick_assessments
2020
.order(created_at: :desc)
2121
.for_session(session)
22-
.where_programme(programme)
22+
.for_programme(programme)
2323
.first
2424
end
2525

app/components/app_import_format_details_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def summary_text
1717
when CohortImport
1818
"How to format your Mavis CSV file for child records"
1919
when ImmunisationImport
20-
if team.type_upload_only?
20+
if team.has_upload_only_access?
2121
"How to format your CSV file for vaccination records"
2222
else
2323
"How to format your Mavis CSV file for vaccination records"
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
3+
<% if @new_records.any? %>
4+
<h2 class="nhsuk-heading-m">New records</h2>
5+
<p class="nhsuk-u-reading-width">
6+
<%= new_records_message %>
7+
</p>
8+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
9+
<% c.with_summary do %>
10+
<%= pluralize(@new_records.count, "new record") %>
11+
<% end %>
12+
<%= render AppImportReviewRecordsSummaryComponent.new(changesets: @new_records) %>
13+
<% end %>
14+
<% end %>
15+
16+
<% if @auto_matched_records.any? %>
17+
<h2 class="nhsuk-heading-m">Records already in Mavis</h2>
18+
<p class="nhsuk-u-reading-width">
19+
<%= auto_matched_message %>
20+
</p>
21+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
22+
<% c.with_summary do %>
23+
<%= pluralize(@auto_matched_records.count, "record") %> already in Mavis
24+
<% end %>
25+
<%= render AppImportReviewRecordsSummaryComponent.new(changesets: @auto_matched_records) %>
26+
<% end %>
27+
<% end %>
28+
29+
<% if @inter_team.any? %>
30+
<h2 class="nhsuk-heading-m">Children moving from another SAIS team's area - resolve after import</h2>
31+
<p class="nhsuk-u-reading-width">
32+
<%= inter_team_message %>
33+
</p>
34+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
35+
<% c.with_summary do %>
36+
<%= pluralize(@inter_team.count, "school move") %> across teams
37+
<% end %>
38+
<%= render AppImportReviewSchoolMovesSummaryComponent.new(changesets: @inter_team) %>
39+
<% end %>
40+
41+
<% if @inter_team_import_issues.any? %>
42+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
43+
<% c.with_summary do %>
44+
<%= pluralize(@inter_team_import_issues.count, "close match") %> to existing records
45+
<% end %>
46+
<%= render AppImportReviewIssuesSummaryComponent.new(import: @import, records: @inter_team_import_issues) %>
47+
<% end %>
48+
<% end %>
49+
<% end %>
50+
51+
<% if @import_issues.any? %>
52+
<h2 class="nhsuk-heading-m">Close matches to existing records - resolve after import</h2>
53+
<p class="nhsuk-u-reading-width">
54+
<%= import_issues_message %>
55+
</p>
56+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
57+
<% c.with_summary do %>
58+
<%= pluralize(@import_issues.count, "close match") %> to existing records
59+
<% end %>
60+
<%= render AppImportReviewIssuesSummaryComponent.new(import: @import, records: @import_issues) %>
61+
<% end %>
62+
<% end %>
63+
64+
<% if @school_moves.any? %>
65+
<h2 class="nhsuk-heading-m">School moves - resolve after import</h2>
66+
<p class="nhsuk-u-reading-width">
67+
<%= school_moves_message %>
68+
</p>
69+
<%= render AppDetailsComponent.new(expander: true, sticky: true) do |c| %>
70+
<% c.with_summary do %>
71+
<%= pluralize(@school_moves.count, "school move") %>
72+
<% end %>
73+
<%= render AppImportReviewSchoolMovesSummaryComponent.new(changesets: @school_moves) %>
74+
<% end %>
75+
<% end %>
76+
77+
<hr class="nhsuk-section-break nhsuk-section-break--visible nhsuk-section-break--l">
78+
79+
<div class="nhsuk-button-group">
80+
<%= helpers.govuk_button_to approve_button_text, polymorphic_path([:approve, @import]),
81+
method: :post %>
82+
<% if show_cancel_button? %>
83+
<%= helpers.govuk_button_to cancel_button_text, polymorphic_path([:cancel, @import]),
84+
method: :post,
85+
secondary: true %>
86+
<% end %>
87+
</div>

app/components/app_import_review_component.rb

Lines changed: 15 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -17,95 +17,7 @@ def initialize(
1717
@auto_matched_records = auto_matched_records.sort_by(&:row_number)
1818
@import_issues = import_issues.sort_by(&:row_number)
1919
@school_moves = school_moves
20-
end
21-
22-
def call
23-
helpers.safe_join(
24-
[
25-
render_section(
26-
title: "New records",
27-
description: new_records_message,
28-
summary: pluralize(@new_records.count, "new record"),
29-
changesets: @new_records
30-
) do
31-
render(
32-
AppImportReviewRecordsSummaryComponent.new(changesets: @new_records)
33-
)
34-
end,
35-
render_section(
36-
title: "Records already in Mavis",
37-
description: auto_matched_message,
38-
summary:
39-
"#{pluralize(@auto_matched_records.count, "record")} already in Mavis",
40-
changesets: @auto_matched_records
41-
) do
42-
render(
43-
AppImportReviewRecordsSummaryComponent.new(
44-
changesets: @auto_matched_records
45-
)
46-
)
47-
end,
48-
render_section(
49-
title:
50-
"Children moving from another SAIS team's area - will need review after import",
51-
description: inter_team_message,
52-
summary:
53-
"#{pluralize(@inter_team.count, "school move")} across teams",
54-
changesets: @inter_team
55-
) do
56-
render(
57-
AppImportReviewSchoolMovesSummaryComponent.new(
58-
changesets: @inter_team
59-
)
60-
)
61-
end,
62-
if @inter_team_import_issues.any?
63-
render_expander(
64-
summary:
65-
"#{pluralize(@inter_team_import_issues.count, "close match")} to existing records"
66-
) do
67-
render(
68-
AppImportReviewIssuesSummaryComponent.new(
69-
import: @import,
70-
records: @inter_team_import_issues
71-
)
72-
)
73-
end
74-
end,
75-
render_section(
76-
title:
77-
"Close matches to existing records - will need review after import",
78-
description: import_issues_message,
79-
summary:
80-
"#{pluralize(@import_issues.count, "close match")} to existing records",
81-
changesets: @import_issues
82-
) do
83-
render(
84-
AppImportReviewIssuesSummaryComponent.new(
85-
import: @import,
86-
records: @import_issues
87-
)
88-
)
89-
end,
90-
render_section(
91-
title: "School moves - will need review after import",
92-
description: school_moves_message,
93-
summary: pluralize(@school_moves.count, "school move"),
94-
changesets: @school_moves
95-
) do
96-
render(
97-
AppImportReviewSchoolMovesSummaryComponent.new(
98-
changesets: @school_moves
99-
)
100-
)
101-
end,
102-
helpers.tag.hr(
103-
class:
104-
"nhsuk-section-break nhsuk-section-break--visible nhsuk-section-break--l"
105-
),
106-
render_button_group
107-
].compact
108-
)
20+
@school_moves_from_file = @school_moves.reject { it.row_number.nil? }
10921
end
11022

11123
private
@@ -122,6 +34,7 @@ def auto_matched_message
12234
count = @auto_matched_records.count
12335
"This upload includes #{pluralize(count, "record")} that already " \
12436
"#{count > 1 ? "exist" : "exists"} in Mavis. " \
37+
"You do not need to remove #{count > 1 ? "these" : "this"} from your CSV file. " \
12538
"If you approve the upload, any additional information will be added to " \
12639
"the existing #{count > 1 ? "records" : "record"}."
12740
end
@@ -130,31 +43,37 @@ def import_issues_message
13043
count = @import_issues.count
13144
"This upload includes #{pluralize(count, "record")} that " \
13245
"#{count > 1 ? "are close matches to existing records" : "is a close match to an existing record"} " \
133-
"in Mavis. If you approve the upload, any differences will be flagged as " \
134-
"import issues needing review."
46+
"in Mavis. If you approve the upload, you will need to resolve " \
47+
"#{count > 1 ? "these records" : "this record"} in the Issues tab."
13548
end
13649

13750
def inter_team_message
13851
count = @inter_team.count
13952
"This upload includes #{count > 1 ? "children" : "child"} who " \
14053
"#{count > 1 ? "are" : "is"} currently registered with another team. " \
141-
"If you approve the upload, the records below will be flagged as school moves needing review."
54+
"If you approve the upload, you will need to resolve #{count > 1 ? "these records" : "this record"} " \
55+
"in the School moves area of Mavis."
14256
end
14357

14458
def school_moves_message
14559
count = @school_moves.count
14660
if @import.is_a?(ClassImport)
14761
"This upload will change the school of the #{count > 1 ? "children" : "child"} listed below. " \
14862
"Children present in the class list will be moved into the school, and those who are not in the " \
149-
"class list will be moved out of the school. If you approve the upload, these will be flagged as " \
150-
"school moves needing review."
63+
"class list will be moved out of the school. If you approve the upload, you will need to resolve " \
64+
"#{count > 1 ? "these records" : "this record"} in the School moves area of Mavis."
15165
else
15266
"This upload includes #{count} #{count > 1 ? "children" : "child"} with a different school to " \
153-
"the one on their Mavis record. If you approve the upload, these will be flagged as " \
154-
"school moves needing review."
67+
"the one on their Mavis record. If you approve the upload, you will need to resolve " \
68+
"#{count > 1 ? "these records" : "this record"} in the School moves area of Mavis."
15569
end
15670
end
15771

72+
def show_cancel_button?
73+
@new_records.any? || @auto_matched_records.any? || @import_issues.any? ||
74+
@school_moves_from_file.any?
75+
end
76+
15877
def cancel_button_text
15978
@import.in_re_review? ? "Ignore changes" : "Cancel and delete upload"
16079
end
@@ -166,52 +85,4 @@ def approve_button_text
16685
"Approve and import records"
16786
end
16887
end
169-
170-
def render_section(title:, description:, summary:, changesets:, &block)
171-
return if changesets.blank?
172-
173-
helpers.safe_join(
174-
[
175-
tag.h2(title, class: "nhsuk-heading-m"),
176-
tag.p(description, class: "nhsuk-u-reading-width"),
177-
render_expander(summary:, &block)
178-
]
179-
)
180-
end
181-
182-
def render_expander(summary:, &block)
183-
tag.details(class: "nhsuk-details nhsuk-expander") do
184-
helpers.safe_join(
185-
[
186-
tag.summary(
187-
class: "nhsuk-details__summary",
188-
data: {
189-
module: "app-sticky"
190-
}
191-
) { tag.span(summary, class: "nhsuk-details__summary-text") },
192-
tag.div(class: "nhsuk-details__text", &block)
193-
]
194-
)
195-
end
196-
end
197-
198-
def render_button_group
199-
tag.div(class: "nhsuk-button-group") do
200-
helpers.safe_join(
201-
[
202-
helpers.govuk_button_to(
203-
approve_button_text,
204-
polymorphic_path([:approve, @import]),
205-
method: :post
206-
),
207-
helpers.govuk_button_to(
208-
cancel_button_text,
209-
polymorphic_path([:cancel, @import]),
210-
secondary: true,
211-
method: :post
212-
)
213-
]
214-
)
215-
end
216-
end
21788
end

0 commit comments

Comments
 (0)