Skip to content

Commit 3855a65

Browse files
committed
Remove daily_submission_emails_enabled feature flag
1 parent 69e17c3 commit 3855a65

File tree

9 files changed

+35
-81
lines changed

9 files changed

+35
-81
lines changed

.review_apps/ecs_task_definition.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ locals {
2525
{ name = "SETTINGS__AUTH_PROVIDER", value = "developer" },
2626
{ name = "SETTINGS__FORMS_ENV", value = "review" },
2727
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk" },
28-
{ name = "SETTINGS__FEATURES__DAILY_SUBMISSION_EMAILS_ENABLED", value = "true" },
2928
{ name = "SETTINGS__FEATURES__WELSH", value = "true" }
3029
]
3130
}

app/controllers/forms/daily_submission_batch_controller.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module Forms
22
class DailySubmissionBatchController < FormsController
3-
before_action :check_feature_flag
4-
53
def new
64
authorize current_form, :can_edit_form?
75
@daily_submission_batch_input = Forms::DailySubmissionBatchInput.new(form: current_form).assign_form_values
@@ -20,10 +18,6 @@ def create
2018

2119
private
2220

23-
def check_feature_flag
24-
raise NotFoundError unless FeatureService.enabled?(:daily_submission_emails_enabled)
25-
end
26-
2721
def daily_submission_batch_input_params
2822
params.require(:forms_daily_submission_batch_input).permit(:send_daily_submission_batch).merge(form: current_form)
2923
end

app/services/form_task_list_service.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def how_you_get_completed_forms_section_tasks
102102
def how_you_get_completed_forms_optional_subsection
103103
rows = []
104104
rows << submission_attachments_task if @form.email?
105-
rows << daily_submission_batch_task if FeatureService.enabled?(:daily_submission_emails_enabled)
105+
rows << daily_submission_batch_task
106106

107107
return nil if rows.empty?
108108

app/views/forms/_made_live_form.html.erb

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,11 @@
149149
<p><%= t(".how_you_get_completed_forms.submission_format.email.#{submission_format}_html") %></p>
150150
<% end %>
151151

152-
<% if FeatureService.enabled?(:daily_submission_emails_enabled) %>
153-
<h4 class="govuk-heading-s"><%= t(".how_you_get_completed_forms.daily_csv.title") %></h4>
154-
<% if form_document.send_daily_submission_batch %>
155-
<p><%= t(".how_you_get_completed_forms.daily_csv.enabled") %></p>
156-
<% else %>
157-
<p><%= t(".how_you_get_completed_forms.daily_csv.disabled") %></p>
158-
<% end %>
152+
<h4 class="govuk-heading-s"><%= t(".how_you_get_completed_forms.daily_csv.title") %></h4>
153+
<% if form_document.send_daily_submission_batch %>
154+
<p><%= t(".how_you_get_completed_forms.daily_csv.enabled") %></p>
155+
<% else %>
156+
<p><%= t(".how_you_get_completed_forms.daily_csv.disabled") %></p>
159157
<% end %>
160158

161159
<% if form_document.has_welsh_translation? %>

config/settings.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ features:
44
enabled_by_group: true
55
welsh:
66
enabled_by_group: true
7-
daily_submission_emails_enabled: false
87
org_admin_alerts_enabled: false
98

109
forms_api:

spec/config/settings_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
features = settings[:features]
2424

2525
include_examples expected_value_test, :welsh, features, { "enabled_by_group" => true }
26-
include_examples expected_value_test, :daily_submission_emails_enabled, features, false
2726
include_examples expected_value_test, :org_admin_alerts_enabled, features, false
2827
end
2928

spec/requests/forms/daily_submission_batch_controller_spec.rb

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,8 @@
55
let(:send_daily_submission_batch_original_value) { false }
66
let(:current_user) { standard_user }
77
let(:group) { create(:group, organisation: standard_user.organisation) }
8-
let(:daily_submission_emails_enabled) { true }
98

109
before do
11-
allow(FeatureService).to receive(:enabled?).with(:daily_submission_emails_enabled).and_return(daily_submission_emails_enabled)
12-
1310
Membership.create!(group_id: group.id, user: standard_user, added_by: standard_user)
1411
GroupForm.create!(form_id: form.id, group_id: group.id)
1512

@@ -36,14 +33,6 @@
3633
expect(response).to have_http_status(:forbidden)
3734
end
3835
end
39-
40-
context "when the feature flag is disabled" do
41-
let(:daily_submission_emails_enabled) { false }
42-
43-
it "returns 404" do
44-
expect(response).to have_http_status(:not_found)
45-
end
46-
end
4736
end
4837

4938
describe "#create" do

spec/services/form_task_list_service_spec.rb

Lines changed: 18 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -287,48 +287,32 @@
287287
let(:section_rows) { section[:rows] }
288288
let(:all_task_names) { all_sections.flat_map { |section| section[:rows] }.compact.map { |row| row[:task_name] } }
289289

290-
context "when the daily_submission_emails_enabled feature flag is enabled", :feature_daily_submission_emails_enabled do
291-
context "when the submission type is email" do
292-
it "has link to the submission attachments page" do
293-
expect(section_rows.first[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments")
294-
expect(section_rows.first[:path]).to eq "/forms/#{form.id}/submission-attachments"
295-
end
296-
297-
it "has the subsection title 'Optional tasks' as there are multiple tasks" do
298-
expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.other")
299-
end
290+
context "when the submission type is email" do
291+
it "has link to the submission attachments page" do
292+
expect(section_rows.first[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments")
293+
expect(section_rows.first[:path]).to eq "/forms/#{form.id}/submission-attachments"
300294
end
301295

302-
context "when the submission type is s3" do
303-
let(:form) { create(:form, submission_type: "s3") }
296+
it "has the subsection title 'Optional tasks' as there are multiple tasks" do
297+
expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.other")
298+
end
299+
end
304300

305-
it "does not have link to the submission attachments page" do
306-
expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments")
307-
end
301+
context "when the submission type is s3" do
302+
let(:form) { create(:form, submission_type: "s3") }
308303

309-
it "has the subsection title 'Optional task' as there is only one task" do
310-
expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.one")
311-
end
304+
it "does not have link to the submission attachments page" do
305+
expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments")
312306
end
313307

314-
it "has link to the daily submission batch page" do
315-
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")
316-
expect(section_rows.second[:path]).to eq "/forms/#{form.id}/daily-submission-csv"
308+
it "has the subsection title 'Optional task' as there is only one task" do
309+
expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.one")
317310
end
318311
end
319312

320-
context "when the daily_submission_emails_enabled feature flag is disabled", feature_daily_submission_emails_enabled: false do
321-
it "does not have link to the daily submission batch page" do
322-
expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch")
323-
end
324-
325-
context "when the submission type is s3" do
326-
let(:form) { create(:form, submission_type: "s3") }
327-
328-
it "does not include the optional tasks subsection at all" do
329-
expect(section[:title]).to eq I18n.t("forms.task_list_create.privacy_and_contact_details_section.title")
330-
end
331-
end
313+
it "has link to the daily submission batch page" do
314+
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")
315+
expect(section_rows.second[:path]).to eq "/forms/#{form.id}/daily-submission-csv"
332316
end
333317
end
334318

@@ -525,7 +509,7 @@
525509
end
526510
end
527511

528-
context "when editing an existing form", :feature_daily_submission_emails_enabled do
512+
context "when editing an existing form" do
529513
let(:form) { create(:form, :live) }
530514
let(:group) { create(:group, :with_welsh_enabled, name: "Group 1", organisation:, status: group_status) }
531515
let(:can_make_form_live) { true }

spec/views/forms/_made_live_form.html.erb_spec.rb

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,29 +189,21 @@
189189
end
190190
end
191191

192-
context "when the daily_submission_emails_enabled feature is enabled", :feature_daily_submission_emails_enabled do
193-
context "when send_daily_submission_batch is true" do
194-
let(:send_daily_submission_batch) { true }
192+
context "when send_daily_submission_batch is true" do
193+
let(:send_daily_submission_batch) { true }
195194

196-
it "tells the user they getting a daily CSV" do
197-
expect(rendered).to have_css("h4", text: I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.title"))
198-
expect(rendered).to include(I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.enabled"))
199-
end
200-
end
201-
202-
context "when send_daily_submission_batch is false" do
203-
let(:send_daily_submission_batch) { false }
204-
205-
it "tells the user they have not opted to get a daily CSV" do
206-
expect(rendered).to have_css("h4", text: I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.title"))
207-
expect(rendered).to include(I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.disabled"))
208-
end
195+
it "tells the user they getting a daily CSV" do
196+
expect(rendered).to have_css("h4", text: I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.title"))
197+
expect(rendered).to include(I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.enabled"))
209198
end
210199
end
211200

212-
context "when the daily_submission_emails_enabled feature is disabled", feature_daily_submission_emails_enabled: false do
213-
it "does not include the daily CSV section" do
214-
expect(rendered).not_to have_css("h4", text: I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.title"))
201+
context "when send_daily_submission_batch is false" do
202+
let(:send_daily_submission_batch) { false }
203+
204+
it "tells the user they have not opted to get a daily CSV" do
205+
expect(rendered).to have_css("h4", text: I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.title"))
206+
expect(rendered).to include(I18n.t("forms.made_live_form.how_you_get_completed_forms.daily_csv.disabled"))
215207
end
216208
end
217209

0 commit comments

Comments
 (0)