Class: Plutonium::UI::Form::Wizard

Inherits:
Resource
  • Object
show all
Defined in:
lib/plutonium/ui/form/wizard.rb

Overview

Renders the CURRENT wizard step through the existing resource-form pipeline (§7). It rides Form::Resource unchanged — the only wizard-specific wiring is the per-step adapter (resource_definition), the value source (the wizard's typed data, so inputs render seeded from staged data for resume/back, including repeater rows), the wizard[...] param namespace, the step POST URL, and a hidden _direction (default next).

Constant Summary

Constants included from Concerns::RendersNestedResourceFields

Concerns::RendersNestedResourceFields::DEFAULT_NESTED_LIMIT, Concerns::RendersNestedResourceFields::NESTED_OPTION_KEYS, Concerns::RendersNestedResourceFields::SINGULAR_MACROS

Instance Attribute Summary

Attributes inherited from Resource

#resource_definition, #resource_fields, #singular_resource

Instance Method Summary collapse

Methods inherited from Resource

#view_template

Methods included from Component::Behaviour

#around_template

Methods included from Component::Tokens

#classes, #tokens

Methods included from Component::Kit

#BuildActionButton, #BuildActionsDropdown, #BuildAvatar, #BuildBlock, #BuildBreadcrumbs, #BuildBulkActionsToolbar, #BuildColorModeSelector, #BuildDynaFrameContent, #BuildDynaFrameHost, #BuildEmptyCard, #BuildFrameNavigatorPanel, #BuildModalCentered, #BuildModalSlideover, #BuildPageHeader, #BuildPanel, #BuildRowActionsDropdown, #BuildSkeletonTable, #BuildTabList, #BuildTableFilterPills, #BuildTableInfo, #BuildTablePagination, #BuildTableScopesBar, #BuildTableScopesPills, #BuildTableSearchBar, #BuildTableToolbar, #BuildTableViewSwitcher, #method_missing, #respond_to_missing?

Constructor Details

#initialize(step:, data:, action:, fields:, **options) ⇒ Wizard

Returns a new instance of Wizard.

Parameters:

  • step (Plutonium::Wizard::Step)
  • data (Object)

    the wizard's typed data snapshot (the form object; responds to every step attribute / structured input name).

  • action (String)

    the current step's POST URL.

  • fields (Array<Symbol>)

    the step's renderable field names (scalar attributes + structured inputs).



19
20
21
22
23
24
25
26
27
28
# File 'lib/plutonium/ui/form/wizard.rb', line 19

def initialize(step:, data:, action:, fields:, **options, &)
  @step = step
  options[:key] = :wizard
  options[:as] = :wizard
  options[:action] = action
  options[:resource_fields] = fields
  options[:resource_definition] = Plutonium::Wizard::StepAdapter.new(step)
  options[:singular_resource] = true
  super(data, **options, &)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Plutonium::UI::Component::Kit