From c0abcea4570dc4e4c13a1861a62399397dfd2e47 Mon Sep 17 00:00:00 2001 From: JG Date: Wed, 29 Jun 2022 11:44:57 +0100 Subject: [PATCH] checking for stock owning org selection --- app/views/schemes/new.html.erb | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/app/views/schemes/new.html.erb b/app/views/schemes/new.html.erb index f74ae4b44..24fa1c90e 100644 --- a/app/views/schemes/new.html.erb +++ b/app/views/schemes/new.html.erb @@ -18,7 +18,7 @@ <%= f.govuk_text_field :service_name, label: { text: "Scheme name", size: "m" }, - hint: { text: "This is how you’ll refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> + hint: { text: "This is how you refer to this supported housing scheme within your organisation. For example, the name could relate to the address or location. You’ll be able to see the client group when selecting it." } %> <%= f.govuk_check_box :sensitive, "Yes", @@ -26,18 +26,24 @@ multiple: false, label: { text: "This scheme contains confidential information" } %> - <% if current_user.support? %> - <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> - <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> - <% answer_options = null_option + organisations %> + <% null_option = [OpenStruct.new(id: "", name: "Select an option")] %> + <% organisations = Organisation.all.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> + <% answer_options = null_option + organisations %> + + <%= f.govuk_collection_select :stock_owning_organisation_id, + answer_options, + :id, + :name, + label: { text: "Which organisation owns the housing stock for this scheme?", size: "m" }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> + <% if current_user.support? %> <%= f.govuk_collection_select :organisation_id, - answer_options, - :id, - :name, - label: { text: "Which organisation manages this scheme", size: "m" }, - hint: { text: "Enter organisation name" }, - "data-controller": %w[accessible-autocomplete conditional-filter] %> + answer_options, + :id, + :name, + label: { text: "Which organisation manages this scheme", size: "m" }, + "data-controller": %w[accessible-autocomplete conditional-filter] %> <% end %> <% if current_user.data_coordinator? %>