Skip to content

Rm early submission #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions app/controllers/admin/forms_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ def form_params
:hisp,
:template,
:kind,
:early_submission,
:notes,
:status,
:title,
Expand Down Expand Up @@ -583,7 +582,6 @@ def form_admin_options_params
:template,
:kind,
:aasm_state,
:early_submission,
:notes,
:status,
:title,
Expand Down
1 change: 0 additions & 1 deletion app/serializers/form_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class FormSerializer < ActiveModel::Serializer
:success_text,
:modal_button_text,
:display_header_square_logo,
:early_submission,
:user_id,
:template,
:uuid,
Expand Down
1 change: 0 additions & 1 deletion app/serializers/full_form_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def links
:success_text,
:modal_button_text,
:display_header_square_logo,
:early_submission,
:template,
:uuid,
:short_uuid,
Expand Down
12 changes: 0 additions & 12 deletions app/views/admin/forms/_form_manager_options.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,18 +95,6 @@
<%= f.text_field :expiration_date, class: "usa-input" %>
</div>

<fieldset class="usa-fieldset margin-top-2">
<legend class="usa-sr-only">Display Organization Tag Logo</legend>
<div class="usa-checkbox">
<%= f.check_box :early_submission, class: "usa-checkbox__input" %>
<%= f.label :early_submission, class: "usa-checkbox__label" do %>
Early Submission
<small class="text-base">
Display a submit button at the end of the first page in a multi-page form?
</small>
<% end %>
</div>
</fieldset>
<fieldset class="usa-fieldset">
<legend class="usa-sr-only">Load USWDS</legend>
<div class="usa-checkbox">
Expand Down
8 changes: 1 addition & 7 deletions app/views/components/forms/_custom.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,7 @@

<%- if (section != form.form_sections.first) || (section != form.form_sections.last) %>
<div class="pagination-buttons">
<%- if (section == form.form_sections.first) && form.early_submission? %>
<div class="usa-prose text-bold margin-top-3">
<%= t 'form.answer_more_questions' %>
</div>
<%= link_to (t 'form.yes_keep_going'), "#next-page", class: "usa-button next-section", 'data-form-section-target' => "" %>
<button type="submit" class="usa-button usa-button--outline fba-early-submit"><%= t 'form.no_submit' %></button>
<% elsif section != form.form_sections.last %>
<%- if section != form.form_sections.last %>
<nav aria-label="Pagination" class="pagination-buttons text-right">
<%= link_to "#next-page",
class: "next-section usa-button",
Expand Down
3 changes: 0 additions & 3 deletions config/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ en-US:
submit: "Submit"
submit_thankyou: "Thank you. Your feedback has been received."
help_improve: "Help improve this site"
answer_more_questions: "Would you like to take two more minutes to answer more questions to help us improve our services?"
yes_keep_going: "Yes, keep going →"
no_submit: "No, only submit these responses"
next: "Next →"
back: "← Back"
select_one: "Select one"
Expand Down
3 changes: 0 additions & 3 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ en-US:
submit: "Submit"
submit_thankyou: "Thank you. Your feedback has been received."
help_improve: "Help improve this site"
answer_more_questions: "Would you like to take two more minutes to answer more questions to help us improve our services?"
yes_keep_going: "Yes, keep going →"
no_submit: "No, only submit these responses"
next: "Next →"
back: "← Back"
select_one: "Select one"
Expand Down
3 changes: 0 additions & 3 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ es:
submit: "Enviar"
submit_thankyou: "Gracias. Su comentario ha sido recibido."
help_improve: "Ayuda a mejorar este sitio"
answer_more_questions: "¿Le gustaría tomar dos minutos más para responder más preguntas y ayudarnos a mejorar nuestros servicios?"
yes_keep_going: "Sí, sigue adelante →"
no_submit: "No, solo envíe estas respuestas"
next: "Siguiente →"
back: "← Volver"
select_one: "Seleccione uno"
Expand Down
3 changes: 0 additions & 3 deletions config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ zh-CN:
submit: "提交"
submit_thankyou: "谢谢. 已收到您的反馈."
help_improve: "帮助改善这个网站"
answer_more_questions: "您是否想再花两分钟回答另外五个问题,以帮助我们改善服务质量?"
yes_keep_going: "是的,继续前进→"
no_submit: "不,仅提交这些回复"
next: "下一个→"
back: "←返回"
select_one: "选择一个"
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20250117221334_remove_form_early_submission.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveFormEarlySubmission < ActiveRecord::Migration[7.2]
def change
remove_column :forms, :early_submission
end
end
3 changes: 1 addition & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2025_01_17_004643) do
ActiveRecord::Schema[7.2].define(version: 2025_01_17_221334) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

Expand Down Expand Up @@ -255,7 +255,6 @@
t.text "success_text"
t.string "modal_button_text"
t.boolean "display_header_square_logo"
t.boolean "early_submission", default: false
t.integer "user_id"
t.boolean "template", default: false
t.string "uuid"
Expand Down
24 changes: 0 additions & 24 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def production_suitable_seeds
# Staging and Development Environments; not Production.
return false if Rails.env.production?

require_relative 'seeds/forms/a11'
require_relative 'seeds/forms/a11_v2'
require_relative 'seeds/forms/kitchen_sink'
require_relative 'seeds/forms/yes_no'
Expand Down Expand Up @@ -431,7 +430,6 @@ def production_suitable_seeds
is_required: false,
})

a11_form = Seeds::Forms.a11
a11_v2_form_template = Seeds::Forms.a11_v2

a11_v2_form = Seeds::Forms.a11_v2
Expand All @@ -440,12 +438,6 @@ def production_suitable_seeds
kitchen_sink_form = Seeds::Forms.kitchen_sink
yes_no_form = Seeds::Forms.yes_no

UserRole.create(
user: admin_user,
form: a11_form,
role: UserRole::Role::FormManager
)

UserRole.create(
user: admin_user,
form: a11_v2_form,
Expand Down Expand Up @@ -522,22 +514,6 @@ def production_suitable_seeds
end
end

# TODO: Seed A11
range = [1,2,3,4,5]
50.times do |i|
Submission.create!({
form: a11_form,
answer_01: range.sample,
answer_02: range.sample,
answer_03: range.sample,
answer_04: range.sample,
answer_05: range.sample,
answer_06: range.sample,
answer_07: range.sample
})
a11_form.update_attribute(:survey_form_activations, a11_form.survey_form_activations + 1)
end

digital_gov_user = User.new({
email: '[email protected]',
password: 'password',
Expand Down
131 changes: 0 additions & 131 deletions db/seeds/forms/a11.rb

This file was deleted.

1 change: 0 additions & 1 deletion db/seeds/forms/a11_v2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ def self.a11_v2
title: "",
instructions: "",
disclaimer_text: "Disclaimer Text Goes Here",
early_submission: true,
delivery_method: "modal",
modal_button_text: "Click here to leave feedback"
})
Expand Down
2 changes: 0 additions & 2 deletions public/api/v0/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ components:
type: boolean
display_header_square_logo:
type: boolean
early_submission:
type: boolean
template:
type: boolean
load_css:
Expand Down
1 change: 0 additions & 1 deletion public/api/v1/openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@
- "success_text"
- "modal_button_text"
- "display_header_square_logo"
- "early_submission"
- "user_id"
- "template"
- "uuid"
Expand Down
17 changes: 0 additions & 17 deletions spec/features/touchpoints_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,23 +299,6 @@
end
end

describe 'multi-page early submission form' do
let!(:multi_form) { FactoryBot.create(:form, :kitchen_sink, organization:) }

context 'when required on 2nd page' do
before do
multi_form.update(early_submission: true)
multi_form.form_sections[1].questions.first.update(is_required: true)
visit touchpoint_path(multi_form)
end

it 'display flash message' do
click_on 'No, only submit these responses'
expect(page).to have_content('A response is required:')
end
end
end

describe 'phone number question' do
let!(:dropdown_form) { FactoryBot.create(:form, :phone, organization:) }

Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/form.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"success_text": null,
"modal_button_text": "Click here to leave feedback",
"display_header_square_logo": null,
"early_submission": false,
"user_id": 1,
"template": true,
"uuid": "a5ad2e97-e655-45dc-8b59-ad54cb5bc640",
Expand Down
1 change: 0 additions & 1 deletion spec/fixtures/forms.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
"success_text": null,
"modal_button_text": "Click here to leave feedback",
"display_header_square_logo": null,
"early_submission": false,
"user_id": 1,
"template": true,
"uuid": "a5ad2e97-e655-45dc-8b59-ad54cb5bc640",
Expand Down