diff --git a/app/frontend/controllers/index.js b/app/frontend/controllers/index.js index 35385e46e..944e32e2d 100644 --- a/app/frontend/controllers/index.js +++ b/app/frontend/controllers/index.js @@ -19,8 +19,6 @@ import FilterLayoutController from './filter_layout_controller.js' import TabsController from './tabs_controller.js' -import OrganisationsController from './organisations_controller.js' - application.register('accessible-autocomplete', AccessibleAutocompleteController) application.register('conditional-filter', ConditionalFilterController) application.register('conditional-question', ConditionalQuestionController) @@ -29,4 +27,3 @@ application.register('numeric-question', NumericQuestionController) application.register('filter-layout', FilterLayoutController) application.register('search', SearchController) application.register('tabs', TabsController) -application.register('organisations', OrganisationsController) diff --git a/app/frontend/controllers/organisations_controller.js b/app/frontend/controllers/organisations_controller.js deleted file mode 100644 index 855081dab..000000000 --- a/app/frontend/controllers/organisations_controller.js +++ /dev/null @@ -1,14 +0,0 @@ -import { Controller } from '@hotwired/stimulus' - -export default class extends Controller { - static targets = ["groupSelect"] - - connect() { - this.toggleGroupSelect() - } - - toggleGroupSelect() { - const groupMemberYes = this.element.querySelector('input[name="organisation[group_member]"]:checked')?.value === 'true' - this.groupSelectTarget.style.display = groupMemberYes ? 'block' : 'none' - } -} diff --git a/app/views/organisations/new.html.erb b/app/views/organisations/new.html.erb index 0b3c85cbd..68040ece6 100644 --- a/app/views/organisations/new.html.erb +++ b/app/views/organisations/new.html.erb @@ -56,23 +56,24 @@ :name, legend: { text: "Does the organisation hold its own stock?", size: "m" } %> - <%= f.govuk_collection_radio_buttons :group_member, - [OpenStruct.new(id: true, name: "Yes"), OpenStruct.new(id: false, name: "No")], - :id, - :name, - legend: { text: "Is this organisation part of a housing provider group structure?", size: "m" }, - "data-action": "change->group-member#toggleGroupSelect" %> - <% group_organisation_options = Organisation.visible.map { |org| OpenStruct.new(id: org.id, name: org.name) } %> -