Class: Plutonium::UI::Page::Wizard

Inherits:
Base show all
Defined in:
lib/plutonium/ui/page/wizard.rb

Overview

The full-page wizard step page (§7). Composes the stepper, the current step's form (or the terminal review summary), and the Back / Next / Finish / Cancel navigation strip — all carrying _direction. Rendered inside the portal layout exactly like a resource page; in a turbo frame (modal) the layout is dropped by the controller.

The step form rides the existing resource-form pipeline through a per-step adapter, seeded from the wizard's typed data so inputs (including repeater rows) rehydrate from staged data on GET — the resume/back requirement.

Instance Method Summary collapse

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(runner:, step_url:, errors: nil, description: nil) ⇒ Wizard

Returns a new instance of Wizard.

Parameters:

  • runner (Plutonium::Wizard::Runner)
  • step_url (String)

    the current step's POST/GET URL.

  • errors (Hash{Symbol=>Array<String>}) (defaults to: nil)

    runner errors (per-field + :base).



19
20
21
22
23
24
25
# File 'lib/plutonium/ui/page/wizard.rb', line 19

def initialize(runner:, step_url:, errors: nil, description: nil)
  @runner = runner
  @step_url = step_url
  @errors = errors || {}
  @description = description
  super(page_title: wizard_title, page_description: nil)
end

Dynamic Method Handling

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

Instance Method Details

#view_templateObject



27
28
29
30
31
32
33
34
35
# File 'lib/plutonium/ui/page/wizard.rb', line 27

def view_template(&)
  DynaFrameContent() do
    article(class: "pu-wizard mx-auto max-w-3xl", data: {controller: "wizard"}) do
      render_header
      render_stepper
      render_body
    end
  end
end