Class: Polaris::ResourceItem::ShortcutActionsComponent::ShortcutActionsButtonComponent

Inherits:
Component
  • Object
show all
Defined in:
app/components/polaris/resource_item/shortcut_actions_component.rb

Constant Summary

Constants included from ViewHelper

ViewHelper::POLARIS_HELPERS, ViewHelper::POLARIS_TEXT_STYLES

Constants included from FetchOrFallbackHelper

FetchOrFallbackHelper::InvalidValueError

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from ViewHelper

#polaris_body_styles, #polaris_html_classes, #polaris_html_styles, #polaris_icon_source

Methods included from StylesListHelper

#styles_list

Methods included from OptionHelper

#append_option, #prepend_option

Methods included from FetchOrFallbackHelper

#fetch_or_fallback, #fetch_or_fallback_boolean, #fetch_or_fallback_nested

Methods included from ClassNameHelper

#class_names

Constructor Details

#initialize(url:, content:, persist_actions:, action_list_item_arguments: {}, **system_arguments) ⇒ ShortcutActionsButtonComponent

Returns a new instance of ShortcutActionsButtonComponent.



60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'app/components/polaris/resource_item/shortcut_actions_component.rb', line 60

def initialize(
  url:,
  content:,
  persist_actions:,
  action_list_item_arguments: {},
  **system_arguments
)
  @url = url
  @content = content
  @persist_actions = persist_actions
  @action_list_item_arguments = action_list_item_arguments
  @system_arguments = system_arguments
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



58
59
60
# File 'app/components/polaris/resource_item/shortcut_actions_component.rb', line 58

def content
  @content
end

Instance Method Details

#action_list_item_argumentsObject



82
83
84
85
86
# File 'app/components/polaris/resource_item/shortcut_actions_component.rb', line 82

def action_list_item_arguments
  @action_list_item_arguments.tap do |opts|
    opts[:url] = @url
  end
end

#system_argumentsObject



74
75
76
77
78
79
80
# File 'app/components/polaris/resource_item/shortcut_actions_component.rb', line 74

def system_arguments
  @system_arguments.tap do |opts|
    opts[:url] = @url
    opts[:size] = :slim unless @persist_actions
    opts[:plain] = true if @persist_actions
  end
end