diff --git a/app/components/related_organisation_search_component.html.erb b/app/components/related_organisation_search_component.html.erb deleted file mode 100644 index e77881bc9..000000000 --- a/app/components/related_organisation_search_component.html.erb +++ /dev/null @@ -1,14 +0,0 @@ -<%= form_with model: @user, url: path(current_user), method: "get", local: true do |f| %> - - <%= f.govuk_submit "Add" %> -<% end %> diff --git a/app/components/related_organisation_search_component.rb b/app/components/related_organisation_search_component.rb deleted file mode 100644 index 95ffe66cf..000000000 --- a/app/components/related_organisation_search_component.rb +++ /dev/null @@ -1,2 +0,0 @@ -class RelatedOrganisationSearchComponent < SearchComponent -end diff --git a/app/views/organisation_relationships/_related_organisation_select_question.html.erb b/app/views/organisation_relationships/_related_organisation_select_question.html.erb new file mode 100644 index 000000000..79821883e --- /dev/null +++ b/app/views/organisation_relationships/_related_organisation_select_question.html.erb @@ -0,0 +1,15 @@ +<% answers = [OpenStruct.new(id: 1, name: "test1", resource: nil), OpenStruct.new(id: 2, name: "test2", resource: nil)] %> +<%= f.govuk_select(question.id.to_sym, + label: legend(question, page_header, conditional), + "data-controller": "accessible-autocomplete", + caption: caption(caption_text, page_header, conditional), + hint: { text: question.hint_text&.html_safe }) do %> + <% answers.each do |answer| %> + + <% end %> +<% end %> diff --git a/app/views/organisation_relationships/add_housing_provider.html.erb b/app/views/organisation_relationships/add_housing_provider.html.erb index 2735591a4..b26befaa4 100644 --- a/app/views/organisation_relationships/add_housing_provider.html.erb +++ b/app/views/organisation_relationships/add_housing_provider.html.erb @@ -1,11 +1,19 @@ -<%= render partial: "organisations/headings", locals: { main: "What is the name of your housing provider?", sub: nil } %> -<%= render RelatedOrganisationSearchComponent.new(current_user:, search_label: "Start typing to search for your housing provider", value: @searched) %> -<%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> - + +<%= form_with model: nil, url: housing_providers_add_organisation_path, method: "post", local: true do |f| %> + <%# remove_other_page_errors(@log, @page) %> + <%#= f.govuk_error_summary %> + <%= render partial: "organisations/headings", locals: { main: "What is the name of your housing provider?", sub: nil } %> + <%#= render partial: "form/#{question.type}_question", locals: { question:, caption_text: @subsection.label, page_header: @page.header, lettings_log: @log, f:, conditional: false } %> + <%= f.govuk_submit "Add" %> + <%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %> + + <% end %> <% end %> + + diff --git a/config/routes.rb b/config/routes.rb index bb2252a4e..85f15229f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -81,6 +81,7 @@ Rails.application.routes.draw do get "schemes", to: "organisations#schemes" get "housing-providers", to: "organisation_relationships#housing_providers" get "housing-providers/add", to: "organisation_relationships#add_housing_provider" + post "housing-providers/add", to: "organisation_relationships#housing_providers" end end