OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[59174] Fixed group row name rendering
Andreas Pfohl151dbff5514d
diff --git a/app/models/custom_field/hierarchy/hierarchy_item_adapter.rb b/app/models/custom_field/hierarchy/hierarchy_item_adapter.rbindex 7db6d539d3f..14cd4053bc7 100644--- a/app/models/custom_field/hierarchy/hierarchy_item_adapter.rb+++ b/app/models/custom_field/hierarchy/hierarchy_item_adapter.rb@@ -29,14 +29,11 @@#++class CustomField::Hierarchy::HierarchyItemAdapter- attr_reader :name-delegate :id, :label, :short, :to_s, to: :item- def initialize(item:)- @item = item- @name = item.label- end+ def initialize(item:) = @item = item++ def name = @item.labelprivatediff --git a/app/models/custom_field/hierarchy/item.rb b/app/models/custom_field/hierarchy/item.rbindex 19bc4a7dd78..7bfd41af215 100644--- a/app/models/custom_field/hierarchy/item.rb+++ b/app/models/custom_field/hierarchy/item.rb@@ -36,5 +36,5 @@ class CustomField::Hierarchy::Item < ApplicationRecordscope :including_children, -> { includes(children: :children) }- def to_s = label+ def to_s = short.nil? ? label : "#{label} (#{short})"enddiff --git a/app/models/query/results/group_by.rb b/app/models/query/results/group_by.rbindex ed741e8f255..efe8d4f1811 100644--- a/app/models/query/results/group_by.rb+++ b/app/models/query/results/group_by.rb@@ -101,9 +101,7 @@ module ::Query::Results::GroupBygroups.transform_keys do |key|if custom_field.multi_value?- (key ? key.split(".") : []).map do |subkey|- items[subkey]- end+ Array(key&.split(".")).map { |subkey| items[subkey] }elseitems[key] || nilend@@ -118,8 +116,7 @@ module ::Query::Results::GroupBy.new.get_descendants(item: custom_field.hierarchy_root, include_self: false).fmap do |list|- list.map { |item| CustomField::Hierarchy::HierarchyItemAdapter.new(item:) }- .filter { |item| keys.include?(item.label) }+ list.filter_map { |item| CustomField::Hierarchy::HierarchyItemAdapter.new(item:) if keys.include?(item.label) }.index_by(&:label)end.either(@@ -138,9 +135,7 @@ module ::Query::Results::GroupBygroups.transform_keys do |key|if custom_field.multi_value?- (key ? key.split(".") : []).map do |subkey|- options[subkey].first- end+ Array(key&.split(".")).map.map { |subkey| options[subkey].first }elseoptions[key]&.firstenddiff --git a/lib/api/decorators/aggregation_group.rb b/lib/api/decorators/aggregation_group.rbindex c3f066747a6..ec343ba83bb 100644--- a/lib/api/decorators/aggregation_group.rb+++ b/lib/api/decorators/aggregation_group.rb@@ -33,11 +33,9 @@ module API@count = count@query = query- if group_key.is_a?(Array)- group_key = set_links!(group_key)- end-- @link = ::API::V3::Utilities::ResourceLinkGenerator.make_link(group_key)+ @link = ::API::V3::Utilities::ResourceLinkGenerator.make_link(+ group_key.is_a?(Array) ? set_links!(group_key) : group_key+ )super(group_key, current_user:)end@@ -86,10 +84,13 @@ module APIenddef value- if represented == true || represented == false+ case represented+ when TrueClass, FalseClassrepresented+ when Array+ represented.empty? ? nil : represented.map(&:to_s).sort.join(", ")else- represented ? represented.to_s : nil+ represented&.to_sendend