Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/presenters/online_reschedule_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ def date
previous_start_at.strftime(DATE_FORMAT)
end

def new_date
appointment.start_at.strftime(DATE_FORMAT)
end

def reference
appointment.id
end
Expand Down
4 changes: 3 additions & 1 deletion app/views/online_reschedulings/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
<th>Customer</th>
<th>Guider</th>
<th>Original Date/Time</th>
<th>New Date/Time</th>
<th>Rescheduled At</th>
<% unless current_user.tpas? %>
<th>Processed</th>
Expand All @@ -61,10 +62,11 @@
<% @results.each do |result| %>
<% result = OnlineReschedulePresenter.new(result) %>
<tr class="appointment-search-results__row t-result">
<td class="appointment-search-results__item"><b class="visible-xs-block">Reference</b><span class="id js-allow-highlighting t-id">#<%= result.reference %></span></td>
<td class="appointment-search-results__item"><b class="visible-xs-block">Reference</b><span class="id t-id"><%= link_to "##{result.reference}", appointment_path(result) %></a></span></td>
<td class="appointment-search-results__item"><b class="visible-xs-block">Customer</b><span class="js-allow-highlighting t-name"><%= result.customer_name %></span></td>
<td class="appointment-search-results__item"><b class="visible-xs-block">Guider</b><span class="js-allow-highlighting t-previous-guider-name"><%= result.previous_guider_name %></span> <small>(<%= result.previous_guider_organisation %>)</small></td>
<td class="appointment-search-results__item t-appointment-date-time"><b class="visible-xs-block">Original Date/Time</b><%= result.date %></td>
<td class="appointment-search-results__item t-appointment-new-date-time"><b class="visible-xs-block">New Date/Time</b><%= result.new_date %></td>
<td class="appointment-search-results__item t-rescheduled-date-time"><b class="visible-xs-block">Rescheduled At</b><%= result.rescheduled_at %></td>
<% unless current_user.tpas? %>
<td class="appointment-search-results__item t-processed"><b class="visible-xs-block">Processed</b><%= processed_label(result) %></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def they_see_the_rescheduled_appointments
expect(result.customer_name).to have_text(@first.name)
expect(result.previous_guider_name).to have_text(@first.previous_guider.name)
expect(result.appointment_date_time).to have_text('01 February 2025 12:00')
expect(result.appointment_new_date_time).to have_text('02 February 2025 13:00')
expect(result.rescheduled_date_time).to have_text('30 January 2025 13:00')
expect(result.processed).to have_text('Yes')
end
Expand Down
1 change: 1 addition & 0 deletions spec/support/pages/online_reschedulings_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class OnlineReschedulingsSearch < Base
element :customer_name, '.t-name'
element :previous_guider_name, '.t-previous-guider-name'
element :appointment_date_time, '.t-appointment-date-time'
element :appointment_new_date_time, '.t-appointment-new-date-time'
element :rescheduled_date_time, '.t-rescheduled-date-time'
element :processed, '.t-processed'
end
Expand Down
Loading