Skip to content

Commit

Permalink
Merge pull request #1693 from DFE-Digital/chore/add-completing-a-proj…
Browse files Browse the repository at this point in the history
…ect-link

Add task list link to completion section
  • Loading branch information
mec committed Jun 25, 2024
2 parents 3e198d1 + 5e22254 commit 6f0a87f
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased][unreleased]

### Added

- The task list includes a link to the completing a project section.

## [Release-75][release-75]

### Added
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/show/_complete.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<%= form_with url: project_complete_path(@project), method: :put do |form| %>
<%= form_with url: project_complete_path(@project), method: :put, id: "completing-a-project" do |form| %>
<h3 class="govuk-heading-m"><%= t("project.complete.heading") %></h3>
<p class="govuk-body"><%= t("project.complete.guidance.html") %></p>

Expand Down
4 changes: 4 additions & 0 deletions app/views/shared/projects/_task_list.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<% @task_list.sections.each do |section| %>
<%= render partial: "shared/side_navigation_item", locals: {name: t("#{section.locales_path}.title"), path: "##{section.identifier}"} %>
<% end %>
<% unless @project.completed? %>
<li><%= link_to t("project.show.completing_a_project_link"), "#completing-a-project", class: "govuk-link govuk-link--no-visited-state" %></li>
<% end %>
</ul>
</nav>
</div>
Expand Down
1 change: 1 addition & 0 deletions config/locales/project.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ en:
title: Task list
edit_button:
text: Edit
completing_a_project_link: Completing a project
all:
in_progress:
title: All projects in progress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
scenario "the project is completed successfully" do
visit project_path(project)

click_on "Completing a project"

click_on I18n.t("project.complete.submit_button")

expect(page).to have_content("Project completed")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
scenario "the project is completed successfully" do
visit project_path(project)

click_on "Completing a project"

click_on I18n.t("project.complete.submit_button")

expect(page).to have_content("Project completed")
Expand Down

0 comments on commit 6f0a87f

Please sign in to comment.