Skip to content

Commit

Permalink
Merge pull request #1242 from DFE-Digital/make-content-changes-to-as-…
Browse files Browse the repository at this point in the history
…is-by-month-views

Update By month view language to reflect transfers and conversions
  • Loading branch information
beeLorna authored Dec 12, 2023
2 parents c32e4a1 + db23acc commit 4e92b95
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Move the existing exports into a `conversions` namespace (the urls for these
pages will now include `conversions` and the downloaded file name will contain
the word `conversions`)
- Change langauge for `by month` view for all projects to reflect transfers as
well as conversions.

## [Release-47][release-47]

Expand Down
4 changes: 2 additions & 2 deletions app/views/all/by_month/projects/_revised_table.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<% if projects.empty? %>
<%= govuk_inset_text(text: t("project.revised_conversion_date.empty_html")) %>
<%= govuk_inset_text(text: t("project.revised_date.empty_html")) %>
<% else %>
<table class="govuk-table" name="projects_table" aria-label="Projects table">
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header" scope="col"><%= t("project.table.headers.school_name") %></th>
<th class="govuk-table__header" scope="col"><%= t("project.table.headers.school_urn") %></th>
<th class="govuk-table__header" scope="col"><%= t("project.table.headers.revised_conversion_date") %></th>
<th class="govuk-table__header" scope="col"><%= t("project.table.headers.revised_date") %></th>
<th class="govuk-table__header" scope="col"><%= t("project.table.headers.view") %></th>
</tr>
</thead>
Expand Down
5 changes: 3 additions & 2 deletions app/views/all/by_month/projects/revised.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
<% end %>

<% content_for :page_title do %>
<%= page_title(t("project.revised_conversion_date.title", date: @date)) %>
<%= page_title(t("project.revised_date.title", date: @date)) %>
<% end %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">

<h1 class="govuk-heading-l">
<%= t("project.revised_conversion_date.title", date: @date) %>
<%= t("project.revised_date.title", date: @date) %>
</h1>
<p><%= t("project.revised_date.subtitle") %></p>

<nav class="moj-sub-navigation" aria-label="Project index sub-navigation">
<ul class="moj-sub-navigation__list">
Expand Down
4 changes: 2 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ en:
internal_contacts: Internal contacts
member_of_parliament: Member of Parliament
added_by_projects: Added by you
openers: Opening as planned
revised: Revised conversion date
openers: Proceeding as planned
revised: Revised date
active_users: Active users
inactive_users: Inactive users
pages:
Expand Down
11 changes: 6 additions & 5 deletions config/locales/project.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ en:
conversion_date: Conversion date
conversion_or_transfer_date: Conversion or transfer date
created_at: Created at date
revised_conversion_date: Revised conversion date
revised_date: Revised date
route: Route
school_phase: School phase
school_type: School type
Expand Down Expand Up @@ -235,8 +235,8 @@ en:
empty: There are no users with projects
caption: Table of users who have in-progress projects
openers:
title: Academies opening in %{date}
subtitle: Schools that are expected to become academies.
title: Academies opening or transferring in %{date}
subtitle: Schools that will become academies, and academies that will move to a different trust.
empty:
html:
<p>There are currently no schools expected to become academies in %{date}.</p>
Expand All @@ -256,8 +256,9 @@ en:
academy_order: AO (Academy Order)
directive_academy_order: DAO (Directive Academy Order)
not_applicable: Not applicable
revised_conversion_date:
title: Academies that were expected to convert in %{date}
revised_date:
title: Academies that will no longer open or transfer in %{date}
subtitle: Projects where the conversion or transfer date has changed.
empty_html:
<p>None found.</p>
table:
Expand Down
8 changes: 4 additions & 4 deletions spec/accessibility/all_projects_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@
check_accessibility(page)
end

scenario "> Opening > Confirmed conversion date" do
scenario "> By month > Confirmed conversion date" do
project = create(:conversion_project, assigned_to: user, urn: 123434, conversion_date: Date.today.next_month.at_beginning_of_month, conversion_date_provisional: false)

visit confirmed_all_by_month_projects_path

expect(page).to have_content(project.urn)
expect(page).to have_link("Opening")
expect(page).to have_link("Proceeding as planned")
check_accessibility(page)
end

scenario "> Opening > Revised conversion date" do
scenario "> By month > Revised conversion date" do
project = create(:conversion_project, assigned_to: user, urn: 123434, conversion_date_provisional: false)
create(:date_history, project: project, previous_date: Date.today.next_month.at_beginning_of_month)
create(:date_history, project: project, previous_date: Date.today.next_month.at_beginning_of_month)

visit revised_all_by_month_projects_path

expect(page).to have_content(project.urn)
expect(page).to have_link("Opening")
expect(page).to have_link("Proceeding as planned")
check_accessibility(page)
end
end
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require "rails_helper"

RSpec.feature "Viewing projects with a revised conversion date" do
scenario "Users can view the projects that were due to convert for a given month and year" do
RSpec.feature "Viewing projects with a revised conversion or transfer date" do
scenario "Users can view the projects that were due to convert or transfer for a given month and year" do
user = create(:user)

sign_in_with_user(user)
Expand All @@ -19,7 +19,7 @@

visit "/projects/all/by-month/revised/#{(Date.today + 3.months).month}/#{(Date.today + 3.months).year}"

expect(page).to have_content I18n.t("project.revised_conversion_date.title", date: (Date.today + 3.months).to_fs(:govuk_month))
expect(page).to have_content I18n.t("project.revised_date.title", date: (Date.today + 3.months).to_fs(:govuk_month))
expect(page).to have_content project_with_matching_date.urn
expect(page).not_to have_content project_with_confirmed_date.urn
expect(page).not_to have_content project_with_other_date.urn
Expand Down
2 changes: 1 addition & 1 deletion spec/requests/all/by_month/projects_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
it "shows a page title with the month & year" do
get "/projects/all/by-month/confirmed/1/2022"

expect(response.body).to include("Academies opening in January 2022")
expect(response.body).to include("Academies opening or transferring in January 2022")
end

it "returns project details in table form" do
Expand Down

0 comments on commit 4e92b95

Please sign in to comment.