From 9eba348433c96c061f165f43cf6ba35e9b1bea9b Mon Sep 17 00:00:00 2001 From: Kevin Sedgley Date: Fri, 26 Jan 2024 09:44:25 +0000 Subject: [PATCH] WIP Has a failing cucumber test --- ...petition_action_email_petitioners.html.erb | 4 ++-- ...petition_action_email_petitioners.html.erb | 4 ++-- .../archived/petition_emails/edit.html.erb | 2 +- ...petition_action_email_petitioners.html.erb | 4 ++-- app/views/admin/petition_emails/edit.html.erb | 2 +- .../petitions/_closed_petition_show.html.erb | 4 ++-- .../petitions/_open_petition_show.html.erb | 2 +- ...ails.html.erb => _update_details.html.erb} | 2 +- config/locales/admin.en-GB.yml | 8 ++++---- features/admin/petition_email.feature | 20 +++++++++---------- .../joe_views_an_archived_petition.feature | 10 +++++----- features/step_definitions/petition_steps.rb | 8 ++++---- features/suzie_views_a_petition.feature | 10 +++++----- .../petition_emails_controller_spec.rb | 8 ++++---- .../admin/petition_emails_controller_spec.rb | 8 ++++---- .../archived/email_petitioners_job_spec.rb | 3 +-- spec/jobs/email_petitioners_job_spec.rb | 2 +- spec/requests/archived_petition_show_spec.rb | 2 +- spec/requests/petition_show_spec.rb | 2 +- 19 files changed, 52 insertions(+), 53 deletions(-) rename app/views/petitions/{_other_business_details.html.erb => _update_details.html.erb} (87%) diff --git a/app/views/admin/admin/_petition_action_email_petitioners.html.erb b/app/views/admin/admin/_petition_action_email_petitioners.html.erb index 74d1b2ff6..3b87469a6 100644 --- a/app/views/admin/admin/_petition_action_email_petitioners.html.erb +++ b/app/views/admin/admin/_petition_action_email_petitioners.html.erb @@ -1,5 +1,5 @@ <% if @petition.is_a?(::Archived::Petition) %> - <%= link_to 'Other parliamentary business', new_admin_archived_petition_email_path(@petition), class: 'petition-action-heading' %> + <%= link_to 'Updates', new_admin_archived_petition_email_path(@petition), class: 'petition-action-heading' %> <% else %> - <%= link_to 'Other parliamentary business', new_admin_petition_email_path(@petition), class: 'petition-action-heading' %> + <%= link_to 'Updates', new_admin_petition_email_path(@petition), class: 'petition-action-heading' %> <% end %> diff --git a/app/views/admin/archived/petition_emails/_petition_action_email_petitioners.html.erb b/app/views/admin/archived/petition_emails/_petition_action_email_petitioners.html.erb index f7dee5716..34c8c36f4 100644 --- a/app/views/admin/archived/petition_emails/_petition_action_email_petitioners.html.erb +++ b/app/views/admin/archived/petition_emails/_petition_action_email_petitioners.html.erb @@ -1,4 +1,4 @@ -

Other parliamentary business

+

Updates

<% if petition.emails.any?(&:persisted?) %> @@ -18,7 +18,7 @@ <%= button_to 'Edit', edit_admin_archived_petition_email_path(petition, email), method: :get, class: 'button' %> - <%= button_to 'Delete', admin_archived_petition_email_path(petition, email), method: :delete, class: 'button-warning', data: { confirm: 'Delete other parliamentary business?' } %> + <%= button_to 'Delete', admin_archived_petition_email_path(petition, email), method: :delete, class: 'button-warning', data: { confirm: 'Delete update?' } %> <% end %> diff --git a/app/views/admin/archived/petition_emails/edit.html.erb b/app/views/admin/archived/petition_emails/edit.html.erb index b3f6479f8..09676f1ef 100644 --- a/app/views/admin/archived/petition_emails/edit.html.erb +++ b/app/views/admin/archived/petition_emails/edit.html.erb @@ -1,6 +1,6 @@
-

Edit other parliamentary business

+

Edit update

<%= form_for @email, url: admin_archived_petition_email_path(@petition, @email), method: :patch do |f| -%> <%= form_row :for => [f.object, :subject] do %> diff --git a/app/views/admin/petition_emails/_petition_action_email_petitioners.html.erb b/app/views/admin/petition_emails/_petition_action_email_petitioners.html.erb index fa5d90405..c099b53cd 100644 --- a/app/views/admin/petition_emails/_petition_action_email_petitioners.html.erb +++ b/app/views/admin/petition_emails/_petition_action_email_petitioners.html.erb @@ -1,4 +1,4 @@ -

Other parliamentary business

+

Updates

<% if petition.emails.any?(&:persisted?) %>
<%= number_with_delimiter(email.email_count) || "–" %> <%= date_format(email.emails_enqueued_at) || "–" %>
@@ -18,7 +18,7 @@ <% end %> diff --git a/app/views/admin/petition_emails/edit.html.erb b/app/views/admin/petition_emails/edit.html.erb index 9d7c41600..ab091c231 100644 --- a/app/views/admin/petition_emails/edit.html.erb +++ b/app/views/admin/petition_emails/edit.html.erb @@ -1,6 +1,6 @@
-

Edit other parliamentary business

+

Edit update

<%= form_for @email, url: admin_petition_email_path(@petition, @email), method: :patch do |f| -%> <%= form_row :for => [f.object, :subject] do %> diff --git a/app/views/petitions/_closed_petition_show.html.erb b/app/views/petitions/_closed_petition_show.html.erb index 780474cb3..0acd24230 100644 --- a/app/views/petitions/_closed_petition_show.html.erb +++ b/app/views/petitions/_closed_petition_show.html.erb @@ -47,8 +47,8 @@

- <%= render 'threshold_details', petition: petition %> - <%= render 'other_business_details', petition: petition %> + <%= render 'update_details', petition: petition %> + <%= render 'update_details', petition: petition %>
<%= render 'threshold_details', petition: petition %> - <%= render 'other_business_details', petition: petition %> + <%= render 'update_details', petition: petition %> <%= render 'share_petition', petition: petition %>
<%= date_format(email.emails_enqueued_at) || "–" %> <%= button_to 'Edit', edit_admin_petition_email_path(petition, email), method: :get, class: 'button', disabled: @petition.editing_disabled? %> - <%= button_to 'Delete', admin_petition_email_path(petition, email), method: :delete, class: 'button-warning', disabled: @petition.editing_disabled?, data: { confirm: 'Delete other parliamentary business?' } %> + <%= button_to 'Delete', admin_petition_email_path(petition, email), method: :delete, class: 'button-warning', disabled: @petition.editing_disabled?, data: { confirm: 'Delete update?' } %>