5 changed files with 172 additions and 2 deletions
@ -0,0 +1,5 @@
|
||||
module MergeRequestsHelper |
||||
def display_value_or_placeholder(value, placeholder = "You didn't answer this question") |
||||
value.presence || content_tag(:span, placeholder, class: "app-!-colour-muted") |
||||
end |
||||
end |
||||
@ -0,0 +1,158 @@
|
||||
<% content_for :before_content do %> |
||||
<% title = "Merge details: #{@merge_request.absorbing_organisation_name}" %> |
||||
<% content_for :title, title %> |
||||
|
||||
<%= govuk_back_link href: "#{organisations_path}#merge-requests" %> |
||||
<% end %> |
||||
<% unless @merge_request.signed_dsa %> |
||||
<div class="govuk-notification-banner" role="region" aria-labelledby="govuk-notification-banner-title" data-module="govuk-notification-banner"> |
||||
<div class="govuk-notification-banner__header"> |
||||
<h2 class="govuk-notification-banner__title" id="govuk-notification-banner-title"> |
||||
Important |
||||
</h2> |
||||
</div> |
||||
<div class="govuk-notification-banner__content"> |
||||
<strong>The absorbing organisation must accept the Data Sharing Agreement before merging.</strong> |
||||
<p>Contact the Data Protection Officer: |
||||
<% if @merge_request.dpo_user %> |
||||
<%= link_to @merge_request.dpo_user.name, user_path(@merge_request.dpo_user.id) %> |
||||
<% else %> |
||||
None belong to the organisation |
||||
<% end %> |
||||
</p> |
||||
</div> |
||||
</div> |
||||
<% end %> |
||||
<h1 class="govuk-heading-l"> |
||||
<span class="govuk-caption-l">Merge details</span> |
||||
<%= @merge_request.absorbing_organisation_name %> |
||||
</h1> |
||||
<div class="govuk-button-group"> |
||||
<button type="submit" <%= @merge_request.status == "ready_to_merge" ? "" : "disabled aria-disabled=\"true\"" %> class="govuk-button" data-module="govuk-button"> |
||||
Begin merge |
||||
</button> |
||||
<button type="submit" <%= @merge_request.status != "request_merged" ? "" : "disabled aria-disabled=\"true\"" %> class="govuk-button govuk-button--warning" data-module="govuk-button"> |
||||
Delete merge request |
||||
</button> |
||||
</div> |
||||
|
||||
<table class="govuk-table govuk-!-width-three-quarters" style="border: 1px solid #b1b4b6;"> |
||||
<thead class="govuk-table__head"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="col" colspan="3" class="govuk-table__header govuk-!-font-weight-regular govuk-!-padding-3" style="background-color:#f3f2f1">Request details</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody class="govuk-table__body app-table-group"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4">Requester</th> |
||||
<td class="govuk-table__cell govuk-!-width-one-half govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4"><%= display_value_or_placeholder(@merge_request.requesting_user&.name) %></td> |
||||
<td class="govuk-table__cell govuk-!-width-one-quarter-width govuk-!-padding-2 govuk-!-padding-top-4 govuk-!-text-align-right" style="width: 10%;"></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9">Helpdesk ticket</th> |
||||
<% ticket_base_url = "https://dluhcdigital.atlassian.net/browse/" %> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"> |
||||
<% if @merge_request.helpdesk_ticket.blank? %> |
||||
<%= display_value_or_placeholder(nil) %> |
||||
<% else %> |
||||
<a href="<%= ticket_base_url + @merge_request.helpdesk_ticket %>" target="_blank" rel="noopener noreferrer" title="<%= @merge_request.helpdesk_ticket %> (opens in a new tab)"> |
||||
<%= @merge_request.helpdesk_ticket %> (opens in a new tab) |
||||
</a> |
||||
<% end %> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="Change helpdesk ticket">Change</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-bottom-5">Status</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"><%= status_tag(@merge_request.status) %></td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"></td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
|
||||
<table class="govuk-table govuk-!-width-three-quarters" style="border: 1px solid #b1b4b6;"> |
||||
<thead class="govuk-table__head"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="col" colspan="3" class="govuk-table__header govuk-!-font-weight-regular govuk-!-padding-3" style="background-color:#f3f2f1">Merge details</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody class="govuk-table__body app-table-group"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4">Absorbing organisation</th> |
||||
<td class="govuk-table__cell govuk-!-width-one-half govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4"><%= display_value_or_placeholder(@merge_request.absorbing_organisation_name) %></td> |
||||
<td class="govuk-table__cell govuk-!-width-one-quarter-width govuk-!-padding-2 govuk-!-padding-top-4 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="Change absorbing organisation">Change</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9">Merging organisations</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"> |
||||
<% if @merge_request.other_merging_organisations.blank? %> |
||||
<%= display_value_or_placeholder(nil) %> |
||||
<% else %> |
||||
<% @merge_request.other_merging_organisations.split(',').each do |organisation| %> |
||||
<p class="govuk-!-padding-bottom-1 govuk-!-margin-0"><%= organisation.strip %></p> |
||||
<% end %> |
||||
<% end %> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="Change merging organisations">Change</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-bottom-5">Merge date</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"><%= display_value_or_placeholder(@merge_request.merge_date) %></td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="Change merge date">Change</a></td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
|
||||
<table class="govuk-table govuk-!-width-three-quarters" style="border: 1px solid #b1b4b6;"> |
||||
<thead class="govuk-table__head"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="col" colspan="3" class="govuk-table__header govuk-!-font-weight-regular govuk-!-padding-3" style="background-color:#f3f2f1">Merge outcomes</th> |
||||
</tr> |
||||
</thead> |
||||
<tbody class="govuk-table__body app-table-group"> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4">Total users after merge</th> |
||||
<td class="govuk-table__cell govuk-!-width-one-half govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-top-4"><%= display_value_or_placeholder(@merge_request.total_users) %></td> |
||||
<td class="govuk-table__cell govuk-!-width-one-quarter-width govuk-!-padding-2 govuk-!-padding-top-4 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="View all users after merge">View</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9">Total schemes after merge</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"><%= display_value_or_placeholder(@merge_request.total_schemes) %></td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="View all schemes after merge">View</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9">Total logs after merge</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"> |
||||
<% if @merge_request.total_lettings_logs.blank? && @merge_request.total_sales_logs.blank? %> |
||||
<%= display_value_or_placeholder(nil) %> |
||||
<% else %> |
||||
<% unless @merge_request.total_lettings_logs.blank? %> |
||||
<%= @merge_request.total_lettings_logs %> lettings logs |
||||
<% end %> |
||||
<br> |
||||
<% unless @merge_request.total_sales_logs.blank? %> |
||||
<%= @merge_request.total_sales_logs %> sales logs |
||||
<% end %> |
||||
<% end %> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="View all lettings and sales logs after merge">View</a></td> |
||||
</tr> |
||||
<tr class="govuk-table__row"> |
||||
<th scope="row" class="govuk-table__header govuk-!-padding-2 govuk-!-padding-right-9 govuk-!-padding-bottom-5">Total stock owners & managing agents after merge</th> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-padding-right-9"> |
||||
<% if @merge_request.total_stock_owners.blank? && @merge_request.total_managing_agents.blank? %> |
||||
<%= display_value_or_placeholder(nil) %> |
||||
<% else %> |
||||
<% unless @merge_request.total_stock_owners.blank? %> |
||||
<%= @merge_request.total_stock_owners %> stock owners |
||||
<% end %> |
||||
<br> |
||||
<% unless @merge_request.total_managing_agents.blank? %> |
||||
<%= @merge_request.total_managing_agents %> managing agents |
||||
<% end %> |
||||
<% end %> |
||||
</td> |
||||
<td class="govuk-table__cell govuk-!-padding-2 govuk-!-text-align-right" style="width: 10%;"><a href="#" aria-label="View all stock owners and managing agents after merge">View</a></td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
Loading…
Reference in new issue