Remove priority-low-other and priority-high-other css classes for issue priorities, to solve n+1 query problems

This commit is contained in:
Alexander Meindl 2024-03-10 10:32:03 +01:00
parent a306835fff
commit 7739fe4922
2 changed files with 0 additions and 37 deletions

View File

@ -104,7 +104,6 @@ module Additionals
loader.add_patch %w[ApplicationController
AutoCompletesController
Issue
IssuePriority
TimeEntry
Mailer
Project

View File

@ -1,36 +0,0 @@
# frozen_string_literal: true
module Additionals
module Patches
module IssuePriorityPatch
extend ActiveSupport::Concern
included do
prepend InstanceOverwriteMethods
include InstanceMethods
end
module InstanceOverwriteMethods
def css_classes
classes = super
other_class = css_name_based_class
return classes if other_class.blank?
"#{classes} #{other_class}"
end
end
module InstanceMethods
# css class based on priority name
def css_name_based_class
if low?
'priority-low-other' if position_name != 'lowest'
else
'priority-high-other' unless %w[default highest high2 high3].include? position_name
end
end
end
end
end
end