Skip to content

Commit f0ff197

Browse files
authored
Merge pull request #24022 from opf/bug/agile-313-sprint-link-opens-backlog-and-sprints-page-without-scrolling-to-a-selected-sprint
[AGILE-313] All sprints links directly to selected sprint
2 parents 80a3269 + b768160 commit f0ff197

3 files changed

Lines changed: 9 additions & 6 deletions

File tree

modules/backlogs/app/helpers/backlogs/sprints_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def href_for_sprint(sprint, project)
3535
if sprint.active? && (board = sprint.task_board_for(project))
3636
project_work_package_board_path(project, board)
3737
elsif sprint.in_planning?
38-
project_backlogs_backlog_path(project)
38+
project_backlogs_backlog_path(project, sprint_ids: [sprint.id])
3939
elsif sprint.completed?
4040
sprint_work_packages_path(sprint, project)
4141
end

modules/backlogs/spec/components/backlogs/sprints/row_component_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@
6363
context "when sprint is in planning" do
6464
let(:sprint) { build_stubbed(:sprint, project:, status: :in_planning, name: "Planning sprint") }
6565

66-
it "links to the backlog" do
67-
expect(rendered_component).to have_link("Planning sprint", href: project_backlogs_backlog_path(project))
66+
it "links to the backlog filtered by sprint" do
67+
expect(rendered_component).to have_link("Planning sprint",
68+
href: project_backlogs_backlog_path(project, sprint_ids: [sprint.id]))
6869
end
6970
end
7071

@@ -128,7 +129,7 @@
128129
it "shows dates, status and mapped work package count" do
129130
expect(rendered_component).to have_css(".start_date", text: "09/01/2025")
130131
expect(rendered_component).to have_css(".finish_date", text: "09/15/2025")
131-
expect(rendered_component).to have_css(".status", text: I18n.t(:"activerecord.attributes.sprint.statuses.in_planning"))
132+
expect(rendered_component).to have_css(".status", text: "In planning")
132133
expect(rendered_component).to have_css(".work_package_count", text: "7")
133134
end
134135
end

modules/backlogs/spec/features/backlogs/sprints/index_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@
153153
sprints_page.visit!
154154

155155
sprints_page.expect_sprint_present(shared_sprint)
156-
sprints_page.expect_sprint_name_link(shared_sprint, href: project_backlogs_backlog_path(receiving_project))
156+
sprints_page.expect_sprint_name_link(shared_sprint,
157+
href: project_backlogs_backlog_path(receiving_project, sprint_ids: [shared_sprint.id]))
157158
end
158159
end
159160

@@ -196,7 +197,8 @@
196197
it "links the sprint name according to status" do
197198
sprints_page.visit!
198199

199-
sprints_page.expect_sprint_name_link(planning_sprint, href: project_backlogs_backlog_path(project))
200+
sprints_page.expect_sprint_name_link(planning_sprint,
201+
href: project_backlogs_backlog_path(project, sprint_ids: [planning_sprint.id]))
200202
sprints_page.expect_sprint_name_link(active_sprint, href: project_work_package_board_path(project, active_board))
201203

202204
default_columns = Setting.work_package_list_default_columns.map(&:to_s)

0 commit comments

Comments
 (0)