Skip to content

Commit fb35af2

Browse files
committed
Remove weekly_submission_batch feature flag
1 parent b50c101 commit fb35af2

11 files changed

Lines changed: 110 additions & 266 deletions

File tree

.review_apps/ecs_task_definition.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ locals {
2424
{ name = "SETTINGS__ACT_AS_USER_ENABLED", value = "true" },
2525
{ name = "SETTINGS__AUTH_PROVIDER", value = "developer" },
2626
{ name = "SETTINGS__FORMS_ENV", value = "review" },
27-
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk" },
28-
{ name = "SETTINGS__FEATURES__WEEKLY_SUBMISSION_EMAILS_ENABLED", value = "true" }
27+
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk" }
2928
]
3029
}
3130

app/controllers/forms/batch_submissions_controller.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ def batch_submissions_input_params
2525
def success_message(form)
2626
return nil unless form.send_daily_submission_batch_previously_changed? || form.send_weekly_submission_batch_previously_changed?
2727

28-
unless FeatureService.enabled?(:weekly_submission_emails_enabled)
29-
return form.send_daily_submission_batch ? t("banner.success.form.daily_submission_batch_enabled") : t("banner.success.form.daily_submission_batch_disabled")
30-
end
31-
3228
if form.send_daily_submission_batch && form.send_weekly_submission_batch
3329
t("banner.success.form.batch_submissions.daily_and_weekly_enabled")
3430
elsif form.send_daily_submission_batch

app/services/form_task_list_service.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,8 @@ def submission_attachments_task
114114
end
115115

116116
def batch_submissions_task
117-
task_name = if FeatureService.enabled?(:weekly_submission_emails_enabled)
118-
I18n.t("forms.task_list_#{create_or_edit}.how_you_get_completed_forms_section.optional_subsection.batch_submissions")
119-
else
120-
I18n.t("forms.task_list_#{create_or_edit}.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch")
121-
end
117+
task_name = I18n.t("forms.task_list_#{create_or_edit}.how_you_get_completed_forms_section.optional_subsection.batch_submissions")
118+
122119
{
123120
task_name:,
124121
path: batch_submissions_path(@form.id),

app/views/forms/_made_live_form.html.erb

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -151,24 +151,15 @@
151151
<p><%= t(".how_you_get_completed_forms.submission_format.email.#{submission_format}_html") %></p>
152152
<% end %>
153153

154-
<% if FeatureService.enabled?(:weekly_submission_emails_enabled) %>
155-
<h4 class="govuk-heading-s"><%= t(".how_you_get_completed_forms.batch_submissions.title") %></h4>
156-
<% if form_document.send_daily_submission_batch && form_document.send_weekly_submission_batch %>
157-
<p><%= t(".how_you_get_completed_forms.batch_submissions.daily_and_weekly_enabled") %></p>
158-
<% elsif form_document.send_daily_submission_batch %>
159-
<p><%= t(".how_you_get_completed_forms.batch_submissions.daily_enabled") %></p>
160-
<% elsif form_document.send_weekly_submission_batch %>
161-
<p><%= t(".how_you_get_completed_forms.batch_submissions.weekly_enabled") %></p>
162-
<% else %>
163-
<p><%= t(".how_you_get_completed_forms.batch_submissions.disabled") %></p>
164-
<% end %>
154+
<h4 class="govuk-heading-s"><%= t(".how_you_get_completed_forms.batch_submissions.title") %></h4>
155+
<% if form_document.send_daily_submission_batch && form_document.send_weekly_submission_batch %>
156+
<p><%= t(".how_you_get_completed_forms.batch_submissions.daily_and_weekly_enabled") %></p>
157+
<% elsif form_document.send_daily_submission_batch %>
158+
<p><%= t(".how_you_get_completed_forms.batch_submissions.daily_enabled") %></p>
159+
<% elsif form_document.send_weekly_submission_batch %>
160+
<p><%= t(".how_you_get_completed_forms.batch_submissions.weekly_enabled") %></p>
165161
<% else %>
166-
<h4 class="govuk-heading-s"><%= t(".how_you_get_completed_forms.daily_csv.title") %></h4>
167-
<% if form_document.send_daily_submission_batch %>
168-
<p><%= t(".how_you_get_completed_forms.daily_csv.enabled") %></p>
169-
<% else %>
170-
<p><%= t(".how_you_get_completed_forms.daily_csv.disabled") %></p>
171-
<% end %>
162+
<p><%= t(".how_you_get_completed_forms.batch_submissions.disabled") %></p>
172163
<% end %>
173164

174165
<% if form_document.has_welsh_translation? %>

app/views/forms/batch_submissions/new.html.erb

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<% weekly_enabled = FeatureService.enabled?(:weekly_submission_emails_enabled) %>
2-
<% page_title = weekly_enabled ? t("page_titles.submission_batches") : t("page_titles.daily_submission_batch") %>
1+
<% page_title = t("page_titles.submission_batches") %>
32
<% set_page_title(title_with_error_prefix(page_title, @batch_submissions_input.errors.any?)) %>
43
<% content_for :back_link, govuk_back_link_to(form_path(@batch_submissions_input.form.id), t("back_link.form_create")) %>
54

@@ -15,21 +14,11 @@
1514
<%= page_title %>
1615
</h1>
1716

18-
<% if weekly_enabled %>
19-
<%= t(".body_html") %>
20-
<% else %>
21-
<%= t(".weekly_disabled_body_html") %>
22-
<% end %>
17+
<%= t(".body_html") %>
2318

24-
<% if weekly_enabled %>
25-
<%= f.govuk_check_boxes_fieldset :batch_frequencies, legend: { tag: 'h2', size: 'm' } do %>
26-
<%= f.govuk_check_box :batch_frequencies, "daily" %>
27-
<%= f.govuk_check_box :batch_frequencies, "weekly" %>
28-
<% end %>
29-
<% else %>
30-
<%= f.govuk_check_boxes_fieldset :batch_frequencies, legend: { tag: 'h2', size: 'm', text: t(".weekly_disabled_fieldset_legend") } do %>
31-
<%= f.govuk_check_box :batch_frequencies, "daily", label: { text: t(".weekly_disabled_checkbox_label") } %>
32-
<% end %>
19+
<%= f.govuk_check_boxes_fieldset :batch_frequencies, legend: { tag: 'h2', size: 'm' } do %>
20+
<%= f.govuk_check_box :batch_frequencies, "daily" %>
21+
<%= f.govuk_check_box :batch_frequencies, "weekly" %>
3322
<% end %>
3423

3524
<%= f.govuk_submit t("save_and_continue") %>

config/locales/en.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,6 @@ en:
235235
weekly_enabled: You’ll get a weekly batch of form submissions
236236
change_name: Your form name has been saved
237237
copied: Your form has been copied
238-
daily_submission_batch_disabled: You will not get a daily CSV of the previous day’s completed forms
239-
daily_submission_batch_enabled: You’ll get a daily CSV of the previous day’s completed forms
240238
declaration_saved: Your declaration has been saved
241239
declaration_saved_and_completed: Your declaration has been saved and marked as complete
242240
page_moved: "‘%{question_text}’ has moved %{direction} to number %{question_number}"
@@ -398,14 +396,6 @@ en:
398396
<p>The CSVs will include each submission’s answers in plain text separated by commas - plus the date and time of submission.</p>
399397
<p>If you make changes to the form such as adding, moving or deleting a question, the structure of the CSV will change. Forms completed before and after the change will be split into separate CSV files.</p>
400398
<p>You’ll continue to receive individual completed form submissions in the usual way. If your form has any file upload questions, the uploaded files will only be attached to the individual submissions.</p>
401-
weekly_disabled_body_html: |
402-
<p>You can get a daily email with all the answers from the previous day’s completed forms collected into a CSV file.</p>
403-
<p>The CSV will list all the answers in plain text, separated by commas, with a row for each completed form.</p>
404-
<p>We’ll send the email shortly after 2am with the completed forms from the previous day. It’ll be sent to the same email address you set for completed forms.</p>
405-
<p>If you make changes to the form such as adding, moving or deleting a question, the structure of the CSV will change. Forms completed before and after the change will be split into separate CSV files.</p>
406-
<p>You’ll continue to receive individual completed form emails. If your form has any file upload questions, the uploaded files will only be attached to the individual completed form emails.</p>
407-
weekly_disabled_checkbox_label: Get a daily CSV of completed forms
408-
weekly_disabled_fieldset_legend: Do you want to get a daily CSV of the previous day’s completed forms?
409399
delete_confirmation:
410400
delete:
411401
hint_for_archived_draft: Deleting this draft will not remove the archived form.
@@ -443,10 +433,6 @@ en:
443433
title: Daily and weekly CSVs
444434
weekly_enabled: You are getting a weekly batch of completed forms.
445435
csv_and_json: CSV and JSON
446-
daily_csv:
447-
disabled: You have not opted to get a daily CSV of the previous day’s completed forms.
448-
enabled: You are getting a daily CSV of the previous day’s completed forms.
449-
title: Daily CSV
450436
submission_email: Email
451437
submission_format:
452438
email:
@@ -515,7 +501,6 @@ en:
515501
hint_text_html: Completed forms will be sent to:<br> <span class="govuk-!-text-break-word">%{submission_email}</span>
516502
optional_subsection:
517503
batch_submissions: Get a daily or weekly batch of completed forms
518-
daily_submission_batch: Get a daily CSV of the previous day’s completed forms
519504
submission_attachments: Get a CSV or JSON file of each completed form
520505
title: Set up how you get completed forms
521506
make_form_live_section:
@@ -561,7 +546,6 @@ en:
561546
hint_text_html: Completed forms will be sent to:<br> <span class="govuk-!-text-break-word">%{submission_email}</span>
562547
optional_subsection:
563548
batch_submissions: Get a daily or weekly batch of completed forms
564-
daily_submission_batch: Get a daily CSV of the previous day’s completed forms
565549
submission_attachments: Get a CSV or JSON file of each completed form
566550
title: Change how you get completed forms
567551
make_form_live_section:
@@ -1462,7 +1446,6 @@ en:
14621446
confirm_email_success: Email address confirmed
14631447
contact_details: Provide contact details for support
14641448
copy: What is the name of your form?
1465-
daily_submission_batch: Get a daily CSV of the previous day’s completed forms
14661449
date_settings: Are you asking for someone’s date of birth?
14671450
declaration: Add a declaration for people to agree to
14681451
delete_secondary_skip: Are you sure you want to delete the route for any other answer?

spec/config/settings_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
describe ".features" do
2323
features = settings[:features]
2424

25-
include_examples expected_value_test, :weekly_submission_emails_enabled, features, false
25+
include_examples expected_value_test, :exit_pages, features, { "enabled_by_group" => true }
2626
end
2727

2828
describe "forms_api" do

spec/requests/forms/batch_submissions_controller_spec.rb

Lines changed: 31 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -37,93 +37,53 @@
3737
end
3838

3939
describe "#create" do
40-
let(:batch_frequencies) { %w[daily] }
4140
let(:params) { { forms_batch_submissions_input: { batch_frequencies: } } }
41+
let(:batch_frequencies) { %w[daily weekly] }
4242

43-
context "when the weekly submission batch feature is disabled", feature_weekly_submission_emails_enabled: false do
44-
context "when the daily batch checkbox is checked" do
45-
it "updates the form send_daily_submission_batch flag to true" do
46-
expect {
47-
post(batch_submissions_create_path(form_id: form.id), params:)
48-
}.to change { form.reload.send_daily_submission_batch }.to(true)
49-
end
50-
51-
it "redirects to the form overview page" do
52-
post(batch_submissions_create_path(form_id: form.id), params:)
53-
expect(response).to redirect_to(form_path(form.id))
54-
end
55-
56-
it "displays a success flash message" do
57-
post(batch_submissions_create_path(form_id: form.id), params:)
58-
expect(flash[:success]).to eq(I18n.t("banner.success.form.daily_submission_batch_enabled"))
59-
end
60-
end
61-
62-
context "when the daily batch checkbox is not checked" do
63-
let(:send_daily_submission_batch) { true }
64-
let(:batch_frequencies) { [] }
65-
66-
it "updates the form send_daily_submission_batch flag to false" do
67-
expect {
68-
post(batch_submissions_create_path(form_id: form.id), params:)
69-
}.to change { form.reload.send_daily_submission_batch }.to(false)
70-
end
71-
72-
it "displays a success flash message" do
73-
post(batch_submissions_create_path(form_id: form.id), params:)
74-
expect(flash[:success]).to eq(I18n.t("banner.success.form.daily_submission_batch_disabled"))
75-
end
76-
end
43+
before do
44+
post(batch_submissions_create_path(form_id: form.id), params:)
7745
end
7846

79-
context "when the weekly submission batch feature is enabled", :feature_weekly_submission_emails_enabled do
80-
let(:batch_frequencies) { %w[daily weekly] }
81-
82-
before do
83-
post(batch_submissions_create_path(form_id: form.id), params:)
84-
end
85-
86-
it "updates the form" do
87-
expect(form.reload.send_daily_submission_batch).to be true
88-
expect(form.reload.send_weekly_submission_batch).to be true
89-
end
47+
it "updates the form" do
48+
expect(form.reload.send_daily_submission_batch).to be true
49+
expect(form.reload.send_weekly_submission_batch).to be true
50+
end
9051

91-
it "redirects to the form overview page" do
92-
expect(response).to redirect_to(form_path(form.id))
93-
end
52+
it "redirects to the form overview page" do
53+
expect(response).to redirect_to(form_path(form.id))
54+
end
9455

95-
context "when only the daily batch checkbox is checked" do
96-
let(:batch_frequencies) { %w[daily] }
56+
context "when only the daily batch checkbox is checked" do
57+
let(:batch_frequencies) { %w[daily] }
9758

98-
it "displays a success flash message indicating that daily batch emails are enabled" do
99-
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.daily_enabled"))
100-
end
59+
it "displays a success flash message indicating that daily batch emails are enabled" do
60+
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.daily_enabled"))
10161
end
62+
end
10263

103-
context "when only the weekly batch checkbox is checked" do
104-
let(:batch_frequencies) { %w[weekly] }
64+
context "when only the weekly batch checkbox is checked" do
65+
let(:batch_frequencies) { %w[weekly] }
10566

106-
it "displays a success flash message indicating that weekly batch emails are enabled" do
107-
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.weekly_enabled"))
108-
end
67+
it "displays a success flash message indicating that weekly batch emails are enabled" do
68+
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.weekly_enabled"))
10969
end
70+
end
11071

111-
context "when both the daily and weekly batch checkboxes are checked" do
112-
let(:batch_frequencies) { %w[daily weekly] }
72+
context "when both the daily and weekly batch checkboxes are checked" do
73+
let(:batch_frequencies) { %w[daily weekly] }
11374

114-
it "displays a success flash message indicating that daily and weekly batch emails are enabled" do
115-
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.daily_and_weekly_enabled"))
116-
end
75+
it "displays a success flash message indicating that daily and weekly batch emails are enabled" do
76+
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.daily_and_weekly_enabled"))
11777
end
78+
end
11879

119-
context "when daily and weekly batch checkboxes are unchecked" do
120-
let(:send_daily_submission_batch) { true }
121-
let(:send_weekly_submission_batch) { true }
122-
let(:batch_frequencies) { [] }
80+
context "when daily and weekly batch checkboxes are unchecked" do
81+
let(:send_daily_submission_batch) { true }
82+
let(:send_weekly_submission_batch) { true }
83+
let(:batch_frequencies) { [] }
12384

124-
it "displays a success flash message indicating that batch emails are disabled" do
125-
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.disabled"))
126-
end
85+
it "displays a success flash message indicating that batch emails are disabled" do
86+
expect(flash[:success]).to eq(I18n.t("banner.success.form.batch_submissions.disabled"))
12787
end
12888
end
12989

spec/services/form_task_list_service_spec.rb

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,18 +289,9 @@
289289
end
290290
end
291291

292-
context "when the weekly submission emails feature flag is disabled", feature_weekly_submission_emails_enabled: false do
293-
it "has link to the daily submission batch page" do
294-
expect(section_rows.second[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch")
295-
expect(section_rows.second[:path]).to eq "/forms/#{form.id}/batch-submissions"
296-
end
297-
end
298-
299-
context "when the weekly submission emails feature flag is enabled", :feature_weekly_submission_emails_enabled do
300-
it "has link to the batch submissions page" do
301-
expect(section_rows.second[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.batch_submissions")
302-
expect(section_rows.second[:path]).to eq "/forms/#{form.id}/batch-submissions"
303-
end
292+
it "has link to the batch submissions page" do
293+
expect(section_rows.second[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.batch_submissions")
294+
expect(section_rows.second[:path]).to eq "/forms/#{form.id}/batch-submissions"
304295
end
305296
end
306297

0 commit comments

Comments
 (0)