Skip to content

Commit 70ab2ae

Browse files
committed
[#73104] Add Sprint column to work package table
1 parent d1702cf commit 70ab2ae

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

modules/backlogs/lib/open_project/backlogs/engine.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ def self.settings
276276
filter OpenProject::Backlogs::WorkPackageFilter
277277

278278
select OpenProject::Backlogs::QueryBacklogsSelect
279+
select OpenProject::Backlogs::WorkPackageSprintSelect
279280
end
280281
end
281282
end
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# frozen_string_literal: true
2+
3+
#-- copyright
4+
# OpenProject is an open source project management software.
5+
# Copyright (C) the OpenProject GmbH
6+
#
7+
# This program is free software; you can redistribute it and/or
8+
# modify it under the terms of the GNU General Public License version 3.
9+
#
10+
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
11+
# Copyright (C) 2006-2013 Jean-Philippe Lang
12+
# Copyright (C) 2010-2013 the ChiliProject Team
13+
#
14+
# This program is free software; you can redistribute it and/or
15+
# modify it under the terms of the GNU General Public License
16+
# as published by the Free Software Foundation; either version 2
17+
# of the License, or (at your option) any later version.
18+
#
19+
# This program is distributed in the hope that it will be useful,
20+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
# GNU General Public License for more details.
23+
#
24+
# You should have received a copy of the GNU General Public License
25+
# along with this program; if not, write to the Free Software
26+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
27+
#
28+
# See COPYRIGHT and LICENSE files for more details.
29+
#++
30+
31+
module OpenProject::Backlogs
32+
class WorkPackageSprintSelect < Queries::WorkPackages::Selects::WorkPackageSelect
33+
class_attribute :sprint_selects
34+
35+
self.sprint_selects = {
36+
sprint: {
37+
association: "sprint",
38+
sortable: "name",
39+
groupable: "#{WorkPackage.table_name}.sprint_id" # FIXME
40+
}
41+
}
42+
43+
def self.instances(context = nil)
44+
return [] if context && !context.backlogs_enabled?
45+
return [] unless OpenProject::FeatureDecisions.scrum_projects_active?
46+
47+
sprint_selects.map do |name, options|
48+
new(name, options)
49+
end
50+
end
51+
end
52+
end

0 commit comments

Comments
 (0)