Skip to content

Commit

Permalink
Update session edit page
Browse files Browse the repository at this point in the history
This updates the session edit page to match the latest designs in the
prototype.
  • Loading branch information
thomasleese committed Sep 27, 2024
1 parent e6094c8 commit aa4d437
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/components/app_session_summary_card_component.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

class AppSessionSummaryCardComponent < ViewComponent::Base
def initialize(session:)
def initialize(session)
super

@session = session
Expand Down
18 changes: 9 additions & 9 deletions app/views/sessions/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<% page_title = "Session details" %>
<% content_for :before_main do %>
<%= render AppBreadcrumbComponent.new(items: [
{ text: "Home", href: dashboard_path },
{ text: t("sessions.index.title"), href: sessions_path },
{ text: session_location(@session), href: session_path(@session) },
]) %>
<%= render AppBacklinkComponent.new(
href: session_path(@session),
name: session_location(@session),
) %>
<% end %>
<%= h1 page_title %>
<%= h1 "Edit session" do %>
<span class="nhsuk-caption-l"><%= session_location(@session) %></span>
Edit session
<% end %>
<%= render AppSessionSummaryCardComponent.new(session: @session) %>
<%= render AppSessionSummaryCardComponent.new(@session) %>
2 changes: 1 addition & 1 deletion app/views/sessions/edit/confirm.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= h1 "Check and confirm details" %>
<%= render AppSessionSummaryCardComponent.new(session: @session) %>
<%= render AppSessionSummaryCardComponent.new(@session) %>
<% if @session.send_consent_requests_at.today? %>
<%= govuk_inset_text do %>
Expand Down
5 changes: 2 additions & 3 deletions spec/components/app_session_summary_card_component_spec.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# frozen_string_literal: true

describe AppSessionSummaryCardComponent do
subject { page }
subject(:rendered) { render_inline(component) }

before { render_inline(component) }
let(:component) { described_class.new(session) }

let(:component) { described_class.new(session:) }
let(:date) { Date.new(2024, 1, 1) }
let(:close_consent_at) { date }
let(:session) { create(:session, date:, close_consent_at:) }
Expand Down

0 comments on commit aa4d437

Please sign in to comment.