Sha256: a15bee03a616bbaa5b43abbdc939ee05e59a42a95592e931a42252c64b6b6157
Contents?: true
Size: 1015 Bytes
Versions: 44
Compression:
Stored size: 1015 Bytes
Contents
# This concern helps us figure out what kind of items (field, tool, tab_group, or panel) have been passed to the resource or action. module Avo module Concerns module IsResourceItem # These attributes are required to be hydrated in order to properly find the visible_items attr_accessor :resource attr_accessor :view def hydrate(**args) args.each do |key, value| if respond_to?("#{key}=") send("#{key}=", value) end end self end # Returns the final state of if an item is visible or not # For items that have children it checks to see if it contains any visible children. def visible? # For items that may contains other items like tabs and panels we should also check # if any on their children have visible items. if self.class.ancestors.include?(Avo::Concerns::HasItems) return false unless visible_items.any? end super end end end end
Version data entries
44 entries across 44 versions & 1 rubygems