app/components/avo/resource_sidebar_component.rb in avo-2.18.1.pre.1.eagerloaddirs vs app/components/avo/resource_sidebar_component.rb in avo-2.18.1
- old
+ new
@@ -3,17 +3,22 @@
class Avo::ResourceSidebarComponent < ViewComponent::Base
attr_reader :resource
attr_reader :params
attr_reader :view
attr_reader :form
- attr_reader :fields
def initialize(resource: nil, fields: nil, index: nil, params: nil, form: nil, view: nil)
@resource = resource
@fields = fields
@params = params
@view = view
@form = form
+ end
+
+ def fields
+ @fields.filter do |field|
+ field.visible_on? view
+ end
end
def render?
Avo::App.license.has_with_trial(:resource_sidebar)
end