Skip to content

Commit 969cfd7

Browse files
committed
Update review flow content
Updates statuses and colours based off UR findings. MAV-2515
1 parent 1d401a4 commit 969cfd7

6 files changed

Lines changed: 52 additions & 39 deletions

File tree

app/components/app_import_review_component.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,16 @@ def import_issues_message
105105

106106
def school_moves_message
107107
count = @school_moves.count
108-
"This upload includes #{count > 1 ? "children" : "child"} with a different school to " \
109-
"the one on their Mavis record. If you approve the upload, these will be flagged as " \
110-
"school moves needing review."
108+
if @import.is_a?(ClassImport)
109+
"This upload will change the school of the #{count > 1 ? "children" : "child"} listed below. " \
110+
"Children present in the class list will be moved into the school, and those who are not in the " \
111+
"class list will be moved out of the school. If you approve the upload, these will be flagged as " \
112+
"school moves needing review."
113+
else
114+
"This upload includes #{count} #{count > 1 ? "children" : "child"} with a different school to " \
115+
"the one on their Mavis record. If you approve the upload, these will be flagged as " \
116+
"school moves needing review."
117+
end
111118
end
112119

113120
def cancel_button_text

app/components/app_import_status_component.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def status_text
1515
"pending_import" => "Processing",
1616
"rows_are_invalid" => "Invalid",
1717
"changesets_are_invalid" => "Failed",
18-
"in_review" => "Needs review",
18+
"in_review" => "Review and approve",
1919
"calculating_re_review" => "Processing",
20-
"in_re_review" => "Needs re-review",
20+
"in_re_review" => "Review",
2121
"committing" => "Importing",
2222
"processed" => "Completed",
2323
"partially_processed" => "Partially completed",
@@ -31,9 +31,9 @@ def status_color
3131
"pending_import" => "blue",
3232
"rows_are_invalid" => "red",
3333
"changesets_are_invalid" => "red",
34-
"in_review" => "yellow",
34+
"in_review" => "blue",
3535
"calculating_re_review" => "blue",
36-
"in_re_review" => "yellow",
36+
"in_re_review" => "blue",
3737
"committing" => "blue",
3838
"processed" => "green",
3939
"partially_processed" => "green",

app/views/imports/imported_records.html.erb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
]) %>
66
<% end %>
77

8-
<%= h1 "Upload (#{import.created_at.to_fs(:long)})" %>
8+
<%= h1 "Further review and approve upload (#{import.created_at.to_fs(:long)})" %>
99

1010
<%= render AppImportSummaryComponent.new(import:) %>
1111

12-
<%= render AppSecondaryNavigationComponent.new do |nav| %>
13-
<%= nav.with_item(
14-
href: polymorphic_path([:re_review, import]),
15-
text: "Needs re-review",
16-
selected: request.path.ends_with?("/re_review"),
17-
) %>
18-
<% if @patients.present? %>
12+
<% if @patients.present? %>
13+
<%= render AppSecondaryNavigationComponent.new do |nav| %>
1914
<%= nav.with_item(
20-
href: polymorphic_path([:imported_records, import]),
21-
text: "Imported",
22-
selected: request.path.ends_with?("/imported_records"),
15+
href: polymorphic_path([:re_review, import]),
16+
text: "Needs further review",
17+
selected: request.path.ends_with?("/re_review"),
2318
) %>
19+
<%= nav.with_item(
20+
href: polymorphic_path([:imported_records, import]),
21+
text: "Imported",
22+
selected: request.path.ends_with?("/imported_records"),
23+
) %>
2424
<% end %>
2525
<% end %>
2626

2727
<% if @patients.present? %>
28-
<%= render AppPatientTableComponent.new(@patients, current_user:, count: @pagy.count) %>
28+
<%= render AppPatientTableComponent.new(@patients, current_user:, count: @pagy.count) %>
2929
<% else %>
3030
<p>No patients have been imported.</p>
3131
<% end %>

app/views/imports/re_review.html.erb

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,27 @@
55
]) %>
66
<% end %>
77

8-
<%= h1 "Upload (#{import.created_at.to_fs(:long)})" %>
8+
<%= h1 "Further review and approve upload (#{import.created_at.to_fs(:long)})" %>
99

1010
<%= render AppImportSummaryComponent.new(import:) %>
1111

12-
<%= render AppSecondaryNavigationComponent.new do |nav| %>
13-
<%= nav.with_item(
14-
href: polymorphic_path([:re_review, import]),
15-
text: "Needs re-review",
16-
selected: request.path.ends_with?("/re_review"),
17-
) %>
18-
<% if @patients.present? %>
12+
<% if @patients.present? %>
13+
<%= render AppSecondaryNavigationComponent.new do |nav| %>
1914
<%= nav.with_item(
20-
href: polymorphic_path([:imported_records, import]),
21-
text: "Imported",
22-
selected: request.path.ends_with?("/imported_records"),
15+
href: polymorphic_path([:re_review, import]),
16+
text: "Needs further review",
17+
selected: request.path.ends_with?("/re_review"),
2318
) %>
19+
<%= nav.with_item(
20+
href: polymorphic_path([:imported_records, import]),
21+
text: "Imported",
22+
selected: request.path.ends_with?("/imported_records"),
23+
) %>
2424
<% end %>
2525
<% end %>
2626

27-
<%= render AppWarningCalloutComponent.new(heading: "Changes since you approved this import") do %>
28-
<p>Since you approved this import, some records have been updated. Confirm that you want to import the following and override later changes.</p>
27+
<%= render AppWarningCalloutComponent.new(heading: "Changes since you uploaded this file") do %>
28+
<p>The records listed below have changed since you uploaded this file. This may be because another import was approved that includes some or all of the records in your file, or a child's school or NHS number may have changed in Mavis. You need to review these records again and confirm you still want to import the remaining changes from your file.</p>
2929
<% end %>
3030

3131
<%= render AppImportReviewComponent.new(

app/views/imports/show.html.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
]) %>
66
<% end %>
77

8-
<%= h1 "Upload (#{import.created_at.to_fs(:long)})" %>
8+
<% if import.in_review? %>
9+
<%= h1 "Review and approve upload (#{import.created_at.to_fs(:long)})" %>
10+
<% elsif import.in_re_review? %>
11+
<%= h1 "Further review and approve upload (#{import.created_at.to_fs(:long)})" %>
12+
<% else %>
13+
<%= h1 "Upload (#{import.created_at.to_fs(:long)})" %>
14+
<% end %>
915

1016
<%= render AppImportSummaryComponent.new(import: import) %>
1117

spec/features/import_class_list_review_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ def when_a_patient_is_moved_into_the_school
343343
def then_i_should_see_the_import_review_screen
344344
page.refresh
345345
click_on_most_recent_import(ClassImport)
346-
expect(page).to have_content("Needs review")
346+
expect(page).to have_content("Review and approve")
347347

348348
find(".nhsuk-details__summary", text: "1 new record").click
349349
expect(page).to have_content("KORS, Michael")
@@ -367,7 +367,7 @@ def then_i_should_see_the_import_review_screen
367367

368368
def then_i_should_see_the_first_import_review_screen
369369
click_on_most_recent_import(ClassImport)
370-
expect(page).to have_content("Needs review")
370+
expect(page).to have_content("Review and approve")
371371

372372
find(".nhsuk-details__summary", text: "4 new records").click
373373
expect(page).to have_content("KORS, Michael")
@@ -399,7 +399,7 @@ def then_i_should_see_the_second_import_review_screen
399399

400400
def then_i_should_see_the_import_review_screen_with_new_patients_only
401401
visit class_import_path(ClassImport.order(:created_at).last)
402-
expect(page).to have_content("Needs review")
402+
expect(page).to have_content("Review and approve")
403403

404404
find(".nhsuk-details__summary", text: "1 new record").click
405405
expect(page).to have_content("KLEIN, Calvin")
@@ -411,7 +411,7 @@ def then_i_should_see_the_import_review_screen_with_new_patients_only
411411

412412
def then_i_see_the_re_review_screen_for_school_moves_out_only
413413
visit class_import_path(ClassImport.order(:created_at).last)
414-
expect(page).to have_content("Needs re-review")
414+
expect(page).to have_content("Further review and approve")
415415

416416
find(".nhsuk-details__summary", text: "1 school move").click
417417
expect(page).to have_content("SMITH, John")
@@ -423,7 +423,7 @@ def then_i_see_the_re_review_screen_for_school_moves_out_only
423423
def and_the_import_is_in_re_review_again
424424
wait_for_import_to_complete_until_review(ClassImport)
425425
visit class_import_path(ClassImport.order(:created_at).first)
426-
expect(page).to have_content("Needs re-review")
426+
expect(page).to have_content("Further review and approve")
427427

428428
find(".nhsuk-details__summary", text: "3 school moves").click
429429
expect(page).to have_content("KLEIN, Calvin")
@@ -498,7 +498,7 @@ def when_i_go_back_to_the_first_import
498498
def then_i_see_the_import_needs_re_review
499499
wait_for_import_to_complete_until_review(ClassImport)
500500
visit class_import_path(ClassImport.order(:created_at).first)
501-
expect(page).to have_content("Needs re-review")
501+
expect(page).to have_content("Further review and approve")
502502
expect(ClassImport.first.changesets.processed.count).to eq(2)
503503
expect(ClassImport.first.changesets.ready_for_review.count).to eq(4)
504504
expect(ClassImport.first.changesets.from_file.ready_for_review.count).to eq(

0 commit comments

Comments
 (0)