Browse Source

Add registration number to organisation details views (#815)

* Add registration number to organisation details views

* Downcase data-qa value
pull/818/head
baarkerlounger 2 years ago committed by GitHub
parent
commit
6fb8e44393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      app/models/organisation.rb
  2. 2
      app/views/organisations/show.html.erb

17
app/models/organisation.rb

@ -63,15 +63,16 @@ class Organisation < ApplicationRecord
def display_attributes def display_attributes
[ [
{ name: "name", value: name, editable: true }, { name: "Name", value: name, editable: true },
{ name: "address", value: address_string, editable: true }, { name: "Address", value: address_string, editable: true },
{ name: "telephone_number", value: phone, editable: true }, { name: "Telephone_number", value: phone, editable: true },
{ name: "type", value: display_provider_type, editable: false }, { name: "Type of provider", value: display_provider_type, editable: false },
{ name: "rent_periods", value: rent_period_labels, editable: false, format: :bullet }, { name: "Registration number", value: housing_registration_no || "", editable: false },
{ name: "Rent_periods", value: rent_period_labels, editable: false, format: :bullet },
{ name: "Owns housing stock", value: holds_own_stock ? "Yes" : "No", editable: false }, { name: "Owns housing stock", value: holds_own_stock ? "Yes" : "No", editable: false },
{ name: "other_stock_owners", value: other_stock_owners, editable: false }, { name: "Other stock owners", value: other_stock_owners, editable: false },
{ name: "managing_agents", value: managing_agents, editable: false }, { name: "Managing agents", value: managing_agents, editable: false },
{ name: "data_protection_agreement", value: data_protection_agreement_string, editable: false }, { name: "Data protection agreement", value: data_protection_agreement_string, editable: false },
] ]
end end
end end

2
app/views/organisations/show.html.erb

@ -22,7 +22,7 @@
<% row.action( <% row.action(
visually_hidden_text: attr[:name].to_s.humanize.downcase, visually_hidden_text: attr[:name].to_s.humanize.downcase,
href: edit_organisation_path, href: edit_organisation_path,
html_attributes: { "data-qa": "change-#{attr[:name]}" }, html_attributes: { "data-qa": "change-#{attr[:name].downcase}" },
) %> ) %>
<% end %> <% end %>
<% else %> <% else %>

Loading…
Cancel
Save