Skip to content

Commit 2a3839a

Browse files
authored
Merge pull request #6574 from NHSDigital/design-review-april
April design review
2 parents fe7a3ff + 96c269c commit 2a3839a

21 files changed

Lines changed: 97 additions & 118 deletions

app/assets/stylesheets/components/_filters.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
padding-left: nhsuk-spacing(3);
1515
background-color: nhsuk-colour("grey-1");
1616

17+
@include nhsuk-font-size(22);
18+
1719
// stylelint-disable-next-line max-nesting-depth
1820
@include nhsuk-media-query($from: tablet) {
1921
margin-left: #{nhsuk-spacing(-4) - 1px};
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
@forward "details";
22
@forward "summary-list";
3-
@forward "tables";

app/assets/stylesheets/vendor/nhsuk-frontend/overrides/_tables.scss

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

app/components/app_location_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(location, patient_count:, next_session_date:, heading_level: 4)
1010

1111
def call
1212
render AppCardComponent.new(link_to:, compact: true) do |card|
13-
card.with_heading(level: @heading_level) { heading }
13+
card.with_heading(level: @heading_level, size: "s") { heading }
1414
govuk_summary_list(rows:)
1515
end
1616
end

app/components/app_patient_search_result_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def initialize(
3838

3939
def call
4040
render AppCardComponent.new(link_to:, compact: true) do |card|
41-
card.with_heading(level: @heading_level) do
41+
card.with_heading(level: @heading_level, size: "s") do
4242
patient.full_name_with_known_as
4343
end
4444
govuk_summary_list(rows:)

app/components/app_patient_session_search_result_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def initialize(
3636

3737
def call
3838
render AppCardComponent.new(link_to: card_link, compact: true) do |card|
39-
card.with_heading(level: @heading_level) { heading }
39+
card.with_heading(level: @heading_level, size: "s") { heading }
4040
safe_join([summary_list, registration_buttons].compact)
4141
end
4242
end

app/components/app_session_actions_component.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ class AppSessionActionsComponent < ViewComponent::Base
66
<% card.with_heading(level: 3) { "Action required" } %>
77
<% if rows.any? %>
88
<%= govuk_summary_list(rows:) %>
9-
<% else %>
10-
<p>No action required</p>
9+
<% end %>
10+
<% if policy(session).invite_to_clinic? %>
11+
<%= render AppActionLinkComponent.new(
12+
href: edit_session_invite_to_clinic_path(@session),
13+
text: "Send clinic invitations",
14+
) %>
1115
<% end %>
1216
<% end %>
1317
ERB

app/components/app_session_buttons_component.rb

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

app/components/app_session_card_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def initialize(
2323

2424
def call
2525
render AppCardComponent.new(link_to:, compact: true) do |card|
26-
card.with_heading(level: @heading_level) { heading }
26+
card.with_heading(level: @heading_level, size: "s") { heading }
2727
safe_join([summary_list, button_group].compact)
2828
end
2929
end

app/components/app_session_details_component.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class AppSessionDetailsComponent < ViewComponent::Base
44
erb_template <<-ERB
55
<%= render AppCardComponent.new do |card| %>
6-
<% card.with_heading(level: 3) { "Session details" } %>
6+
<% card.with_heading(level: 3, actions:) { "Session details" } %>
77
<%= render AppSessionSummaryComponent.new(
88
session,
99
patient_count: session.patients.count,
@@ -13,6 +13,11 @@ class AppSessionDetailsComponent < ViewComponent::Base
1313
show_status: true,
1414
show_consent_style: true
1515
) %>
16+
<% if helpers.policy(session).edit? %>
17+
<%= govuk_button_link_to "Download offline spreadsheet",
18+
session_path(session, format: :xlsx),
19+
secondary: true %>
20+
<% end %>
1621
<% end %>
1722
ERB
1823

@@ -25,4 +30,10 @@ def initialize(session)
2530
attr_reader :session
2631

2732
delegate :govuk_button_link_to, to: :helpers
33+
34+
def actions
35+
return [] unless helpers.policy(session).edit?
36+
37+
[{ text: "Edit session", href: helpers.edit_session_path(session) }]
38+
end
2839
end

0 commit comments

Comments
 (0)