diff --git a/app/components/create_log_actions_component.rb b/app/components/create_log_actions_component.rb index 11c63c3a9..4b451c2cc 100644 --- a/app/components/create_log_actions_component.rb +++ b/app/components/create_log_actions_component.rb @@ -14,9 +14,8 @@ class CreateLogActionsComponent < ViewComponent::Base def display_actions? return false if bulk_upload.present? return true if user.support? - return false if !user.organisation.holds_own_stock? && user.organisation.stock_owners.empty? && user.organisation.absorbed_organisations.empty? - user.organisation.data_protection_confirmed? + user.organisation.data_protection_confirmed? && user.organisation.organisation_or_stock_owner_signed_dsa_and_holds_own_stock? end def create_button_href diff --git a/app/components/data_protection_confirmation_banner_component.rb b/app/components/data_protection_confirmation_banner_component.rb index 745c79e20..7ce852ae0 100644 --- a/app/components/data_protection_confirmation_banner_component.rb +++ b/app/components/data_protection_confirmation_banner_component.rb @@ -13,13 +13,16 @@ class DataProtectionConfirmationBannerComponent < ViewComponent::Base def display_banner? return false if user.support? && organisation.blank? return true if org_without_dpo? + return false if !org_or_user_org.holds_own_stock? && org_or_user_org.stock_owners.empty? && org_or_user_org.absorbed_organisations.empty? - !org_or_user_org.data_protection_confirmed? + !org_or_user_org.data_protection_confirmed? || !org_or_user_org.organisation_or_stock_owner_signed_dsa_and_holds_own_stock? end def header_text if org_without_dpo? "To create logs your organisation must state a data protection officer. They must sign the Data Sharing Agreement." + elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + "Your organisation does not own stock. To create logs your stock owner(s) must accept the Data Sharing Agreement on CORE." elsif user.is_dpo? "Your organisation must accept the Data Sharing Agreement before you can create any logs." else @@ -28,7 +31,7 @@ class DataProtectionConfirmationBannerComponent < ViewComponent::Base end def banner_text - if org_without_dpo? || user.is_dpo? + if org_without_dpo? || user.is_dpo? || !org_or_user_org.holds_own_stock? govuk_link_to( link_text, link_href, @@ -50,13 +53,21 @@ private def link_text if dpo_required? "Contact helpdesk to assign a data protection officer" + elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + "View or add stock owners" else "Read the Data Sharing Agreement" end end def link_href - dpo_required? ? GlobalConstants::HELPDESK_URL : data_sharing_agreement_organisation_path(org_or_user_org) + if dpo_required? + GlobalConstants::HELPDESK_URL + elsif !org_or_user_org.holds_own_stock? && org_or_user_org.data_protection_confirmed? + stock_owners_organisation_path(org_or_user_org) + else + data_sharing_agreement_organisation_path(org_or_user_org) + end end def dpo_required? diff --git a/app/components/lettings_log_summary_component.html.erb b/app/components/lettings_log_summary_component.html.erb index 1845a155f..a24ca6046 100644 --- a/app/components/lettings_log_summary_component.html.erb +++ b/app/components/lettings_log_summary_component.html.erb @@ -1,6 +1,6 @@
-
+

<%= govuk_link_to lettings_log_path(log) do %> @@ -8,20 +8,14 @@ <% end %>

<% if log.tenancycode? or log.propcode? %> - +
<% end %> <% if log.needstype? or log.startdate? %> @@ -51,7 +45,7 @@ <% end %>
-