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
extract CustomFieldFormat#enterprise_feature_allowed?
Ivan Kuchinf48a54ec2b22
diff --git a/lib/open_project/custom_field_format.rb b/lib/open_project/custom_field_format.rbindex a416dc33103..dc2c8440465 100644--- a/lib/open_project/custom_field_format.rb+++ b/lib/open_project/custom_field_format.rb@@ -34,7 +34,7 @@ module OpenProjectclass_attribute :registered, default: {}- attr_reader :name, :order, :label, :edit_as, :class_names, :enterprise_feature+ attr_reader :name, :order, :label, :edit_as, :class_namesdef initialize(name,label:,@@ -73,6 +73,10 @@ module OpenProject!enabled?end+ def enterprise_feature_allowed?+ !@enterprise_feature || EnterpriseToken.allows_to?(@enterprise_feature)+ end+class << selfdef map(&)yield self@@ -85,7 +89,7 @@ module OpenProjectdef availableregistered.select do |_, format|- format.enabled? && (!format.enterprise_feature || EnterpriseToken.allows_to?(format.enterprise_feature))+ format.enabled? && format.enterprise_feature_allowed?endend