Skip to content

Commit

Permalink
remove legacy_form_embed
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwoldatwork authored and sanason committed Oct 24, 2024
1 parent 3caa2c8 commit e4f211d
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 892 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/fba2', formats: :js, locals: { form: @form })
end

def new
Expand Down Expand Up @@ -581,7 +577,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/fba2', formats: :js, locals: { form: @form })
end

private
Expand Down
6 changes: 1 addition & 5 deletions app/models/form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,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/fba2', formats: :js, locals: { touchpoint: 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 e4f211d

Please sign in to comment.