diff --git a/app/controllers/organisation_relationships_controller.rb b/app/controllers/organisation_relationships_controller.rb index 4d9e75912..d622fd17b 100644 --- a/app/controllers/organisation_relationships_controller.rb +++ b/app/controllers/organisation_relationships_controller.rb @@ -49,23 +49,19 @@ class OrganisationRelationshipsController < ApplicationController if related_organisation_id.empty? @organisation.errors.add :related_organisation_id, "You must choose a housing provider" @organisations = Organisation.where.not(id: child_organisation_id).pluck(:id, :name) - render 'organisation_relationships/add_housing_provider' + render "organisation_relationships/add_housing_provider" return elsif OrganisationRelationship.exists?(child_organisation_id:, parent_organisation_id:, relationship_type:) @organisation.errors.add :related_organisation_id, "You have already added this housing provider" @organisations = Organisation.where.not(id: child_organisation_id).pluck(:id, :name) - render 'organisation_relationships/add_housing_provider' + render "organisation_relationships/add_housing_provider" return end - create(child_organisation_id:, parent_organisation_id:, relationship_type:) + create!(child_organisation_id:, parent_organisation_id:, relationship_type:) redirect_to housing_providers_organisation_path(related_organisation_id:) end - def create_managing_agent - create(child_organisation_id: related_organisation_id, parent_organisation_id: @organisation.id, relationship_type: 1) - end - - def create(child_organisation_id:, parent_organisation_id:, relationship_type:) + def create!(child_organisation_id:, parent_organisation_id:, relationship_type:) @resource = OrganisationRelationship.new(child_organisation_id:, parent_organisation_id:, relationship_type:) @resource.save! end diff --git a/app/frontend/styles/_accessible-autocomplete.scss b/app/frontend/styles/_accessible-autocomplete.scss index cb14ee4cf..a59b38f44 100644 --- a/app/frontend/styles/_accessible-autocomplete.scss +++ b/app/frontend/styles/_accessible-autocomplete.scss @@ -9,7 +9,7 @@ background-repeat: no-repeat; background-size: 1em 1em; background-position: 7px center; - padding-left: govuk-spacing(6) !important; + text-indent: govuk-spacing(6); } .autocomplete__option__append { @@ -18,7 +18,7 @@ .autocomplete__hint { font-family: inherit; - padding-left: govuk-spacing(6) !important; + text-indent: govuk-spacing(6); } .autocomplete__option__hint { diff --git a/app/views/form/review.html.erb b/app/views/form/review.html.erb index 59e0bde40..127e52762 100644 --- a/app/views/form/review.html.erb +++ b/app/views/form/review.html.erb @@ -1,7 +1,7 @@ <% content_for :title, "Review lettings log" %> <% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { "Logs" => "/logs", - "Log #{@log.id}" => "/logs/#{@log.id}", + "Log #{@log.id}" => "/lettings-logs/#{@log.id}", "Review lettings log" => "", }) %> diff --git a/app/views/organisation_relationships/add_housing_provider.html.erb b/app/views/organisation_relationships/add_housing_provider.html.erb index 94beaf7b4..638d0e00f 100644 --- a/app/views/organisation_relationships/add_housing_provider.html.erb +++ b/app/views/organisation_relationships/add_housing_provider.html.erb @@ -20,8 +20,9 @@ <% answer_options[organisation[0]] = organisation[1] %> <% end %> <%= render partial: "organisation_relationships/related_organisation_select_question", locals: { - question: Form::Question.new("", {"answer_options" => answer_options}, nil), - f: } %> + question: Form::Question.new("", { "answer_options" => answer_options }, nil), + f:, + } %> <%= f.govuk_submit "Add" %> <%= govuk_details(summary_text: "Can't find the housing provider you're looking for?") do %>