Browse Source
* CLDC-2056 Add absorbing organisation question * Handle next page and previous_template with `page` * Hardcode backlinks * Refactor flow to store value when selecting new org option * Handle unanswered question * Update error copypull/1595/head
Jack
2 years ago
committed by
GitHub
11 changed files with 269 additions and 66 deletions
@ -0,0 +1,37 @@
|
||||
<% content_for :before_content do %> |
||||
<% title = "Tell us if your organisation is merging" %> |
||||
<% content_for :title, title %> |
||||
<%= govuk_back_link href: organisations_merge_request_path(id: @merge_request) %> |
||||
<% end %> |
||||
|
||||
<h2 class="govuk-heading-l">Which organisation is absorbing the others?</h2> |
||||
|
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-two-thirds-from-desktop"> |
||||
<p class="govuk-body">Select the organisation that the other organisations are merging into.</p> |
||||
|
||||
<%= form_with model: @merge_request, url: merge_request_path, method: :patch do |f| %> |
||||
<%= f.govuk_error_summary %> |
||||
|
||||
<%= f.govuk_radio_buttons_fieldset( |
||||
:absorbing_organisation_id, |
||||
hint: { text: "For example, if Skype and Yammer merged into Microsoft, you would select Microsoft." }, |
||||
legend: nil, |
||||
) do %> |
||||
<% @merge_request.merging_organisations.order(:name).each do |org| %> |
||||
<%= f.govuk_radio_button( |
||||
:absorbing_organisation_id, |
||||
org.id, |
||||
label: { text: org.name }, |
||||
) %> |
||||
<% end %> |
||||
<%= f.govuk_radio_divider %> |
||||
<%= f.govuk_radio_button :absorbing_organisation_id, "other", checked: @merge_request.new_absorbing_organisation?, label: { text: "These organisations are merging into a new one" } %> |
||||
<% end %> |
||||
|
||||
<%= f.hidden_field :page, value: "absorbing_organisation" %> |
||||
|
||||
<%= f.govuk_submit %> |
||||
<% end %> |
||||
</div> |
||||
</div> |
@ -0,0 +1,13 @@
|
||||
<% content_for :before_content do %> |
||||
<% title = "Tell us if your organisation is merging" %> |
||||
<% content_for :title, title %> |
||||
<%= govuk_back_link href: absorbing_organisation_merge_request_path(id: @merge_request) %> |
||||
<% end %> |
||||
|
||||
<h2 class="govuk-heading-l">What is <%= @merge_request.absorbing_organisation.name %>'s telephone number?</h2> |
||||
|
||||
<div class="govuk-grid-row"> |
||||
<div class="govuk-grid-column-two-thirds-from-desktop"> |
||||
<p class="govuk-body">Confirm the telephone number on file, or enter a new one.</p> |
||||
</div> |
||||
</div> |
@ -0,0 +1,7 @@
|
||||
<% content_for :before_content do %> |
||||
<% title = "Tell us if your organisation is merging" %> |
||||
<% content_for :title, title %> |
||||
<%= govuk_back_link href: absorbing_organisation_merge_request_path(id: @merge_request) %> |
||||
<% end %> |
||||
|
||||
Provide new org name |
@ -0,0 +1,8 @@
|
||||
class AddAbsorbingOrganisationToMergeRequest < ActiveRecord::Migration[7.0] |
||||
def change |
||||
change_table :merge_requests, bulk: true do |t| |
||||
t.column :absorbing_organisation_id, :integer |
||||
t.column :new_absorbing_organisation, :boolean |
||||
end |
||||
end |
||||
end |
Loading…
Reference in new issue