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
[#58160] move UI logic out of the Select
Tobias Dillmann21cea8ad21bd
diff --git a/app/helpers/sort_helper.rb b/app/helpers/sort_helper.rbindex 3158677cbad..8a5bc7dfafc 100644--- a/app/helpers/sort_helper.rb+++ b/app/helpers/sort_helper.rb@@ -427,9 +427,8 @@ module SortHelperif favorite# This column only shows an icon, no text.render Primer::Beta::Octicon.new(icon: "star-fill", color: :subtle, "aria-label": I18n.t(:label_favorite))- elsif column.respond_to?(:action_menu_header)- column.action_menu_header(button)else+ button.with_leading_visual_icon(**column.visual_icon) if column.respond_to?(:visual_icon)button.with_trailing_action_icon(icon: :"triangle-down")h(caption).to_sdiff --git a/app/models/queries/projects/selects/life_cycle_step.rb b/app/models/queries/projects/selects/life_cycle_step.rbindex 47d91507e7d..a2190ca0a7f 100644--- a/app/models/queries/projects/selects/life_cycle_step.rb+++ b/app/models/queries/projects/selects/life_cycle_step.rb@@ -58,7 +58,7 @@ class Queries::Projects::Selects::LifeCycleStep < Queries::Selects::Baselife_cycle_step_definition.present?end- def action_menu_header(button)+ def visual_icon# Show the proper icon for the definition with the correct color.icon = case life_cycle_step_definitionwhen Project::StageDefinition@@ -70,12 +70,8 @@ class Queries::Projects::Selects::LifeCycleStep < Queries::Selects::Baseendclasses = helpers.hl_inline_class("life_cycle_step_definition", life_cycle_step_definition)- button.with_leading_visual_icon(icon:, classes:)- # As all other action menu headers, we will show an action icon and the caption:- button.with_trailing_action_icon(icon: :"triangle-down")-- caption.to_s+ { icon:, classes: }enddef action_menu_classes