Skip to content

Commit

Permalink
remove legacy_form_embed
Browse files Browse the repository at this point in the history
* rename fba2 to fba

---------

Co-authored-by: Shelley Nason <[email protected]>
  • Loading branch information
ryanwoldatwork and sanason authored Dec 6, 2024
1 parent fc0ea38 commit c849a16
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 1,005 deletions.
7 changes: 1 addition & 6 deletions app/controllers/admin/forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,7 @@ def example
end

def js
if @form.legacy_form_embed
render(partial: 'components/widget/fba', formats: :js, locals: { form: @form })
else
render(partial: 'components/widget/fba2', formats: :js, locals: { form: @form })
end
render(partial: 'components/widget/fba', formats: :js, locals: { form: @form })
end

def new
Expand Down Expand Up @@ -582,7 +578,6 @@ def form_admin_options_params
:organization_id,
:user_id,
:template,
:legacy_form_embed,
:kind,
:aasm_state,
:early_submission,
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/touchpoints_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@ def show

def js
@form.increment!(:survey_form_activations)
if @form.legacy_form_embed || (params[:legacy] && params[:legacy] == '1')
render(partial: 'components/widget/fba', formats: :js, locals: { form: @form })
else
render(partial: 'components/widget/fba2', formats: :js, locals: { form: @form })
end
render(partial: 'components/widget/fba', formats: :js, locals: { form: @form })
end

private
Expand Down
7 changes: 1 addition & 6 deletions app/models/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ def duplicate!(new_user:)
new_form.legacy_touchpoint_uuid = nil
new_form.notification_emails = nil
new_form.organization = new_user.organization
new_form.legacy_form_embed = false
new_form.template = false
new_form.save!

Expand Down Expand Up @@ -295,11 +294,7 @@ def deployable_form?
# returns javascript text that can be used standalone
# or injected into a GTM Container Tag
def touchpoints_js_string
if self.legacy_form_embed
ApplicationController.new.render_to_string(partial: 'components/widget/fba', formats: :js, locals: { touchpoint: self })
else
ApplicationController.new.render_to_string(partial: 'components/widget/fba2', formats: :js, locals: { touchpoint: self })
end
ApplicationController.new.render_to_string(partial: 'components/widget/fba', formats: :js, locals: { form: self })
end

def non_flagged_submissions(start_date: nil, end_date: nil)
Expand Down
15 changes: 0 additions & 15 deletions app/views/admin/forms/_admin_options.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,6 @@
</div>
</fieldset>
</div>
<div class="grid-col-12 padding-top-2">
<fieldset class="usa-fieldset">
<legend class="usa-sr-only">Form Template?</legend>
<div class="usa-checkbox">
<%= f.check_box :legacy_form_embed, class: "usa-checkbox__input" %>
<%= f.label :legacy_form_embed, class: "usa-checkbox__label" do %>
Render legacy _fba.js.erb?
&nbsp;
<span class="usa-hint font-sans-2xs">
Renders the old form as a fallback for certain clients who may have script customizations based on the old version.
</span>
<% end %>
</div>
</fieldset>
</div>
</div>
<p class="margin-top-4">
<%= f.submit (@form.persisted? ? "Update Form Admin Options " : "Create Form"), class: "usa-button" %>
Expand Down
Loading

0 comments on commit c849a16

Please sign in to comment.