Sha256: 0368518b422482a32138ffeaa42ec2ae8d394d599a3d3649b6131732dbc82c24

Contents?: true

Size: 962 Bytes

Versions: 10

Compression:

Stored size: 962 Bytes

Contents

# frozen_string_literal: true

class Avo::Items::PanelComponent < Avo::ResourceComponent
  include Avo::ApplicationHelper

  prop :form
  prop :item
  prop :is_main_panel
  prop :resource
  prop :view
  prop :actions, reader: :public
  prop :index, reader: :public
  prop :parent_component
  prop :parent_record
  prop :parent_resource
  prop :reflection

  delegate :controls,
    :title,
    :back_path,
    :edit_path,
    :can_see_the_destroy_button?,
    :can_see_the_save_button?,
    :view_for,
    :display_breadcrumbs,
    to: :@parent_component

  def args
    if @is_main_panel
      {
        name: title,
        description: @resource.description,
        display_breadcrumbs: display_breadcrumbs,
        index: 0,
        data: {panel_id: "main"},
        cover_photo: @resource.cover_photo,
        profile_photo: @resource.profile_photo
      }
    else
      {name: @item.name, description: @item.description, index: @index}
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
avo-3.15.1 app/components/avo/items/panel_component.rb
avo-3.15.0 app/components/avo/items/panel_component.rb
avo-3.14.5 app/components/avo/items/panel_component.rb
avo-3.14.4 app/components/avo/items/panel_component.rb
avo-3.14.3 app/components/avo/items/panel_component.rb
avo-3.14.2 app/components/avo/items/panel_component.rb
avo-3.14.1 app/components/avo/items/panel_component.rb
avo-3.14.0 app/components/avo/items/panel_component.rb
avo-3.13.7 app/components/avo/items/panel_component.rb
avo-3.13.6 app/components/avo/items/panel_component.rb