Class: Katalyst::Navigation::Editor::NewItemComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Katalyst::Navigation::Editor::NewItemComponent
show all
- Defined in:
- app/components/katalyst/navigation/editor/new_item_component.rb
Constant Summary
collapse
- ACTIONS =
<<~ACTIONS.gsub(/\s+/, " ").freeze
dragstart->#{NEW_ITEM_CONTROLLER}#dragstart
ACTIONS
BaseComponent::ITEM_CONTROLLER, BaseComponent::LIST_CONTROLLER, BaseComponent::MENU_CONTROLLER, BaseComponent::NEW_ITEM_CONTROLLER, BaseComponent::STATUS_BAR_CONTROLLER
Instance Attribute Summary
#item, #menu
Instance Method Summary
collapse
#call, #menu_form_id
Constructor Details
#initialize(item:, menu: item.menu) ⇒ NewItemComponent
Returns a new instance of NewItemComponent.
13
14
15
|
# File 'app/components/katalyst/navigation/editor/new_item_component.rb', line 13
def initialize(item:, menu: item.)
super(item:, menu:)
end
|
Instance Method Details
#item_component ⇒ Object
17
18
19
|
# File 'app/components/katalyst/navigation/editor/new_item_component.rb', line 17
def item_component(**)
ItemComponent.new(item:, menu:, **)
end
|
#item_type ⇒ Object
29
30
31
|
# File 'app/components/katalyst/navigation/editor/new_item_component.rb', line 29
def item_type
item.model_name.param_key
end
|
#label ⇒ Object
25
26
27
|
# File 'app/components/katalyst/navigation/editor/new_item_component.rb', line 25
def label
t("katalyst.navigation.editor.new_item.#{item_type}", default: item.model_name.human)
end
|
#row_component ⇒ Object
21
22
23
|
# File 'app/components/katalyst/navigation/editor/new_item_component.rb', line 21
def row_component(**)
RowComponent.new(item:, menu:, **)
end
|