mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
[#73968] Move card metrics to Backlogs
Remove the story-points display from the shared work package card and expose a generic metric slot instead. Backlogs now opts into that slot with a small story-points component when rendering sprint, bucket, and inbox cards. https://community.openproject.org/wp/73968
This commit is contained in:
@@ -41,7 +41,9 @@ module OpenProject
|
||||
|
||||
work_packages = sprint.work_packages_for(project).limit(3)
|
||||
render OpenProject::Common::WorkPackageCardBoxComponent.new(
|
||||
work_packages:, project:, container: sprint
|
||||
work_packages:,
|
||||
project:,
|
||||
container: sprint
|
||||
) do |box|
|
||||
box.with_header(title: sprint.name, count: work_packages.size) do |header|
|
||||
points = work_packages.sum { |w| w.story_points || 0 }
|
||||
|
||||
@@ -41,6 +41,19 @@ module OpenProject
|
||||
)
|
||||
end
|
||||
|
||||
def with_metric
|
||||
work_package = WorkPackage.first
|
||||
return preview_message("No work packages in the database.") unless work_package
|
||||
|
||||
render OpenProject::Common::WorkPackageCardComponent.new(
|
||||
work_package:
|
||||
) do |card|
|
||||
card.with_metric do
|
||||
render Backlogs::StoryPointsComponent.new(work_package:)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def preview_message(text)
|
||||
|
||||
Reference in New Issue
Block a user