Class: Plutonium::UI::Page::WizardChooser

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

Overview

The "resume or start new" chooser (ยง4.5), shown at the bare launch URL when a tokened wizard opts in with on_relaunch :prompt and the user already has pending (in-progress) runs. Lists each pending run with a Resume link and offers a Start-new button. Keyed/one-time/anchored wizards never reach here (they auto-resume their single keyed run); only tokened wizards can have several concurrent runs to choose between.

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(wizard_class:, entries:, start_new_url:) ⇒ WizardChooser

Returns a new instance of WizardChooser.

Parameters:

  • wizard_class (Class)

    the wizard being launched.

  • entries (Array<Plutonium::Wizard::Resume::Entry>)

    pending runs.

  • start_new_url (String)

    bare launch URL that forces a fresh run.



16
17
18
19
20
21
# File 'lib/plutonium/ui/page/wizard_chooser.rb', line 16

def initialize(wizard_class:, entries:, start_new_url:)
  @wizard_class = wizard_class
  @entries = entries
  @start_new_url = start_new_url
  super(page_title: wizard_class.label, 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



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/plutonium/ui/page/wizard_chooser.rb', line 23

def view_template
  DynaFrameContent() do
    article(class: "pu-wizard pu-wizard-chooser mx-auto max-w-2xl", data: {wizard_chooser: true}) do
      render_header
      div(class: card_classes) do
        render_pending_list
        render_start_new
      end
    end
  end
end